cli-link 0.0.6 → 0.0.7

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 (56) hide show
  1. package/dist/client/assets/History-D2xDopni.js +4 -0
  2. package/dist/client/assets/ImageViewer-DuegU_fC.js +1 -0
  3. package/dist/client/assets/MarkdownRenderer-CsyizEL3.js +1 -0
  4. package/dist/client/assets/{PageTopBar-C8j-5s_3.js → PageTopBar-CQwjO6Af.js} +1 -1
  5. package/dist/client/assets/Session-B0s5zBGg.js +7 -0
  6. package/dist/client/assets/Settings-CfHFmJdV.js +1 -0
  7. package/dist/client/assets/Workspace-Cfl0mbNE.js +4 -0
  8. package/dist/client/assets/WorkspaceLinkedText-DCVYd9x-.js +2 -0
  9. package/dist/client/assets/c-BIGW1oBm.js +1 -0
  10. package/dist/client/assets/cpp-DIPi6g--.js +1 -0
  11. package/dist/client/assets/csharp-DSvCPggb.js +1 -0
  12. package/dist/client/assets/dart-bE4Kk8sk.js +1 -0
  13. package/dist/client/assets/dotenv-Da5cRb03.js +1 -0
  14. package/dist/client/assets/go-C27-OAKa.js +1 -0
  15. package/dist/client/assets/graphql-pNE0_Gx8.js +1 -0
  16. package/dist/client/assets/groovy-gcz8RCvz.js +1 -0
  17. package/dist/client/assets/index-BCg3ymV3.css +1 -0
  18. package/dist/client/assets/index-CrJqHlc8.js +2 -0
  19. package/dist/client/assets/java-VnEXKtx_.js +148 -0
  20. package/dist/client/assets/jsx-g9-lgVsj.js +1 -0
  21. package/dist/client/assets/kotlin-BdnUsdx6.js +1 -0
  22. package/dist/client/assets/less-B1dDrJ26.js +1 -0
  23. package/dist/client/assets/lua-BaeVxFsk.js +1 -0
  24. package/dist/client/assets/makefile-CHLpvVh8.js +1 -0
  25. package/dist/client/assets/php-BcCyJq-p.js +1 -0
  26. package/dist/client/assets/properties-DTPjHERo.js +1 -0
  27. package/dist/client/assets/ruby-BwImf3Ka.js +1 -0
  28. package/dist/client/assets/rust-B1yitclQ.js +1 -0
  29. package/dist/client/assets/scss-lMagJa-5.js +1 -0
  30. package/dist/client/assets/sql-CRqJ_cUM.js +1 -0
  31. package/dist/client/assets/svelte-B4a9v_or.js +1 -0
  32. package/dist/client/assets/swift-D82vCrfD.js +1 -0
  33. package/dist/client/assets/toml-vGWfd6FD.js +1 -0
  34. package/dist/client/assets/{vendor-icons-CNN4EKVi.js → vendor-icons-CMXJHDEv.js} +125 -65
  35. package/dist/client/assets/vendor-markdown--d-T3AbU.js +37 -0
  36. package/dist/client/assets/{vendor-motion-n6Lx6G4a.js → vendor-motion-D0ZmPdi9.js} +1 -1
  37. package/dist/client/assets/{vendor-react-DSV5aFEg.js → vendor-react-CcDXZHn_.js} +1 -1
  38. package/dist/client/assets/{vendor-virtual-CcftJrIC.js → vendor-virtual-DJI7OicV.js} +1 -1
  39. package/dist/client/assets/vue-DBXACu8K.js +1 -0
  40. package/dist/client/assets/workspace-return-FrQUv7g3.js +1 -0
  41. package/dist/client/index.html +4 -4
  42. package/dist/server/cli-manager.js +151 -26
  43. package/dist/server/codex-history.js +119 -17
  44. package/dist/server/index.js +906 -57
  45. package/dist/server/store.js +369 -27
  46. package/package.json +3 -3
  47. package/dist/client/assets/History-BxJVDFpN.js +0 -3
  48. package/dist/client/assets/MarkdownRenderer-BO-KS_L1.js +0 -1
  49. package/dist/client/assets/Session-CQFXA2Sr.js +0 -11
  50. package/dist/client/assets/Settings-DYmjRmoN.js +0 -1
  51. package/dist/client/assets/Workspace-D8kv9euM.js +0 -8
  52. package/dist/client/assets/WorkspaceLinkedText-DQyPLk-X.js +0 -2
  53. package/dist/client/assets/code-highlight-CEcsuMpw.js +0 -1
  54. package/dist/client/assets/index-BXT2BylN.css +0 -1
  55. package/dist/client/assets/index-DOgH1Kf3.js +0 -2
  56. package/dist/client/assets/vendor-markdown-BDwu-Ux6.js +0 -35
