@tom2012/cc-web 2026.4.23-g → 2026.4.23-h

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/README.md +1 -1
  2. package/backend/dist/routes/filesystem.d.ts.map +1 -1
  3. package/backend/dist/routes/filesystem.js +55 -10
  4. package/backend/dist/routes/filesystem.js.map +1 -1
  5. package/frontend/dist/assets/{AssistantMessageContent-cp44M5-N.js → AssistantMessageContent-DnVqSquL.js} +1 -1
  6. package/frontend/dist/assets/{GraphPreview-BdDwOttu.js → GraphPreview-Pk1mwaUx.js} +1 -1
  7. package/frontend/dist/assets/{MobilePage-D9fNYlVW.js → MobilePage-BZTHZcoN.js} +3 -3
  8. package/frontend/dist/assets/{OfficePreview-BkvETBGR.js → OfficePreview-w9UCmjcC.js} +2 -2
  9. package/frontend/dist/assets/{ProjectPage-DVSS4L5-.js → ProjectPage-zD6vObwd.js} +4 -4
  10. package/frontend/dist/assets/{SettingsPage-CCGrCJ8H.js → SettingsPage-CtAlTMC0.js} +1 -1
  11. package/frontend/dist/assets/{SkillHubPage-5lb1bV5N.js → SkillHubPage-CfF3SPUE.js} +1 -1
  12. package/frontend/dist/assets/{chevron-down-9vAKETIc.js → chevron-down-DDsKpWGy.js} +1 -1
  13. package/frontend/dist/assets/{chevron-up-DetzMyPo.js → chevron-up-DBW0g8sF.js} +1 -1
  14. package/frontend/dist/assets/{index-C3br4lV-.js → index-BprQxUQs.js} +1 -1
  15. package/frontend/dist/assets/{index-BOod62M1.js → index-DIXpAmRD.js} +2 -2
  16. package/frontend/dist/assets/{index-A1ow-4Ih.js → index-DhLWQREd.js} +1 -1
  17. package/frontend/dist/assets/{jszip.min-H1vMAeM8.js → jszip.min-7BwG3j23.js} +1 -1
  18. package/frontend/dist/assets/{search-CewI57f1.js → search-B5sN2qrh.js} +1 -1
  19. package/frontend/dist/index.html +1 -1
  20. package/package.json +1 -1
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  A self-hosted web application (distributed as npm package) that provides a browser-based interface for [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI sessions. Create projects, each with a persistent terminal running Claude Code, and interact with them through a real-time terminal UI.
4
4
 
5
- **Current version**: v2026.4.23-g | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
5
+ **Current version**: v2026.4.23-h | [GitHub](https://github.com/zbc0315/cc-web) | MIT License
6
6
 
7
7
  ## Features
8
8
 
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/routes/filesystem.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA+axB,eAAe,MAAM,CAAC"}
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../../src/routes/filesystem.ts"],"names":[],"mappings":"AAYA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA4dxB,eAAe,MAAM,CAAC"}
@@ -40,8 +40,11 @@ const express_1 = require("express");
40
40
  const fs = __importStar(require("fs"));
41
41
  const path = __importStar(require("path"));
42
42
  const os = __importStar(require("os"));
43
+ const promises_1 = require("stream/promises");
43
44
  const multer_1 = __importDefault(require("multer"));
44
45
  const config_1 = require("../config");
46
+ const logger_1 = require("../logger");
47
+ const log = (0, logger_1.modLogger)('filesystem');
45
48
  const router = (0, express_1.Router)();
46
49
  /**
47
50
  * Security: restrict filesystem access to user's workspace and registered project directories.
@@ -311,7 +314,7 @@ const MIME_MAP = {
311
314
  pptx: 'application/vnd.openxmlformats-officedocument.presentationml.presentation',
312
315
  pdf: 'application/pdf',
313
316
  };
314
- router.get('/raw', (req, res) => {
317
+ router.get('/raw', async (req, res) => {
315
318
  const requestedPath = req.query['path'];
316
319
  if (!requestedPath) {
317
320
  res.status(400).json({ error: 'path is required' });
@@ -334,23 +337,65 @@ router.get('/raw', (req, res) => {
334
337
  res.status(400).json({ error: 'Not a file' });
335
338
  return;
336
339
  }
337
- const RAW_LIMIT = 20 * 1024 * 1024; // 20 MB
338
- if (stat.size > RAW_LIMIT) {
339
- res.status(413).json({ error: 'File too large' });
340
+ const isDownload = req.query['dl'] === '1';
341
+ // Preview mode serves <img>/<video>/etc. sources in the browser — we cap
342
+ // at 20 MB there so an accidentally-huge image can't blow up the page.
343
+ // Downloads (dl=1) are an explicit user action; no size cap.
344
+ const PREVIEW_LIMIT = 20 * 1024 * 1024;
345
+ if (!isDownload && stat.size > PREVIEW_LIMIT) {
346
+ res.status(413).json({ error: 'File too large for preview' });
340
347
  return;
341
348
  }
342
349
  const ext = path.extname(resolvedPath).slice(1).toLowerCase();
343
350
  const mime = MIME_MAP[ext] || 'application/octet-stream';
344
351
  res.setHeader('Content-Type', mime);
345
- res.setHeader('Content-Length', stat.size);
346
352
  res.setHeader('Cache-Control', 'no-cache');
347
- if (req.query['dl'] === '1') {
353
+ if (isDownload) {
354
+ // RFC 5987: emit both a plain ASCII fallback (for old UAs) and
355
+ // `filename*=UTF-8''<pct-encoded>` so modern browsers render Chinese /
356
+ // emoji / spaces correctly instead of showing percent escapes as the
357
+ // literal saved filename.
348
358
  const fileName = path.basename(resolvedPath);
349
- const encoded = encodeURIComponent(fileName).replace(/"/g, '%22');
350
- res.setHeader('Content-Disposition', `attachment; filename="${encoded}"`);
359
+ const ascii = fileName.replace(/[^\x20-\x7e]/g, '_').replace(/"/g, '\\"');
360
+ const encoded = encodeURIComponent(fileName).replace(/'/g, '%27');
361
+ res.setHeader('Content-Disposition', `attachment; filename="${ascii}"; filename*=UTF-8''${encoded}`);
362
+ // Deliberately NOT setting Content-Length for downloads. When the file
363
+ // is concurrently appended / truncated (common for CLI session JSONL),
364
+ // or when stat metadata lags actual content (APFS clones, network FS),
365
+ // a pre-declared Content-Length that disagrees with the bytes actually
366
+ // streamed leaves the browser waiting forever for the "missing" tail
367
+ // bytes — the "stuck at 99%" bug. Without Content-Length, Node falls
368
+ // back to chunked transfer encoding, which terminates cleanly at EOF
369
+ // regardless of the stat.size figure.
370
+ }
371
+ else {
372
+ res.setHeader('Content-Length', String(stat.size));
373
+ }
374
+ // Use stream/promises `pipeline` for the whole stream lifecycle:
375
+ // - normal EOF: pipeline resolves, response ends cleanly
376
+ // - stream 'error': pipeline rejects, we destroy the response so the
377
+ // client sees an aborted connection (not "99% stuck")
378
+ // - client disconnect (res 'close' before EOF): pipeline rejects with
379
+ // ERR_STREAM_PREMATURE_CLOSE, and pipeline itself destroys both sides
380
+ // — no manual `res.on('close')` needed, and no double-destroy race
381
+ // that the older `stream.pipe(res)` + manual cleanup combo had.
382
+ const stream = fs.createReadStream(resolvedPath);
383
+ try {
384
+ await (0, promises_1.pipeline)(stream, res);
385
+ }
386
+ catch (err) {
387
+ // Premature close on client abort is expected; don't log as error.
388
+ const code = err?.code;
389
+ if (code !== 'ERR_STREAM_PREMATURE_CLOSE') {
390
+ log.error({ err, path: resolvedPath }, 'file stream error during /raw');
391
+ }
392
+ if (!res.headersSent) {
393
+ res.status(500).json({ error: 'Read error' });
394
+ }
395
+ else if (!res.writableEnded) {
396
+ res.destroy(err);
397
+ }
351
398
  }
352
- fs.createReadStream(resolvedPath).on('error', () => { if (!res.headersSent)
353
- res.status(500).end(); }).pipe(res);
354
399
  });
355
400
  // PUT /api/filesystem/file body: { path: string, content: string }
356
401
  router.put('/file', (req, res) => {
@@ -1 +1 @@
1
- {"version":3,"file":"filesystem.js","sourceRoot":"","sources":["../../src/routes/filesystem.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAoD;AACpD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,oDAA4B;AAC5B,sCAAuE;AAGvE,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB;;;GAGG;AACH,MAAM,sBAAsB,GAAyC;IACnE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,YAAY,CAAC;IACpC,CAAC,MAAM,CAAC,EAAE,CAAC,Q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AAC,EAAE,OAAO,EAAE,YAAY,EAAE,CAAC,CAAC;IACtC,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,GAA4B,CAAC;QAC3C,IAAI,KAAK,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,mBAAmB,EAAE,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QACD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"}
@@ -1,4 +1,4 @@
1
- import{bA as e,bB as t,r as n,bC as r,c as a,bD as i,bE as o,j as s,R as l,d as c,aK as u,bF as d,t as p,A as m,p as g,b1 as h,bG as f,a as b}from"./index-BOod62M1.js";import{C as y}from"./chevron-down-9vAKETIc.js";import{C as E,a as S}from"./chevron-up-DetzMyPo.js";function v(){!e.current&&t();const[a]=n.useState(r.current);return a}
1
+ import{bA as e,bB as t,r as n,bC as r,c as a,bD as i,bE as o,j as s,R as l,d as c,aK as u,bF as d,t as p,A as m,p as g,b1 as h,bG as f,a as b}from"./index-DIXpAmRD.js";import{C as y}from"./chevron-down-DDsKpWGy.js";import{C as E,a as S}from"./chevron-up-DBW0g8sF.js";function v(){!e.current&&t();const[a]=n.useState(r.current);return a}
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,4 +1,4 @@
1
- import{c as e,r as t,b as n,j as i,aK as r,B as o,l as a}from"./index-BOod62M1.js";import{Z as s,a as l}from"./ProjectPage-DVSS4L5-.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-cp44M5-N.js";import"./chevron-down-9vAKETIc.js";import"./chevron-up-DetzMyPo.js";import"./index-C3br4lV-.js";import"./search-CewI57f1.js";
1
+ import{c as e,r as t,b as n,j as i,aK as r,B as o,l as a}from"./index-DIXpAmRD.js";import{Z as s,a as l}from"./ProjectPage-zD6vObwd.js";import"./purify.es-CgRAQgUo.js";import"./AssistantMessageContent-DnVqSquL.js";import"./chevron-down-DDsKpWGy.js";import"./chevron-up-DBW0g8sF.js";import"./index-BprQxUQs.js";import"./search-B5sN2qrh.js";
2
2
  /**
3
3
  * @license lucide-react v0.309.0 - ISC
4
4
  *
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-BkvETBGR.js","assets/index-BOod62M1.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
2
- import{c as e,aE as t,b0 as s,r as a,bs as n,bt as r,j as l,bu as o,l as c,d as i,bv as d,bw as x,aS as u,aT as m,ab as h,aa as p,bx as f,a9 as j,aG as b,aK as g,a_ as v,a as y,b as N,g as w,D as k,f as C,R as S,_ as I,k as M,X as z,o as P,by as U,bz as T,C as $,A,p as D}from"./index-BOod62M1.js";import{A as E,d as L,T as R,G as _,M as H,r as O,a as F,b as q,h as B,o as W,c as K,I as V,F as G}from"./AssistantMessageContent-cp44M5-N.js";import{C as J}from"./chevron-up-DetzMyPo.js";import{C as Q}from"./chevron-down-9vAKETIc.js";
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/OfficePreview-w9UCmjcC.js","assets/index-DIXpAmRD.js","assets/index-ChWqp_e7.css","assets/purify.es-CgRAQgUo.js"])))=>i.map(i=>d[i]);
2
+ import{c as e,aE as t,b0 as s,r as a,bs as n,bt as r,j as l,bu as o,l as c,d as i,bv as d,bw as x,aS as u,aT as m,ab as h,aa as p,bx as f,a9 as j,aG as b,aK as g,a_ as v,a as y,b as N,g as w,D as k,f as C,R as S,_ as I,k as M,X as z,o as P,by as U,bz as T,C as $,A,p as D}from"./index-DIXpAmRD.js";import{A as E,d as L,T as R,G as _,M as H,r as O,a as F,b as q,h as B,o as W,c as K,I as V,F as G}from"./AssistantMessageContent-DnVqSquL.js";import{C as J}from"./chevron-up-DBW0g8sF.js";import{C as Q}from"./chevron-down-DDsKpWGy.js";
3
3
  /**
4
4
  * @license lucide-react v0.309.0 - ISC
5
5
  *
@@ -11,4 +11,4 @@ import{c as e,aE as t,b0 as s,r as a,bs as n,bt as r,j as l,bu as o,l as c,d as
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
- */function se({onSelectProject:e}){const x=t(),{projects:u,fetchProjects:m,hasFetched:h,loading:p}=s(),[f,j]=a.useState(new Map),[b,g]=a.useState(new Set),[v,y]=a.useState(!1);a.useEffect(()=>{m()},[m]);const N=a.useCallback(e=>{e.status&&j(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&g(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);n({onActivityUpdate:N});const{applyOrder:w}=r(),k=w(u.filter(e=>!e.archived));return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[l.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),l.jsx(o,{}),l.jsx("button",{onClick:()=>{(async()=>{y(!0);try{await m()}finally{y(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:v,children:l.jsx(c,{className:i("h-4 w-4",v&&"animate-spin")})}),!te&&l.jsx("button",{onClick:()=>x("/"),className:"text-muted-foreground active:text-foreground",title:"桌面模式",children:l.jsx(d,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[p&&!h&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),h&&0===k.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:k.map(t=>{var s;const a="running"===(s=t,f.get(s.id)??s.status??"stopped"),n=b.has(t.id),r=l.jsxs("button",{onClick:()=>e(t.id),className:i("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),l.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),l.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return l.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function ae(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function ne({project:e,onBack:t,onOpenPanel:s,onContextUpdate:n}){const[r,o]=a.useState(""),c=a.useRef(null),d=a.useRef(null),[y,N]=a.useState([]),w=a.useCallback(e=>{N(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),k=a.useRef(null),C=a.useCallback(e=>{var t;"stopped"===e&&(null==(t=k.current)||t.call(k,"stopped"))},[]),[S,I]=a.useState([]),M=a.useRef(new Set),z=a.useCallback(e=>{M.current.has(e.toolUseId)||I(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),P=a.useCallback(e=>{M.current.add(e.toolUseId),I(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),U=a.useCallback(e=>{M.current.add(e),I(t=>t.filter(t=>t.toolUseId!==e))},[]),[T,$]=a.useState(null),A=a.useRef(0),D=a.useCallback(e=>{var t,s,a;if(!e.active)return void $(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void $(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;$(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++A.current,phase:n,detail:r})},[]),{sendInput:H,connected:O}=x({projectId:e.id,enabled:!0,onChatMessage:w,onStatusChange:C,onContextUpdate:n,onApprovalRequest:z,onApprovalResolved:P,onSemanticUpdate:D});a.useEffect(()=>{if(!O)return;if("claude"!==e.cliTool)return;let t=!1;return u(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!M.current.has(e.toolUseId));I(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||M.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,O]);const{state:F,setState:q,messages:B,hasMoreHistory:W,loadMoreHistory:K,sendMessage:V,isWaking:G}=m({project:e,liveMessages:y,ws:{send:H,connected:O},historyLimit:20});k.current=q;const Y=a.useRef(O);a.useEffect(()=>{!Y.current&&O&&N([]),Y.current=O},[O]);const Z=(()=>{for(let e=B.length-1;e>=0;e--)if("assistant"===B[e].role)return e;return-1})(),[te,se]=a.useState([]),[ne,re]=a.useState([]),[le,oe]=a.useState(null);a.useEffect(()=>{h().then(se).catch(()=>{}),p(e.id).then(re).catch(()=>{})},[e.id]);const ce=a.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await K(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[K]),ie=a.useRef(0);a.useEffect(()=>{const e=c.current;if(!e)return;const t=B.length>ie.current,s=0===ie.current&&B.length>0;ie.current=B.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[B,S.length]);const[de,xe]=a.useState(!1),ue=a.useCallback(async()=>{const e=r.trim();if(!e||de)return;xe(!0);const t=await V(e);xe(!1),"delivered"===t&&(o(""),d.current&&(d.current.style.height="auto"))},[r,de,V]),me=f(ue,"shift"),he=a.useCallback((t,s)=>{oe(null),V(t.command),"project"===s&&j(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})},[V,e.id]),pe="live"===F;return l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(b,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[l.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",pe?"bg-green-500":G?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),l.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(ee,{className:"h-5 w-5"})})]}),l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[W&&l.jsx("div",{className:"flex justify-center pb-1",children:l.jsxs("button",{onClick:()=>{ce()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[l.jsx(J,{className:"h-3 w-3"}),"加载更早消息"]})}),B.map((e,t)=>{const s="user"===e.role;return l.jsx("div",{className:i("flex",s?"justify-end":"justify-start"),children:l.jsx("div",{className:i("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:l.jsx(E,{content:e.content,blocks:e.blocks,isLatest:t===Z})})},e.id)}),S.map(e=>l.jsx(L,{approval:e,onResolved:U},e.toolUseId)),T&&0===S.length&&l.jsx("div",{className:"flex justify-start",children:l.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(R,{}),ae(T)&&l.jsx("span",{children:ae(T)})]})},T.id),0===B.length&&0===S.length&&!T&&"stopped"===F&&l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),G&&l.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),le&&l.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:l.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===le?te:ne).map(e=>l.jsxs("button",{onClick:()=>he(e,le),disabled:G,className:i("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",G&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-medium text-xs",children:e.label}),l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===le?te:ne).length&&l.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}),(te.length>0||ne.length>0)&&l.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[l.jsxs("button",{onClick:()=>oe(e=>"global"===e?null:"global"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(_,{className:"h-3 w-3"}),"全局","global"===le&&l.jsx(Q,{className:"h-3 w-3"})]}),l.jsxs("button",{onClick:()=>oe(e=>"project"===e?null:"project"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(X,{className:"h-3 w-3"}),"项目","project"===le&&l.jsx(Q,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("textarea",{ref:d,value:r,onChange:e=>o(e.target.value),onKeyDown:me,disabled:G||de,placeholder:G?"启动中...":de?"发送中…":"stopped"===F?"输入消息(自动启动)...":"输入消息...",rows:1,className:i("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(G||de)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),l.jsx("button",{onClick:ue,disabled:G||de||!r.trim(),className:i("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!de?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:de?l.jsx(g,{className:"h-5 w-5 animate-spin"}):l.jsx(v,{className:"h-5 w-5"})})]})})]})}const re=S.lazy(()=>I(()=>import("./OfficePreview-BkvETBGR.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),le=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),oe=new Set(["docx","xlsx","xls","pptx"]),ce={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function ie(e){return e.split("/").pop()??e}function de({filePath:e,onBack:t}){const[s,n]=a.useState(null),[r,o]=a.useState(!0),[c,i]=a.useState(null),{resolved:d}=y(),x=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),u=le.has(x),m=oe.has(x),h=ce[x],p="dark"===d;a.useEffect(()=>{u||m?o(!1):(o(!0),i(null),N(e).then(n).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>o(!1)))},[e,u,m]);const f=C(e),j=a.useMemo(()=>{const e=w();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),v=a.useMemo(()=>u?`${j}&t=${Date.now()}`:"",[j,u]);return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(b,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:ie(e)}),l.jsx("a",{href:j,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:l.jsx(k,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&l.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),u&&l.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:l.jsx("img",{src:v,alt:ie(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&l.jsx(a.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:l.jsx(re,{filePath:e,ext:x,zoom:100})}),s&&(s.binary||s.tooLarge)&&l.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[l.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${S=s.size,S<1024?`${S} B`:S<1048576?`${(S/1024).toFixed(1)} KB`:`${(S/1048576).toFixed(1)} MB`})`]}),l.jsxs("a",{href:j,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[l.jsx(k,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&l.jsxs(l.Fragment,{children:["md"===x&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:l.jsx(H,{remarkPlugins:[F,q],rehypePlugins:[O],children:s.content})}),"md"!==x&&h&&l.jsx(B,{language:h,style:p?W:K,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==x&&!h&&l.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var S}const xe=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),ue=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),me=new Set(["json","yaml","yml","toml","csv","tsv"]);function he({entry:e}){if("dir"===e.type)return l.jsx(P,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return xe.has(t)?l.jsx(V,{className:"h-8 w-8 text-emerald-400"}):ue.has(t)?l.jsx(Y,{className:"h-8 w-8 text-orange-400"}):me.has(t)?l.jsx(Z,{className:"h-8 w-8 text-yellow-400"}):"md"===t?l.jsx(G,{className:"h-8 w-8 text-sky-400"}):l.jsx(U,{className:"h-8 w-8 text-muted-foreground"})}function pe({rootPath:e,onClose:t}){const[s,n]=a.useState(e),[r,o]=a.useState([]),[c,i]=a.useState(!0),[d,x]=a.useState(null),u=a.useCallback(async e=>{i(!0);try{const t=[...(await M(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));o(t),n(e)}catch{o([])}finally{i(!1)}},[]);a.useEffect(()=>{u(e)},[e,u]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?l.jsx(de,{filePath:d,onBack:()=>x(null)}):l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(z,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&l.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&u(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:l.jsx(b,{className:"h-4 w-4"})}),l.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&l.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>l.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?u(e.path):x(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[l.jsx(he,{entry:e}),l.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function fe(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function je(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function be({projectName:e,cliTool:t,folderPath:s,contextData:n,onClose:r}){const[o,d]=a.useState(new Set(["context","usage","files"])),[x,u]=a.useState(null),[m,h]=a.useState(!1),p=e=>{d(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};a.useEffect(()=>{h(!0),T(t).then(u).catch(()=>u(null)).finally(()=>h(!1))},[t]);const f=n?Math.round(n.usedPercentage):null;return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(z,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("context")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&l.jsxs("span",{className:i("text-xs font-mono ml-auto",fe(f)),children:[f,"%"]})]}),o.has("context")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&n?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full transition-all",je(f)),style:{width:`${Math.min(f,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-10 text-right",fe(f)),children:[f,"%"]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{children:"窗口大小"}),l.jsx("span",{className:"text-right font-mono",children:n.contextWindowSize>=1e6?`${(n.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(n.contextWindowSize/1e3)}K`}),l.jsx("span",{children:"输入 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.inputTokens.toLocaleString()}),l.jsx("span",{children:"输出 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.outputTokens.toLocaleString()})]})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),l.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[o.has("usage")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"用量"}),l.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await I(async()=>{const{refreshUsage:e}=await import("./index-BOod62M1.js").then(e=>e.bI);return{refreshUsage:e}},__vite__mapDeps([1,2]));u(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:l.jsx(c,{className:i("h-3 w-3",m&&"animate-spin")})})]}),o.has("usage")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:x?l.jsxs("div",{className:"space-y-2",children:[x.planName&&l.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",l.jsx("span",{className:"font-medium text-foreground",children:x.planName})]}),l.jsx(ge,{label:"5h",bucket:x.fiveHour}),l.jsx(ge,{label:"7d",bucket:x.sevenDay}),x.sevenDaySonnet&&l.jsx(ge,{label:"7d Sonnet",bucket:x.sevenDaySonnet}),x.sevenDayOpus&&l.jsx(ge,{label:"7d Opus",bucket:x.sevenDayOpus}),!x.fiveHour&&!x.sevenDay&&l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),l.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("files")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),o.has("files")&&l.jsx("div",{className:"h-[60vh]",children:l.jsx(pe,{rootPath:s,onClose:()=>p("files")})})]})]})}function ge({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),l.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full",je(s)),style:{width:`${Math.min(s,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-8 text-right",fe(s)),children:[s,"%"]}),a&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function ve(){a.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=a.useState({screen:"list"}),[n,r]=a.useState(null),o=s(e=>e.projects),c=a.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=a.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=a.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),x="list"!==e.screen?o.find(t=>t.id===e.projectId):void 0;return l.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[l.jsxs(A,{mode:"wait",children:["list"===e.screen&&l.jsx(D.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(se,{onSelectProject:c})},"list"),"chat"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ne,{project:x,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),l.jsx(A,{children:"panel"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(be,{projectName:x.name,cliTool:x.cliTool??"claude",folderPath:x.folderPath,contextData:n,onClose:d})},"panel")})]})}export{ve as MobilePage};
14
+ */function se({onSelectProject:e}){const x=t(),{projects:u,fetchProjects:m,hasFetched:h,loading:p}=s(),[f,j]=a.useState(new Map),[b,g]=a.useState(new Set),[v,y]=a.useState(!1);a.useEffect(()=>{m()},[m]);const N=a.useCallback(e=>{e.status&&j(t=>{const s=new Map(t);return s.set(e.projectId,e.status),s}),void 0!==e.active&&g(t=>{const s=new Set(t);return e.active?s.add(e.projectId):s.delete(e.projectId),s})},[]);n({onActivityUpdate:N});const{applyOrder:w}=r(),k=w(u.filter(e=>!e.archived));return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-3 px-4 h-12 border-b border-border shrink-0",children:[l.jsx("span",{className:"font-semibold text-base flex-1",children:"CC Web"}),l.jsx(o,{}),l.jsx("button",{onClick:()=>{(async()=>{y(!0);try{await m()}finally{y(!1)}})()},className:"text-muted-foreground active:text-foreground",disabled:v,children:l.jsx(c,{className:i("h-4 w-4",v&&"animate-spin")})}),!te&&l.jsx("button",{onClick:()=>x("/"),className:"text-muted-foreground active:text-foreground",title:"桌面模式",children:l.jsx(d,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[p&&!h&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"加载中..."}),h&&0===k.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"暂无项目"}),l.jsx("div",{className:"grid grid-cols-2 gap-2",children:k.map(t=>{var s;const a="running"===(s=t,f.get(s.id)??s.status??"stopped"),n=b.has(t.id),r=l.jsxs("button",{onClick:()=>e(t.id),className:i("w-full text-left rounded-xl border bg-card p-2.5 active:bg-accent transition-colors",n?"border-transparent":"border-border"),children:[l.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",a?"bg-green-500":"bg-zinc-400")}),l.jsx("span",{className:"font-medium text-sm truncate flex-1",children:t.name})]}),l.jsx("div",{className:"text-[10px] text-muted-foreground font-mono truncate",children:t.cliTool??"claude"})]});return l.jsx("div",{className:n?"card-active-glow rounded-xl":void 0,children:r},t.id)})})]})]})}function ae(e){if(!e.phase)return null;if("thinking"===e.phase)return"思考中";if("tool_result"===e.phase)return"处理结果";if("tool_use"===e.phase){const t=(e.detail||"").toLowerCase();return"bash"===t?"执行命令":"read"===t?"读取文件":"edit"===t||"multiedit"===t?"编辑文件":"write"===t?"写入文件":"grep"===t?"搜索内容":"glob"===t?"匹配文件":"webfetch"===t||"websearch"===t?"访问网络":"task"===t?"调度子任务":"todowrite"===t?"更新任务列表":"notebookedit"===t?"编辑 Notebook":e.detail?`调用 ${e.detail}`:"调用工具"}return null}function ne({project:e,onBack:t,onOpenPanel:s,onContextUpdate:n}){const[r,o]=a.useState(""),c=a.useRef(null),d=a.useRef(null),[y,N]=a.useState([]),w=a.useCallback(e=>{N(t=>{const s=[...t,e];return s.length>200?s.slice(-200):s})},[]),k=a.useRef(null),C=a.useCallback(e=>{var t;"stopped"===e&&(null==(t=k.current)||t.call(k,"stopped"))},[]),[S,I]=a.useState([]),M=a.useRef(new Set),z=a.useCallback(e=>{M.current.has(e.toolUseId)||I(t=>t.some(t=>t.toolUseId===e.toolUseId)?t:[...t,{projectId:e.projectId,toolUseId:e.toolUseId,toolName:e.toolName,toolInput:e.toolInput,sessionId:e.sessionId,createdAt:e.createdAt}])},[]),P=a.useCallback(e=>{M.current.add(e.toolUseId),I(t=>t.filter(t=>t.toolUseId!==e.toolUseId))},[]),U=a.useCallback(e=>{M.current.add(e),I(t=>t.filter(t=>t.toolUseId!==e))},[]),[T,$]=a.useState(null),A=a.useRef(0),D=a.useCallback(e=>{var t,s,a;if(!e.active)return void $(null);if("text"===(null==(t=e.semantic)?void 0:t.phase))return void $(null);const n=null==(s=e.semantic)?void 0:s.phase,r=null==(a=e.semantic)?void 0:a.detail;$(e=>e?e.phase===n&&e.detail===r?e:{...e,phase:n,detail:r}:{id:"mab"+ ++A.current,phase:n,detail:r})},[]),{sendInput:H,connected:O}=x({projectId:e.id,enabled:!0,onChatMessage:w,onStatusChange:C,onContextUpdate:n,onApprovalRequest:z,onApprovalResolved:P,onSemanticUpdate:D});a.useEffect(()=>{if(!O)return;if("claude"!==e.cliTool)return;let t=!1;return u(e.id).then(e=>{if(t)return;const s=e.pending.filter(e=>!M.current.has(e.toolUseId));I(e=>{const t=new Map;for(const a of s)t.set(a.toolUseId,a);for(const s of e)t.has(s.toolUseId)||M.current.has(s.toolUseId)||t.set(s.toolUseId,s);return[...t.values()]})}).catch(()=>{}),()=>{t=!0}},[e.id,e.cliTool,O]);const{state:F,setState:q,messages:B,hasMoreHistory:W,loadMoreHistory:K,sendMessage:V,isWaking:G}=m({project:e,liveMessages:y,ws:{send:H,connected:O},historyLimit:20});k.current=q;const Y=a.useRef(O);a.useEffect(()=>{!Y.current&&O&&N([]),Y.current=O},[O]);const Z=(()=>{for(let e=B.length-1;e>=0;e--)if("assistant"===B[e].role)return e;return-1})(),[te,se]=a.useState([]),[ne,re]=a.useState([]),[le,oe]=a.useState(null);a.useEffect(()=>{h().then(se).catch(()=>{}),p(e.id).then(re).catch(()=>{})},[e.id]);const ce=a.useCallback(async()=>{const e=c.current,t=(null==e?void 0:e.scrollHeight)??0;await K(),requestAnimationFrame(()=>{e&&(e.scrollTop+=e.scrollHeight-t)})},[K]),ie=a.useRef(0);a.useEffect(()=>{const e=c.current;if(!e)return;const t=B.length>ie.current,s=0===ie.current&&B.length>0;ie.current=B.length,s?e.scrollTo({top:e.scrollHeight}):t&&e.scrollTo({top:e.scrollHeight,behavior:"smooth"})},[B,S.length]);const[de,xe]=a.useState(!1),ue=a.useCallback(async()=>{const e=r.trim();if(!e||de)return;xe(!0);const t=await V(e);xe(!1),"delivered"===t&&(o(""),d.current&&(d.current.style.height="auto"))},[r,de,V]),me=f(ue,"shift"),he=a.useCallback((t,s)=>{oe(null),V(t.command),"project"===s&&j(e.id,t.id,!0).catch(e=>{console.error("Failed to mark shortcut used:",e)})},[V,e.id]),pe="live"===F;return l.jsxs("div",{className:"flex flex-col h-full bg-background",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(b,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1.5 flex-1 min-w-0",children:[l.jsx("span",{className:"font-medium text-sm truncate",children:e.name}),l.jsx("span",{className:i("w-2 h-2 rounded-full shrink-0",pe?"bg-green-500":G?"bg-yellow-400 animate-pulse":"bg-zinc-400")})]}),l.jsx("button",{onClick:s,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(ee,{className:"h-5 w-5"})})]}),l.jsxs("div",{ref:c,className:"flex-1 overflow-y-auto px-3 py-3 space-y-3 min-h-0",children:[W&&l.jsx("div",{className:"flex justify-center pb-1",children:l.jsxs("button",{onClick:()=>{ce()},className:"flex items-center gap-1 px-3 py-1.5 rounded-full text-xs text-muted-foreground border border-border active:bg-accent transition-colors",children:[l.jsx(J,{className:"h-3 w-3"}),"加载更早消息"]})}),B.map((e,t)=>{const s="user"===e.role;return l.jsx("div",{className:i("flex",s?"justify-end":"justify-start"),children:l.jsx("div",{className:i("max-w-[85%] rounded-xl px-3 py-2 break-words text-sm leading-relaxed",s?"bg-blue-500/15 text-foreground border border-blue-500/20 rounded-br-sm whitespace-pre-wrap":"bg-secondary text-secondary-foreground border border-border rounded-bl-sm"),children:s?e.content:l.jsx(E,{content:e.content,blocks:e.blocks,isLatest:t===Z})})},e.id)}),S.map(e=>l.jsx(L,{approval:e,onResolved:U},e.toolUseId)),T&&0===S.length&&l.jsx("div",{className:"flex justify-start",children:l.jsxs("div",{className:"rounded-2xl rounded-bl-md px-3 py-1.5 bg-black/5 dark:bg-white/10 border border-black/10 dark:border-white/15 flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(R,{}),ae(T)&&l.jsx("span",{children:ae(T)})]})},T.id),0===B.length&&0===S.length&&!T&&"stopped"===F&&l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground/40 text-sm",children:"暂无对话记录"}),G&&l.jsx("div",{className:"flex items-center justify-center py-4 text-yellow-400 text-sm animate-pulse",children:"启动中..."})]}),le&&l.jsx("div",{className:"border-t border-border max-h-48 overflow-y-auto shrink-0",children:l.jsxs("div",{className:"px-3 py-2 space-y-1",children:[("global"===le?te:ne).map(e=>l.jsxs("button",{onClick:()=>he(e,le),disabled:G,className:i("w-full text-left rounded-md px-2.5 py-2 text-sm active:bg-accent transition-colors border border-border/50",G&&"opacity-50 cursor-not-allowed"),children:[l.jsx("div",{className:"font-medium text-xs",children:e.label}),l.jsx("div",{className:"text-[11px] text-muted-foreground font-mono truncate",children:e.command})]},e.id)),0===("global"===le?te:ne).length&&l.jsx("div",{className:"text-center text-muted-foreground text-xs py-3",children:"暂无快捷 Prompts"})]})}),(te.length>0||ne.length>0)&&l.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 border-t border-border shrink-0",children:[l.jsxs("button",{onClick:()=>oe(e=>"global"===e?null:"global"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","global"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(_,{className:"h-3 w-3"}),"全局","global"===le&&l.jsx(Q,{className:"h-3 w-3"})]}),l.jsxs("button",{onClick:()=>oe(e=>"project"===e?null:"project"),className:i("flex items-center gap-1 px-2 py-1 rounded-md text-xs transition-colors","project"===le?"bg-blue-500/15 text-blue-500":"text-muted-foreground active:bg-accent"),children:[l.jsx(X,{className:"h-3 w-3"}),"项目","project"===le&&l.jsx(Q,{className:"h-3 w-3"})]})]}),l.jsx("div",{className:"border-t border-border px-3 py-2 shrink-0",style:{paddingBottom:"max(0.5rem, env(safe-area-inset-bottom))"},children:l.jsxs("div",{className:"flex items-end gap-2",children:[l.jsx("textarea",{ref:d,value:r,onChange:e=>o(e.target.value),onKeyDown:me,disabled:G||de,placeholder:G?"启动中...":de?"发送中…":"stopped"===F?"输入消息(自动启动)...":"输入消息...",rows:1,className:i("flex-1 resize-none rounded-md border border-input bg-transparent px-3 py-2 text-sm outline-none","focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50","max-h-32 overflow-y-auto",(G||de)&&"opacity-50 cursor-not-allowed"),style:{minHeight:"2.5rem"},onInput:e=>{const t=e.currentTarget;t.style.height="auto",t.style.height=Math.min(t.scrollHeight,128)+"px"}}),l.jsx("button",{onClick:ue,disabled:G||de||!r.trim(),className:i("shrink-0 p-2 rounded-md transition-colors",r.trim()&&!de?"text-blue-500 active:bg-blue-500/10":"text-muted-foreground/30"),children:de?l.jsx(g,{className:"h-5 w-5 animate-spin"}):l.jsx(v,{className:"h-5 w-5"})})]})})]})}const re=S.lazy(()=>I(()=>import("./OfficePreview-w9UCmjcC.js"),__vite__mapDeps([0,1,2,3])).then(e=>({default:e.OfficePreview}))),le=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),oe=new Set(["docx","xlsx","xls","pptx"]),ce={js:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",c:"c",cpp:"cpp",h:"c",cs:"csharp",php:"php",sh:"bash",bash:"bash",zsh:"bash",yaml:"yaml",yml:"yaml",json:"json",toml:"toml",html:"html",htm:"html",xml:"xml",svg:"xml",css:"css",scss:"scss",less:"less",sql:"sql",graphql:"graphql",gql:"graphql",dockerfile:"docker",makefile:"makefile",r:"r",lua:"lua",dart:"dart",zig:"zig"};function ie(e){return e.split("/").pop()??e}function de({filePath:e,onBack:t}){const[s,n]=a.useState(null),[r,o]=a.useState(!0),[c,i]=a.useState(null),{resolved:d}=y(),x=function(e){const t=e.split("/").pop()??"",s=t.toLowerCase();if("dockerfile"===s)return"dockerfile";if("makefile"===s)return"makefile";const a=t.lastIndexOf(".");return a>=0?t.slice(a+1).toLowerCase():""}(e),u=le.has(x),m=oe.has(x),h=ce[x],p="dark"===d;a.useEffect(()=>{u||m?o(!1):(o(!0),i(null),N(e).then(n).catch(e=>i(e instanceof Error?e.message:"Failed to load")).finally(()=>o(!1)))},[e,u,m]);const f=C(e),j=a.useMemo(()=>{const e=w();return e?`${f}&token=${encodeURIComponent(e)}`:f},[f]),v=a.useMemo(()=>u?`${j}&t=${Date.now()}`:"",[j,u]);return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(b,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 text-sm font-medium truncate",children:ie(e)}),l.jsx("a",{href:j,download:!0,className:"text-muted-foreground active:text-foreground p-1",onClick:e=>e.stopPropagation(),children:l.jsx(k,{className:"h-4 w-4"})})]}),l.jsxs("div",{className:"flex-1 overflow-auto min-h-0",children:[r&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),c&&l.jsx("div",{className:"text-center text-destructive text-sm py-12 px-4",children:c}),u&&l.jsx("div",{className:"flex items-center justify-center p-4 h-full",children:l.jsx("img",{src:v,alt:ie(e),className:"max-w-full max-h-full object-contain rounded",style:{touchAction:"pinch-zoom"}})}),m&&l.jsx(a.Suspense,{fallback:l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),children:l.jsx(re,{filePath:e,ext:x,zoom:100})}),s&&(s.binary||s.tooLarge)&&l.jsxs("div",{className:"text-center py-12 px-4 space-y-3",children:[l.jsxs("p",{className:"text-muted-foreground text-sm",children:[s.binary?"二进制文件":"文件过大",s.size>0&&` (${S=s.size,S<1024?`${S} B`:S<1048576?`${(S/1024).toFixed(1)} KB`:`${(S/1048576).toFixed(1)} MB`})`]}),l.jsxs("a",{href:j,download:!0,className:"inline-flex items-center gap-1.5 text-sm text-blue-500 active:text-blue-400",children:[l.jsx(k,{className:"h-4 w-4"}),"下载文件"]})]}),s&&!s.binary&&!s.tooLarge&&null!=s.content&&l.jsxs(l.Fragment,{children:["md"===x&&l.jsx("div",{className:"prose prose-sm dark:prose-invert max-w-none px-4 py-3",children:l.jsx(H,{remarkPlugins:[F,q],rehypePlugins:[O],children:s.content})}),"md"!==x&&h&&l.jsx(B,{language:h,style:p?W:K,customStyle:{margin:0,fontSize:"12px",borderRadius:0},showLineNumbers:!0,children:s.content}),"md"!==x&&!h&&l.jsx("pre",{className:"p-4 text-xs font-mono whitespace-pre-wrap break-words",children:s.content})]})]})]});var S}const xe=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico","avif"]),ue=new Set(["js","jsx","ts","tsx","py","rb","go","rs","java","c","cpp","h","swift","kt","cs","php","sh","bash","zsh","r","lua","dart","zig","css","scss","less","html","htm","xml","sql"]),me=new Set(["json","yaml","yml","toml","csv","tsv"]);function he({entry:e}){if("dir"===e.type)return l.jsx(P,{className:"h-8 w-8 text-blue-400"});const t=function(e){const t=e.lastIndexOf(".");return t>=0?e.slice(t+1).toLowerCase():""}(e.name);return xe.has(t)?l.jsx(V,{className:"h-8 w-8 text-emerald-400"}):ue.has(t)?l.jsx(Y,{className:"h-8 w-8 text-orange-400"}):me.has(t)?l.jsx(Z,{className:"h-8 w-8 text-yellow-400"}):"md"===t?l.jsx(G,{className:"h-8 w-8 text-sky-400"}):l.jsx(U,{className:"h-8 w-8 text-muted-foreground"})}function pe({rootPath:e,onClose:t}){const[s,n]=a.useState(e),[r,o]=a.useState([]),[c,i]=a.useState(!0),[d,x]=a.useState(null),u=a.useCallback(async e=>{i(!0);try{const t=[...(await M(e)).entries].sort((e,t)=>e.type!==t.type?"dir"===e.type?-1:1:e.name.localeCompare(t.name));o(t),n(e)}catch{o([])}finally{i(!1)}},[]);a.useEffect(()=>{u(e)},[e,u]);const m=s!==e,h=s.startsWith(e)?s.slice(e.length)||"/":s;return d?l.jsx(de,{filePath:d,onBack:()=>x(null)}):l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:t,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(z,{className:"h-5 w-5"})}),l.jsxs("div",{className:"flex items-center gap-1 flex-1 min-w-0 text-sm",children:[m&&l.jsx("button",{onClick:()=>{if(s===e)return;const t=s.replace(/\/[^/]+$/,"")||"/";t.startsWith(e)&&u(t)},className:"text-muted-foreground active:text-foreground p-0.5 shrink-0",children:l.jsx(b,{className:"h-4 w-4"})}),l.jsx("span",{className:"truncate text-muted-foreground font-mono text-xs",children:h})]})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto px-3 py-3",children:[c&&l.jsx("div",{className:"flex items-center justify-center py-12",children:l.jsx(g,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!c&&0===r.length&&l.jsx("div",{className:"text-center text-muted-foreground text-sm py-12",children:"空目录"}),!c&&l.jsx("div",{className:"grid grid-cols-3 gap-1",children:r.map(e=>l.jsxs("button",{onClick:()=>(e=>{"dir"===e.type?u(e.path):x(e.path)})(e),className:"flex flex-col items-center gap-1 p-2 rounded-md active:bg-accent transition-colors",children:[l.jsx(he,{entry:e}),l.jsx("span",{className:"text-[11px] text-center leading-tight w-full line-clamp-2 break-all",children:e.name})]},e.path))})]})]})}function fe(e){return e<50?"text-green-400":e<80?"text-yellow-400":"text-red-400"}function je(e){return e<50?"bg-green-500":e<80?"bg-yellow-500":"bg-red-500"}function be({projectName:e,cliTool:t,folderPath:s,contextData:n,onClose:r}){const[o,d]=a.useState(new Set(["context","usage","files"])),[x,u]=a.useState(null),[m,h]=a.useState(!1),p=e=>{d(t=>{const s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})};a.useEffect(()=>{h(!0),T(t).then(u).catch(()=>u(null)).finally(()=>h(!1))},[t]);const f=n?Math.round(n.usedPercentage):null;return l.jsxs("div",{className:"flex flex-col h-full",children:[l.jsxs("div",{className:"flex items-center gap-2 px-3 h-12 border-b border-border shrink-0",children:[l.jsx("button",{onClick:r,className:"text-muted-foreground active:text-foreground p-1",children:l.jsx(z,{className:"h-5 w-5"})}),l.jsx("span",{className:"flex-1 font-medium text-sm truncate",children:e})]}),l.jsxs("div",{className:"flex-1 overflow-y-auto",children:[l.jsxs("button",{onClick:()=>p("context"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("context")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"上下文"}),null!==f&&l.jsxs("span",{className:i("text-xs font-mono ml-auto",fe(f)),children:[f,"%"]})]}),o.has("context")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:null!==f&&n?l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"flex-1 h-2 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full transition-all",je(f)),style:{width:`${Math.min(f,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-10 text-right",fe(f)),children:[f,"%"]})]}),l.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-[11px] text-muted-foreground",children:[l.jsx("span",{children:"窗口大小"}),l.jsx("span",{className:"text-right font-mono",children:n.contextWindowSize>=1e6?`${(n.contextWindowSize/1e6).toFixed(1)}M`:`${Math.round(n.contextWindowSize/1e3)}K`}),l.jsx("span",{children:"输入 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.inputTokens.toLocaleString()}),l.jsx("span",{children:"输出 tokens"}),l.jsx("span",{className:"text-right font-mono",children:n.outputTokens.toLocaleString()})]})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:"暂无数据"})}),l.jsxs("div",{className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 cursor-pointer",role:"button",tabIndex:0,onClick:()=>p("usage"),onKeyDown:e=>{"Enter"!==e.key&&" "!==e.key||p("usage")},children:[o.has("usage")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"用量"}),l.jsx("button",{onClick:e=>{e.stopPropagation(),(async()=>{h(!0);try{const{refreshUsage:e}=await I(async()=>{const{refreshUsage:e}=await import("./index-DIXpAmRD.js").then(e=>e.bI);return{refreshUsage:e}},__vite__mapDeps([1,2]));u(await e(t))}catch{}finally{h(!1)}})()},className:"ml-auto text-muted-foreground active:text-foreground",children:l.jsx(c,{className:i("h-3 w-3",m&&"animate-spin")})})]}),o.has("usage")&&l.jsx("div",{className:"px-4 py-3 border-b border-border/50",children:x?l.jsxs("div",{className:"space-y-2",children:[x.planName&&l.jsxs("div",{className:"text-[11px] text-muted-foreground",children:["Plan: ",l.jsx("span",{className:"font-medium text-foreground",children:x.planName})]}),l.jsx(ge,{label:"5h",bucket:x.fiveHour}),l.jsx(ge,{label:"7d",bucket:x.sevenDay}),x.sevenDaySonnet&&l.jsx(ge,{label:"7d Sonnet",bucket:x.sevenDaySonnet}),x.sevenDayOpus&&l.jsx(ge,{label:"7d Opus",bucket:x.sevenDayOpus}),!x.fiveHour&&!x.sevenDay&&l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center",children:"暂无数据"})]}):l.jsx("div",{className:"text-xs text-muted-foreground/50 text-center py-2",children:m?"加载中...":"暂无数据"})}),l.jsxs("button",{onClick:()=>p("files"),className:"w-full flex items-center gap-2 px-4 py-2.5 border-b border-border/50 active:bg-accent",children:[o.has("files")?l.jsx(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}):l.jsx($,{className:"h-3.5 w-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-sm font-medium",children:"文件"})]}),o.has("files")&&l.jsx("div",{className:"h-[60vh]",children:l.jsx(pe,{rootPath:s,onClose:()=>p("files")})})]})]})}function ge({label:e,bucket:t}){if(!t||void 0===t.utilization)return null;const s=t.utilization,a=function(e){if(!e)return"";const t=new Date(e).getTime()-Date.now();if(t<=0)return"即将重置";const s=Math.floor(t/36e5),a=Math.floor(t%36e5/6e4);return s>0?`${s}h${a}m`:`${a}m`}(t.resetAt);return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-xs text-muted-foreground w-16",children:e}),l.jsx("div",{className:"flex-1 h-1.5 bg-secondary rounded-full overflow-hidden",children:l.jsx("div",{className:i("h-full rounded-full",je(s)),style:{width:`${Math.min(s,100)}%`}})}),l.jsxs("span",{className:i("text-xs font-mono w-8 text-right",fe(s)),children:[s,"%"]}),a&&l.jsx("span",{className:"text-[10px] text-muted-foreground/60",children:a})]})}function ve(){a.useEffect(()=>{const e=document.querySelector('meta[name="viewport"]');if(!e)return;const t=e.getAttribute("content")??"";return e.setAttribute("content","width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover"),()=>{e.setAttribute("content",t)}},[]);const[e,t]=a.useState({screen:"list"}),[n,r]=a.useState(null),o=s(e=>e.projects),c=a.useCallback(e=>{t({screen:"chat",projectId:e}),r(null)},[]),i=a.useCallback(e=>{t({screen:"panel",projectId:e})},[]),d=a.useCallback(()=>{t(e=>"panel"===e.screen?{screen:"chat",projectId:e.projectId}:{screen:"list"})},[]),x="list"!==e.screen?o.find(t=>t.id===e.projectId):void 0;return l.jsxs("div",{className:"fixed inset-0 bg-background overflow-hidden",children:[l.jsxs(A,{mode:"wait",children:["list"===e.screen&&l.jsx(D.div,{className:"absolute inset-0",initial:{opacity:0},animate:{opacity:1},exit:{x:"-30%",opacity:0},transition:{duration:.2},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(se,{onSelectProject:c})},"list"),"chat"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(ne,{project:x,onBack:d,onOpenPanel:()=>i(e.projectId),onContextUpdate:r})},`chat-${e.projectId}`)]}),l.jsx(A,{children:"panel"===e.screen&&x&&l.jsx(D.div,{className:"absolute inset-0 z-50 bg-background",initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"tween",duration:.25},style:{paddingTop:"env(safe-area-inset-top)"},children:l.jsx(be,{projectName:x.name,cliTool:x.cliTool??"claude",folderPath:x.folderPath,contextData:n,onClose:d})},"panel")})]})}export{ve as MobilePage};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-A1ow-4Ih.js","assets/index-BOod62M1.js","assets/index-ChWqp_e7.css","assets/jszip.min-H1vMAeM8.js"])))=>i.map(i=>d[i]);
2
- import{j as e,r as t,_ as s,g as r,f as a}from"./index-BOod62M1.js";import{p as n}from"./purify.es-CgRAQgUo.js";async function l(e){let t=a(e);const s=r();s&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file: ${n.status}`);return n.arrayBuffer()}function o({filePath:r,zoom:a}){const[o,i]=t.useState(""),[d,c]=t.useState(null),[x,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),c(null),(async()=>{try{const t=await s(()=>import("./index-A1ow-4Ih.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),a=await l(r),n=await t.convertToHtml({arrayBuffer:a});e||i(n.value)}catch(t){e||c(t instanceof Error?t.message:"Failed to render docx")}finally{e||u(!1)}})(),()=>{e=!0}},[r]),x?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):d?e.jsx("p",{className:"text-sm text-destructive p-4",children:d}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize(o)}})}function i({filePath:r,zoom:a}){var o;const[i,d]=t.useState([]),[c,x]=t.useState(0),[u,p]=t.useState(null),[m,f]=t.useState(!0);return t.useEffect(()=>{let e=!1;return f(!0),p(null),(async()=>{try{const t=await s(()=>import("./xlsx-DfDjAMCE.js"),[]),a=await l(r),n=t.read(a,{type:"array"}),o=n.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(n.Sheets[e],{editable:!1})}));e||(d(o),x(0))}catch(t){e||p(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||f(!1)}})(),()=>{e=!0}},[r]),m?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):0===i.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[i.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:i.map((t,s)=>e.jsx("button",{onClick:()=>x(s),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(s===c?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},s))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize((null==(o=i[c])?void 0:o.html)??"")}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function d({filePath:r,zoom:a}){const[n,o]=t.useState([]),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await l(r),a=await async function(e){const{default:t}=await s(async()=>{const{default:e}=await import("./jszip.min-H1vMAeM8.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),r=await t.loadAsync(e),a=[],n=Object.keys(r.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var s,r;return parseInt((null==(s=e.match(/slide(\d+)/))?void 0:s[1])??"0")-parseInt((null==(r=t.match(/slide(\d+)/))?void 0:r[1])??"0")});for(let s=0;s<n.length;s++){const e=await r.file(n[s]).async("text"),t=[],l=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').trim();e&&t.push(e)}a.push({index:s+1,texts:t})}return a}(t);e||o(a)}catch(t){e||d(t instanceof Error?t.message:"Failed to render pptx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):0===n.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*a/100+"px"},children:n.map(t=>e.jsxs("div",{className:"border border-border rounded-xl p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,s)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},s))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const c=new Set(["docx","xlsx","xls","pptx"]);function x({filePath:t,ext:s,zoom:r}){return"docx"===s?e.jsx(o,{filePath:t,zoom:r}):"xlsx"===s||"xls"===s?e.jsx(i,{filePath:t,zoom:r}):"pptx"===s?e.jsx(d,{filePath:t,zoom:r}):null}export{c as OFFICE_EXTS,x as OfficePreview};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-DhLWQREd.js","assets/index-DIXpAmRD.js","assets/index-ChWqp_e7.css","assets/jszip.min-7BwG3j23.js"])))=>i.map(i=>d[i]);
2
+ import{j as e,r as t,_ as s,g as r,f as a}from"./index-DIXpAmRD.js";import{p as n}from"./purify.es-CgRAQgUo.js";async function l(e){let t=a(e);const s=r();s&&(t+=`${t.includes("?")?"&":"?"}token=${encodeURIComponent(s)}`);const n=await fetch(t);if(!n.ok)throw new Error(`Failed to fetch file: ${n.status}`);return n.arrayBuffer()}function o({filePath:r,zoom:a}){const[o,i]=t.useState(""),[d,c]=t.useState(null),[x,u]=t.useState(!0);return t.useEffect(()=>{let e=!1;return u(!0),c(null),(async()=>{try{const t=await s(()=>import("./index-DhLWQREd.js").then(e=>e.i),__vite__mapDeps([0,1,2,3])),a=await l(r),n=await t.convertToHtml({arrayBuffer:a});e||i(n.value)}catch(t){e||c(t instanceof Error?t.message:"Failed to render docx")}finally{e||u(!1)}})(),()=>{e=!0}},[r]),x?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Word 文档中..."}):d?e.jsx("p",{className:"text-sm text-destructive p-4",children:d}):e.jsx("div",{className:"p-6 prose dark:prose-invert max-w-none",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize(o)}})}function i({filePath:r,zoom:a}){var o;const[i,d]=t.useState([]),[c,x]=t.useState(0),[u,p]=t.useState(null),[m,f]=t.useState(!0);return t.useEffect(()=>{let e=!1;return f(!0),p(null),(async()=>{try{const t=await s(()=>import("./xlsx-DfDjAMCE.js"),[]),a=await l(r),n=t.read(a,{type:"array"}),o=n.SheetNames.map(e=>({name:e,html:t.utils.sheet_to_html(n.Sheets[e],{editable:!1})}));e||(d(o),x(0))}catch(t){e||p(t instanceof Error?t.message:"Failed to render xlsx")}finally{e||f(!1)}})(),()=>{e=!0}},[r]),m?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 Excel 文件中..."}):u?e.jsx("p",{className:"text-sm text-destructive p-4",children:u}):0===i.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsxs("div",{className:"flex flex-col h-full",children:[i.length>1&&e.jsx("div",{className:"flex gap-0.5 px-3 py-1.5 border-b border-border bg-muted/30 flex-shrink-0 overflow-x-auto",children:i.map((t,s)=>e.jsx("button",{onClick:()=>x(s),className:"px-3 py-1 text-xs rounded-t transition-colors whitespace-nowrap "+(s===c?"bg-background text-foreground border border-b-0 border-border":"text-muted-foreground hover:text-foreground"),children:t.name},s))}),e.jsx("div",{className:"flex-1 overflow-auto p-2 xlsx-preview",style:{fontSize:12*a/100+"px"},dangerouslySetInnerHTML:{__html:n.sanitize((null==(o=i[c])?void 0:o.html)??"")}}),e.jsx("style",{children:"\n .xlsx-preview table { border-collapse: collapse; width: auto; min-width: 100%; }\n .xlsx-preview td, .xlsx-preview th {\n border: 1px solid hsl(var(--border));\n padding: 4px 8px;\n text-align: left;\n white-space: nowrap;\n font-size: inherit;\n }\n .xlsx-preview th { background: hsl(var(--muted)); font-weight: 600; }\n .xlsx-preview tr:hover td { background: hsl(var(--accent) / 0.3); }\n "})]})}function d({filePath:r,zoom:a}){const[n,o]=t.useState([]),[i,d]=t.useState(null),[c,x]=t.useState(!0);return t.useEffect(()=>{let e=!1;return x(!0),d(null),(async()=>{try{const t=await l(r),a=await async function(e){const{default:t}=await s(async()=>{const{default:e}=await import("./jszip.min-7BwG3j23.js").then(e=>e.j);return{default:e}},__vite__mapDeps([3,1,2])),r=await t.loadAsync(e),a=[],n=Object.keys(r.files).filter(e=>/^ppt\/slides\/slide\d+\.xml$/i.test(e)).sort((e,t)=>{var s,r;return parseInt((null==(s=e.match(/slide(\d+)/))?void 0:s[1])??"0")-parseInt((null==(r=t.match(/slide(\d+)/))?void 0:r[1])??"0")});for(let s=0;s<n.length;s++){const e=await r.file(n[s]).async("text"),t=[],l=/<a:t[^>]*>([\s\S]*?)<\/a:t>/g;let o;for(;null!==(o=l.exec(e));){const e=o[1].replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').trim();e&&t.push(e)}a.push({index:s+1,texts:t})}return a}(t);e||o(a)}catch(t){e||d(t instanceof Error?t.message:"Failed to render pptx")}finally{e||x(!1)}})(),()=>{e=!0}},[r]),c?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"加载 PPT 文件中..."}):i?e.jsx("p",{className:"text-sm text-destructive p-4",children:i}):0===n.length?e.jsx("p",{className:"text-sm text-muted-foreground p-4",children:"空文件"}):e.jsx("div",{className:"p-4 space-y-4",style:{fontSize:12*a/100+"px"},children:n.map(t=>e.jsxs("div",{className:"border border-border rounded-xl p-5 bg-muted/20",children:[e.jsxs("div",{className:"text-xs text-muted-foreground mb-2 font-medium",children:["Slide ",t.index]}),t.texts.length>0?e.jsx("div",{className:"space-y-1.5",children:t.texts.map((t,s)=>e.jsx("p",{className:"text-foreground leading-relaxed",style:{fontSize:"inherit"},children:t},s))}):e.jsx("p",{className:"text-muted-foreground text-sm italic",children:"(无文本内容)"})]},t.index))})}const c=new Set(["docx","xlsx","xls","pptx"]);function x({filePath:t,ext:s,zoom:r}){return"docx"===s?e.jsx(o,{filePath:t,zoom:r}):"xlsx"===s||"xls"===s?e.jsx(i,{filePath:t,zoom:r}):"pptx"===s?e.jsx(d,{filePath:t,zoom:r}):null}export{c as OFFICE_EXTS,x as OfficePreview};