@@ -1,11 +0,0 @@
1
- import{r as i,j as e,R as F}from"./vendor-react-DSV5aFEg.js";import{u as bt}from"./vendor-virtual-CcftJrIC.js";import{u as yt,a as Be,c as g}from"./index-DOgH1Kf3.js";import{g as kt,M as ne,i as He,W as jt}from"./WorkspaceLinkedText-DQyPLk-X.js";import{P as wt}from"./PageTopBar-C8j-5s_3.js";import{b as le,c as oe,d as Nt,T as Se,A as vt,H as Ct,e as Oe,f as St,F as Tt,g as Te,h as De,i as Dt,j as Et,X as ie,k as Ee,l as Re,m as de,n as V,B as Rt,P as Pt,o as Ft,p as Lt}from"./vendor-icons-CNN4EKVi.js";function Ve(r){if(/^```/.test(r.trim()))return r;try{const l=JSON.parse(r);return"```json\n"+JSON.stringify(l,null,2)+"\n```"}catch{}return r.split(`
2
- `).map(l=>{const a=l.trim();if(!a)return l;try{const d=JSON.parse(a);return"```json\n"+JSON.stringify(d,null,2)+"\n```"}catch{return l}}).join(`
3
- `)}function Mt(r){var a;const t=(r==null?void 0:r.cliCommand)||"",o=((a=t.split(/[\\/]/).pop())==null?void 0:a.toLowerCase())||t.toLowerCase();return((r==null?void 0:r.cliType)||(o.includes("codex")?"codex":"claude"))==="codex"?"Codex CLI":"Claude Code"}const sr=()=>{const{status:r,messages:t,connectionStatus:o,sendMessage:l,confirmResponse:a,questionResponse:d,interrupt:c,newSession:b,editUserMessage:j,cliConfig:m,tokenUsage:f,hasMoreMessagesBefore:x,isLoadingOlderMessages:w,loadOlderMessages:S}=yt(),h=Mt(m),[u,p]=i.useState(""),[N,v]=i.useState(!1),[C,k]=i.useState(!1),[_,R]=i.useState(""),[Je,ce]=i.useState([]),[M,Pe]=i.useState(!1),[Fe,xe]=i.useState(!1),[G,P]=i.useState(!1),[Le,qe]=i.useState(""),[Me,Xe]=i.useState([]),[Ie,Ye]=i.useState([]),[Ze,et]=i.useState(""),[tt,rt]=i.useState(!1),[X,$e]=i.useState(!1),[Y,I]=i.useState(""),[ue,W]=i.useState(!1),[L,Z]=i.useState(null),[K,Q]=i.useState(""),[me,ee]=i.useState(!1),[st,$]=i.useState(null),[ge,Ae]=i.useState({}),te=i.useRef(null),he=i.useRef(null),fe=i.useRef(null),pe=i.useRef(!0),J=i.useRef(),be=i.useRef(new Set),ye=i.useRef(!1),T=i.useMemo(()=>kt(t),[t]),A=bt({count:T.length,getScrollElement:()=>fe.current,estimateSize:s=>{const n=T[s];return n?n.type==="system_group"?ge[n.id]?48+n.messages.length*42:44:n.type==="tool_group"?ge[n.id]?72+n.messages.length*40:58:n.type==="system"&&!n.details&&n.content==="系统消息"?0:n.type==="system"&&!n.details?32:n.type==="thinking"?44:n.type==="tool"?56:n.type==="confirm"?80:n.type==="question"?100:n.type==="error"?60:80:80},overscan:5});i.useEffect(()=>{const s=fe.current;if(!s)return;const n=()=>{pe.current=s.scrollHeight-s.scrollTop-s.clientHeight<150,s.scrollTop<80&&x&&!w&&S()};return s.addEventListener("scroll",n,{passive:!0}),()=>s.removeEventListener("scroll",n)},[x,w,S]),i.useEffect(()=>{t.length===0&&(ye.current=!1,be.current.clear(),Ae({}))},[t.length]),i.useEffect(()=>{T.length>0&&!ye.current&&(ye.current=!0,requestAnimationFrame(()=>{A.scrollToIndex(T.length-1,{align:"end"}),pe.current=!0}))},[T.length,A]);const z=T.length>0?T[T.length-1]:null,at=(z==null?void 0:z.id)||"",nt=(z==null?void 0:z.content)||"";i.useEffect(()=>(T.length>0&&pe.current&&(J.current&&cancelAnimationFrame(J.current),J.current=requestAnimationFrame(()=>{A.scrollToIndex(T.length-1,{align:"end"})})),()=>{J.current&&cancelAnimationFrame(J.current)}),[T.length,at,nt,A]);const lt=i.useCallback(s=>{Ae(n=>({...n,[s]:!n[s]}))},[]),re=i.useCallback(()=>{const s=he.current,n=te.current;if(!s||!n)return;he.current=null;const y=Math.min(s.start,n.value.length),E=Math.min(s.end,n.value.length);n.focus(),n.setSelectionRange(y,E)},[]),D=i.useCallback((s,n=s.length)=>{he.current={start:n,end:n},p(s),requestAnimationFrame(re)},[re]);i.useLayoutEffect(()=>{re()},[u,re]);const Ue=i.useCallback(async()=>{if(!M){Pe(!0);try{const s=await Be.getSkills();ce(s.skills||[]),xe(!0)}catch{ce([]),xe(!0)}finally{Pe(!1)}}},[M]);i.useEffect(()=>{ce([]),xe(!1)},[m==null?void 0:m.workDir,m==null?void 0:m.cliCommand]),i.useEffect(()=>{C&&!Fe&&!M&&Ue()},[C,Fe,M,Ue]);const We=()=>{!u.trim()||r==="running"||(l(u),p(""),k(!1),R(""),W(!1),te.current&&(te.current.style.height="auto"))},it=s=>{const n=s.target.value;p(n);const y=s.target;if(y.style.height="auto",y.style.height=`${Math.min(y.scrollHeight,120)}px`,n.startsWith("/")){const E=n.slice(1).trimStart();R(E),C||k(!0),G&&(P(!1),I(""))}else if(n.startsWith("@")){const E=n.slice(1).trimStart();if(I(E),!G){P(!0);const H=(m==null?void 0:m.workDir)||"~";ae(H)}C&&(k(!1),R(""))}else C&&(k(!1),R("")),G&&(P(!1),I(""))},ot=s=>{a(s)},se=i.useCallback(s=>{if(s==="/"){k(!0),R(""),D("/",1);return}if(s==="@"){P(!0),I(""),D("@",1);const O=(m==null?void 0:m.workDir)||"~";ae(O);return}const n=u,y=n.trimStart(),E=s+" ",H=E.length;if(y===""){D(E,H);return}if(y.startsWith("/ ")||y.startsWith("! ")||y.startsWith("@ ")||y.startsWith("# ")){const O=y.slice(2);D(E+O,H);return}if(y.startsWith("/")||y.startsWith("!")||y.startsWith("@")||y.startsWith("#")){const O=y.indexOf(" "),pt=O>=0?y.slice(O+1):"";D(E+pt,H);return}D(E+n,H)},[m==null?void 0:m.workDir,u,D]),dt=i.useCallback(s=>{D(s+" ",s.length+1),k(!1),R("")},[D]),ae=i.useCallback(async s=>{$e(!0);try{const n=await Be.listFiles(s);qe(n.dir),Xe(n.dirs),Ye(n.files||[]),et(n.parent),rt(n.isRoot)}catch{}$e(!1)},[]),ct=i.useCallback(s=>{const n=Le.split("/").slice(0,3).join("/"),y=s.replace(n,"~");D("@"+y+" ",y.length+2),P(!1),I("")},[Le,D]),ze=i.useCallback(()=>t.filter(s=>s.type==="user"&&s.content.trim()).map(s=>s.content.trim()).filter((s,n,y)=>y.indexOf(s)===n).slice(-20),[t]),xt=i.useCallback(s=>{D(s),W(!1)},[D]),ut=i.useCallback(s=>{r!=="idle"||o!=="connected"||(Z(s.id),Q(s.content),$(null),k(!1),P(!1),W(!1))},[o,r]),mt=i.useCallback(()=>{Z(null),Q(""),ee(!1),$(null)},[]),gt=i.useCallback(async()=>{if(!L||me)return;const s=t.find(n=>n.id===L);if(!K.trim()){$("消息不能为空");return}if(s&&K.trim()===s.content.trim()){$("内容没有变化");return}ee(!0),$(null);try{await j(L,K),Z(null),Q("")}catch(n){$(n instanceof Error?n.message:"编辑消息失败")}finally{ee(!1)}},[j,L,me,K,t]);i.useEffect(()=>{L&&!t.some(s=>s.id===L)&&(Z(null),Q(""),$(null),ee(!1))},[L,t]);const U=o==="disconnected",B=o==="reconnecting",ht=r==="idle"&&o==="connected",ft=A.getVirtualItems(),ke=_.toLowerCase(),je=Je.filter(s=>!ke||s.command.toLowerCase().includes(ke)||s.description.toLowerCase().includes(ke));return e.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-950",children:[e.jsx(wt,{leading:e.jsx("div",{className:"relative flex items-center justify-center w-4 h-4 flex-shrink-0",children:U?e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-red-500"}):o==="connecting"?e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-yellow-500 animate-pulse"}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-green-500 z-10"}),r==="running"&&e.jsx("div",{className:"absolute w-4 h-4 rounded-full bg-green-500 opacity-30 animate-ping"})]})}),title:h,meta:e.jsxs(e.Fragment,{children:[(m==null?void 0:m.workDir)&&e.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400 truncate max-w-[120px] flex-shrink-0",children:m.workDir.split("/").pop()}),e.jsx("span",{className:g("text-[10px] px-1.5 py-0.5 rounded-full font-medium",U?"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-400":B||o==="connecting"?"bg-yellow-50 dark:bg-yellow-950 text-yellow-600 dark:text-yellow-400":r==="idle"?"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400":r==="running"?"bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400":r==="confirm"?"bg-orange-50 dark:bg-orange-950 text-orange-600 dark:text-orange-400":r==="question"?"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400":"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400"),children:U?"已断开":B?"重连中...":o==="connecting"?"连接中...":r==="idle"?"空闲":r==="running"?"进行中":r==="confirm"?"等待确认":r==="question"?"等待回答":"空闲"})]}),actions:e.jsxs(e.Fragment,{children:[f.inputTokens>0&&e.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 font-mono mr-1",title:`会话累计 Token
4
- 输入: ${f.inputTokens.toLocaleString()}
5
- 输出: ${f.outputTokens.toLocaleString()}${f.cacheReadTokens?`
6
- 缓存读: `+f.cacheReadTokens.toLocaleString():""}${f.cacheCreationTokens?`
7
- 缓存写: `+f.cacheCreationTokens.toLocaleString():""}${f.costUsd>0?`
8
- 费用: $`+f.costUsd.toFixed(4):""}`,children:[(f.inputTokens+f.outputTokens).toLocaleString()," tok"]}),e.jsx("button",{onClick:()=>{t.length>0?v(!0):b()},className:"p-2 text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-950 rounded-full transition-colors",title:"新开会话",children:e.jsx(le,{className:"w-5 h-5"})})]})}),e.jsx("div",{ref:fe,className:"flex-1 overflow-y-auto",children:T.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-gray-400 dark:text-gray-600 gap-3",children:[e.jsx(oe,{className:"w-12 h-12 opacity-20"}),e.jsx("p",{className:"text-sm font-medium",children:"AgentPilot"}),e.jsx("p",{className:"text-xs text-gray-300 dark:text-gray-600",children:"AI Agent 遥控器,随时随地掌控"})]}):e.jsxs(e.Fragment,{children:[x&&e.jsx("div",{className:"px-4 pt-3 pb-1 flex justify-center",children:e.jsx("button",{type:"button",onClick:S,disabled:w,className:"text-xs px-3 py-1.5 rounded-full bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-800 text-gray-500 dark:text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 hover:border-primary-200 dark:hover:border-primary-800 disabled:opacity-60 transition-colors",children:w?"加载中...":"加载更早消息"})}),e.jsx("div",{style:{height:A.getTotalSize()+16,width:"100%",position:"relative"},children:ft.map(s=>{const n=T[s.index],y=!be.current.has(n.id);return be.current.add(n.id),e.jsx("div",{"data-index":s.index,ref:A.measureElement,style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${s.start}px)`},children:e.jsx("div",{className:g("px-4 py-2"),children:e.jsx($t,{message:n,isStreaming:r==="running"&&s.index===T.length-1&&n.type==="ai",animate:y,expanded:ge[n.id]??!1,onToggleExpand:lt,canEditUserMessage:ht,editingMessageId:L,editingValue:K,editingSubmitting:me,editError:st,onStartEdit:ut,onEditingValueChange:Q,onCancelEdit:mt,onSubmitEdit:gt})})},n.id)})})]})}),e.jsx("div",{className:"bg-white dark:bg-gray-900 border-t border-gray-100 dark:border-gray-800 flex-shrink-0 relative shadow-[0_-1px_8px_rgba(0,0,0,0.04)] dark:shadow-[0_-1px_8px_rgba(0,0,0,0.2)]",children:r==="confirm"?e.jsx(Qt,{pendingMessage:t.filter(s=>s.type==="confirm"&&s.status==="pending").slice(-1)[0],onConfirm:ot}):r==="question"?e.jsx(qt,{pendingMessage:t.filter(s=>s.type==="question"&&s.status==="pending").slice(-1)[0],onAnswer:d}):e.jsxs("div",{children:[e.jsxs("div",{className:"px-3 pt-1 flex items-center gap-1 overflow-x-auto hide-scrollbar",children:[e.jsx(q,{prefix:"/",icon:e.jsx(Nt,{className:"w-3 h-3"}),label:"命令",color:"bg-blue-50/50 dark:bg-blue-950/50 text-blue-500/70 dark:text-blue-400/70 border-blue-200/40 dark:border-blue-800/40",onClick:()=>se("/")}),e.jsx(q,{prefix:"!",icon:e.jsx(Se,{className:"w-3 h-3"}),label:"Bash",color:"bg-amber-50/50 dark:bg-amber-950/50 text-amber-500/70 dark:text-amber-400/70 border-amber-200/40 dark:border-amber-800/40",onClick:()=>se("!")}),e.jsx(q,{prefix:"@",icon:e.jsx(vt,{className:"w-3 h-3"}),label:"文件",color:"bg-green-50/50 dark:bg-green-950/50 text-green-500/70 dark:text-green-400/70 border-green-200/40 dark:border-green-800/40",onClick:()=>se("@")}),e.jsx(q,{prefix:"#",icon:e.jsx(Ct,{className:"w-3 h-3"}),label:"记忆",color:"bg-purple-50/50 dark:bg-purple-950/50 text-purple-500/70 dark:text-purple-400/70 border-purple-200/40 dark:border-purple-800/40",onClick:()=>se("#")}),ze().length>0&&e.jsx(q,{prefix:"",icon:e.jsx(Oe,{className:"w-3 h-3"}),label:"历史",color:"bg-gray-50/50 dark:bg-gray-950/50 text-gray-500/70 dark:text-gray-400/70 border-gray-200/40 dark:border-gray-800/40",onClick:()=>{W(!ue),k(!1),P(!1)}})]}),C&&e.jsx("div",{className:"overflow-hidden border-t border-gray-100 dark:border-gray-800",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||(k(!1),R(""))},children:e.jsxs("div",{className:"max-h-48 overflow-y-auto overscroll-contain py-1",children:[(je.length>0||M)&&e.jsx("div",{className:"px-4 py-1 text-[10px] font-medium uppercase tracking-wider text-gray-400 dark:text-gray-500",children:"CLI Skills"}),je.map(s=>e.jsxs("button",{onClick:()=>dt(s.command),className:"w-full flex items-center gap-3 px-4 py-2.5 hover:bg-purple-50 dark:hover:bg-purple-950/50 active:bg-purple-100 dark:active:bg-purple-950 transition-colors text-left",children:[e.jsx("span",{className:"text-sm font-mono font-semibold text-purple-600 dark:text-purple-400 whitespace-nowrap",children:s.command}),e.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500 truncate flex-1",children:s.description}),e.jsx("span",{className:"text-[10px] text-gray-300 dark:text-gray-600 flex-shrink-0",children:s.source})]},`${s.source}:${s.name}`)),M&&e.jsx("div",{className:"px-4 py-3 text-xs text-gray-400 text-center",children:"正在加载 CLI Skills..."}),!M&&je.length===0&&e.jsx("div",{className:"px-4 py-3 text-xs text-gray-400 text-center",children:"命令会原样发送给 CLI"})]})}),G&&e.jsx("div",{className:"overflow-hidden border-t border-gray-100 dark:border-gray-800",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||(P(!1),I(""))},children:e.jsxs("div",{className:"max-h-52 overflow-y-auto overscroll-contain py-1",children:[!tt&&e.jsxs("button",{onClick:()=>ae(Ze),className:"w-full flex items-center gap-3 px-4 py-2 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors text-left",children:[e.jsx(St,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:"返回上级"})]}),X&&e.jsx("div",{className:"flex items-center justify-center py-4",children:e.jsx("div",{className:"w-5 h-5 border-2 border-green-500 border-t-transparent rounded-full animate-spin"})}),!X&&Me.filter(s=>!Y||s.name.toLowerCase().includes(Y.toLowerCase())).map(s=>e.jsxs("button",{onClick:()=>ae(s.path),className:"w-full flex items-center gap-3 px-4 py-2.5 hover:bg-green-50 dark:hover:bg-green-950/50 active:bg-green-100 dark:active:bg-green-950 transition-colors text-left",children:[e.jsx(Tt,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:s.name}),e.jsx(Te,{className:"w-3.5 h-3.5 text-gray-300 dark:text-gray-600 ml-auto flex-shrink-0"})]},s.path)),!X&&Ie.filter(s=>!Y||s.name.toLowerCase().includes(Y.toLowerCase())).map(s=>e.jsxs("button",{onClick:()=>ct(s.path),className:"w-full flex items-center gap-3 px-4 py-2.5 hover:bg-green-50 dark:hover:bg-green-950/50 active:bg-green-100 dark:active:bg-green-950 transition-colors text-left",children:[e.jsx(De,{className:"w-4 h-4 text-green-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate flex-1",children:s.name}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 flex-shrink-0",children:s.ext||"?"})]},s.path)),!X&&Me.length===0&&Ie.length===0&&e.jsx("div",{className:"px-4 py-3 text-xs text-gray-400 text-center",children:"空目录"})]})}),ue&&e.jsx("div",{className:"overflow-hidden border-t border-gray-100 dark:border-gray-800",onBlur:s=>{s.currentTarget.contains(s.relatedTarget)||W(!1)},children:e.jsx("div",{className:"max-h-48 overflow-y-auto overscroll-contain py-1",children:ze().slice().reverse().map((s,n)=>e.jsxs("button",{onClick:()=>xt(s),className:"w-full flex items-center gap-3 px-4 py-2.5 hover:bg-gray-50 dark:hover:bg-gray-800 active:bg-gray-100 dark:active:bg-gray-700 transition-colors text-left",children:[e.jsx(Oe,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:s})]},n))})}),e.jsxs("div",{className:"p-3 pb-safe flex items-center gap-2.5",children:[e.jsx("div",{className:"flex-1 relative",children:e.jsx("textarea",{ref:te,value:u,onChange:it,placeholder:U||B?"连接已断开":"输入指令…",disabled:U||B,className:"w-full bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 focus:bg-white dark:focus:bg-gray-800 focus:border-primary-400 focus:ring-[3px] focus:ring-primary-100 dark:focus:ring-primary-900 rounded-2xl px-4 py-3 text-sm text-gray-800 dark:text-gray-200 placeholder:text-gray-400 dark:placeholder:text-gray-600 resize-none min-h-[44px] max-h-[120px] transition-all duration-200 outline-none hide-scrollbar",rows:1,onKeyDown:s=>{if(s.key==="Escape"){if(C){s.preventDefault(),k(!1),R("");return}if(G){s.preventDefault(),P(!1),I("");return}if(ue){s.preventDefault(),W(!1);return}}s.key==="Enter"&&(s.metaKey||s.ctrlKey)&&(s.preventDefault(),We())}})}),r==="running"?e.jsx("button",{className:"p-2.5 bg-red-500 text-white rounded-full flex-shrink-0 hover:bg-red-600 active:scale-95 transition-all shadow-sm",onClick:c,children:e.jsx(Dt,{className:"w-4 h-4 fill-current"})},"interrupt"):e.jsx("button",{onClick:We,disabled:!u.trim()||U||B,className:g("p-2.5 rounded-full flex-shrink-0 transition-all duration-200 shadow-sm active:scale-95",u.trim()&&!U&&!B?"bg-primary-600 text-white hover:bg-primary-700 shadow-primary-200 dark:shadow-primary-900":"bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500 shadow-none"),children:e.jsx(Et,{className:"w-4 h-4"})},"send")]})]})}),N&&e.jsxs(e.Fragment,{children:[e.jsx("div",{onClick:()=>v(!1),className:"absolute inset-0 bg-black/40 z-40"}),e.jsxs("div",{className:"absolute inset-x-4 top-1/2 -translate-y-1/2 bg-white dark:bg-gray-900 rounded-2xl z-50 p-5 shadow-xl",children:[e.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-50 dark:bg-primary-950 flex items-center justify-center flex-shrink-0",children:e.jsx(le,{className:"w-5 h-5 text-primary-600 dark:text-primary-400"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"新开会话"}),e.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-0.5",children:"当前会话将保存到会话记录"})]})]}),e.jsxs("div",{className:"flex gap-3 mt-4",children:[e.jsx("button",{onClick:()=>v(!1),className:"flex-1 py-2.5 border border-gray-200 dark:border-gray-700 text-gray-700 dark:text-gray-300 rounded-xl font-medium hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors text-sm",children:"取消"}),e.jsx("button",{onClick:()=>{v(!1),b()},className:"flex-1 py-2.5 bg-primary-600 text-white rounded-xl font-medium hover:bg-primary-700 transition-colors text-sm shadow-sm",children:"确认"})]})]})]})]})},It=F.memo(function({message:t,animClass:o,canEdit:l,isEditing:a,editingValue:d,editingSubmitting:c,editError:b,onStartEdit:j,onEditingValueChange:m,onCancelEdit:f,onSubmitEdit:x}){const w=i.useRef(null),S=i.useCallback(h=>{h&&(h.style.height="auto",h.style.height=`${Math.min(h.scrollHeight,240)}px`)},[]);return i.useEffect(()=>{a&&requestAnimationFrame(()=>{const h=w.current;h&&(S(h),h.focus(),h.setSelectionRange(h.value.length,h.value.length))})},[a,S]),a?e.jsx("div",{className:g("flex justify-end",o),children:e.jsxs("div",{className:"w-[95%] max-w-2xl bg-primary-600 text-white rounded-2xl rounded-tr-sm px-3 py-3 shadow-sm",children:[e.jsx("textarea",{ref:w,value:d,disabled:c,onChange:h=>{m(h.target.value),S(h.currentTarget)},onKeyDown:h=>{h.key==="Escape"&&(h.preventDefault(),f()),h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),x())},className:"w-full min-h-[88px] max-h-60 resize-none overflow-y-auto rounded-xl border border-white/25 bg-white/10 px-3 py-2 text-[15px] leading-relaxed text-white placeholder:text-primary-100 outline-none focus:border-white/60 focus:ring-2 focus:ring-white/20 disabled:opacity-70"}),b&&e.jsx("div",{className:"mt-2 text-xs text-red-100 bg-red-500/25 border border-red-200/30 rounded-lg px-2 py-1",children:b}),e.jsxs("div",{className:"mt-2 flex justify-end gap-1.5",children:[e.jsx("button",{type:"button",onClick:f,disabled:c,className:"p-1.5 rounded-full text-primary-100 hover:text-white hover:bg-white/15 active:scale-95 transition-all disabled:opacity-50",title:"取消编辑",children:e.jsx(ie,{className:"w-4 h-4"})}),e.jsx("button",{type:"button",onClick:x,disabled:c||!d.trim(),className:"p-1.5 rounded-full bg-white text-primary-700 hover:bg-primary-50 active:scale-95 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:"提交编辑",children:e.jsx(Re,{className:"w-4 h-4"})})]})]})}):e.jsx("div",{className:g("flex justify-end",o),children:e.jsxs("div",{className:"relative group max-w-[95%]",children:[l&&e.jsx("button",{type:"button",onClick:()=>j(t),className:"absolute -left-8 top-1/2 -translate-y-1/2 p-1.5 rounded-full bg-white dark:bg-gray-800 border border-gray-100 dark:border-gray-700 text-gray-400 hover:text-primary-600 dark:hover:text-primary-400 shadow-sm opacity-70 sm:opacity-0 sm:group-hover:opacity-100 focus:opacity-100 transition-all",title:"编辑消息",children:e.jsx(Pt,{className:"w-3.5 h-3.5"})}),e.jsxs("div",{className:"bg-primary-600 text-white rounded-2xl rounded-tr-sm px-4 py-2.5 shadow-sm relative overflow-hidden",children:[e.jsx("p",{className:"text-[15px] leading-relaxed whitespace-pre-wrap break-words",children:e.jsx(jt,{linkClassName:"text-white decoration-white/70",children:t.content})}),e.jsx("span",{className:"text-[10px] text-primary-200 absolute bottom-1 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:t.time})]})]})})}),$t=F.memo(function({message:t,isStreaming:o,animate:l,expanded:a,onToggleExpand:d,canEditUserMessage:c,editingMessageId:b,editingValue:j,editingSubmitting:m,editError:f,onStartEdit:x,onEditingValueChange:w,onCancelEdit:S,onSubmitEdit:h}){var p;const u=l?"message-animate-in":"";switch(t.type){case"system_group":return e.jsx(_t,{group:t,animate:l,expanded:a??!1,onToggleExpand:d});case"tool_group":return e.jsx(Ot,{group:t,animate:l,expanded:a??!1,onToggleExpand:d});case"user":return e.jsx(It,{message:t,animClass:u,canEdit:c,isEditing:b===t.id,editingValue:j,editingSubmitting:m,editError:f,onStartEdit:x,onEditingValueChange:w,onCancelEdit:S,onSubmitEdit:h});case"ai":return e.jsx("div",{className:g("flex justify-start",u),children:e.jsxs("div",{className:"bg-white dark:bg-gray-800 border border-gray-100 dark:border-gray-700 text-gray-800 dark:text-gray-200 rounded-2xl rounded-tl-md px-3.5 py-3 max-w-[94%] shadow-sm relative group markdown-body overflow-hidden min-w-0",children:[e.jsx(ne,{children:t.content}),o&&e.jsx("span",{className:"inline-block w-1.5 h-4 bg-primary-500 animate-pulse ml-0.5 align-text-bottom rounded-sm"}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 absolute bottom-1 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:t.time})]})});case"tool":return e.jsx(Ht,{message:t,animate:l,expanded:a??!1,onToggleExpand:d});case"confirm":return e.jsx("div",{className:g("flex justify-start",u),children:e.jsxs("div",{className:g("border rounded-xl px-4 py-3 max-w-[95%] shadow-sm relative overflow-hidden",t.status==="pending"?"bg-orange-50 dark:bg-orange-950 border-orange-200 dark:border-orange-800":t.status==="approved"?"bg-green-50 dark:bg-green-950 border-green-200 dark:border-green-800":"bg-red-50 dark:bg-red-950 border-red-200 dark:border-red-800"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[t.status==="pending"?e.jsx(Ee,{className:"w-4 h-4 text-orange-500"}):t.status==="approved"?e.jsx(Re,{className:"w-4 h-4 text-green-600"}):e.jsx(ie,{className:"w-4 h-4 text-red-600"}),e.jsx("span",{className:g("text-sm font-semibold",t.status==="pending"?"text-orange-800 dark:text-orange-300":t.status==="approved"?"text-green-800 dark:text-green-300":"text-red-800 dark:text-red-300"),children:t.status==="pending"?"等待确认":t.status==="approved"?"已批准":"已拒绝"}),t.permission&&e.jsx(Qe,{permission:t.permission})]}),e.jsx("p",{className:g("text-sm",t.status==="pending"?"text-orange-900 dark:text-orange-200":t.status==="approved"?"text-green-900 dark:text-green-200":"text-red-900 dark:text-red-200"),children:t.content}),((p=t.permission)==null?void 0:p.filePath)&&e.jsx("div",{className:"mt-1.5 text-xs font-mono text-gray-500 dark:text-gray-400 bg-white/50 dark:bg-gray-900/50 px-2 py-1 rounded break-all",children:t.permission.filePath})]})});case"system":return e.jsx(Gt,{message:t,animate:l});case"question":return e.jsx(Jt,{message:t,animate:l});case"thinking":return e.jsx(Kt,{message:t,animate:l,expanded:a??!1,onToggleExpand:d});case"error":return e.jsx("div",{className:g("flex justify-start",u),children:e.jsxs("div",{className:"bg-red-50 dark:bg-red-950 border border-red-100 dark:border-red-800 text-red-800 dark:text-red-300 rounded-xl px-4 py-3 max-w-[95%] shadow-sm flex items-start gap-2 overflow-hidden",children:[e.jsx(ie,{className:"w-4 h-4 mt-0.5 flex-shrink-0"}),e.jsx("p",{className:"text-sm leading-relaxed break-words min-w-0",children:t.content})]})});default:return null}},(r,t)=>{const o=He(r.message),l=He(t.message);if(o||l){if(!o||!l||r.message.type!==t.message.type||r.message.id!==t.message.id||r.message.content!==t.message.content||r.message.time!==t.message.time||r.message.messages.length!==t.message.messages.length)return!1;for(let a=0;a<r.message.messages.length;a+=1){const d=r.message.messages[a],c=t.message.messages[a];if(d.id!==c.id||d.content!==c.content||d.status!==c.status||d.toolDetails!==c.toolDetails||d.toolResult!==c.toolResult||d.details!==c.details)return!1}return!(r.animate!==t.animate||r.expanded!==t.expanded)}return!(r.message.id!==t.message.id||r.message.content!==t.message.content||r.message.status!==t.message.status||r.isStreaming!==t.isStreaming||r.animate!==t.animate||r.expanded!==t.expanded||(r.message.type==="user"||t.message.type==="user")&&(r.canEditUserMessage!==t.canEditUserMessage||r.editingMessageId!==t.editingMessageId||(r.editingMessageId===r.message.id||t.editingMessageId===t.message.id)&&(r.editingValue!==t.editingValue||r.editingSubmitting!==t.editingSubmitting||r.editError!==t.editError))||r.message.toolDetails!==t.message.toolDetails||r.message.toolResult!==t.message.toolResult||r.message.permission!==t.message.permission||r.message.question!==t.message.question)});function At(r){const t=(r.toolName||r.content||"").toLowerCase();return["readfile","writefile","read","write","edit","multiedit"].includes(t)}function we(r){return r.toolName&&r.toolName!=="result"?r.toolName:r.content||"tool"}function Ut(r){return _e(r).join("、")||"工具调用"}function _e(r){return Array.from(new Set(r.map(we).filter(Boolean)))}function Wt(r){if(r.some(t=>t.status==="failed"))return"failed";if(r.some(t=>t.status==="running"))return"running";if(r.some(t=>t.status==="success"))return"success"}function zt(r){const t=r.filter(d=>d.status==="running").length,o=r.filter(d=>d.status==="failed").length,l=r.filter(d=>d.status==="success").length,a=[`${r.length} 个`];return t&&a.push(`${t} 运行中`),o&&a.push(`${o} 失败`),l&&!t&&!o&&a.push("已完成"),a.join(" · ")}function Ge(r,t="w-4 h-4"){return At(r)?e.jsx(Ft,{className:t}):e.jsx(oe,{className:t})}function Ne({status:r,className:t="w-3.5 h-3.5"}){return r==="running"?e.jsx(Lt,{className:g(t,"text-primary-500 animate-pulse")}):r==="success"?e.jsx(Re,{className:g(t,"text-green-600")}):r==="failed"?e.jsx(ie,{className:g(t,"text-red-600")}):null}function Bt({status:r}){return e.jsx("span",{className:g("w-1.5 h-1.5 rounded-full flex-shrink-0",r==="running"?"bg-primary-500 animate-pulse":r==="failed"?"bg-red-500":r==="success"?"bg-green-500":"bg-gray-300 dark:bg-gray-600")})}const Ke=F.memo(function({message:t,compact:o=!1}){const l=o?"max-h-40":"max-h-72";return e.jsxs("div",{className:"mt-1.5 flex flex-col gap-1.5",onClick:a=>a.stopPropagation(),children:[t.toolDetails&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-medium text-primary-600 dark:text-primary-400 uppercase tracking-wider mb-1",children:"输入"}),e.jsx("div",{className:g("text-xs text-gray-600 dark:text-gray-400 bg-white/50 dark:bg-gray-900/50 p-2.5 rounded-lg border border-primary-50 dark:border-gray-700 overflow-y-auto markdown-body-sm",l),children:e.jsx(ne,{children:Ve(t.toolDetails)})})]}),t.toolResult&&e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] font-medium text-primary-600 dark:text-primary-400 uppercase tracking-wider mb-1",children:"输出"}),e.jsx("div",{className:g("text-xs p-2.5 rounded-lg overflow-y-auto markdown-body-sm",l,t.status==="failed"?"text-red-700 dark:text-red-300 bg-red-50/50 dark:bg-red-950/50 border border-red-100 dark:border-red-900":"text-gray-600 dark:text-gray-400 bg-white/50 dark:bg-gray-900/50 border border-primary-50 dark:border-gray-700"),children:e.jsx(ne,{children:Ve(t.toolResult)})})]})]})}),Ht=F.memo(function({message:t,animate:o,expanded:l,onToggleExpand:a}){const d=o?"message-animate-in":"",c=!!(t.toolDetails||t.toolResult);return e.jsx("div",{className:g("flex justify-start",d),children:e.jsxs("div",{className:g("bg-primary-50 dark:bg-gray-800 border border-primary-100 dark:border-gray-700 rounded-xl px-3 py-2 max-w-[95%] flex flex-col gap-1.5 overflow-hidden",c&&"cursor-pointer hover:bg-primary-100/50 dark:hover:bg-gray-700 transition-colors"),onClick:()=>c&&a(t.id),children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary-800 dark:text-primary-300 min-w-0",children:[Ge(t,"w-4 h-4 flex-shrink-0"),e.jsx("span",{className:"text-sm font-medium break-words min-w-0",children:t.content}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5 flex-shrink-0",children:[e.jsx(Ne,{status:t.status}),c&&(l?e.jsx(de,{className:"w-3.5 h-3.5 text-primary-500"}):e.jsx(V,{className:"w-3.5 h-3.5 text-primary-500"}))]})]}),l&&c&&e.jsx(Ke,{message:t})]})})}),Ot=F.memo(function({group:t,animate:o,expanded:l,onToggleExpand:a}){const d=o?"message-animate-in":"",c=Wt(t.messages),b=Ut(t.messages),[j,m]=i.useState({}),f=i.useCallback(x=>{m(w=>({...w,[x]:!w[x]}))},[]);return e.jsx("div",{className:g("flex justify-start",d),children:e.jsxs("div",{className:"max-w-[95%] rounded-xl border border-primary-100 dark:border-gray-700 bg-primary-50/90 dark:bg-gray-800 overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>a(t.id),className:"w-full px-3 py-2 flex items-center gap-2 text-left min-w-0 hover:bg-primary-100/60 dark:hover:bg-gray-700 transition-colors",children:[l?e.jsx(V,{className:"w-3.5 h-3.5 text-primary-500 flex-shrink-0"}):e.jsx(Te,{className:"w-3.5 h-3.5 text-primary-500 flex-shrink-0"}),e.jsx(oe,{className:"w-3.5 h-3.5 text-primary-600 dark:text-primary-400 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-primary-800 dark:text-primary-300 flex-shrink-0",children:"工具调用"}),e.jsx("span",{className:g("text-[10px] px-1.5 py-0.5 rounded-full flex-shrink-0",c==="failed"?"bg-red-100 text-red-700 dark:bg-red-950 dark:text-red-300":c==="running"?"bg-primary-100 text-primary-700 dark:bg-primary-950 dark:text-primary-300":"bg-green-100 text-green-700 dark:bg-green-950 dark:text-green-300"),children:zt(t.messages)}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 flex-shrink-0",children:t.time}),e.jsx("span",{className:"min-w-0 truncate text-xs text-gray-600 dark:text-gray-400",title:b,children:b}),e.jsx("span",{className:"ml-auto flex-shrink-0",children:e.jsx(Ne,{status:c})})]}),!l&&e.jsx("div",{className:"px-3 pb-2 flex flex-wrap gap-1.5",children:_e(t.messages).map(x=>{const w=t.messages.find(S=>we(S)===x);return e.jsxs("span",{className:"inline-flex max-w-full min-w-0 items-center gap-1.5 text-[10px] px-1.5 py-0.5 rounded-full bg-white/70 dark:bg-gray-900/50 text-gray-600 dark:text-gray-300 border border-primary-100/60 dark:border-gray-700",title:x,children:[e.jsx(Bt,{status:w==null?void 0:w.status}),e.jsx("span",{className:"truncate text-left",children:x})]},x)})}),l&&e.jsx("div",{className:"border-t border-primary-100/80 dark:border-gray-700 divide-y divide-primary-100/70 dark:divide-gray-700",children:t.messages.map(x=>{const w=we(x),S=x.content&&x.content!==w,h=!!(x.toolDetails||x.toolResult),u=!!j[x.id];return e.jsxs("div",{className:"px-3 py-2 min-w-0",children:[e.jsxs("button",{type:"button",onClick:()=>h&&f(x.id),className:g("w-full flex flex-col gap-1 text-primary-800 dark:text-primary-300 min-w-0 text-left",h&&"cursor-pointer hover:text-primary-900 dark:hover:text-primary-200"),children:[e.jsxs("div",{className:"w-full flex items-start gap-2 min-w-0",children:[Ge(x,"w-3.5 h-3.5 flex-shrink-0 mt-0.5"),e.jsx("span",{className:"min-w-0 flex-1 truncate text-xs font-semibold",title:w,children:w}),e.jsxs("span",{className:"ml-auto flex items-center gap-1.5 flex-shrink-0",children:[e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 flex-shrink-0",children:x.time}),h&&e.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-white/70 dark:bg-gray-900/50 text-gray-500 dark:text-gray-400 border border-primary-100/60 dark:border-gray-700",children:x.toolDetails&&x.toolResult?"输入/输出":x.toolDetails?"输入":"输出"}),e.jsx(Ne,{status:x.status,className:"w-3 h-3"}),h&&(u?e.jsx(de,{className:"w-3 h-3 text-primary-500"}):e.jsx(V,{className:"w-3 h-3 text-primary-500"}))]})]}),S&&e.jsx("span",{className:"w-full pl-5 pr-1 text-xs text-gray-500 dark:text-gray-400 truncate min-w-0",children:x.content})]}),h&&u&&e.jsx(Ke,{message:x,compact:!0})]},x.id)})})]})})});function Vt(r){const t=Math.round(r/1e3);return t>=60?`${Math.floor(t/60)}m${t%60}s`:`${t}s`}function ve(r){if(!r)return[];const t=[];if(r.model&&t.push({label:"模型",value:r.model,color:"bg-purple-50 text-purple-700 dark:bg-purple-950 dark:text-purple-300"}),r.costUsd!=null&&t.push({label:"费用",value:`$${Number(r.costUsd).toFixed(4)}`,color:"bg-amber-50 text-amber-700 dark:bg-amber-950 dark:text-amber-300"}),r.durationMs!=null&&t.push({label:"耗时",value:Vt(Number(r.durationMs)),color:"bg-blue-50 text-blue-700 dark:bg-blue-950 dark:text-blue-300"}),r.numTurns!=null&&t.push({label:"轮次",value:String(r.numTurns),color:"bg-green-50 text-green-700 dark:bg-green-950 dark:text-green-300"}),r.inputTokens!=null||r.outputTokens!=null){const o=r.inputTokens?Number(r.inputTokens).toLocaleString():"0",l=r.outputTokens?Number(r.outputTokens).toLocaleString():"0";let a=`${o} → ${l}`;if(r.cacheReadTokens||r.cacheCreationTokens){const d=[];r.cacheCreationTokens&&d.push(`缓存写 ${Number(r.cacheCreationTokens).toLocaleString()}`),r.cacheReadTokens&&d.push(`缓存读 ${Number(r.cacheReadTokens).toLocaleString()}`),a+=` (${d.join(", ")})`}t.push({label:"Token",value:a,color:"bg-cyan-50 text-cyan-700 dark:bg-cyan-950 dark:text-cyan-300"})}return r.toolsCount!=null&&t.push({label:"工具",value:String(r.toolsCount),color:"bg-indigo-50 text-indigo-700 dark:bg-indigo-950 dark:text-indigo-300"}),t}function Ce(r){return r.length===0?null:e.jsx("div",{className:"flex flex-wrap gap-1.5",children:r.map((t,o)=>e.jsxs("span",{className:g("inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium max-w-full",t.color),children:[e.jsx("span",{className:"opacity-60 flex-shrink-0",children:t.label}),e.jsx("span",{className:"font-semibold truncate",children:t.value})]},`${t.label}-${o}`))})}const _t=F.memo(function({group:t,animate:o,expanded:l,onToggleExpand:a}){const d=o?"message-animate-in":"",c=t.messages[t.messages.length-1],b=ve(c==null?void 0:c.details),j=t.messages.length>1,m=t.messages.filter(f=>{var x;return((x=f.details)==null?void 0:x.subtype)==="result"}).length;return e.jsx("div",{className:g("flex justify-start",d),children:e.jsxs("div",{className:"max-w-[95%] rounded-xl border border-gray-200 dark:border-gray-800 bg-gray-50/90 dark:bg-gray-900/80 overflow-hidden",children:[e.jsxs("button",{type:"button",onClick:()=>j&&a(t.id),className:g("w-full px-3 py-2 flex items-center gap-2 text-left min-w-0",j&&"hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer"),children:[j?l?e.jsx(V,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}):e.jsx(Te,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}):e.jsx(oe,{className:"w-3.5 h-3.5 text-gray-400 flex-shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-gray-600 dark:text-gray-300 flex-shrink-0",children:"系统消息"}),j&&e.jsxs("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full bg-gray-200/70 dark:bg-gray-800 text-gray-500 dark:text-gray-400 flex-shrink-0",children:[t.messages.length," 条",m>0?` · ${m} 次完成`:""]}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 flex-shrink-0",children:t.time}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate min-w-0",children:t.content})]}),!l&&b.length>0&&e.jsx("div",{className:"px-3 pb-2",children:Ce(b)}),l&&j&&e.jsx("div",{className:"border-t border-gray-200/80 dark:border-gray-800 divide-y divide-gray-200/70 dark:divide-gray-800",children:t.messages.map(f=>{const x=ve(f.details);return e.jsxs("div",{className:"px-3 py-2 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("span",{className:"text-xs text-gray-600 dark:text-gray-300 truncate min-w-0",children:f.content}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500 flex-shrink-0",children:f.time})]}),x.length>0&&e.jsx("div",{className:"mt-1.5",children:Ce(x)})]},f.id)})})]})})}),Gt=F.memo(function({message:t,animate:o}){const l=t.details,a=o?"message-animate-in":"",d=t.content==="系统消息";if((!l||Object.keys(l).length===0)&&d)return null;if(!l||Object.keys(l).length===0)return e.jsx("div",{className:g("flex justify-start",a),children:e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 bg-gray-100 dark:bg-gray-800 px-3 py-1 rounded-full",children:t.content})});const c=l.subtype==="result",b=l.subtype==="init",j=ve(l);return e.jsx("div",{className:g("flex justify-start",a),children:e.jsxs("div",{className:g("px-3 py-2 rounded-xl border max-w-[95%]",c?"bg-green-50/80 dark:bg-green-950/40 border-green-200/60 dark:border-green-800/40":b?"bg-blue-50/80 dark:bg-blue-950/40 border-blue-200/60 dark:border-blue-800/40":"bg-gray-50 dark:bg-gray-800/80 border-gray-200 dark:border-gray-700"),children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[e.jsx("span",{className:g("text-xs font-medium",c?"text-green-700 dark:text-green-300":b?"text-blue-700 dark:text-blue-300":"text-gray-500 dark:text-gray-400"),children:t.content}),e.jsx("span",{className:"text-[10px] text-gray-400 dark:text-gray-500",children:t.time})]}),Ce(j)]})})}),Kt=F.memo(function({message:t,animate:o,expanded:l,onToggleExpand:a}){const d=o?"message-animate-in":"";return e.jsx("div",{className:g("flex justify-start",d),children:e.jsxs("div",{className:"bg-indigo-50/80 dark:bg-indigo-950/40 border border-indigo-200/60 dark:border-indigo-800/40 rounded-xl px-3 py-2 max-w-[95%] cursor-pointer hover:bg-indigo-100/60 dark:hover:bg-indigo-950/60 transition-colors",onClick:()=>a(t.id),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(Rt,{className:"w-3.5 h-3.5 text-indigo-500 dark:text-indigo-400"}),e.jsx("span",{className:"text-xs font-medium text-indigo-600 dark:text-indigo-400",children:l?"思考过程":"思考中..."}),e.jsxs("span",{className:"text-[10px] text-indigo-400 dark:text-indigo-500",children:["(",t.content.length," 字)"]}),l?e.jsx(de,{className:"w-3 h-3 text-indigo-400"}):e.jsx(V,{className:"w-3 h-3 text-indigo-400"})]}),l&&e.jsx("div",{className:"mt-2 text-sm text-indigo-800/80 dark:text-indigo-200/80 markdown-body-sm prose-sm",children:e.jsx(ne,{children:t.content})})]})})}),Qe=({permission:r})=>{const t={file:{icon:De,label:"文件操作",color:"bg-primary-100 text-primary-700 dark:bg-primary-900 dark:text-primary-300"},command:{icon:Se,label:"命令执行",color:"bg-amber-100 text-amber-700 dark:bg-amber-900 dark:text-amber-300"},other:{icon:Ee,label:"权限请求",color:"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-300"}}[r.category],o=t.icon;return e.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] px-1.5 py-0.5 rounded-full font-medium ${t.color}`,children:[e.jsx(o,{className:"w-3 h-3"}),t.label]})},Qt=({pendingMessage:r,onConfirm:t})=>{const[o,l]=i.useState(!1),a=r==null?void 0:r.permission;return e.jsxs("div",{className:"p-4 pb-safe",children:[e.jsxs("div",{className:"flex items-center gap-2 text-orange-600 dark:text-orange-400 mb-3",children:[e.jsx(Ee,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"需要确认"}),a&&e.jsx(Qe,{permission:a})]}),e.jsx("div",{className:"mb-3",children:e.jsx("p",{className:"text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800 p-3 rounded-lg border border-gray-100 dark:border-gray-700",children:(r==null?void 0:r.content)||"CLI 请求确认"})}),(a==null?void 0:a.category)==="file"&&a.filePath&&e.jsxs("div",{className:"mb-3 bg-primary-50 dark:bg-primary-950 border border-primary-100 dark:border-primary-900 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary-800 dark:text-primary-300 mb-1",children:[e.jsx(De,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:a.toolName})]}),e.jsx("div",{className:"text-xs font-mono text-primary-600 dark:text-primary-400 bg-white/50 dark:bg-gray-900/50 px-2 py-1 rounded",children:a.filePath})]}),(a==null?void 0:a.category)==="command"&&a.command&&e.jsxs("div",{className:"mb-3 bg-amber-50 dark:bg-amber-950 border border-amber-100 dark:border-amber-900 rounded-lg p-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-amber-800 dark:text-amber-300 mb-1",children:[e.jsx(Se,{className:"w-4 h-4"}),e.jsx("span",{className:"text-sm font-medium",children:"命令执行"})]}),e.jsx("div",{className:"text-xs font-mono text-amber-700 dark:text-amber-400 bg-white/50 dark:bg-gray-900/50 px-2 py-1.5 rounded whitespace-pre-wrap break-all",children:a.command})]}),(a==null?void 0:a.diffContent)&&e.jsxs("div",{className:"mb-3",children:[e.jsxs("button",{onClick:()=>l(!o),className:"flex items-center gap-1 text-xs text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 mb-1.5",children:[o?e.jsx(de,{className:"w-3.5 h-3.5"}):e.jsx(V,{className:"w-3.5 h-3.5"}),o?"收起内容":"查看变更内容"]}),o&&e.jsx("div",{className:"overflow-hidden",children:e.jsx("div",{className:"text-xs font-mono bg-slate-800 text-slate-200 p-3 rounded-lg max-h-48 overflow-y-auto whitespace-pre-wrap break-all",children:a.diffContent})})]}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{onClick:()=>t(!1),className:"flex-1 py-2.5 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 rounded-lg font-medium hover:bg-red-50 dark:hover:bg-red-950 transition-colors",children:"拒绝"}),e.jsx("button",{onClick:()=>t(!0),className:"flex-1 py-2.5 bg-primary-600 text-white rounded-lg font-medium hover:bg-primary-700 transition-colors shadow-sm",children:"批准"})]})]})},Jt=F.memo(function({message:t,animate:o}){var c;const l=o?"message-animate-in":"",a=t.question,d=t.status==="answered";return e.jsx("div",{className:g("flex justify-start",l),children:e.jsxs("div",{className:g("border rounded-xl px-4 py-3 max-w-[95%] shadow-sm relative overflow-hidden","bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800"),children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(le,{className:"w-4 h-4 text-blue-500"}),e.jsx("span",{className:"text-sm font-semibold text-blue-800 dark:text-blue-300",children:d?"已回答":"Agent 提问"})]}),(c=a==null?void 0:a.questions)==null?void 0:c.map((b,j)=>e.jsxs("div",{className:"mb-2 last:mb-0",children:[b.header&&e.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wider",children:b.header}),e.jsx("p",{className:"text-sm text-blue-900 dark:text-blue-200",children:b.question}),b.options&&b.options.length>0&&e.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:b.options.map((m,f)=>e.jsx("span",{className:"text-xs px-2 py-1 rounded-full bg-blue-100/60 dark:bg-blue-900/60 text-blue-700 dark:text-blue-300 border border-blue-200/50 dark:border-blue-800/50",children:m.label},f))})]},j))]})})}),qt=({pendingMessage:r,onAnswer:t})=>{const[o,l]=i.useState({}),[a,d]=i.useState({}),c=r==null?void 0:r.question,b=(c==null?void 0:c.questions)||[],j=b.length<=1;i.useEffect(()=>{l({}),d({})},[r==null?void 0:r.id]);const m=u=>{var N;const p=(N=o[u])==null?void 0:N.trim();return p||(a[u]||[]).join(", ")},f=(u,p)=>j?p||m(0):b.map((N,v)=>{const C=v===u&&p?p:m(v);return`${N.header?`[${N.header}] ${N.question}`:N.question}
9
- 回答:${C}`}).join(`
10
-
11
- `),x=b.length>0&&b.every((u,p)=>!!m(p)),w=(u,p,N)=>{if(j&&!N){t(f(u,p),c==null?void 0:c.toolUseId);return}l(v=>({...v,[u]:""})),d(v=>{const C=v[u]||[],k=N?C.includes(p)?C.filter(_=>_!==p):[...C,p]:[p];return{...v,[u]:k}})},S=(u,p)=>{l(N=>({...N,[u]:p})),p.trim()&&d(N=>({...N,[u]:[]}))},h=()=>{x&&(t(f(),c==null?void 0:c.toolUseId),l({}),d({}))};return e.jsxs("div",{className:"p-4 pb-safe",children:[e.jsxs("div",{className:"flex items-center gap-2 text-blue-600 dark:text-blue-400 mb-3",children:[e.jsx(le,{className:"w-5 h-5"}),e.jsx("span",{className:"font-semibold",children:"Agent 提问"})]}),b.map((u,p)=>{var C;const N=a[p]||[],v=o[p]||"";return e.jsxs("div",{className:"mb-3",children:[u.header&&e.jsx("span",{className:"text-[10px] font-medium text-blue-600 dark:text-blue-400 uppercase tracking-wider",children:u.header}),e.jsx("p",{className:"text-sm text-gray-800 dark:text-gray-200 bg-gray-50 dark:bg-gray-800 p-3 rounded-lg border border-gray-100 dark:border-gray-700",children:u.question}),u.options&&u.options.length>0&&e.jsx("div",{className:"flex flex-col gap-2 mt-2",children:u.options.map((k,_)=>{const R=N.includes(k.label);return e.jsxs("button",{onClick:()=>w(p,k.label,u.multiSelect),className:g("w-full text-left px-4 py-3 border rounded-lg transition-colors",R?"bg-blue-100 dark:bg-blue-900 border-blue-400 dark:border-blue-600":"bg-blue-50 dark:bg-blue-950 border-blue-200 dark:border-blue-800 hover:bg-blue-100 dark:hover:bg-blue-900"),children:[e.jsx("span",{className:"text-sm font-medium text-blue-800 dark:text-blue-200",children:k.label}),k.description&&e.jsx("p",{className:"text-xs text-blue-600 dark:text-blue-400 mt-0.5",children:k.description})]},_)})}),e.jsx("input",{type:"text",value:v,onChange:k=>S(p,k.target.value),onKeyDown:k=>{k.key==="Enter"&&j&&v.trim()?(t(v.trim(),c==null?void 0:c.toolUseId),l({})):k.key==="Enter"&&x&&h()},placeholder:(C=u.options)!=null&&C.length?"或输入自定义回答...":"输入回答...",className:"mt-2 w-full bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 focus:border-blue-400 focus:ring-2 focus:ring-blue-100 dark:focus:ring-blue-900 rounded-lg px-3 py-2 text-sm text-gray-800 dark:text-gray-200 placeholder:text-gray-400 dark:placeholder:text-gray-600 outline-none transition-all"})]},p)}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:h,disabled:!x,className:g("px-4 py-2 rounded-lg font-medium text-sm transition-colors",x?"bg-blue-600 text-white hover:bg-blue-700 shadow-sm":"bg-gray-200 dark:bg-gray-700 text-gray-400 dark:text-gray-500"),children:"发送"})})]})},q=({prefix:r,icon:t,label:o,color:l,onClick:a})=>e.jsxs("button",{onClick:a,className:g("inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded border text-[10px] font-normal whitespace-nowrap active:scale-95 transition-all flex-shrink-0 opacity-50 hover:opacity-100",l),children:[t,e.jsx("span",{children:o})]});export{sr as Session};
@@ -1 +0,0 @@
1
- import{r as s,j as e,u as J}from"./vendor-react-DSV5aFEg.js";import{b as _,d as V,p as Y,a as Z,u as ee,e as re,c as g}from"./index-DOgH1Kf3.js";import{A as ae,m as q}from"./vendor-motion-n6Lx6G4a.js";import{X as se,F as R,f as te,g as ne,l as le,D as z,h as de,$ as ie,a0 as ce,a1 as oe,a2 as xe,r as me,a3 as ge,a4 as ye,R as F,a5 as O,T as he,a6 as be,a7 as pe,b as ue,k as fe}from"./vendor-icons-CNN4EKVi.js";import{P as je}from"./PageTopBar-C8j-5s_3.js";function ke(){const[c,n]=s.useState(()=>_());s.useEffect(()=>V(()=>{n(_())}),[]);const l=s.useCallback(async()=>Y(),[]);return{...c,promptInstall:l}}const Ne={home:e.jsx(ce,{className:"w-4 h-4"}),desktop:e.jsx(ie,{className:"w-4 h-4"}),documents:e.jsx(de,{className:"w-4 h-4"}),downloads:e.jsx(z,{className:"w-4 h-4"})},ve=({open:c,currentDir:n,onSelect:l,onClose:d})=>{const[w,E]=s.useState(n),[t,A]=s.useState([]),[b,P]=s.useState(""),[C,x]=s.useState(!1),[f,T]=s.useState([]),[j,o]=s.useState(!1),[m,S]=s.useState(""),k=s.useCallback(async a=>{o(!0),S("");try{const i=await Z.listDir(a);E(i.dir),A(i.dirs),P(i.parent),x(i.isRoot),T(i.quickAccess)}catch(i){S(i.message||"加载失败")}finally{o(!1)}},[]);s.useEffect(()=>{c&&k(n)},[c,n,k]);const y=a=>{k(a)},N=()=>{l(w),d()},p=a=>{const i=t.length>0?a.split("/").slice(0,3).join("/"):a;return a.replace(i,"~").replace("//","/")};return e.jsx(ae,{children:c&&e.jsxs(e.Fragment,{children:[e.jsx(q.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 z-40",onClick:d}),e.jsxs(q.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:25,stiffness:300},className:"fixed bottom-0 left-0 right-0 bg-white dark:bg-gray-900 rounded-t-2xl z-50 flex flex-col",style:{maxHeight:"80vh"},children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-gray-100 dark:border-gray-800",children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:"选择工作目录"}),e.jsx("button",{onClick:d,className:"p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(se,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800",children:e.jsxs("div",{className:"flex items-center gap-2 text-sm font-mono text-primary-600 dark:text-primary-400 bg-primary-50 dark:bg-primary-950 rounded-lg px-3 py-2 overflow-x-auto whitespace-nowrap",children:[e.jsx(R,{className:"w-4 h-4 flex-shrink-0"}),e.jsx("span",{children:p(w)})]})}),e.jsxs("div",{className:"flex-1 overflow-y-auto overscroll-contain",children:[f.length>0&&e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"快捷访问"}),e.jsx("div",{className:"grid grid-cols-2 gap-2",children:f.map(a=>e.jsxs("button",{onClick:()=>y(a.path),className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-gray-50 dark:bg-gray-800 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors text-left",children:[e.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:Ne[a.icon]||e.jsx(R,{className:"w-4 h-4"})}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 truncate",children:a.name})]},a.path))})]}),e.jsxs("div",{className:"px-4 py-2",children:[e.jsx("div",{className:"text-xs font-medium text-gray-400 dark:text-gray-500 uppercase tracking-wider mb-1",children:"目录列表"}),!C&&e.jsxs("button",{onClick:()=>y(b),className:"w-full flex items-center gap-3 px-3 py-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors text-left",children:[e.jsx(te,{className:"w-5 h-5 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"返回上级目录"})]}),j&&e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx("div",{className:"w-6 h-6 border-2 border-primary-600 border-t-transparent rounded-full animate-spin"})}),m&&e.jsx("div",{className:"px-3 py-4 text-center text-sm text-red-500",children:m}),!j&&!m&&t.length===0&&e.jsx("div",{className:"px-3 py-4 text-center text-sm text-gray-400",children:"此目录下没有子目录"}),!j&&!m&&t.map(a=>e.jsxs("button",{onClick:()=>y(a.path),className:"w-full flex items-center gap-3 px-3 py-3 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors text-left active:bg-gray-100 dark:active:bg-gray-700",children:[e.jsx(R,{className:"w-5 h-5 text-amber-500 dark:text-amber-400 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300 flex-1 truncate",children:a.name}),e.jsx(ne,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},a.path))]})]}),e.jsx("div",{className:"px-4 py-3 border-t border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-900 pb-safe",children:e.jsxs("button",{onClick:N,className:"w-full py-3 flex items-center justify-center gap-2 text-sm font-medium text-white bg-primary-600 rounded-xl hover:bg-primary-700 transition-colors active:scale-[0.98]",children:[e.jsx(le,{className:"w-4 h-4"}),"使用此目录"]})})]})]})})},we=["--dangerously-bypass-approvals-and-sandbox","-m","gpt-5.5","-c",'model_reasoning_effort="xhigh"'],v={claude:{label:"Claude Code",command:"claude",cliArgs:["--dangerously-skip-permissions"],dangerArg:"--dangerously-skip-permissions"},codex:{label:"Codex CLI",command:"codex",cliArgs:we,dangerArg:"--dangerously-bypass-approvals-and-sandbox",modelLabel:"GPT-5.5",intelligenceLabel:"超好",speedLabel:"标准"}};function G(c){var d;const n=c||"";return n.trim()?(((d=n.split(/[\\/]/).pop())==null?void 0:d.toLowerCase())||n.toLowerCase()).includes("codex")?"codex":"claude":"codex"}const Pe=()=>{const c=J(),{connectionStatus:n,cliConfig:l,startCLI:d,restartCLI:w,setConfirmMode:E,status:t,newSession:A}=ee(),{theme:b,toggleTheme:P}=re(),{canPromptInstall:C,isInstalled:x,isInstalling:f,isIos:T,promptInstall:j}=ke(),[o,m]=s.useState("codex"),[S,k]=s.useState("key"),[y,N]=s.useState("codex"),[p,a]=s.useState("~"),[i,M]=s.useState(!1),h=n==="connected",D=t==="running"||t==="confirm"||t==="question",B=window.location.port||(window.location.protocol==="https:"?"443":"80");s.useEffect(()=>{if(l){const r=l.cliType||G(l.cliCommand);m(r),k(l.confirmMode),N(l.cliCommand),a(l.workDir)}},[l]);const I=(r=p,u=o,$=y)=>({cliType:u,cliCommand:$,workDir:r,confirmMode:S,cliArgs:v[u].cliArgs}),H=()=>{d(I())},Q=()=>{d(I())},U=()=>{w(),c("/session")},W=r=>{const u=v[r].command;r===o&&u===y||(m(r),N(u),h&&!D&&d(I(p,r,u)))},X=r=>{a(r),h&&d(I(r))},K=r=>{N(r),m(G(r))},L=v[o];return e.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-950 overflow-y-auto",children:[e.jsx(je,{title:"设置",className:"sticky top-0"}),e.jsxs("div",{className:"p-4 space-y-6 pb-8",children:[e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"外观"}),e.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:e.jsxs("div",{className:"p-4 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[b==="dark"?e.jsx("div",{className:"w-10 h-10 rounded-full bg-gray-800 text-gray-300 flex items-center justify-center",children:e.jsx(oe,{className:"w-5 h-5"})}):e.jsx("div",{className:"w-10 h-10 rounded-full bg-yellow-50 text-yellow-600 flex items-center justify-center",children:e.jsx(xe,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:b==="dark"?"深色模式":"浅色模式"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:"切换界面主题"})]})]}),e.jsx("button",{onClick:P,className:g("relative inline-flex h-7 w-12 items-center rounded-full transition-colors",b==="dark"?"bg-primary-600":"bg-gray-300"),children:e.jsx("span",{className:g("inline-block h-5 w-5 transform rounded-full bg-white transition-transform shadow-sm",b==="dark"?"translate-x-6":"translate-x-1")})})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"安装应用"}),e.jsx("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:e.jsxs("div",{className:"p-4 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[e.jsx("div",{className:g("w-10 h-10 rounded-full flex items-center justify-center flex-shrink-0",x?"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-400":"bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400"),children:x?e.jsx(me,{className:"w-5 h-5"}):e.jsx(ge,{className:"w-5 h-5"})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:x?"已安装为独立 App":"添加到主屏幕"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5 leading-relaxed",children:x?"当前正在独立窗口中运行":C?"从桌面或主屏幕直接启动 AgentPilot":T?"打开分享菜单后选择“添加到主屏幕”":"使用浏览器菜单安装 AgentPilot"})]})]}),C?e.jsxs("button",{onClick:j,disabled:f,className:"flex items-center justify-center gap-1.5 rounded-lg bg-primary-600 px-3 py-2 text-sm font-medium text-white hover:bg-primary-700 disabled:cursor-not-allowed disabled:opacity-60 transition-colors flex-shrink-0",children:[e.jsx(z,{className:"w-4 h-4"}),f?"安装中":"安装"]}):e.jsx("span",{className:g("text-xs px-2 py-1 rounded-full font-medium flex-shrink-0",x?"bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-400":"bg-gray-100 dark:bg-gray-800 text-gray-500 dark:text-gray-400"),children:x?"已完成":"浏览器菜单"})]})})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"连接信息"}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-50 dark:border-gray-800 flex justify-between items-center",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:g("w-10 h-10 rounded-full flex items-center justify-center",h?"bg-green-50 dark:bg-green-950 text-green-600 dark:text-green-400":"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-400"),children:e.jsx(ye,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"Agent Server"}),e.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[e.jsx("div",{className:g("w-2 h-2 rounded-full",h?"bg-green-500":"bg-red-500")}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n==="connected"?"已连接":n==="connecting"?"连接中...":n==="reconnecting"?"重连中...":"已断开"})]})]})]}),!h&&e.jsx("button",{onClick:Q,className:"p-2 text-primary-600 dark:text-primary-400 hover:bg-primary-50 dark:hover:bg-primary-950 rounded-full transition-colors",children:e.jsx(F,{className:"w-5 h-5"})})]}),e.jsxs("div",{className:"p-4 space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"服务器地址"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono text-gray-900 dark:text-gray-100",children:window.location.hostname}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(O,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"端口"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-sm font-mono text-gray-900 dark:text-gray-100",children:B}),e.jsx("button",{className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:e.jsx(O,{className:"w-3.5 h-3.5"})})]})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"CLI 状态"}),e.jsx("span",{className:g("text-xs px-2 py-0.5 rounded-full font-medium",t==="idle"?"bg-gray-100 dark:bg-gray-800 text-gray-600 dark:text-gray-400":t==="running"?"bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400":t==="confirm"?"bg-orange-50 dark:bg-orange-950 text-orange-600 dark:text-orange-400":t==="question"?"bg-blue-50 dark:bg-blue-950 text-blue-600 dark:text-blue-400":"bg-red-50 dark:bg-red-950 text-red-600 dark:text-red-400"),children:t==="idle"?"空闲":t==="running"?"进行中":t==="confirm"?"等待确认":t==="question"?"等待回答":"未连接"})]}),e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"权限模式"}),e.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full font-medium bg-amber-50 dark:bg-amber-950 text-amber-700 dark:text-amber-400",children:"跳过权限检查"})]})]})]})]}),e.jsxs("section",{children:[e.jsx("h2",{className:"text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider mb-2 px-1",children:"CLI 配置"}),e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-xl border border-gray-100 dark:border-gray-800 shadow-sm overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b border-gray-50 dark:border-gray-800 flex items-center gap-3",children:[e.jsx("div",{className:"w-10 h-10 rounded-full bg-primary-50 dark:bg-primary-950 text-primary-600 dark:text-primary-400 flex items-center justify-center",children:e.jsx(he,{className:"w-5 h-5"})}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:"运行环境"}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-0.5",children:"配置底层 Agent CLI 参数"})]})]}),e.jsxs("div",{className:"divide-y divide-gray-50 dark:divide-gray-800",children:[e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"CLI 类型"}),e.jsx("div",{className:"grid grid-cols-2 gap-2 rounded-lg bg-gray-50 dark:bg-gray-800 p-1 border border-gray-200 dark:border-gray-700",children:Object.keys(v).map(r=>e.jsx("button",{onClick:()=>W(r),disabled:D,className:g("py-2 px-3 rounded-md text-sm font-medium transition-colors",o===r?"bg-white dark:bg-gray-900 text-primary-700 dark:text-primary-300 shadow-sm":"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",D&&"opacity-60 cursor-not-allowed"),children:v[r].label},r))})]}),e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"CLI 命令"}),e.jsx("input",{type:"text",value:y,onChange:r=>K(r.target.value),className:"w-full text-sm text-gray-900 dark:text-gray-100 font-mono bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 focus:outline-none focus:border-primary-500",disabled:h&&t!=="disconnected"})]}),e.jsxs("div",{className:"w-full p-4 space-y-2",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"工作目录"}),e.jsxs("button",{onClick:()=>M(!0),className:"w-full flex items-center gap-2 text-sm text-gray-900 dark:text-gray-100 font-mono bg-gray-50 dark:bg-gray-800 border border-gray-200 dark:border-gray-700 rounded-lg px-3 py-2 text-left hover:border-primary-500 transition-colors",children:[e.jsx(be,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsx("span",{className:"truncate flex-1",children:p})]})]}),o==="codex"&&e.jsxs("div",{className:"w-full p-4 flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:"Codex 档位"}),e.jsxs("div",{className:"flex flex-wrap justify-end gap-1.5",children:[e.jsx("span",{className:"text-xs px-2 py-1 rounded-full bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300",children:L.modelLabel}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full bg-green-50 dark:bg-green-950 text-green-700 dark:text-green-400",children:["智能度 ",L.intelligenceLabel]}),e.jsxs("span",{className:"text-xs px-2 py-1 rounded-full bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-400",children:["速度 ",L.speedLabel]})]})]})]}),e.jsx("div",{className:"p-3 bg-gray-50 dark:bg-gray-800 border-t border-gray-100 dark:border-gray-700 space-y-2",children:h?e.jsxs(e.Fragment,{children:[e.jsxs("button",{onClick:()=>{A(),c("/session")},className:"w-full py-2.5 flex items-center justify-center gap-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[e.jsx(ue,{className:"w-4 h-4"}),"新开会话"]}),e.jsxs("button",{onClick:U,className:"w-full py-2.5 flex items-center justify-center gap-2 text-sm font-medium text-red-600 dark:text-red-400 bg-white dark:bg-gray-900 border border-red-100 dark:border-red-800 rounded-lg hover:bg-red-50 dark:hover:bg-red-950 transition-colors",children:[e.jsx(F,{className:"w-4 h-4"}),"重启 CLI 进程"]})]}):e.jsxs("button",{onClick:H,className:"w-full py-2.5 flex items-center justify-center gap-2 text-sm font-medium text-white bg-primary-600 rounded-lg hover:bg-primary-700 transition-colors",children:[e.jsx(pe,{className:"w-4 h-4"}),"启动 CLI"]})})]})]}),e.jsx("section",{children:e.jsx("div",{className:"bg-amber-50 dark:bg-amber-950 rounded-xl border border-amber-200 dark:border-amber-800 p-4",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(fe,{className:"w-5 h-5 text-amber-600 dark:text-amber-400 flex-shrink-0 mt-0.5"}),e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-medium text-amber-800 dark:text-amber-300",children:"危险模式已启用"}),e.jsxs("div",{className:"text-xs text-amber-700 dark:text-amber-400 mt-1 leading-relaxed",children:["当前使用 ",L.dangerArg," 运行,CLI 拥有完整的文件读写和命令执行权限,无需手动确认。请确保在可信环境中使用。",o==="codex"&&" Codex CLI 预设为 GPT-5.5 / 智能度超好 / 速度标准。"]})]})]})})}),e.jsxs("div",{className:"text-center pt-4 pb-8",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-400 dark:text-gray-600",children:"AgentPilot"}),e.jsx("div",{className:"text-xs text-gray-300 dark:text-gray-600 mt-1",children:"AI Agent 遥控器"}),e.jsx("div",{className:"text-[10px] text-gray-300 dark:text-gray-700 mt-2",children:"v0.1.0"})]})]}),e.jsx(ve,{open:i,currentDir:p,onSelect:X,onClose:()=>M(!1)})]})};export{Pe as Settings};
@@ -1,8 +0,0 @@
1
- import{r as l,j as e,R as ce,h as Wt}from"./vendor-react-DSV5aFEg.js";import{c as p,u as Rt,a as j}from"./index-DOgH1Kf3.js";import{c as zt}from"./code-highlight-CEcsuMpw.js";import{M as Gt,r as Mt}from"./vendor-markdown-BDwu-Ux6.js";import{P as Bt}from"./PageTopBar-C8j-5s_3.js";import{a as Tt,G as _,t as ie,R as Ht,g as te,k as N,L as v,f as Ut,F as tt,u as ae,v as Ee,D as it,w as Vt,x as _t,X as qt,h as ct,y as Ot,z as Kt,E as at,I as Yt,J as Jt,K as Xt,N as Qt,O as st,Q as Zt,U as ea,V as ta,W as aa,Y as sa,Z as ra,_ as na}from"./vendor-icons-CNN4EKVi.js";import{A as se,m as rt}from"./vendor-motion-n6Lx6G4a.js";const la=[[Mt,zt]];function ia(t){var s;const r=((s=t.match(/~{3,}/g))==null?void 0:s.reduce((o,n)=>Math.max(o,n.length),2))??2;return"~".repeat(r+1)}function ca(t){return t.replace(/[^\w#+.-]/g,"")}function oa(t,r){const s=ia(t),o=ca(r),n=t.endsWith(`
2
- `)?"":`
3
- `;return`${s}${o?` ${o}`:""}
4
- ${t}${n}${s}`}function da(t,r){return t==null||typeof t=="boolean"?[[]]:typeof t=="string"||typeof t=="number"?String(t).split(`
5
- `).map(s=>s?[s]:[]):Array.isArray(t)?Fe(t,r):ce.isValidElement(t)?Fe(t.props.children,r).map((o,n)=>o.length>0?[ce.cloneElement(t,{key:`${r}-${n}`},o)]:[]):[[t]]}function Fe(t,r="code"){const s=[[]];return ce.Children.forEach(t,(o,n)=>{da(o,`${r}-${n}`).forEach((d,c)=>{c===0?s[s.length-1].push(...d):s.push([...d])})}),s}function xa(t,r){const s=[...t];for(;s.length>r&&s[s.length-1].length===0;)s.pop();for(;s.length<r;)s.push([]);return s}function ma({children:t,className:r,expectedLineCount:s,lineNumberWidth:o,targetLine:n,targetLineRef:x}){const d=l.useMemo(()=>xa(Fe(t),s),[t,s]);return e.jsx("div",{className:"min-w-max py-3 font-mono text-[12px] leading-5",children:d.map((c,m)=>{const u=m+1,y=n===u;return e.jsxs("div",{ref:y?x:void 0,className:p("grid min-w-max",y?"bg-primary-50 text-primary-950 dark:bg-primary-950/45 dark:text-primary-100":"text-gray-800 dark:text-gray-200"),style:{gridTemplateColumns:`${o}ch minmax(0, 1fr)`},children:[e.jsx("div",{className:p("select-none border-r px-2 text-right text-[11px]",y?"border-primary-200 text-primary-600 dark:border-primary-800 dark:text-primary-300":"border-gray-100 text-gray-400 dark:border-gray-800 dark:text-gray-600"),children:u}),e.jsx("code",{className:p("whitespace-pre px-3 font-mono tabular-nums",r),children:c.length>0?c:" "})]},u)})})}function ga({content:t,language:r,lineNumberWidth:s,targetLine:o,targetLineRef:n}){const x=l.useMemo(()=>t.split(`
6
- `).length,[t]),d=l.useMemo(()=>oa(t,r),[t,r]),c=l.useMemo(()=>({pre({children:m}){return e.jsx(e.Fragment,{children:m})},code({children:m,className:u}){return e.jsx(ma,{className:u,expectedLineCount:x,lineNumberWidth:s,targetLine:o,targetLineRef:n,children:m})}}),[x,s,o,n]);return e.jsx(Gt,{rehypePlugins:la,components:c,children:d})}const ha={".bash":"bash",".c":"c",".cc":"cpp",".conf":"ini",".cpp":"cpp",".cs":"csharp",".css":"css",".dart":"dart",".diff":"diff",".dockerfile":"dockerfile",".go":"go",".graphql":"graphql",".groovy":"groovy",".h":"cpp",".hpp":"cpp",".html":"html",".ini":"ini",".java":"java",".js":"javascript",".json":"json",".jsx":"jsx",".kt":"kotlin",".less":"less",".lua":"lua",".md":"markdown",".mjs":"javascript",".php":"php",".plist":"xml",".properties":"ini",".py":"python",".rb":"ruby",".rs":"rust",".scss":"scss",".sh":"bash",".sql":"sql",".svelte":"xml",".swift":"swift",".toml":"ini",".ts":"typescript",".tsx":"tsx",".vue":"xml",".xml":"xml",".yaml":"yaml",".yml":"yaml",".zsh":"bash"},nt={dockerfile:"dockerfile",makefile:"makefile","package.json":"json","pnpm-lock.yaml":"yaml","tsconfig.json":"json",vite:"typescript"};function oe(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/1024/1024).toFixed(1)} MB`}function A(t){const r=t.split("/").filter(Boolean);return r[r.length-1]||t||"工作目录"}function ve(t){return t?t.replace(/^\/Users\/[^/]+/,"~"):"未选择工作目录"}function lt(t){return t||"."}function ot(t){const r=new Date(t);return Number.isNaN(r.getTime())?t:new Intl.DateTimeFormat("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}).format(r)}function dt(t){const r=[];for(const s of t.replace(/\\/g,"/").replace(/^\/+/,"").split("/"))if(!(!s||s===".")){if(s===".."){if(r.length===0)return"";r.pop();continue}r.push(s)}return r.join("/")}function ua(t){const r=dt(t),s=r.lastIndexOf("/");return s>0?r.slice(0,s):""}function pa(t){if(!t)return null;const r=Number(t);return Number.isSafeInteger(r)&&r>0?r:null}function xt(t){const r=A(t).toLowerCase(),s=r.lastIndexOf(".");return s>0?r.slice(s):""}function fa(t){const r=A(t).toLowerCase();return nt[r]?nt[r]:r.startsWith("dockerfile")?"dockerfile":r.endsWith("rc")||r.startsWith(".env")?"ini":ha[xt(t)]||""}function de(t){const r=A(t).toLowerCase(),s=xt(t);return r==="package.json"||r.endsWith("lock.json")||r==="pnpm-lock.yaml"?{Icon:Kt,className:"text-orange-500 dark:text-orange-400",label:"包配置"}:r.startsWith("dockerfile")?{Icon:at,className:"text-blue-600 dark:text-blue-400",label:"Dockerfile"}:r==="makefile"||[".sh",".bash",".zsh"].includes(s)?{Icon:at,className:"text-slate-700 dark:text-slate-300",label:"脚本"}:r.startsWith(".env")||[".ini",".conf",".toml",".properties",".plist"].includes(s)?{Icon:Yt,className:"text-gray-600 dark:text-gray-400",label:"配置"}:[".json"].includes(s)?{Icon:Jt,className:"text-yellow-600 dark:text-yellow-400",label:"JSON"}:[".ts",".tsx",".js",".jsx",".mjs",".vue",".svelte"].includes(s)?{Icon:Xt,className:"text-sky-600 dark:text-sky-400",label:"前端代码"}:[".go",".rs",".py",".rb",".php",".java",".kt",".swift",".c",".cc",".cpp",".h",".hpp",".cs",".lua",".dart"].includes(s)?{Icon:Qt,className:"text-primary-600 dark:text-primary-400",label:"代码"}:[".css",".scss",".less"].includes(s)?{Icon:st,className:"text-pink-600 dark:text-pink-400",label:"样式"}:[".png",".jpg",".jpeg",".gif",".webp",".ico",".bmp",".avif",".svg"].includes(s)?{Icon:Zt,className:"text-emerald-600 dark:text-emerald-400",label:s===".svg"?"SVG":"图片"}:[".html",".xml"].includes(s)?{Icon:ea,className:"text-orange-600 dark:text-orange-400",label:"标记"}:[".md",".mdx",".txt",".log",".rst"].includes(s)?{Icon:ie,className:"text-gray-600 dark:text-gray-400",label:"文档"}:[".sql",".db",".sqlite"].includes(s)?{Icon:ta,className:"text-indigo-600 dark:text-indigo-400",label:"数据"}:[".zip",".gz",".tar",".tgz",".rar",".7z"].includes(s)?{Icon:aa,className:"text-amber-600 dark:text-amber-400",label:"压缩包"}:[".mp3",".wav",".ogg",".m4a"].includes(s)?{Icon:sa,className:"text-purple-600 dark:text-purple-400",label:"音频"}:[".mp4",".mov",".avi",".webm"].includes(s)?{Icon:ra,className:"text-purple-600 dark:text-purple-400",label:"视频"}:[".csv",".tsv",".xls",".xlsx"].includes(s)?{Icon:na,className:"text-green-700 dark:text-green-400",label:"表格"}:[".yaml",".yml"].includes(s)?{Icon:st,className:"text-red-600 dark:text-red-400",label:"YAML"}:{Icon:ct,className:"text-gray-500 dark:text-gray-400",label:"文件"}}function mt(t){return t.includes("D")?"text-red-600 dark:text-red-400 bg-red-50 dark:bg-red-950/50 border-red-100 dark:border-red-900":t.includes("A")||t==="??"?"text-green-700 dark:text-green-400 bg-green-50 dark:bg-green-950/50 border-green-100 dark:border-green-900":t.includes("R")||t.includes("C")?"text-blue-700 dark:text-blue-400 bg-blue-50 dark:bg-blue-950/50 border-blue-100 dark:border-blue-900":t.includes("U")?"text-orange-700 dark:text-orange-400 bg-orange-50 dark:bg-orange-950/50 border-orange-100 dark:border-orange-900":"text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/50 border-amber-100 dark:border-amber-900"}function Ce(t){return t.status==="??"||t.worktreeStatus!==" "&&t.worktreeStatus!=="?"&&t.worktreeStatus!=="!"}function re(t){return t.indexStatus!==" "&&t.indexStatus!=="?"&&t.indexStatus!=="!"}function ne(t){return t.replace(/^"|"$/g,"").replace(/^[ab]\//,"").replace(/^\/dev\/null$/,"/dev/null")}function ba(t){const r=t.match(/^@@\s+-(\d+)(?:,\d+)?\s+\+(\d+)(?:,\d+)?/);return r?{oldLine:Number(r[1]),newLine:Number(r[2])}:{oldLine:0,newLine:0}}function ya(t){const r=[];let s=null,o=null,n=0,x=0;const d=()=>(s||(s={oldPath:"",newPath:"",meta:[],hunks:[],additions:0,deletions:0},r.push(s)),s);for(const c of t.split(`
7
- `)){if(c.startsWith("diff --git ")){const u=c.split(" ");s={oldPath:ne(u[2]||""),newPath:ne(u[3]||u[2]||""),meta:[],hunks:[],additions:0,deletions:0},r.push(s),o=null;continue}if(c.startsWith("--- ")&&!c.startsWith("--- 已")){d().oldPath=ne(c.slice(4).trim());continue}if(c.startsWith("+++ ")){d().newPath=ne(c.slice(4).trim());continue}if(c.startsWith("@@")){const u=d();o={header:c,lines:[]},u.hunks.push(o);const y=ba(c);n=y.oldLine,x=y.newLine;continue}if(!o){c.trim()&&d().meta.push(c);continue}const m=d();c.startsWith("+")?(o.lines.push({kind:"add",newLine:x,content:c.slice(1)}),m.additions+=1,x+=1):c.startsWith("-")?(o.lines.push({kind:"delete",oldLine:n,content:c.slice(1)}),m.deletions+=1,n+=1):c.startsWith(" ")?(o.lines.push({kind:"context",oldLine:n,newLine:x,content:c.slice(1)}),n+=1,x+=1):c.startsWith("\\")?o.lines.push({kind:"note",content:c}):c.trim()&&o.lines.push({kind:"meta",content:c})}return r.filter(c=>c.hunks.length>0||c.meta.length>0)}const Le=({path:t,className:r="w-4 h-4 flex-shrink-0"})=>{const s=de(t),o=s.Icon;return e.jsx(o,{className:p(r,s.className),"aria-label":s.label})},$a=()=>{var Ze,et;const{cliConfig:t,connectionStatus:r}=Rt(),[s,o]=Wt(),[n,x]=l.useState("files"),[d,c]=l.useState(""),[m,u]=l.useState(null),[y,q]=l.useState(!1),[Pe,Ie]=l.useState(""),[L,xe]=l.useState(null),[ht,me]=l.useState(null),[f,ge]=l.useState(null),[$e,De]=l.useState(!1),[Ae,We]=l.useState(""),[G,he]=l.useState(!1),[Re,M]=l.useState(""),[g,ut]=l.useState(null),[ue,ze]=l.useState(!1),[Ge,Me]=l.useState(""),[k,pt]=l.useState(null),[pe,Be]=l.useState(!1),[Te,He]=l.useState(""),[Ue,W]=l.useState(""),[P,fe]=l.useState(null),[I,be]=l.useState(null),[ft,ye]=l.useState(!1),[ke,O]=l.useState(""),[bt,Ve]=l.useState(!1),[yt,_e]=l.useState(!1),[kt,C]=l.useState(""),[jt,B]=l.useState(""),[b,K]=l.useState(null),[wt,qe]=l.useState(!1),[Oe,Ke]=l.useState(""),[$,Y]=l.useState(null),[R,J]=l.useState(null),[Nt,Ye]=l.useState(!1),[Je,X]=l.useState(""),[D,T]=l.useState(null),S=(t==null?void 0:t.workDir)||"",w=r==="connected",Q=dt(s.get("file")||""),Xe=pa(s.get("line")),vt=(f==null?void 0:f.name)||(L?A(L):""),Ct=b?A(b):"",St=(D==null?void 0:D.shortHash)||((Ze=k==null?void 0:k.commits.find(a=>a.hash===R))==null?void 0:Ze.shortHash)||(R==null?void 0:R.slice(0,8))||"",je=b?(g==null?void 0:g.files.find(a=>a.path===b))||($==null?void 0:$.files.find(a=>a.path===b)):void 0,Et=!!(g!=null&&g.files.some(Ce)),Ft=!!(g!=null&&g.files.some(re)),H=(g==null?void 0:g.files.filter(re).length)||0;l.useEffect(()=>{c(""),xe(null),me(null),K(null),J(null),ge(null),M(""),he(!1),Y(null),T(null),X(""),W(""),fe(null),be(null),ye(!1),O(""),C(""),B("")},[S]);const we=l.useCallback(async(a=d)=>{q(!0),Ie("");try{const i=await j.listWorkdir(a);u({workDir:i.workDir,path:i.path||"",parent:i.parent||"",isRoot:!!i.isRoot,dirs:i.dirs||[],files:i.files||[]}),c(i.path||"")}catch(i){Ie(i instanceof Error?i.message:"加载失败")}finally{q(!1)}},[d]),E=l.useCallback(async()=>{ze(!0),Me(""),W("");try{const a=await j.getWorkdirChanges();ut({workDir:a.workDir,isGitRepo:!!a.isGitRepo,branch:a.branch||"",files:a.files||[],diff:a.diff||"",diffPath:a.diffPath,truncated:!!a.truncated})}catch(a){Me(a instanceof Error?a.message:"加载失败")}finally{ze(!1)}},[]),U=l.useCallback(async()=>{Be(!0),He("");try{const a=await j.getWorkdirCommits();pt({workDir:a.workDir,isGitRepo:!!a.isGitRepo,branch:a.branch||"",commits:a.commits||[]})}catch(a){He(a instanceof Error?a.message:"加载失败")}finally{Be(!1)}},[]);l.useEffect(()=>{!w||n!=="files"||we(d)},[w,n,d,S,we]),l.useEffect(()=>{!w||n!=="changes"||E()},[w,n,S,E]),l.useEffect(()=>{!w||n!=="commits"||U()},[w,n,S,U]);const Ne=l.useCallback(async(a,i=null)=>{xe(a),me(i),ge(null),We(""),M(""),De(!0);try{const F=await j.readWorkdirFile(a);ge(F)}catch(F){We(F instanceof Error?F.message:"读取失败")}finally{De(!1)}},[]);l.useEffect(()=>{!w||!Q||(x("files"),K(null),Y(null),J(null),T(null),c(ua(Q)),Ne(Q,Xe))},[w,Xe,Q,Ne,S]);const Lt=l.useCallback(()=>{if(xe(null),me(null),M(""),!s.has("file")&&!s.has("line"))return;const a=new URLSearchParams(s);a.delete("file"),a.delete("line"),o(a,{replace:!0})},[s,o]),Z=l.useCallback(()=>{if(L){he(!0),M("");try{const a=document.createElement("a");a.href=j.getWorkdirFileDownloadUrl(L),a.download=A(L)||"download",document.body.appendChild(a),a.click(),a.remove()}catch(a){M(a instanceof Error?a.message:"下载失败")}finally{window.setTimeout(()=>he(!1),800)}}},[L]),V=l.useCallback(async a=>{K(a),Y(null),Ke(""),qe(!0);try{const i=await j.getWorkdirChanges(a);Y({workDir:i.workDir,isGitRepo:!!i.isGitRepo,branch:i.branch||"",files:i.files||[],diff:i.diff||"",diffPath:i.diffPath,truncated:!!i.truncated})}catch(i){Ke(i instanceof Error?i.message:"读取失败")}finally{qe(!1)}},[]),Pt=l.useCallback(async a=>{J(a),T(null),X(""),Ye(!0);try{const i=await j.getWorkdirCommit(a);T({workDir:i.workDir,isGitRepo:!!i.isGitRepo,hash:i.hash,shortHash:i.shortHash,authorName:i.authorName,authorEmail:i.authorEmail,date:i.date,subject:i.subject,body:i.body||"",files:i.files||[],diff:i.diff||"",truncated:!!i.truncated})}catch(i){X(i instanceof Error?i.message:"读取失败")}finally{Ye(!1)}},[]),ee=l.useCallback(async(a,i)=>{fe(`${i}:${a}`),W("");try{i==="stage"?await j.stageWorkdirChanges(a):await j.unstageWorkdirChanges(a),await E(),b===a&&await V(a)}catch(F){W(F instanceof Error?F.message:i==="stage"?"暂存失败":"取消暂存失败")}finally{fe(null)}},[E,V,b]),Qe=l.useCallback(async a=>{be(a),W("");try{a==="stage"?await j.stageWorkdirChanges():await j.unstageWorkdirChanges(),await E(),b&&await V(b)}catch(i){W(i instanceof Error?i.message:a==="stage"?"暂存失败":"取消暂存失败")}finally{be(null)}},[E,V,b]),It=l.useCallback(()=>{ye(!0),C(""),B("")},[]),$t=l.useCallback(async()=>{if(H===0){C("请先暂存要提交的文件");return}_e(!0),C(""),B("");try{const a=await j.generateWorkdirCommitMessage();O(a.message||"")}catch(a){C(a instanceof Error?a.message:"生成提交信息失败")}finally{_e(!1)}},[H]),Dt=l.useCallback(async()=>{const a=ke.trim();if(!a){C("提交信息不能为空");return}if(H===0){C("请先暂存要提交的文件");return}Ve(!0),C(""),B("");try{const i=await j.commitWorkdirChanges(a);B(`已提交 ${i.commitHash}`),O(""),await E(),await U()}catch(i){C(i instanceof Error?i.message:"提交失败")}finally{Ve(!1)}},[ke,E,U,H]),At=l.useMemo(()=>{const a=d.split("/").filter(Boolean);return a.map((i,F)=>({label:i,path:a.slice(0,F+1).join("/")}))},[d]);return e.jsxs("div",{className:"flex flex-col h-full bg-gray-50 dark:bg-gray-950 relative",children:[e.jsx(Bt,{title:A(S),meta:e.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400 font-mono truncate max-w-[220px]",title:ve(S),children:ve(S)}),actions:e.jsx("button",{onClick:()=>n==="files"?we(d):n==="changes"?E():U(),disabled:!w||y||ue||pe,className:"w-9 h-9 rounded-full border border-gray-200 dark:border-gray-800 flex items-center justify-center text-gray-500 dark:text-gray-400 disabled:opacity-40 active:scale-95 transition-all",title:"刷新",children:e.jsx(Ht,{className:p("w-4 h-4",(y||ue||pe)&&"animate-spin")})}),bottom:e.jsx("div",{className:"px-4 pb-3",children:e.jsxs("div",{className:"grid grid-cols-3 p-1 rounded-xl bg-gray-100 dark:bg-gray-800",children:[e.jsxs("button",{type:"button",onClick:()=>x("files"),className:p("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",n==="files"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(Tt,{className:"w-4 h-4"}),"代码"]}),e.jsxs("button",{type:"button",onClick:()=>x("changes"),className:p("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",n==="changes"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(_,{className:"w-4 h-4"}),"变更"]}),e.jsxs("button",{type:"button",onClick:()=>x("commits"),className:p("h-9 rounded-lg flex items-center justify-center gap-2 text-sm font-medium transition-colors",n==="commits"?"bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-sm":"text-gray-500 dark:text-gray-400"),children:[e.jsx(ie,{className:"w-4 h-4"}),"提交"]})]})})}),n==="files"?e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 bg-white dark:bg-gray-900 border-b border-gray-100 dark:border-gray-800 overflow-x-auto hide-scrollbar flex items-center gap-1 text-xs",children:[e.jsx("button",{onClick:()=>c(""),className:p("px-2 py-1 rounded-md flex-shrink-0",d?"text-gray-500 dark:text-gray-400":"text-primary-600 bg-primary-50 dark:bg-primary-950"),children:"."}),At.map(a=>e.jsxs(ce.Fragment,{children:[e.jsx(te,{className:"w-3 h-3 text-gray-300 flex-shrink-0"}),e.jsx("button",{onClick:()=>c(a.path),className:"px-2 py-1 rounded-md text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 whitespace-nowrap",children:a.label})]},a.path))]}),e.jsx("div",{className:"flex-1 overflow-y-auto",children:w?y?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):Pe?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Pe,danger:!0}):m&&(m.dirs.length>0||m.files.length>0||!m.isRoot)?e.jsxs("div",{className:"py-2",children:[!m.isRoot&&e.jsxs("button",{onClick:()=>c(m.parent),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(Ut,{className:"w-4 h-4 text-gray-400"}),e.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"返回上级"})]}),m.dirs.map(a=>e.jsxs("button",{onClick:()=>c(a.path),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(tt,{className:"w-4 h-4 text-amber-500 flex-shrink-0"}),e.jsx("span",{className:"text-sm text-gray-800 dark:text-gray-200 flex-1 truncate",children:a.name}),e.jsx(te,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},a.path)),m.files.map(a=>e.jsxs("button",{onClick:()=>Ne(a.path),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx(Le,{path:a.path}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 truncate",children:a.name}),e.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:[oe(a.size),a.ext?` · ${a.ext}`:""]})]})]},a.path))]}):e.jsx(h,{icon:e.jsx(tt,{className:"w-5 h-5"}),title:"空目录"}):e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:"连接已断开"})})]}):n==="changes"?e.jsx("div",{className:"flex-1 overflow-y-auto",children:w?ue?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):Ge?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Ge,danger:!0}):g&&!g.isGitRepo?e.jsx(h,{icon:e.jsx(ae,{className:"w-5 h-5"}),title:"非 Git 仓库"}):g&&g.files.length>0?e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between text-xs text-gray-500 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(ae,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:g.branch||"HEAD"})]}),e.jsxs("div",{className:"flex items-center justify-end gap-2 flex-wrap",children:[e.jsxs("span",{children:[g.files.length," 个文件"]}),Et&&e.jsx(z,{variant:"stage",label:"全部暂存",loading:I==="stage",disabled:I!==null,onClick:()=>Qe("stage")}),Ft&&e.jsx(z,{variant:"unstage",label:"全部取消",loading:I==="unstage",disabled:I!==null,onClick:()=>Qe("unstage")}),e.jsxs("button",{type:"button",onClick:It,className:"h-7 px-2.5 rounded-md border border-primary-200 dark:border-primary-900 bg-primary-50 dark:bg-primary-950/40 text-primary-700 dark:text-primary-300 flex items-center gap-1.5 text-xs font-medium active:scale-95 transition-all",title:"提交代码","aria-label":"提交代码",children:[e.jsx(Ee,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"提交"})]})]})]}),Ue&&e.jsxs("div",{className:"mx-4 mb-2 px-3 py-2 rounded-md border border-red-100 dark:border-red-900 bg-red-50 dark:bg-red-950/40 flex items-center gap-2 text-xs text-red-600 dark:text-red-300",children:[e.jsx(N,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0 truncate",children:Ue})]}),g.files.map(a=>e.jsxs("div",{className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsxs("button",{type:"button",onClick:()=>V(a.path),className:"min-w-0 flex-1 flex items-center gap-3 text-left",children:[e.jsx("span",{className:p("w-14 h-6 rounded-full border flex items-center justify-center text-[11px] font-medium flex-shrink-0",mt(a.status)),children:a.label}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(Le,{path:a.path,className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("div",{className:"text-sm text-gray-800 dark:text-gray-200 truncate",children:a.name})]}),e.jsx("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:a.path})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[Ce(a)&&e.jsx(z,{variant:"stage",label:"暂存",loading:P===`stage:${a.path}`,disabled:P!==null||I!==null,onClick:i=>{i.stopPropagation(),ee(a.path,"stage")}}),re(a)&&e.jsx(z,{variant:"unstage",label:"取消",loading:P===`unstage:${a.path}`,disabled:P!==null||I!==null,onClick:i=>{i.stopPropagation(),ee(a.path,"unstage")}})]}),e.jsx(te,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},`${a.status}-${a.path}`))]}):e.jsx(h,{icon:e.jsx(_,{className:"w-5 h-5"}),title:"工作区干净"}):e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:"连接已断开"})}):e.jsx("div",{className:"flex-1 overflow-y-auto",children:w?pe?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在加载"}):Te?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Te,danger:!0}):k&&!k.isGitRepo?e.jsx(h,{icon:e.jsx(ae,{className:"w-5 h-5"}),title:"非 Git 仓库"}):k&&k.commits.length>0?e.jsxs("div",{className:"py-2",children:[e.jsxs("div",{className:"px-4 py-2 flex items-center justify-between gap-3 text-xs text-gray-500 dark:text-gray-400",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx(ae,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"truncate",children:k.branch||"HEAD"})]}),e.jsxs("span",{className:"flex-shrink-0",children:[k.commits.length," 条提交"]})]}),k.commits.map(a=>e.jsxs("button",{type:"button",onClick:()=>Pt(a.hash),className:"w-full px-4 py-3 flex items-center gap-3 text-left hover:bg-white dark:hover:bg-gray-900 transition-colors",children:[e.jsx("span",{className:"w-20 h-6 rounded-full border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-900 text-gray-600 dark:text-gray-300 font-mono text-[11px] flex items-center justify-center flex-shrink-0",children:a.shortHash}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:a.subject||"(无提交信息)"}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-2 min-w-0 text-[11px] text-gray-500 dark:text-gray-400",children:[e.jsx("span",{className:"truncate",children:a.authorName||a.authorEmail||"unknown"}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"flex-shrink-0",children:ot(a.date)})]})]}),e.jsx(te,{className:"w-4 h-4 text-gray-300 dark:text-gray-600 flex-shrink-0"})]},a.hash))]}):e.jsx(h,{icon:e.jsx(ie,{className:"w-5 h-5"}),title:"暂无 commit 记录"}):e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:"连接已断开"})}),e.jsx(se,{children:L&&e.jsx(le,{title:vt,subtitle:lt(L),onClose:Lt,actions:e.jsx("button",{type:"button",onClick:()=>void Z(),disabled:!f||$e||G,className:"w-8 h-8 rounded-full flex items-center justify-center text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-900 disabled:opacity-40 disabled:hover:bg-transparent active:scale-95 transition-all",title:"下载","aria-label":"下载文件",children:G?e.jsx(v,{className:"w-4 h-4 animate-spin"}):e.jsx(it,{className:"w-4 h-4"})}),children:e.jsxs("div",{className:"h-full min-h-0 flex flex-col",children:[Re&&e.jsx("div",{className:"px-4 py-2 border-b border-red-100 dark:border-red-950 bg-red-50 dark:bg-red-950/30 text-xs text-red-600 dark:text-red-300 flex-shrink-0",children:Re}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:$e?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):Ae?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Ae,danger:!0,compact:!0}):f!=null&&f.tooLarge?e.jsx(Se,{file:f,title:`文件过大:${oe(f.size)}`,downloading:G,onDownload:Z}):f!=null&&f.isImage?f.dataUrl?e.jsx(ja,{file:f}):e.jsx(Se,{file:f,title:"图片预览不可用",downloading:G,onDownload:Z}):f!=null&&f.isBinary?e.jsx(Se,{file:f,title:"二进制文件",downloading:G,onDownload:Z}):e.jsx(Na,{file:f,targetLine:ht})})]})})}),e.jsx(se,{children:b&&e.jsx(le,{title:Ct,subtitle:lt(b),onClose:()=>K(null),actions:je?e.jsxs("div",{className:"flex items-center gap-1.5",children:[Ce(je)&&e.jsx(z,{variant:"stage",label:"暂存",loading:P===`stage:${b}`,disabled:P!==null||I!==null,onClick:()=>ee(b,"stage")}),re(je)&&e.jsx(z,{variant:"unstage",label:"取消",loading:P===`unstage:${b}`,disabled:P!==null||I!==null,onClick:()=>ee(b,"unstage")})]}):void 0,children:wt?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):Oe?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Oe,danger:!0,compact:!0}):$!=null&&$.diff?e.jsx(gt,{diff:$.diff,truncated:$.truncated}):e.jsx(h,{icon:e.jsx(_,{className:"w-5 h-5"}),title:"暂无 diff 内容",compact:!0})})}),e.jsx(se,{children:R&&e.jsx(le,{title:St,subtitle:(D==null?void 0:D.subject)||((et=k==null?void 0:k.commits.find(a=>a.hash===R))==null?void 0:et.subject)||"commit 详情",onClose:()=>{J(null),T(null),X("")},children:Nt?e.jsx(h,{icon:e.jsx(v,{className:"w-5 h-5 animate-spin"}),title:"正在读取",compact:!0}):Je?e.jsx(h,{icon:e.jsx(N,{className:"w-5 h-5"}),title:Je,danger:!0,compact:!0}):D?e.jsx(wa,{commit:D}):e.jsx(h,{icon:e.jsx(ie,{className:"w-5 h-5"}),title:"暂无 commit 详情",compact:!0})})}),e.jsx(se,{children:ft&&e.jsx(le,{title:"提交代码",subtitle:g!=null&&g.branch?`当前分支:${g.branch}`:ve(S),onClose:()=>ye(!1),children:e.jsx(ka,{message:ke,onMessageChange:O,onGenerate:$t,onCommit:Dt,aiLoading:yt,commitLoading:bt,error:kt,result:jt,changedCount:(g==null?void 0:g.files.length)||0,stagedCount:H})})})]})},h=({icon:t,title:r,danger:s=!1,compact:o=!1})=>e.jsxs("div",{className:p("flex flex-col items-center justify-center gap-2 text-center",o?"h-full min-h-[220px]":"h-full min-h-[360px]"),children:[e.jsx("div",{className:p(s?"text-red-500 dark:text-red-400":"text-gray-400 dark:text-gray-600"),children:t}),e.jsx("div",{className:p("text-sm",s?"text-red-500 dark:text-red-400":"text-gray-400 dark:text-gray-600"),children:r})]}),ka=({message:t,onMessageChange:r,onGenerate:s,onCommit:o,aiLoading:n,commitLoading:x,error:d,result:c,changedCount:m,stagedCount:u})=>{const y=n||x;return e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-xs text-gray-500 dark:text-gray-400",children:[e.jsx(_,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("span",{className:"truncate",children:[u," 个已暂存 / ",m," 个文件"]})]}),e.jsxs("button",{type:"button",onClick:s,disabled:y||u===0,className:"h-8 px-3 rounded-md border border-violet-200 dark:border-violet-900 bg-violet-50 dark:bg-violet-950/40 text-violet-700 dark:text-violet-300 flex items-center gap-1.5 text-xs font-medium disabled:opacity-60 active:scale-95 transition-all",title:"AI 生成提交信息","aria-label":"AI 生成提交信息",children:[n?e.jsx(v,{className:"w-3.5 h-3.5 animate-spin"}):e.jsx(Ot,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"AI 生成"})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 p-4 flex flex-col gap-3",children:[e.jsx("label",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",htmlFor:"workspace-commit-message",children:"Commit 信息"}),e.jsx("textarea",{id:"workspace-commit-message",value:t,onChange:q=>r(q.target.value),placeholder:"feat(scope): describe the change",className:"flex-1 min-h-[220px] resize-none rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-950 px-3 py-2 text-sm leading-6 font-mono text-gray-900 dark:text-gray-100 placeholder:text-gray-400 dark:placeholder:text-gray-600 focus:outline-none focus:ring-2 focus:ring-primary-500/40"}),d&&e.jsxs("div",{className:"px-3 py-2 rounded-md border border-red-100 dark:border-red-900 bg-red-50 dark:bg-red-950/40 flex items-center gap-2 text-xs text-red-600 dark:text-red-300",children:[e.jsx(N,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0",children:d})]}),c&&e.jsxs("div",{className:"px-3 py-2 rounded-md border border-green-100 dark:border-green-900 bg-green-50 dark:bg-green-950/40 flex items-center gap-2 text-xs text-green-700 dark:text-green-300",children:[e.jsx(Ee,{className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsx("span",{className:"min-w-0",children:c})]}),e.jsxs("button",{type:"button",onClick:o,disabled:y||!t.trim()||u===0,className:"h-10 rounded-lg bg-primary-600 text-white text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-50 active:scale-[0.99] transition-all",children:[x?e.jsx(v,{className:"w-4 h-4 animate-spin"}):e.jsx(Ee,{className:"w-4 h-4"}),e.jsx("span",{children:"提交代码"})]})]})]})},z=({variant:t,label:r,loading:s,disabled:o=!1,onClick:n})=>{const x=t==="stage";return e.jsxs("button",{type:"button",onClick:n,disabled:o||s,className:p("h-7 px-2.5 rounded-md border flex items-center gap-1.5 text-xs font-medium flex-shrink-0 disabled:opacity-60 active:scale-95 transition-all",x?"border-green-200 dark:border-green-900 bg-green-50 dark:bg-green-950/40 text-green-700 dark:text-green-300":"border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 text-gray-600 dark:text-gray-300"),title:r,"aria-label":r,children:[s?e.jsx(v,{className:"w-3.5 h-3.5 animate-spin"}):x?e.jsx(Vt,{className:"w-3.5 h-3.5"}):e.jsx(_t,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:r})]})},Se=({file:t,title:r,downloading:s,onDownload:o})=>{const n=de(t.path||t.name||""),x=n.Icon;return e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col items-center justify-center gap-4 px-6 text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-2xl border border-gray-200 dark:border-gray-800 bg-gray-50 dark:bg-gray-900 flex items-center justify-center",children:e.jsx(x,{className:p("w-7 h-7",n.className)})}),e.jsxs("div",{className:"max-w-full space-y-1",children:[e.jsx("div",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:r}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate max-w-[280px]",children:[t.mimeType||n.label," · ",oe(t.size)]})]}),e.jsxs("button",{type:"button",onClick:()=>void o(),disabled:s,className:"h-10 px-4 rounded-lg bg-primary-600 text-white text-sm font-medium flex items-center justify-center gap-2 disabled:opacity-60 active:scale-[0.99] transition-all",children:[s?e.jsx(v,{className:"w-4 h-4 animate-spin"}):e.jsx(it,{className:"w-4 h-4"}),e.jsx("span",{children:"下载文件"})]})]})},ja=({file:t})=>{const r=de(t.path||t.name||""),s=r.Icon;return e.jsxs("div",{className:"h-full overflow-hidden bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(s,{className:p("w-4 h-4 flex-shrink-0",r.className)}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:r.label})]}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono text-gray-400 dark:text-gray-500",children:[t.mimeType&&e.jsx("span",{className:"truncate",children:t.mimeType}),e.jsx("span",{className:"flex-shrink-0",children:oe(t.size)})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto workspace-image-canvas p-4",children:e.jsx("div",{className:"h-full min-h-[320px] flex items-center justify-center",children:e.jsx("img",{src:t.dataUrl,alt:t.name,className:"max-w-full max-h-[calc(86vh-132px)] object-contain rounded border border-gray-200/80 dark:border-gray-800/80 bg-white/80 dark:bg-gray-950/80 shadow-sm",draggable:!1})})})]})},wa=({commit:t})=>e.jsxs("div",{className:"h-full bg-white dark:bg-gray-950 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-3 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 break-words",children:t.subject||"(无提交信息)"}),e.jsxs("div",{className:"mt-1 flex items-center gap-2 min-w-0 text-[11px] text-gray-500 dark:text-gray-400",children:[e.jsx("span",{className:"font-mono flex-shrink-0",children:t.shortHash}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"truncate",children:t.authorName||t.authorEmail||"unknown"}),e.jsx("span",{className:"flex-shrink-0",children:"·"}),e.jsx("span",{className:"flex-shrink-0",children:ot(t.date)})]})]}),e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400 flex-shrink-0",children:[t.files.length," 个文件"]})]}),t.body&&e.jsx("div",{className:"mt-3 rounded-lg border border-gray-200 dark:border-gray-800 bg-white dark:bg-gray-950 px-3 py-2 text-xs leading-5 text-gray-700 dark:text-gray-300 whitespace-pre-wrap break-words",children:t.body})]}),t.files.length>0&&e.jsx("div",{className:"max-h-40 overflow-y-auto border-b border-gray-100 dark:border-gray-800 bg-white dark:bg-gray-950 flex-shrink-0",children:t.files.map(r=>e.jsxs("div",{className:"px-4 py-2 flex items-center gap-3 border-b border-gray-50 dark:border-gray-900 last:border-b-0",children:[e.jsx("span",{className:p("w-14 h-6 rounded-full border flex items-center justify-center text-[11px] font-medium flex-shrink-0",mt(r.status)),children:r.label}),e.jsx(Le,{path:r.path,className:"w-3.5 h-3.5 flex-shrink-0"}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("div",{className:"text-xs text-gray-800 dark:text-gray-200 truncate",children:r.path}),r.oldPath&&r.oldPath!==r.path&&e.jsxs("div",{className:"text-[11px] text-gray-400 dark:text-gray-500 font-mono truncate",children:[r.oldPath," ","->"," ",r.path]})]})]},`${r.status}-${r.oldPath||""}-${r.path}`))}),e.jsx("div",{className:"flex-1 min-h-0",children:t.diff?e.jsx(gt,{diff:t.diff,truncated:t.truncated}):e.jsx(h,{icon:e.jsx(_,{className:"w-5 h-5"}),title:"暂无 diff 内容",compact:!0})})]}),Na=({file:t,targetLine:r})=>{const s=fa((t==null?void 0:t.path)||(t==null?void 0:t.name)||""),o=de((t==null?void 0:t.path)||(t==null?void 0:t.name)||""),n=o.Icon,x=l.useMemo(()=>((t==null?void 0:t.content)??"").split(`
8
- `),[t==null?void 0:t.content]),d=Math.max(2,String(x.length).length)+1,c=l.useRef(null);return l.useEffect(()=>{if(!t||!r)return;const m=requestAnimationFrame(()=>{var u;(u=c.current)==null||u.scrollIntoView({block:"center",inline:"nearest"})});return()=>cancelAnimationFrame(m)},[t,r]),t?e.jsxs("div",{className:"h-full overflow-hidden bg-white dark:bg-gray-950 flex flex-col",children:[e.jsxs("div",{className:"px-4 py-2 border-b border-gray-100 dark:border-gray-800 bg-gray-50 dark:bg-gray-900/70 flex items-center justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(n,{className:p("w-4 h-4 flex-shrink-0",o.className)}),e.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400 truncate",children:o.label})]}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0 text-[11px] font-mono text-gray-400 dark:text-gray-500",children:[r&&e.jsxs("span",{className:"flex-shrink-0",children:["L",r]}),s&&e.jsx("span",{className:"flex-shrink-0",children:s})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-auto bg-white dark:bg-gray-950 workspace-code-preview",children:e.jsx(ga,{content:t.content,language:s,lineNumberWidth:d,targetLine:r,targetLineRef:c})})]}):e.jsx(h,{icon:e.jsx(ct,{className:"w-5 h-5"}),title:"暂无文件内容",compact:!0})},gt=({diff:t,truncated:r})=>{const s=l.useMemo(()=>ya(t),[t]),o=l.useMemo(()=>s.reduce((n,x)=>({additions:n.additions+x.additions,deletions:n.deletions+x.deletions}),{additions:0,deletions:0}),[s]);return s.length===0?e.jsx("pre",{className:"min-h-full overflow-auto p-4 text-[12px] leading-5 font-mono text-gray-800 dark:text-gray-200 whitespace-pre-wrap break-words bg-white dark:bg-gray-950",children:t}):e.jsxs("div",{className:"h-full overflow-y-auto bg-white dark:bg-gray-950",children:[e.jsxs("div",{className:"sticky top-0 z-10 border-b border-gray-100 dark:border-gray-800 bg-white/95 dark:bg-gray-950/95 backdrop-blur px-4 py-2 flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:[s.length," 个文件"]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium",children:[e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:["+",o.additions]}),e.jsxs("span",{className:"text-red-700 dark:text-red-400",children:["-",o.deletions]})]})]}),r&&e.jsx("div",{className:"mx-4 mt-3 rounded-lg border border-amber-200 dark:border-amber-900 bg-amber-50 dark:bg-amber-950/40 px-3 py-2 text-xs text-amber-800 dark:text-amber-300",children:"diff 内容过长,已截断。"}),e.jsx("div",{className:"pb-4",children:s.map((n,x)=>e.jsxs("div",{className:"border-b border-gray-100 dark:border-gray-800 last:border-b-0",children:[e.jsxs("div",{className:"px-4 py-3 bg-gray-50 dark:bg-gray-900/70 border-b border-gray-100 dark:border-gray-800",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:n.newPath||n.oldPath||"变更文件"}),n.oldPath&&n.newPath&&n.oldPath!==n.newPath&&e.jsxs("div",{className:"text-[11px] text-gray-500 dark:text-gray-400 font-mono truncate mt-1",children:[n.oldPath," ","->"," ",n.newPath]})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium flex-shrink-0",children:[e.jsxs("span",{className:"text-green-700 dark:text-green-400",children:["+",n.additions]}),e.jsxs("span",{className:"text-red-700 dark:text-red-400",children:["-",n.deletions]})]})]}),n.meta.length>0&&e.jsx("div",{className:"mt-2 space-y-1",children:n.meta.map((d,c)=>e.jsx("div",{className:"text-[11px] leading-4 text-gray-500 dark:text-gray-400 font-mono truncate",children:d},`${d}-${c}`))})]}),n.hunks.map((d,c)=>e.jsxs("div",{children:[e.jsx("div",{className:"px-4 py-2 bg-primary-50 dark:bg-primary-950/30 text-[11px] font-mono text-primary-700 dark:text-primary-300 border-b border-primary-100 dark:border-primary-900 overflow-x-auto hide-scrollbar",children:d.header}),e.jsx("div",{className:"font-mono text-[12px] leading-5",children:d.lines.map((m,u)=>e.jsx(va,{line:m},`${m.kind}-${m.oldLine}-${m.newLine}-${u}`))})]},`${d.header}-${c}`))]},`${n.newPath||n.oldPath}-${x}`))})]})},va=({line:t})=>{const r=t.kind==="add",s=t.kind==="delete",o=t.kind==="note",n=r?"+":s?"-":o?"\\":" ";return e.jsxs("div",{className:p("grid grid-cols-[3.25rem_3.25rem_1.5rem_minmax(0,1fr)] min-w-0 border-b border-transparent",r&&"bg-green-50 dark:bg-green-950/35",s&&"bg-red-50 dark:bg-red-950/35",t.kind==="meta"&&"bg-gray-50 dark:bg-gray-900/70",o&&"bg-gray-50 dark:bg-gray-900/70 text-gray-500 dark:text-gray-400 italic"),children:[e.jsx("div",{className:"px-2 py-0.5 text-right text-[11px] text-gray-400 dark:text-gray-600 select-none border-r border-gray-100 dark:border-gray-800",children:t.oldLine??""}),e.jsx("div",{className:"px-2 py-0.5 text-right text-[11px] text-gray-400 dark:text-gray-600 select-none border-r border-gray-100 dark:border-gray-800",children:t.newLine??""}),e.jsx("div",{className:p("px-1.5 py-0.5 text-center select-none",r&&"text-green-700 dark:text-green-400",s&&"text-red-700 dark:text-red-400",!r&&!s&&"text-gray-400 dark:text-gray-600"),children:n}),e.jsx("div",{className:p("py-0.5 pr-4 overflow-x-auto whitespace-pre",r&&"text-green-900 dark:text-green-100",s&&"text-red-900 dark:text-red-100",!r&&!s&&"text-gray-800 dark:text-gray-200"),children:t.content||" "})]})},le=({title:t,subtitle:r,onClose:s,actions:o,children:n})=>e.jsxs(e.Fragment,{children:[e.jsx(rt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:s,className:"absolute inset-0 bg-black/40 z-40"}),e.jsxs(rt.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:25,stiffness:220},className:"absolute bottom-0 left-0 right-0 h-[86%] bg-white dark:bg-gray-950 rounded-t-2xl z-50 flex flex-col shadow-xl overflow-hidden",children:[e.jsx("div",{className:"flex justify-center pt-3 pb-2 flex-shrink-0",onClick:s,children:e.jsx("div",{className:"w-12 h-1.5 bg-gray-300 dark:bg-gray-700 rounded-full"})}),e.jsxs("div",{className:"px-4 pb-3 border-b border-gray-100 dark:border-gray-800 flex items-start justify-between gap-3 flex-shrink-0",children:[e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsx("h2",{className:"text-base font-semibold text-gray-900 dark:text-gray-100 truncate",children:t}),e.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400 font-mono truncate mt-0.5",children:r})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-shrink-0",children:[o,e.jsx("button",{onClick:s,className:"w-8 h-8 rounded-full flex items-center justify-center text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-900 flex-shrink-0",title:"关闭","aria-label":"关闭",children:e.jsx(qt,{className:"w-5 h-5"})})]})]}),e.jsx("div",{className:"flex-1 min-h-0 overflow-hidden",children:n})]})]});export{$a as Workspace};
@@ -1,2 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkdownRenderer-BO-KS_L1.js","assets/vendor-react-DSV5aFEg.js","assets/index-DOgH1Kf3.js","assets/vendor-icons-CNN4EKVi.js","assets/index-BXT2BylN.css","assets/code-highlight-CEcsuMpw.js","assets/vendor-markdown-BDwu-Ux6.js"])))=>i.map(i=>d[i]);
2
- import{_,u as k,c as R}from"./index-DOgH1Kf3.js";import{j as c,r as p,R as h,u as M}from"./vendor-react-DSV5aFEg.js";function w(t){return t.type==="system_group"}function E(t){return t.type==="tool_group"}function D(t){return w(t)||E(t)}function F(t){return!!t.details&&Object.keys(t.details).length>0}function m(t){return F(t)||t.content!=="系统消息"}function W(t){const e=t.filter(m);if(e.length===0)return null;const r=e[0],n=e[e.length-1];return{id:`system-group-${r.id}`,type:"system_group",content:n.content,time:e.length>1?`${r.time} - ${n.time}`:n.time,messages:e}}function j(t){const e=t[0],r=t[t.length-1];return{id:`tool-group-${e.id}`,type:"tool_group",content:r.content,time:t.length>1?`${e.time} - ${r.time}`:r.time,messages:t}}function B(t){const e=[];let r=[],n=[];const o=()=>{if(r.length===0)return;const s=W(r);s&&e.push(s),r=[]},i=()=>{n.length!==0&&(n.length===1?e.push(n[0]):e.push(j(n)),n=[])};for(const s of t){if(s.type==="system"){if(i(),!m(s))continue;r.push(s);continue}if(s.type==="tool"){o(),n.push(s);continue}o(),i(),e.push(s)}return o(),i(),e}const T=h.lazy(()=>_(()=>import("./MarkdownRenderer-BO-KS_L1.js"),__vite__mapDeps([0,1,2,3,4,5,6])));function G({children:t,enableWorkspaceLinks:e=!0}){return c.jsx(p.Suspense,{fallback:c.jsx(z,{content:t}),children:c.jsx(T,{enableWorkspaceLinks:e,children:t})})}function z({content:t}){return c.jsx("span",{className:"whitespace-pre-wrap break-words",children:t})}const b=/(^|[^\w@:/?#&=.-])((?:\/|\.{1,2}\/|~\/)?(?:(?:[\w.@+-]+\/)+)?[\w.@+-]+\.[A-Za-z][A-Za-z0-9_-]*)(?::(\d+)(?::\d+)?|#L(\d+))(?![\w/-])/g,S=/^(.+?)(?::(\d+)(?::\d+)?|#L(\d+))$/;function d(t){try{return decodeURIComponent(t)}catch{return t}}function g(t){return t.replace(/^["'<]+/,"").replace(/[>"')\],.;]+$/,"")}function y(t){return t?t.replace(/\\/g,"/").replace(/\/+$/,"")||"/":""}function A(t){const e=y(t),r=e.match(/^(\/Users\/[^/]+)(?:\/|$)/);if(r)return r[1];const n=e.match(/^(\/home\/[^/]+)(?:\/|$)/);return n?n[1]:""}function f(t){const e=[];for(const r of t.replace(/^\.\/+/,"").split("/"))if(!(!r||r===".")){if(r===".."){if(e.length===0)return null;e.pop();continue}e.push(r)}return e.join("/")}function I(t){if(!t)return null;const e=Number(t);return Number.isSafeInteger(e)&&e>0?e:null}function x(t,e,r){const n=I(e);if(!n)return null;let o=g(d(t).trim()).replace(/\\/g,"/");if(!o||(o.startsWith("file://")&&(o=o.slice(7)),/^[a-z][a-z0-9+.-]*:\/\//i.test(o)))return null;const i=A(r);o.startsWith("~/")&&i&&(o=`${i}${o.slice(1)}`);const s=y(r);let u;if(o.startsWith("/")){if(!s)return null;const l=o.replace(/\/+$/,"");if(l!==s&&!l.startsWith(`${s}/`))return null;u=f(l.slice(s.length).replace(/^\/+/,""))}else u=f(o);return u?{path:u,line:n,href:`/workspace?file=${encodeURIComponent(u)}&line=${n}`}:null}function K(t,e){const r=g(d(t).trim());if(!r||r.startsWith("/workspace?"))return null;const n=r.match(S);return n?x(n[1],n[2]||n[3],e):null}function L(t,e){const r=[];let n=0;for(const o of t.matchAll(b)){const i=o[0],s=o[1]||"",u=i.slice(s.length),l=(o.index||0)+s.length,$=(o.index||0)+i.length,a=x(o[2],o[3]||o[4],e);a&&(l>n&&r.push({type:"text",text:t.slice(n,l)}),r.push({type:"link",text:u,target:a}),n=$)}return n<t.length&&r.push({type:"text",text:t.slice(n)}),r.length>0?r:[{type:"text",text:t}]}function H({children:t,linkClassName:e}){const r=M(),{cliConfig:n}=k(),o=p.useMemo(()=>L(t,n==null?void 0:n.workDir),[t,n==null?void 0:n.workDir]);return c.jsx(c.Fragment,{children:o.map((i,s)=>i.type==="text"?c.jsx(h.Fragment,{children:i.text},s):c.jsx("a",{href:i.target.href,className:R("font-mono underline underline-offset-2 decoration-current/50 hover:decoration-current",e),title:`打开 ${i.target.path}:${i.target.line}`,onClick:u=>{u.button!==0||u.metaKey||u.ctrlKey||u.shiftKey||u.altKey||(u.preventDefault(),r(i.target.href))},children:i.text},`${i.target.href}-${s}`))})}export{G as M,H as W,B as g,D as i,K as p,L as s};
@@ -1 +0,0 @@
1
- const t={detect:!0,aliases:{bash:["dockerfile","sh","zsh"],ini:["conf","dotenv","env","properties","toml"],javascript:["cjs","jsx","mjs"],markdown:["md","mdx"],typescript:["cts","mts","tsx"],xml:["html","plist","svelte","svg","vue"],yaml:"yml"},plainText:["plain","plaintext","text","txt"]};export{t as c};
@@ -1 +0,0 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-4{left:1rem;right:1rem}.-left-8{left:-2rem}.bottom-0{bottom:0}.bottom-1{bottom:.25rem}.left-0{left:0}.right-0{right:0}.right-2{right:.5rem}.top-0{top:0}.top-1\/2{top:50%}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-4{margin-left:1rem;margin-right:1rem}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.ml-0\.5{margin-left:.125rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-1\.5{margin-top:.375rem}.mt-10{margin-top:2.5rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-8{margin-top:2rem}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[60px\]{height:60px}.h-\[85\%\]{height:85%}.h-\[86\%\]{height:86%}.h-full{height:100%}.h-screen{height:100vh}.max-h-24{max-height:6rem}.max-h-32{max-height:8rem}.max-h-40{max-height:10rem}.max-h-48{max-height:12rem}.max-h-52{max-height:13rem}.max-h-60{max-height:15rem}.max-h-72{max-height:18rem}.max-h-\[120px\]{max-height:120px}.max-h-\[calc\(86vh-132px\)\]{max-height:calc(86vh - 132px)}.min-h-0{min-height:0px}.min-h-14{min-height:3.5rem}.min-h-\[220px\]{min-height:220px}.min-h-\[320px\]{min-height:320px}.min-h-\[360px\]{min-height:360px}.min-h-\[42px\]{min-height:42px}.min-h-\[44px\]{min-height:44px}.min-h-\[88px\]{min-height:88px}.min-h-full{min-height:100%}.w-1\.5{width:.375rem}.w-10{width:2.5rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-20{width:5rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[95\%\]{width:95%}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-max{min-width:-moz-max-content;min-width:max-content}.max-w-2xl{max-width:42rem}.max-w-\[120px\]{max-width:120px}.max-w-\[220px\]{max-width:220px}.max-w-\[280px\]{max-width:280px}.max-w-\[85\%\]{max-width:85%}.max-w-\[88\%\]{max-width:88%}.max-w-\[94\%\]{max-width:94%}.max-w-\[95\%\]{max-width:95%}.max-w-full{max-width:100%}.flex-1{flex:1 1 0%}.flex-shrink-0{flex-shrink:0}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-1{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-6{--tw-translate-x: 1.5rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes ping{75%,to{transform:scale(2);opacity:0}}.animate-ping{animation:ping 1s cubic-bezier(0,0,.2,1) infinite}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[3\.25rem_3\.25rem_1\.5rem_minmax\(0\,1fr\)\]{grid-template-columns:3.25rem 3.25rem 1.5rem minmax(0,1fr)}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.justify-around{justify-content:space-around}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse: 0;border-top-width:calc(1px * calc(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px * var(--tw-divide-y-reverse))}.divide-gray-200\/70>:not([hidden])~:not([hidden]){border-color:#e5e7ebb3}.divide-gray-50>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(249 250 251 / var(--tw-divide-opacity, 1))}.divide-primary-100\/70>:not([hidden])~:not([hidden]){border-color:#ede9feb3}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre{white-space:pre}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.rounded-sm{border-radius:.125rem}.rounded-xl{border-radius:.75rem}.rounded-t-2xl{border-top-left-radius:1rem;border-top-right-radius:1rem}.rounded-tl-md{border-top-left-radius:.375rem}.rounded-tr-sm{border-top-right-radius:.125rem}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-2{border-bottom-width:2px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-amber-100{--tw-border-opacity: 1;border-color:rgb(254 243 199 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-200\/40{border-color:#fde68a66}.border-blue-100{--tw-border-opacity: 1;border-color:rgb(219 234 254 / var(--tw-border-opacity, 1))}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-200\/40{border-color:#bfdbfe66}.border-blue-200\/50{border-color:#bfdbfe80}.border-blue-200\/60{border-color:#bfdbfe99}.border-blue-400{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-gray-100{--tw-border-opacity: 1;border-color:rgb(243 244 246 / var(--tw-border-opacity, 1))}.border-gray-200{--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity, 1))}.border-gray-200\/40{border-color:#e5e7eb66}.border-gray-200\/80{border-color:#e5e7ebcc}.border-gray-50{--tw-border-opacity: 1;border-color:rgb(249 250 251 / var(--tw-border-opacity, 1))}.border-green-100{--tw-border-opacity: 1;border-color:rgb(220 252 231 / var(--tw-border-opacity, 1))}.border-green-200{--tw-border-opacity: 1;border-color:rgb(187 247 208 / var(--tw-border-opacity, 1))}.border-green-200\/40{border-color:#bbf7d066}.border-green-200\/60{border-color:#bbf7d099}.border-green-500{--tw-border-opacity: 1;border-color:rgb(34 197 94 / var(--tw-border-opacity, 1))}.border-indigo-200\/60{border-color:#c7d2fe99}.border-orange-100{--tw-border-opacity: 1;border-color:rgb(255 237 213 / var(--tw-border-opacity, 1))}.border-orange-200{--tw-border-opacity: 1;border-color:rgb(254 215 170 / var(--tw-border-opacity, 1))}.border-primary-100{--tw-border-opacity: 1;border-color:rgb(237 233 254 / var(--tw-border-opacity, 1))}.border-primary-100\/60{border-color:#ede9fe99}.border-primary-100\/80{border-color:#ede9fecc}.border-primary-200{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.border-primary-50{--tw-border-opacity: 1;border-color:rgb(245 243 255 / var(--tw-border-opacity, 1))}.border-primary-600{--tw-border-opacity: 1;border-color:rgb(124 58 237 / var(--tw-border-opacity, 1))}.border-purple-200\/40{border-color:#e9d5ff66}.border-red-100{--tw-border-opacity: 1;border-color:rgb(254 226 226 / var(--tw-border-opacity, 1))}.border-red-200{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.border-red-200\/30{border-color:#fecaca4d}.border-transparent{border-color:transparent}.border-violet-200{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.border-white\/25{border-color:#ffffff40}.border-t-transparent{border-top-color:transparent}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-50\/50{background-color:#fffbeb80}.bg-black\/40{background-color:#0006}.bg-black\/50{background-color:#00000080}.bg-blue-100{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.bg-blue-100\/60{background-color:#dbeafe99}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-blue-50\/50{background-color:#eff6ff80}.bg-blue-50\/80{background-color:#eff6ffcc}.bg-blue-600{--tw-bg-opacity: 1;background-color:rgb(37 99 235 / var(--tw-bg-opacity, 1))}.bg-cyan-50{--tw-bg-opacity: 1;background-color:rgb(236 254 255 / var(--tw-bg-opacity, 1))}.bg-gray-100{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.bg-gray-200{--tw-bg-opacity: 1;background-color:rgb(229 231 235 / var(--tw-bg-opacity, 1))}.bg-gray-200\/70{background-color:#e5e7ebb3}.bg-gray-300{--tw-bg-opacity: 1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.bg-gray-50\/50{background-color:#f9fafb80}.bg-gray-50\/90{background-color:#f9fafbe6}.bg-gray-800{--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.bg-green-100{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.bg-green-50{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.bg-green-50\/50{background-color:#f0fdf480}.bg-green-50\/80{background-color:#f0fdf4cc}.bg-green-500{--tw-bg-opacity: 1;background-color:rgb(34 197 94 / var(--tw-bg-opacity, 1))}.bg-indigo-50{--tw-bg-opacity: 1;background-color:rgb(238 242 255 / var(--tw-bg-opacity, 1))}.bg-indigo-50\/80{background-color:#eef2ffcc}.bg-orange-50{--tw-bg-opacity: 1;background-color:rgb(255 247 237 / var(--tw-bg-opacity, 1))}.bg-primary-100{--tw-bg-opacity: 1;background-color:rgb(237 233 254 / var(--tw-bg-opacity, 1))}.bg-primary-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-primary-50\/90{background-color:#f5f3ffe6}.bg-primary-500{--tw-bg-opacity: 1;background-color:rgb(139 92 246 / var(--tw-bg-opacity, 1))}.bg-primary-600{--tw-bg-opacity: 1;background-color:rgb(124 58 237 / var(--tw-bg-opacity, 1))}.bg-purple-50{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.bg-purple-50\/50{background-color:#faf5ff80}.bg-red-100{--tw-bg-opacity: 1;background-color:rgb(254 226 226 / var(--tw-bg-opacity, 1))}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-red-50\/50{background-color:#fef2f280}.bg-red-500{--tw-bg-opacity: 1;background-color:rgb(239 68 68 / var(--tw-bg-opacity, 1))}.bg-red-500\/25{background-color:#ef444440}.bg-slate-800{--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity, 1))}.bg-violet-50{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/10{background-color:#ffffff1a}.bg-white\/50{background-color:#ffffff80}.bg-white\/70{background-color:#ffffffb3}.bg-white\/80{background-color:#fffc}.bg-white\/95{background-color:#fffffff2}.bg-yellow-50{--tw-bg-opacity: 1;background-color:rgb(254 252 232 / var(--tw-bg-opacity, 1))}.bg-yellow-500{--tw-bg-opacity: 1;background-color:rgb(234 179 8 / var(--tw-bg-opacity, 1))}.fill-current{fill:currentColor}.object-contain{-o-object-fit:contain;object-fit:contain}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-1{padding-bottom:.25rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-8{padding-bottom:2rem}.pl-5{padding-left:1.25rem}.pr-1{padding-right:.25rem}.pr-4{padding-right:1rem}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-text-bottom{vertical-align:text-bottom}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[15px\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-relaxed{line-height:1.625}.leading-snug{line-height:1.375}.tracking-wider{letter-spacing:.05em}.text-amber-500{--tw-text-opacity: 1;color:rgb(245 158 11 / var(--tw-text-opacity, 1))}.text-amber-500\/70{color:#f59e0bb3}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-blue-500{--tw-text-opacity: 1;color:rgb(59 130 246 / var(--tw-text-opacity, 1))}.text-blue-500\/70{color:#3b82f6b3}.text-blue-600{--tw-text-opacity: 1;color:rgb(37 99 235 / var(--tw-text-opacity, 1))}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-blue-800{--tw-text-opacity: 1;color:rgb(30 64 175 / var(--tw-text-opacity, 1))}.text-blue-900{--tw-text-opacity: 1;color:rgb(30 58 138 / var(--tw-text-opacity, 1))}.text-cyan-700{--tw-text-opacity: 1;color:rgb(14 116 144 / var(--tw-text-opacity, 1))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-gray-300{--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.text-gray-400{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.text-gray-500{--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.text-gray-500\/70{color:#6b7280b3}.text-gray-600{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.text-gray-700{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.text-gray-800{--tw-text-opacity: 1;color:rgb(31 41 55 / var(--tw-text-opacity, 1))}.text-gray-900{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.text-green-500{--tw-text-opacity: 1;color:rgb(34 197 94 / var(--tw-text-opacity, 1))}.text-green-500\/70{color:#22c55eb3}.text-green-600{--tw-text-opacity: 1;color:rgb(22 163 74 / var(--tw-text-opacity, 1))}.text-green-700{--tw-text-opacity: 1;color:rgb(21 128 61 / var(--tw-text-opacity, 1))}.text-green-800{--tw-text-opacity: 1;color:rgb(22 101 52 / var(--tw-text-opacity, 1))}.text-green-900{--tw-text-opacity: 1;color:rgb(20 83 45 / var(--tw-text-opacity, 1))}.text-indigo-400{--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.text-indigo-500{--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.text-indigo-600{--tw-text-opacity: 1;color:rgb(79 70 229 / var(--tw-text-opacity, 1))}.text-indigo-700{--tw-text-opacity: 1;color:rgb(67 56 202 / var(--tw-text-opacity, 1))}.text-indigo-800\/80{color:#3730a3cc}.text-orange-500{--tw-text-opacity: 1;color:rgb(249 115 22 / var(--tw-text-opacity, 1))}.text-orange-600{--tw-text-opacity: 1;color:rgb(234 88 12 / var(--tw-text-opacity, 1))}.text-orange-700{--tw-text-opacity: 1;color:rgb(194 65 12 / var(--tw-text-opacity, 1))}.text-orange-800{--tw-text-opacity: 1;color:rgb(154 52 18 / var(--tw-text-opacity, 1))}.text-orange-900{--tw-text-opacity: 1;color:rgb(124 45 18 / var(--tw-text-opacity, 1))}.text-pink-600{--tw-text-opacity: 1;color:rgb(219 39 119 / var(--tw-text-opacity, 1))}.text-primary-100{--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.text-primary-200{--tw-text-opacity: 1;color:rgb(221 214 254 / var(--tw-text-opacity, 1))}.text-primary-500{--tw-text-opacity: 1;color:rgb(139 92 246 / var(--tw-text-opacity, 1))}.text-primary-600{--tw-text-opacity: 1;color:rgb(124 58 237 / var(--tw-text-opacity, 1))}.text-primary-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-primary-800{--tw-text-opacity: 1;color:rgb(91 33 182 / var(--tw-text-opacity, 1))}.text-purple-500\/70{color:#a855f7b3}.text-purple-600{--tw-text-opacity: 1;color:rgb(147 51 234 / var(--tw-text-opacity, 1))}.text-purple-700{--tw-text-opacity: 1;color:rgb(126 34 206 / var(--tw-text-opacity, 1))}.text-red-100{--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-red-700{--tw-text-opacity: 1;color:rgb(185 28 28 / var(--tw-text-opacity, 1))}.text-red-800{--tw-text-opacity: 1;color:rgb(153 27 27 / var(--tw-text-opacity, 1))}.text-red-900{--tw-text-opacity: 1;color:rgb(127 29 29 / var(--tw-text-opacity, 1))}.text-sky-600{--tw-text-opacity: 1;color:rgb(2 132 199 / var(--tw-text-opacity, 1))}.text-slate-200{--tw-text-opacity: 1;color:rgb(226 232 240 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-violet-700{--tw-text-opacity: 1;color:rgb(109 40 217 / var(--tw-text-opacity, 1))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.text-yellow-600{--tw-text-opacity: 1;color:rgb(202 138 4 / var(--tw-text-opacity, 1))}.underline{text-decoration-line:underline}.decoration-white\/70{text-decoration-color:#ffffffb3}.underline-offset-2{text-underline-offset:2px}.opacity-0{opacity:0}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.shadow-\[0_-1px_8px_rgba\(0\,0\,0\,0\.04\)\]{--tw-shadow: 0 -1px 8px rgba(0,0,0,.04);--tw-shadow-colored: 0 -1px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-primary-200{--tw-shadow-color: #ddd6fe;--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur: blur(8px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}html,body,#root{height:100%;margin:0;padding:0;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.pb-safe{padding-bottom:env(safe-area-inset-bottom,0px)}.pt-safe{padding-top:env(safe-area-inset-top,0px)}.hide-scrollbar{-ms-overflow-style:none;scrollbar-width:none}.hide-scrollbar::-webkit-scrollbar{display:none}.markdown-body{font-size:15px;line-height:1.6;overflow-wrap:anywhere;word-break:break-word}.markdown-body p{margin:.35em 0}.markdown-body p:first-child{margin-top:0}.markdown-body p:last-child{margin-bottom:0}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4{font-weight:600;margin:.75em 0 .35em;line-height:1.35}.markdown-body h1{font-size:1.25em}.markdown-body h2{font-size:1.15em}.markdown-body h3{font-size:1.05em}.markdown-body code{background:#f1f5f9;border-radius:4px;padding:.15em .35em;font-size:.9em;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;white-space:break-spaces}.markdown-body pre{background:#0f172a;color:#e2e8f0;border:1px solid #334155;border-radius:10px;padding:.75em .875em;overflow-x:auto;-webkit-overflow-scrolling:touch;margin:.6em 0;font-size:.82em;line-height:1.55;word-break:normal;overflow-wrap:normal;white-space:pre;max-width:100%;scrollbar-width:thin}.markdown-body pre code{background:none;padding:0;font-size:inherit;color:inherit;border-radius:0;white-space:inherit;display:block;min-width:-moz-max-content;min-width:max-content}.workspace-code-preview pre{margin:0;min-height:100%;border-radius:8px}.workspace-code-preview pre code,.workspace-code-preview code{-moz-tab-size:2;-o-tab-size:2;tab-size:2}.workspace-image-canvas{background-color:#f8fafc;background-image:linear-gradient(45deg,rgba(148,163,184,.2) 25%,transparent 25%),linear-gradient(-45deg,rgba(148,163,184,.2) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(148,163,184,.2) 75%),linear-gradient(-45deg,transparent 75%,rgba(148,163,184,.2) 75%);background-position:0 0,0 10px,10px -10px,-10px 0;background-size:20px 20px}.dark .workspace-image-canvas{background-color:#0f172a;background-image:linear-gradient(45deg,rgba(71,85,105,.35) 25%,transparent 25%),linear-gradient(-45deg,rgba(71,85,105,.35) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,rgba(71,85,105,.35) 75%),linear-gradient(-45deg,transparent 75%,rgba(71,85,105,.35) 75%)}.markdown-body pre code.hljs,.markdown-body-sm pre code.hljs{color:#e6edf3}.hljs-comment,.hljs-quote{color:#8b949e;font-style:italic}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#ff7b72}.hljs-string,.hljs-addition{color:#a5d6ff}.hljs-number,.hljs-literal{color:#79c0ff}.hljs-built_in{color:#ffa657}.hljs-function .hljs-title,.hljs-title.function_{color:#d2a8ff}.hljs-variable,.hljs-attr{color:#79c0ff}.hljs-property{color:#7ee787}.hljs-meta,.hljs-meta .hljs-keyword{color:#ffa657}.hljs-operator{color:#ff7b72}.hljs-deletion{color:#ffa198;background:#f851491a}.hljs-addition{color:#7ee787;background:#2ea0431a}.hljs-symbol,.hljs-bullet{color:#f2cc60}.hljs-regexp{color:#a5d6ff}.hljs-name,.hljs-selector-class{color:#7ee787}.hljs-selector-id{color:#ffa657}.hljs-section{color:#d2a8ff;font-weight:700}.hljs-link{color:#a5d6ff;text-decoration:underline}.hljs-params{color:#e6edf3}.hljs-attribute{color:#79c0ff}.workspace-code-preview code.hljs{color:inherit}.workspace-code-preview .hljs-comment,.workspace-code-preview .hljs-quote{color:#6e7781;font-style:italic}.workspace-code-preview .hljs-keyword,.workspace-code-preview .hljs-selector-tag,.workspace-code-preview .hljs-type,.workspace-code-preview .hljs-operator{color:#cf222e}.workspace-code-preview .hljs-string,.workspace-code-preview .hljs-regexp{color:#0a3069}.workspace-code-preview .hljs-number,.workspace-code-preview .hljs-literal,.workspace-code-preview .hljs-variable,.workspace-code-preview .hljs-attr,.workspace-code-preview .hljs-attribute{color:#0550ae}.workspace-code-preview .hljs-built_in,.workspace-code-preview .hljs-meta,.workspace-code-preview .hljs-meta .hljs-keyword{color:#953800}.workspace-code-preview .hljs-function .hljs-title,.workspace-code-preview .hljs-title.function_,.workspace-code-preview .hljs-section{color:#8250df}.workspace-code-preview .hljs-property,.workspace-code-preview .hljs-name,.workspace-code-preview .hljs-selector-class{color:#116329}.workspace-code-preview .hljs-deletion{color:#82071e;background:#cf222e14}.workspace-code-preview .hljs-addition{color:#116329;background:#1a7f3714}.workspace-code-preview .hljs-symbol,.workspace-code-preview .hljs-bullet{color:#9a6700}.workspace-code-preview .hljs-selector-id{color:#953800}.workspace-code-preview .hljs-link{color:#0a3069;text-decoration:underline}.workspace-code-preview .hljs-params{color:inherit}.dark .workspace-code-preview .hljs-comment,.dark .workspace-code-preview .hljs-quote{color:#8b949e}.dark .workspace-code-preview .hljs-keyword,.dark .workspace-code-preview .hljs-selector-tag,.dark .workspace-code-preview .hljs-type,.dark .workspace-code-preview .hljs-operator{color:#ff7b72}.dark .workspace-code-preview .hljs-string,.dark .workspace-code-preview .hljs-regexp{color:#a5d6ff}.dark .workspace-code-preview .hljs-number,.dark .workspace-code-preview .hljs-literal,.dark .workspace-code-preview .hljs-variable,.dark .workspace-code-preview .hljs-attr,.dark .workspace-code-preview .hljs-attribute{color:#79c0ff}.dark .workspace-code-preview .hljs-built_in,.dark .workspace-code-preview .hljs-meta,.dark .workspace-code-preview .hljs-meta .hljs-keyword{color:#ffa657}.dark .workspace-code-preview .hljs-function .hljs-title,.dark .workspace-code-preview .hljs-title.function_,.dark .workspace-code-preview .hljs-section{color:#d2a8ff}.dark .workspace-code-preview .hljs-property,.dark .workspace-code-preview .hljs-name,.dark .workspace-code-preview .hljs-selector-class{color:#7ee787}.dark .workspace-code-preview .hljs-deletion{color:#ffa198;background:#f851491a}.dark .workspace-code-preview .hljs-addition{color:#7ee787;background:#2ea0431a}.dark .workspace-code-preview .hljs-symbol,.dark .workspace-code-preview .hljs-bullet{color:#f2cc60}.dark .workspace-code-preview .hljs-selector-id{color:#ffa657}.dark .workspace-code-preview .hljs-link{color:#a5d6ff}.markdown-body ul,.markdown-body ol{margin:.35em 0;padding-left:1.5em}.markdown-body li{margin:.15em 0}.markdown-body li>p{margin:.2em 0}.markdown-body blockquote{border-left:3px solid #cbd5e1;padding-left:.75em;margin:.45em 0;color:#64748b}.markdown-body blockquote p{margin:.2em 0}.markdown-body hr{border:none;border-top:1px solid #e2e8f0;margin:.75em 0}.markdown-body a{color:#8b5cf6;text-decoration:none}.markdown-body a:hover{text-decoration:underline}.markdown-body strong{font-weight:600}.markdown-body table{border-collapse:collapse;min-width:100%;width:-moz-max-content;width:max-content;max-width:100%;margin:.5em 0;font-size:.9em;display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}.markdown-body th,.markdown-body td{border:1px solid #e2e8f0;padding:.35em .6em;text-align:left}.markdown-body th{background:#f8fafc;font-weight:600}.dark .markdown-body code{background:#334155}.dark .markdown-body pre{background:#111827;border-color:#374151}.dark .markdown-body blockquote{border-left-color:#475569;color:#94a3b8}.dark .markdown-body hr{border-top-color:#334155}.dark .markdown-body th,.dark .markdown-body td{border-color:#334155}.dark .markdown-body th{background:#1e293b}.markdown-body-sm{font-size:12px;line-height:1.5}.markdown-body-sm p{margin:.2em 0}.markdown-body-sm code{font-size:.9em;padding:.1em .25em;white-space:break-spaces}.markdown-body-sm pre{margin:.3em 0;padding:.6em .85em;font-size:.9em;border-radius:6px;background:#0f172a;border:1px solid #334155;color:#e2e8f0;overflow-x:auto;-webkit-overflow-scrolling:touch;word-break:normal;overflow-wrap:normal;white-space:pre;scrollbar-width:thin}.markdown-body-sm pre code{background:none;padding:0;font-size:inherit;color:inherit;border-radius:0;white-space:inherit;display:block;min-width:-moz-max-content;min-width:max-content}.dark .markdown-body-sm pre{background:#111827;border-color:#374151}@keyframes messageIn{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.message-animate-in{animation:messageIn .2s ease-out both}.placeholder\:text-gray-400::-moz-placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-gray-400::placeholder{--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.placeholder\:text-primary-100::-moz-placeholder{--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.placeholder\:text-primary-100::placeholder{--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.last\:mb-0:last-child{margin-bottom:0}.last\:border-b-0:last-child{border-bottom-width:0px}.hover\:border-primary-200:hover{--tw-border-opacity: 1;border-color:rgb(221 214 254 / var(--tw-border-opacity, 1))}.hover\:border-primary-500:hover{--tw-border-opacity: 1;border-color:rgb(139 92 246 / var(--tw-border-opacity, 1))}.hover\:bg-blue-100:hover{--tw-bg-opacity: 1;background-color:rgb(219 234 254 / var(--tw-bg-opacity, 1))}.hover\:bg-blue-700:hover{--tw-bg-opacity: 1;background-color:rgb(29 78 216 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-100:hover{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.hover\:bg-gray-50:hover{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity, 1))}.hover\:bg-green-50:hover{--tw-bg-opacity: 1;background-color:rgb(240 253 244 / var(--tw-bg-opacity, 1))}.hover\:bg-indigo-100\/60:hover{background-color:#e0e7ff99}.hover\:bg-primary-100\/50:hover{background-color:#ede9fe80}.hover\:bg-primary-100\/60:hover{background-color:#ede9fe99}.hover\:bg-primary-50:hover{--tw-bg-opacity: 1;background-color:rgb(245 243 255 / var(--tw-bg-opacity, 1))}.hover\:bg-primary-700:hover{--tw-bg-opacity: 1;background-color:rgb(109 40 217 / var(--tw-bg-opacity, 1))}.hover\:bg-purple-50:hover{--tw-bg-opacity: 1;background-color:rgb(250 245 255 / var(--tw-bg-opacity, 1))}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-red-600:hover{--tw-bg-opacity: 1;background-color:rgb(220 38 38 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/15:hover{background-color:#ffffff26}.hover\:text-gray-600:hover{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.hover\:text-gray-700:hover{--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.hover\:text-gray-900:hover{--tw-text-opacity: 1;color:rgb(17 24 39 / var(--tw-text-opacity, 1))}.hover\:text-primary-600:hover{--tw-text-opacity: 1;color:rgb(124 58 237 / var(--tw-text-opacity, 1))}.hover\:text-primary-900:hover{--tw-text-opacity: 1;color:rgb(76 29 149 / var(--tw-text-opacity, 1))}.hover\:text-red-400:hover{--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-white:hover{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.hover\:decoration-current:hover{text-decoration-color:currentColor}.hover\:opacity-100:hover{opacity:1}.focus\:border-blue-400:focus{--tw-border-opacity: 1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.focus\:border-primary-400:focus{--tw-border-opacity: 1;border-color:rgb(167 139 250 / var(--tw-border-opacity, 1))}.focus\:border-primary-500:focus{--tw-border-opacity: 1;border-color:rgb(139 92 246 / var(--tw-border-opacity, 1))}.focus\:border-white\/60:focus{border-color:#fff9}.focus\:bg-white:focus{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-\[3px\]:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-blue-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(219 234 254 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-100:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(237 233 254 / var(--tw-ring-opacity, 1))}.focus\:ring-primary-500\/40:focus{--tw-ring-color: rgb(139 92 246 / .4)}.focus\:ring-white\/20:focus{--tw-ring-color: rgb(255 255 255 / .2)}.active\:scale-95:active{--tw-scale-x: .95;--tw-scale-y: .95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-\[0\.98\]:active{--tw-scale-x: .98;--tw-scale-y: .98;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:scale-\[0\.99\]:active{--tw-scale-x: .99;--tw-scale-y: .99;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-gray-100:active{--tw-bg-opacity: 1;background-color:rgb(243 244 246 / var(--tw-bg-opacity, 1))}.active\:bg-green-100:active{--tw-bg-opacity: 1;background-color:rgb(220 252 231 / var(--tw-bg-opacity, 1))}.active\:bg-purple-100:active{--tw-bg-opacity: 1;background-color:rgb(243 232 255 / var(--tw-bg-opacity, 1))}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:opacity-60:disabled{opacity:.6}.disabled\:opacity-70:disabled{opacity:.7}.disabled\:hover\:bg-transparent:hover:disabled{background-color:transparent}.group:hover .group-hover\:opacity-100{opacity:1}.dark\:divide-gray-700:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(55 65 81 / var(--tw-divide-opacity, 1))}.dark\:divide-gray-800:is(.dark *)>:not([hidden])~:not([hidden]){--tw-divide-opacity: 1;border-color:rgb(31 41 55 / var(--tw-divide-opacity, 1))}.dark\:border-amber-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(146 64 14 / var(--tw-border-opacity, 1))}.dark\:border-amber-800\/40:is(.dark *){border-color:#92400e66}.dark\:border-amber-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(120 53 15 / var(--tw-border-opacity, 1))}.dark\:border-blue-600:is(.dark *){--tw-border-opacity: 1;border-color:rgb(37 99 235 / var(--tw-border-opacity, 1))}.dark\:border-blue-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 64 175 / var(--tw-border-opacity, 1))}.dark\:border-blue-800\/40:is(.dark *){border-color:#1e40af66}.dark\:border-blue-800\/50:is(.dark *){border-color:#1e40af80}.dark\:border-blue-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(30 58 138 / var(--tw-border-opacity, 1))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity: 1;border-color:rgb(55 65 81 / var(--tw-border-opacity, 1))}.dark\:border-gray-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(31 41 55 / var(--tw-border-opacity, 1))}.dark\:border-gray-800\/40:is(.dark *){border-color:#1f293766}.dark\:border-gray-800\/80:is(.dark *){border-color:#1f2937cc}.dark\:border-gray-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(17 24 39 / var(--tw-border-opacity, 1))}.dark\:border-green-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(22 101 52 / var(--tw-border-opacity, 1))}.dark\:border-green-800\/40:is(.dark *){border-color:#16653466}.dark\:border-green-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(20 83 45 / var(--tw-border-opacity, 1))}.dark\:border-indigo-800\/40:is(.dark *){border-color:#3730a366}.dark\:border-orange-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(154 52 18 / var(--tw-border-opacity, 1))}.dark\:border-orange-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(124 45 18 / var(--tw-border-opacity, 1))}.dark\:border-primary-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(91 33 182 / var(--tw-border-opacity, 1))}.dark\:border-primary-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(76 29 149 / var(--tw-border-opacity, 1))}.dark\:border-purple-800\/40:is(.dark *){border-color:#6b21a866}.dark\:border-red-800:is(.dark *){--tw-border-opacity: 1;border-color:rgb(153 27 27 / var(--tw-border-opacity, 1))}.dark\:border-red-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(127 29 29 / var(--tw-border-opacity, 1))}.dark\:border-red-950:is(.dark *){--tw-border-opacity: 1;border-color:rgb(69 10 10 / var(--tw-border-opacity, 1))}.dark\:border-violet-900:is(.dark *){--tw-border-opacity: 1;border-color:rgb(76 29 149 / var(--tw-border-opacity, 1))}.dark\:bg-amber-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(120 53 15 / var(--tw-bg-opacity, 1))}.dark\:bg-amber-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(69 26 3 / var(--tw-bg-opacity, 1))}.dark\:bg-amber-950\/40:is(.dark *){background-color:#451a0366}.dark\:bg-amber-950\/50:is(.dark *){background-color:#451a0380}.dark\:bg-blue-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-900\/60:is(.dark *){background-color:#1e3a8a99}.dark\:bg-blue-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(23 37 84 / var(--tw-bg-opacity, 1))}.dark\:bg-blue-950\/40:is(.dark *){background-color:#17255466}.dark\:bg-blue-950\/50:is(.dark *){background-color:#17255480}.dark\:bg-cyan-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(8 51 68 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-600:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(75 85 99 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-800\/80:is(.dark *){background-color:#1f2937cc}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-900\/50:is(.dark *){background-color:#11182780}.dark\:bg-gray-900\/70:is(.dark *){background-color:#111827b3}.dark\:bg-gray-900\/80:is(.dark *){background-color:#111827cc}.dark\:bg-gray-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(3 7 18 / var(--tw-bg-opacity, 1))}.dark\:bg-gray-950\/50:is(.dark *){background-color:#03071280}.dark\:bg-gray-950\/80:is(.dark *){background-color:#030712cc}.dark\:bg-gray-950\/95:is(.dark *){background-color:#030712f2}.dark\:bg-green-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:bg-green-950\/35:is(.dark *){background-color:#052e1659}.dark\:bg-green-950\/40:is(.dark *){background-color:#052e1666}.dark\:bg-green-950\/50:is(.dark *){background-color:#052e1680}.dark\:bg-indigo-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 27 75 / var(--tw-bg-opacity, 1))}.dark\:bg-indigo-950\/40:is(.dark *){background-color:#1e1b4b66}.dark\:bg-orange-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(67 20 7 / var(--tw-bg-opacity, 1))}.dark\:bg-orange-950\/50:is(.dark *){background-color:#43140780}.dark\:bg-primary-400:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(167 139 250 / var(--tw-bg-opacity, 1))}.dark\:bg-primary-900:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(76 29 149 / var(--tw-bg-opacity, 1))}.dark\:bg-purple-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(59 7 100 / var(--tw-bg-opacity, 1))}.dark\:bg-purple-950\/50:is(.dark *){background-color:#3b076480}.dark\:bg-red-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(69 10 10 / var(--tw-bg-opacity, 1))}.dark\:bg-red-950\/30:is(.dark *){background-color:#450a0a4d}.dark\:bg-red-950\/35:is(.dark *){background-color:#450a0a59}.dark\:bg-red-950\/40:is(.dark *){background-color:#450a0a66}.dark\:bg-red-950\/50:is(.dark *){background-color:#450a0a80}.dark\:bg-violet-950\/40:is(.dark *){background-color:#2e106566}.dark\:bg-yellow-950:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(66 32 6 / var(--tw-bg-opacity, 1))}.dark\:text-amber-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 211 77 / var(--tw-text-opacity, 1))}.dark\:text-amber-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity, 1))}.dark\:text-amber-400\/70:is(.dark *){color:#fbbf24b3}.dark\:text-blue-200:is(.dark *){--tw-text-opacity: 1;color:rgb(191 219 254 / var(--tw-text-opacity, 1))}.dark\:text-blue-300:is(.dark *){--tw-text-opacity: 1;color:rgb(147 197 253 / var(--tw-text-opacity, 1))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity: 1;color:rgb(96 165 250 / var(--tw-text-opacity, 1))}.dark\:text-blue-400\/70:is(.dark *){color:#60a5fab3}.dark\:text-cyan-300:is(.dark *){--tw-text-opacity: 1;color:rgb(103 232 249 / var(--tw-text-opacity, 1))}.dark\:text-emerald-400:is(.dark *){--tw-text-opacity: 1;color:rgb(52 211 153 / var(--tw-text-opacity, 1))}.dark\:text-gray-100:is(.dark *){--tw-text-opacity: 1;color:rgb(243 244 246 / var(--tw-text-opacity, 1))}.dark\:text-gray-200:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity: 1;color:rgb(156 163 175 / var(--tw-text-opacity, 1))}.dark\:text-gray-400\/70:is(.dark *){color:#9ca3afb3}.dark\:text-gray-500:is(.dark *){--tw-text-opacity: 1;color:rgb(107 114 128 / var(--tw-text-opacity, 1))}.dark\:text-gray-600:is(.dark *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:text-gray-700:is(.dark *){--tw-text-opacity: 1;color:rgb(55 65 81 / var(--tw-text-opacity, 1))}.dark\:text-green-100:is(.dark *){--tw-text-opacity: 1;color:rgb(220 252 231 / var(--tw-text-opacity, 1))}.dark\:text-green-200:is(.dark *){--tw-text-opacity: 1;color:rgb(187 247 208 / var(--tw-text-opacity, 1))}.dark\:text-green-300:is(.dark *){--tw-text-opacity: 1;color:rgb(134 239 172 / var(--tw-text-opacity, 1))}.dark\:text-green-400:is(.dark *){--tw-text-opacity: 1;color:rgb(74 222 128 / var(--tw-text-opacity, 1))}.dark\:text-green-400\/70:is(.dark *){color:#4ade80b3}.dark\:text-indigo-200\/80:is(.dark *){color:#c7d2fecc}.dark\:text-indigo-300:is(.dark *){--tw-text-opacity: 1;color:rgb(165 180 252 / var(--tw-text-opacity, 1))}.dark\:text-indigo-400:is(.dark *){--tw-text-opacity: 1;color:rgb(129 140 248 / var(--tw-text-opacity, 1))}.dark\:text-indigo-500:is(.dark *){--tw-text-opacity: 1;color:rgb(99 102 241 / var(--tw-text-opacity, 1))}.dark\:text-orange-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 215 170 / var(--tw-text-opacity, 1))}.dark\:text-orange-300:is(.dark *){--tw-text-opacity: 1;color:rgb(253 186 116 / var(--tw-text-opacity, 1))}.dark\:text-orange-400:is(.dark *){--tw-text-opacity: 1;color:rgb(251 146 60 / var(--tw-text-opacity, 1))}.dark\:text-pink-400:is(.dark *){--tw-text-opacity: 1;color:rgb(244 114 182 / var(--tw-text-opacity, 1))}.dark\:text-primary-100:is(.dark *){--tw-text-opacity: 1;color:rgb(237 233 254 / var(--tw-text-opacity, 1))}.dark\:text-primary-300:is(.dark *){--tw-text-opacity: 1;color:rgb(196 181 253 / var(--tw-text-opacity, 1))}.dark\:text-primary-400:is(.dark *){--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.dark\:text-purple-300:is(.dark *){--tw-text-opacity: 1;color:rgb(216 180 254 / var(--tw-text-opacity, 1))}.dark\:text-purple-400:is(.dark *){--tw-text-opacity: 1;color:rgb(192 132 252 / var(--tw-text-opacity, 1))}.dark\:text-purple-400\/70:is(.dark *){color:#c084fcb3}.dark\:text-red-100:is(.dark *){--tw-text-opacity: 1;color:rgb(254 226 226 / var(--tw-text-opacity, 1))}.dark\:text-red-200:is(.dark *){--tw-text-opacity: 1;color:rgb(254 202 202 / var(--tw-text-opacity, 1))}.dark\:text-red-300:is(.dark *){--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.dark\:text-red-400:is(.dark *){--tw-text-opacity: 1;color:rgb(248 113 113 / var(--tw-text-opacity, 1))}.dark\:text-sky-400:is(.dark *){--tw-text-opacity: 1;color:rgb(56 189 248 / var(--tw-text-opacity, 1))}.dark\:text-slate-300:is(.dark *){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity, 1))}.dark\:text-violet-300:is(.dark *){--tw-text-opacity: 1;color:rgb(196 181 253 / var(--tw-text-opacity, 1))}.dark\:text-yellow-400:is(.dark *){--tw-text-opacity: 1;color:rgb(250 204 21 / var(--tw-text-opacity, 1))}.dark\:shadow-\[0_-1px_8px_rgba\(0\,0\,0\,0\.2\)\]:is(.dark *){--tw-shadow: 0 -1px 8px rgba(0,0,0,.2);--tw-shadow-colored: 0 -1px 8px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.dark\:shadow-primary-900:is(.dark *){--tw-shadow-color: #4c1d95;--tw-shadow: var(--tw-shadow-colored)}.dark\:placeholder\:text-gray-600:is(.dark *)::-moz-placeholder{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:placeholder\:text-gray-600:is(.dark *)::placeholder{--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}.dark\:hover\:border-primary-800:hover:is(.dark *){--tw-border-opacity: 1;border-color:rgb(91 33 182 / var(--tw-border-opacity, 1))}.dark\:hover\:bg-blue-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(30 58 138 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-800:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-gray-900:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(17 24 39 / var(--tw-bg-opacity, 1))}.dark\:hover\:bg-green-950\/50:hover:is(.dark *){background-color:#052e1680}.dark\:hover\:bg-indigo-950\/60:hover:is(.dark *){background-color:#1e1b4b99}.dark\:hover\:bg-purple-950\/50:hover:is(.dark *){background-color:#3b076480}.dark\:hover\:bg-red-950:hover:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(69 10 10 / var(--tw-bg-opacity, 1))}.dark\:hover\:text-gray-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}.dark\:hover\:text-gray-300:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(209 213 219 / var(--tw-text-opacity, 1))}.dark\:hover\:text-primary-200:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(221 214 254 / var(--tw-text-opacity, 1))}.dark\:hover\:text-primary-400:hover:is(.dark *){--tw-text-opacity: 1;color:rgb(167 139 250 / var(--tw-text-opacity, 1))}.dark\:focus\:bg-gray-800:focus:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(31 41 55 / var(--tw-bg-opacity, 1))}.dark\:focus\:ring-blue-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(30 58 138 / var(--tw-ring-opacity, 1))}.dark\:focus\:ring-primary-900:focus:is(.dark *){--tw-ring-opacity: 1;--tw-ring-color: rgb(76 29 149 / var(--tw-ring-opacity, 1))}.dark\:active\:bg-gray-700:active:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(55 65 81 / var(--tw-bg-opacity, 1))}.dark\:active\:bg-green-950:active:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(5 46 22 / var(--tw-bg-opacity, 1))}.dark\:active\:bg-purple-950:active:is(.dark *){--tw-bg-opacity: 1;background-color:rgb(59 7 100 / var(--tw-bg-opacity, 1))}@media (min-width: 640px){.sm\:opacity-0{opacity:0}.group:hover .sm\:group-hover\:opacity-100{opacity:1}}