zen-gitsync 2.16.29 → 2.16.30

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 (26) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/src/ui/public/assets/{AgentView-BPYoiHHQ.js → AgentView-Cp9Xgs_B.js} +1 -1
  4. package/src/ui/public/assets/{AppVersionBadge-AglUMXsb.js → AppVersionBadge-DcgY2eSV.js} +2 -2
  5. package/src/ui/public/assets/{BranchSelector--j-mhugr.js → BranchSelector-Bc_nwnaf.js} +1 -1
  6. package/src/ui/public/assets/{CommitForm-BEDpVfax.js → CommitForm-DmTaYwYF.js} +1 -1
  7. package/src/ui/public/assets/{CommonDialog-DRv7kVO-.js → CommonDialog-Brk9ZIx_.js} +1 -1
  8. package/src/ui/public/assets/EditorView-BXcPstel.js +1 -0
  9. package/src/ui/public/assets/{FlowExecutionViewer-DCtEz-v3.js → FlowExecutionViewer-DT4WJ3H6.js} +1 -1
  10. package/src/ui/public/assets/{FlowOrchestrationWorkspace-BzwzDZHa.js → FlowOrchestrationWorkspace-kzpWFreh.js} +1 -1
  11. package/src/ui/public/assets/{LogList-CGWd23XS.js → LogList-FyPUAVK6.js} +4 -4
  12. package/src/ui/public/assets/{MindmapView-Bk_OuB2D.js → MindmapView-qul1kc2j.js} +1 -1
  13. package/src/ui/public/assets/{MonitorView-DO3klU0a.js → MonitorView-CJO-jTlG.js} +1 -1
  14. package/src/ui/public/assets/{ProjectStartupButton-BnxH4ePw.js → ProjectStartupButton-oZJIaL1F.js} +1 -1
  15. package/src/ui/public/assets/{RemoteRepoCard-yrCYwbwI.js → RemoteRepoCard-Cyz5QDia.js} +1 -1
  16. package/src/ui/public/assets/{SourceMapView-ByRGqDEd.js → SourceMapView-BXHG1JE_.js} +1 -1
  17. package/src/ui/public/assets/{SvgIcon-DrzoiBjT.js → SvgIcon-DjCKMwo1.js} +1 -1
  18. package/src/ui/public/assets/{UserInputNode-DF0GnNcS.js → UserInputNode-lSHdQ7nQ.js} +1 -1
  19. package/src/ui/public/assets/{WorkbenchView-CEoj3Q4T.js → WorkbenchView-BSupsbko.js} +1 -1
  20. package/src/ui/public/assets/{_plugin-vue_export-helper-835DU6GA.js → _plugin-vue_export-helper-DExUTKTW.js} +4 -2
  21. package/src/ui/public/assets/{configStore-avjeYt7I.js → configStore-BFc69UjA.js} +1 -1
  22. package/src/ui/public/assets/{index-CNYOMYpP.js → index-DX3FHIo4.js} +30 -22
  23. package/src/ui/public/assets/index-zmReBTKj.css +1 -0
  24. package/src/ui/public/index.html +6 -6
  25. package/src/ui/public/assets/EditorView-DxTtUCHU.js +0 -1
  26. package/src/ui/public/assets/index-DnD8_s3s.css +0 -1
@@ -10,18 +10,18 @@
10
10
  <link rel="preconnect" href="https://fonts.googleapis.com" />
11
11
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
12
  <link href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet" />
13
- <script type="module" crossorigin src="/assets/index-CNYOMYpP.js"></script>
13
+ <script type="module" crossorigin src="/assets/index-DX3FHIo4.js"></script>
14
14
  <link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-BM3Ffeng.js">
15
15
  <link rel="modulepreload" crossorigin href="/assets/monaco-43aputPh.js">
16
16
  <link rel="modulepreload" crossorigin href="/assets/element-plus--ayTjGvF.js">
17
17
  <link rel="modulepreload" crossorigin href="/assets/vendor-Dan_vdyX.js">
18
- <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-835DU6GA.js">
18
+ <link rel="modulepreload" crossorigin href="/assets/_plugin-vue_export-helper-DExUTKTW.js">
19
19
  <link rel="modulepreload" crossorigin href="/assets/socket-io-BZIzo1US.js">
20
20
  <link rel="modulepreload" crossorigin href="/assets/vue-flow-CUR1dbQb.js">
21
21
  <link rel="modulepreload" crossorigin href="/assets/flow-mindmap-BcBVGR99.js">
22
- <link rel="modulepreload" crossorigin href="/assets/SvgIcon-DrzoiBjT.js">
23
- <link rel="modulepreload" crossorigin href="/assets/CommonDialog-DRv7kVO-.js">
24
- <link rel="modulepreload" crossorigin href="/assets/configStore-avjeYt7I.js">
22
+ <link rel="modulepreload" crossorigin href="/assets/SvgIcon-DjCKMwo1.js">
23
+ <link rel="modulepreload" crossorigin href="/assets/CommonDialog-Brk9ZIx_.js">
24
+ <link rel="modulepreload" crossorigin href="/assets/configStore-BFc69UjA.js">
25
25
  <link rel="modulepreload" crossorigin href="/assets/toolsStore-B2zt5KJ0.js">
26
26
  <link rel="stylesheet" crossorigin href="/assets/monaco-B2lPvkrc.css">
27
27
  <link rel="stylesheet" crossorigin href="/assets/element-plus-D3Dn7nX0.css">
@@ -30,7 +30,7 @@
30
30
  <link rel="stylesheet" crossorigin href="/assets/flow-mindmap-DCVd8Ppe.css">
31
31
  <link rel="stylesheet" crossorigin href="/assets/SvgIcon-CDNsk4-Q.css">
32
32
  <link rel="stylesheet" crossorigin href="/assets/CommonDialog-ChSKsEz2.css">
33
- <link rel="stylesheet" crossorigin href="/assets/index-DnD8_s3s.css">
33
+ <link rel="stylesheet" crossorigin href="/assets/index-zmReBTKj.css">
34
34
  </head>
35
35
  <body>
36
36
  <div id="app"></div>
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-BM3Ffeng.js";import{$n as e,Cn as t,Dn as n,G as r,Ln as i,Pn as a,Qn as o,Tn as s,Un as c,Vn as l,Xn as u,_n as d,bn as f,cn as p,dn as m,fn as h,gn as g,gr as _,i as v,lr as y,mn as b,un as x,ur as ee,vn as te,vr as S,wn as C,yn as w,yr as T,zn as ne}from"./element-plus--ayTjGvF.js";import{n as E,t as D}from"./_plugin-vue_export-helper-835DU6GA.js";import{t as re}from"./SvgIcon-DrzoiBjT.js";import{t as ie}from"./configStore-avjeYt7I.js";import{Bt as ae,It as oe,Lt as se,Rt as ce,gt as le,ht as ue,zt as de}from"./monaco-43aputPh.js";import{n as fe,t as pe}from"./flow-mindmap-BcBVGR99.js";import{f as me,g as he,h as ge,m as _e,p as ve,r as ye}from"./index-CNYOMYpP.js";function be(e){return{ts:`typescript`,tsx:`typescript`,js:`javascript`,mjs:`javascript`,cjs:`javascript`,jsx:`javascript`,vue:`html`,html:`html`,htm:`html`,css:`css`,scss:`scss`,less:`less`,json:`json`,jsonc:`json`,md:`markdown`,markdown:`markdown`,yaml:`yaml`,yml:`yaml`,toml:`ini`,xml:`xml`,svg:`xml`,sh:`shell`,bash:`shell`,zsh:`shell`,fish:`shell`,ps1:`powershell`,py:`python`,go:`go`,rs:`rust`,java:`java`,kt:`kotlin`,rb:`ruby`,php:`php`,c:`c`,cpp:`cpp`,h:`cpp`,cs:`csharp`,sql:`sql`,graphql:`graphql`,gql:`graphql`,txt:`plaintext`,log:`plaintext`,ini:`ini`,env:`ini`,gitignore:`ini`,dockerfile:`dockerfile`}[e.toLowerCase()]??`plaintext`}var xe=n({__name:`MindmapPreview`,props:{content:{type:String,required:!0}},setup(e,{expose:t}){t();let n=e,r={props:n,data:g(()=>pe(n.content||``,`未命名文档`)),get MindMap(){return fe}};return Object.defineProperty(r,`__isScriptSetup`,{enumerable:!1,value:!0}),r}}),Se={class:`mindmap-preview`},Ce={class:`mindmap-preview-canvas`};function O(e,t,n,r,i,a){return l(),f(`div`,Se,[t[0]||=d(`div`,{class:`mindmap-preview-header`},[d(`span`,{class:`mindmap-preview-title`},`整篇导图`),d(`span`,{class:`mindmap-preview-hint`},`基于整篇 Markdown 自动生成 · 阅读模式`)],-1),d(`div`,Ce,[s(r.MindMap,{data:r.data,"preview-mode":``},null,8,[`data`])])])}var we=D(xe,[[`render`,O],[`__scopeId`,`data-v-3969a8bf`],[`__file`,`D:/xz_workspace/github_workspace/zen-gitsync/src/ui/client/src/components/MindmapPreview.vue`]]),Te=15e3,Ee=n({__name:`EditorView`,props:{pendingFilePath:{type:[String,null],required:!1}},setup(e,{expose:t}){t(),self.MonacoEnvironment={getWorker(e,t){return t===`json`?new de:t===`css`||t===`scss`||t===`less`?new ce:t===`html`||t===`handlebars`||t===`razor`?new se:t===`typescript`||t===`javascript`?new oe:new ae}};let n=e,o=ie(),s=ye(),c=y([]),l=y(!1),d=y(``),f=y(``),p=null;function m(){d.value=``,f.value=``,p&&=(clearTimeout(p),null)}u(d,e=>{p&&clearTimeout(p),p=setTimeout(()=>{f.value=e,p=null},180)}),i(()=>{p&&clearTimeout(p),b()});let h=null;function _(){b(),h=setInterval(()=>{document.hidden||o.currentDirectory&&(d.value.trim()||w())},Te)}function b(){h&&=(clearInterval(h),null)}u(()=>o.currentDirectory,()=>{_()});async function x(e,t=0){let n=await(await fetch(`/api/browse_directory?path=${encodeURIComponent(e)}`)).json();return n.success?n.items.map(e=>({...e,depth:t,expanded:!1,loading:!1,children:(e.type,void 0)})):[]}async function te(){let e=o.currentDirectory;if(e){l.value=!0;try{c.value=await x(e,0)}finally{l.value=!1}}}function S(e,t=new Set){for(let n of e)n.type===`directory`&&n.expanded&&(t.add(n.path),n.children&&S(n.children,t));return t}async function C(e,t){for(let n of e)n.type===`directory`&&t.has(n.path)&&(n.children||=await x(n.path,n.depth+1),n.expanded=!0,await C(n.children,t))}async function w(){let e=o.currentDirectory;if(!e)return;let t=S(c.value);l.value=!0;try{c.value=await x(e,0),t.size>0&&await C(c.value,t)}finally{l.value=!1}}async function T(e){if(e.type===`directory`)if(e.expanded)e.expanded=!1;else{if(!e.children){e.loading=!0;try{e.children=await x(e.path,e.depth+1)}finally{e.loading=!1}}e.expanded=!0}}function D(e){let t=[];for(let n of e)t.push(n),n.type===`directory`&&n.expanded&&n.children&&t.push(...D(n.children));return t}let fe=g(()=>f.value.trim().toLowerCase());function pe(e,t){if(!t)return e;let n=[];for(let r of e){let e=r.children?pe(r.children,t):[],i=r.name.toLowerCase().includes(t);r.type===`directory`?(i||e.length>0)&&(r.expanded=!0,r.children!==void 0&&(r.children=e),n.push(r)):i&&n.push(r)}return n}let xe=g(()=>pe(c.value,fe.value)),Se=g(()=>fe.value.length>0&&xe.value.length===0);function Ce(e){let t=f.value.trim();if(!t)return[{text:e,hit:!1}];let n=e.toLowerCase(),r=t.toLowerCase(),i=[],a=0,o=n.indexOf(r,a);for(;o!==-1;)o>a&&i.push({text:e.slice(a,o),hit:!1}),i.push({text:e.slice(o,o+r.length),hit:!0}),a=o+r.length,o=n.indexOf(r,a);return a<e.length&&i.push({text:e.slice(a),hit:!1}),i}let O=y(null);function Ee(){let e=O.value;e&&(e.focus(),e.select())}function De(){d.value?(m(),O.value?.focus()):(O.value?.blur(),N.value?.focus())}let k=y([]),A=y(null),j=y(null);async function Oe(e){if(j.value=e,e.type!==`file`){T(e);return}let t=k.value.find(t=>t.path===e.path);if(console.log(`[debug-open-in-editor] EditorView openFile existing tab check:`,{path:e.path,found:!!t,tabsCount:k.value.length}),t){A.value=e.path,a(()=>F());return}let n=e.name.split(`.`).pop()||``;if(st.has(n.toLowerCase())){let t={path:e.path,name:e.name,content:``,originalContent:``,isDirty:!1,language:`plaintext`};k.value.push(t),A.value=e.path,J.value=!0;return}try{let t=await fetch(`/api/editor/file?path=${encodeURIComponent(e.path)}`),r=await t.json();if(console.log(`[debug-open-in-editor] EditorView fetch /api/editor/file response:`,{path:e.path,status:t.status,data:r}),!r.success){v.error(`${E(`@EDITOR:打开文件失败: `)}${r.error}`);return}let i=be(n),a={path:e.path,name:e.name,content:r.content,originalContent:r.content,isDirty:!1,language:i};console.log(`[debug-open-in-editor] EditorView pushing tab:`,{path:a.path,name:a.name,contentLen:a.content.length,lang:a.language}),k.value.push(a),A.value=e.path,console.log(`[debug-open-in-editor] EditorView tabs after push:`,k.value.length,`activeTabPath=`,A.value)}catch(e){console.log(`[debug-open-in-editor] EditorView fetch threw:`,e),v.error(`${E(`@EDITOR:打开文件失败: `)}${e.message}`)}}u(()=>n.pendingFilePath,async e=>{if(console.log(`[debug-open-in-editor] EditorView watcher fired, filePath=`,e),!e)return;await a();let t=e.split(/[\\/]/).pop()||e;console.log(`[debug-open-in-editor] EditorView calling openFile, name=`,t,`path=`,e),await Oe({name:t,path:e,type:`file`,depth:0}),console.log(`[debug-open-in-editor] EditorView openFile returned`)},{immediate:!0});function ke(e,t){t.stopPropagation();let n=k.value.findIndex(t=>t.path===e);n!==-1&&(k.value[n].isDirty&&!confirm(E(`@EDITOR:文件未保存,确认关闭?`))||(k.value.splice(n,1),A.value===e&&(A.value=k.value[Math.min(n,k.value.length-1)]?.path??null)))}let M=()=>k.value.find(e=>e.path===A.value)??null,Ae=y(null),N=ee(null),P=new Map;function je(e){let t=P.get(e.path);return(!t||t.isDisposed())&&(t=le.createModel(e.content,e.language,ue.file(e.path)),P.set(e.path,t)),t}function Me(){if(!Ae.value)return;let e=document.documentElement.getAttribute(`data-theme`)===`dark`;N.value=le.create(Ae.value,{theme:e?`vs-dark`:`vs`,fontSize:13,lineHeight:20,fontFamily:`'JetBrains Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace`,minimap:{enabled:!0},scrollBeyondLastLine:!1,renderWhitespace:`selection`,automaticLayout:!0,tabSize:2,wordWrap:`off`,smoothScrolling:!0,cursorBlinking:`smooth`,padding:{top:8,bottom:8},editContext:!1}),N.value.onDidChangeModelContent(()=>{let e=M();if(!e)return;let t=N.value.getValue();e.content=t,e.isDirty=t!==e.originalContent}),N.value.onDidBlurEditorText(()=>{o.ui.editorAutoSave&&M()?.isDirty&&Pe(!1),requestAnimationFrame(()=>{if(!R.value||R.value.offsetParent===null)return;let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||F()})})}u(A,e=>{if(!N.value||!e)return;let t=k.value.find(t=>t.path===e);if(!t)return;let n=je(t);N.value.setModel(n),a(()=>F())});function F(){if(!N.value)return;N.value.focus();let e=document.querySelector(`.monaco-editor .native-edit-context`);e&&document.activeElement!==e&&requestAnimationFrame(()=>e.focus?.())}u(()=>k.value.filter(e=>e.isDirty).length,e=>{s.setDirtyCount(e)},{immediate:!0}),i(()=>s.setDirtyCount(0)),_e(()=>{let e=document.documentElement.getAttribute(`data-theme`)===`dark`;le.setTheme(e?`vs-dark`:`vs`)});let I=null;function Ne(){if(I||!R.value)return;let e=[R.value],t=R.value.parentElement;for(;t;){if(t.classList.contains(`view-pane`)||t.classList.contains(`editor-pane`)){e.push(t);break}t=t.parentElement}I=new MutationObserver(()=>{R.value&&R.value.offsetParent!==null&&A.value&&N.value&&requestAnimationFrame(()=>{let e=document.activeElement;e&&(e.tagName===`INPUT`||e.tagName===`TEXTAREA`||e.isContentEditable||e.classList?.contains(`native-edit-context`)||e.classList?.contains(`monaco-editor`))||F()})});let n=I;e.forEach(e=>n.observe(e,{attributes:!0,attributeFilter:[`style`,`class`,`hidden`]}))}ne(async()=>{Me(),await te(),Ne(),_(),A.value&&a(()=>F())}),i(()=>{I?.disconnect(),I=null,N.value?.dispose(),P.forEach(e=>e.dispose()),P.clear()});async function Pe(e=!1){let t=M();if(t)try{let n=await(await fetch(`/api/editor/file`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:t.path,content:t.content})})).json();if(!n.success){v.error(`${E(`@EDITOR:保存失败: `)}${n.error}`);return}t.originalContent=t.content,t.isDirty=!1,e||v.success(E(`@EDITOR:已保存`))}catch(e){v.error(`${E(`@EDITOR:保存失败: `)}${e.message}`)}}function L(e){let t=e.ctrlKey||e.metaKey;if(t&&e.key.toLowerCase()===`f`){e.preventDefault(),Ee();return}t&&e.key===`s`&&(e.preventDefault(),Pe())}ne(()=>window.addEventListener(`keydown`,L)),i(()=>window.removeEventListener(`keydown`,L));let R=y(null),Fe=y(220),z=!1,B=0,V=0;function Ie(e){z=!0,B=e.clientX,V=Fe.value,document.addEventListener(`mousemove`,Le),document.addEventListener(`mouseup`,Re),e.preventDefault()}function Le(e){if(!z)return;let t=e.clientX-B;Fe.value=Math.max(140,Math.min(400,V+t))}function Re(){z=!1,document.removeEventListener(`mousemove`,Le),document.removeEventListener(`mouseup`,Re)}function ze(e){return e.type===`directory`?he(e.name):ge(e.name)}let H=y(null),U=y(null),W=y(null),Be=y(null);function G(){let e=j.value;return e?e.type===`directory`?{parentPath:e.path,afterNode:e,depth:e.depth+1}:{parentPath:e.path.includes(`/`)||e.path.includes(`\\`)?e.path.replace(/[\\/][^\\/]+$/,``):o.currentDirectory??``,afterNode:e,depth:e.depth}:{parentPath:o.currentDirectory??``,afterNode:null,depth:0}}async function Ve(){let e=G();j.value?.type===`directory`&&!j.value.expanded&&await T(j.value),H.value={...e,kind:`file`,value:``},await a(),W.value?.focus()}async function He(){let e=G();j.value?.type===`directory`&&!j.value.expanded&&await T(j.value),H.value={...e,kind:`directory`,value:``},await a(),W.value?.focus()}function Ue(){H.value=null}async function We(){let e=H.value;if(!e||!e.value.trim()){H.value=null;return}let t=e.value.trim(),n=e.parentPath.replace(/[/\\]$/,``)+`/`+t;if(e.kind===`file`){let e=await(await fetch(`/api/editor/file`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){v.error(e.error);return}v.success(E(`@EDITOR:创建成功`))}else{let e=await(await fetch(`/api/editor/directory`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:n})})).json();if(!e.success){v.error(e.error);return}v.success(E(`@EDITOR:创建成功`))}H.value=null,await w()}function Ge(e){e.key===`Enter`&&(e.preventDefault(),We()),e.key===`Escape`&&(e.preventDefault(),Ue())}let K=y(null),Ke=y(null);function qe(e,t){e.preventDefault(),K.value={x:e.clientX,y:e.clientY,node:t}}function q(){K.value=null}async function Je(){let e=K.value?.node;q(),e&&(j.value=e),e?.type===`directory`&&!e.expanded&&await T(e),H.value={...G(),kind:`file`,value:``},await a(),W.value?.focus()}async function Ye(){let e=K.value?.node;q(),e&&(j.value=e),e?.type===`directory`&&!e.expanded&&await T(e),H.value={...G(),kind:`directory`,value:``},await a(),W.value?.focus()}async function Xe(){let e=K.value?.node;q(),e&&(U.value={node:e,value:e.name},await a(),Be.value?.focus(),Be.value?.select())}async function Ze(){let e=U.value;if(!e||!e.value.trim()||e.value.trim()===e.node.name){U.value=null;return}let t=e.value.trim(),n=e.node.path.replace(/[\\/][^\\/]+$/,``).replace(/[/\\]$/,``)+`/`+t,r=await(await fetch(`/api/editor/rename`,{method:`PUT`,headers:{"Content-Type":`application/json`},body:JSON.stringify({oldPath:e.node.path,newPath:n})})).json();if(!r.success){v.error(r.error);return}let i=k.value.find(t=>t.path===e.node.path);i&&(i.path=n,i.name=t,A.value===e.node.path&&(A.value=n)),U.value=null,await w()}function Qe(e){e.key===`Enter`&&(e.preventDefault(),Ze()),e.key===`Escape`&&(e.preventDefault(),U.value=null)}async function $e(){let e=K.value?.node;if(q(),!e)return;let t=e.type===`directory`?E(`@EDITOR:文件夹`):E(`@EDITOR:文件`);if(!confirm(`${E(`@EDITOR:确认删除`)} ${t} "${e.name}"?`))return;let n=await(await fetch(`/api/editor/entry?path=${encodeURIComponent(e.path)}`,{method:`DELETE`})).json();if(!n.success){v.error(n.error);return}let r=k.value.findIndex(t=>t.path===e.path);r!==-1&&(k.value.splice(r,1),A.value===e.path&&(A.value=k.value[Math.max(0,r-1)]?.path??null)),v.success(E(`@EDITOR:已删除`)),await w()}async function et(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/reveal`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||v.error(t.error)}catch(e){v.error(e?.message||String(e))}}function tt(e){let t=o.currentDirectory;if(!t)return e;let n=e=>e.replace(/\\/g,`/`).replace(/\/+$/,``),r=n(t),i=n(e);return i===r?`.`:i.startsWith(r+`/`)?i.slice(r.length+1):i}async function nt(e){try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement(`textarea`);t.value=e,t.style.position=`fixed`,t.style.left=`-9999px`,document.body.appendChild(t),t.select();let n=document.execCommand(`copy`);return document.body.removeChild(t),n}catch{return!1}}async function rt(){let e=K.value?.node;q(),e&&(await nt(e.path)?v.success(E(`@EDITOR:已复制到剪贴板`)):v.error(E(`@EDITOR:复制失败`)))}async function it(){let e=K.value?.node;q(),e&&(await nt(tt(e.path))?v.success(E(`@EDITOR:已复制到剪贴板`)):v.error(E(`@EDITOR:复制失败`)))}async function at(){let e=K.value?.node;if(q(),e)try{let t=await(await fetch(`/api/editor/open-in-vscode`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e.path})})).json();t.success||v.error(t.error||E(`@EDITOR:VSCode 未安装`))}catch(e){v.error(e?.message||String(e))}}ne(()=>document.addEventListener(`click`,q)),i(()=>document.removeEventListener(`click`,q));let ot=new Set([`md`,`html`,`htm`,`svg`]),st=new Set([`png`,`jpg`,`jpeg`,`gif`,`webp`,`ico`,`bmp`]),J=y(!1),Y=y(!1),ct=y(0),X=g(()=>k.value.find(e=>e.path===A.value)??null),lt=g(()=>X.value?.language===`plaintext`&&X.value?.content===``),Z=g(()=>(X.value?.name??``).split(`.`).pop()?.toLowerCase()??``),ut=g(()=>ot.has(Z.value)||st.has(Z.value)),dt=g(()=>((X.value?.content??``).match(/^#{1,6}\s+/gm)||[]).length),ft=g(()=>Z.value===`md`&&dt.value>0);u(A,()=>{J.value&&!ut.value&&(J.value=!1),Y.value&&!ft.value&&(Y.value=!1)});function pt(){ut.value&&(J.value||(Y.value=!1),J.value=!J.value)}function mt(){ft.value&&(Y.value||(J.value=!1),Y.value=!Y.value)}let ht=g(()=>{let e=X.value;if(!e)return``;let t=Z.value,n=document.documentElement.getAttribute(`data-theme`)===`light`?`#ffffff`:`#0d1117`;return t===`html`||t===`htm`?e.content:t===`svg`?`<!DOCTYPE html><html><head><meta charset="utf-8"><style>html,body{margin:0;padding:0;background:${n};display:flex;align-items:center;justify-content:center;min-height:100vh;}svg{max-width:100%;max-height:90vh;}</style></head><body>${e.content}</body></html>`:``}),Q=!1,gt=0,$=0;function _t(e){Q=!0,gt=e.clientX,$=ct.value,document.addEventListener(`mousemove`,vt),document.addEventListener(`mouseup`,yt),e.preventDefault()}function vt(e){if(!Q)return;let t=e.clientX-gt;ct.value=Math.max(200,Math.min(900,$+t))}function yt(){Q=!1,document.removeEventListener(`mousemove`,vt),document.removeEventListener(`mouseup`,yt)}let bt={props:n,configStore:o,editorTabsStore:s,treeNodes:c,treeLoading:l,searchQuery:d,debouncedSearchQuery:f,get searchDebounceTimer(){return p},set searchDebounceTimer(e){p=e},clearSearch:m,TREE_POLL_MS:Te,get treePollTimer(){return h},set treePollTimer(e){h=e},startTreePolling:_,stopTreePolling:b,loadDir:x,initTree:te,collectExpandedPaths:S,restoreExpanded:C,refreshTree:w,toggleDir:T,flattenTree:D,searchQueryLower:fe,filterTree:pe,visibleTree:xe,noSearchResults:Se,highlightName:Ce,searchInputRef:O,focusSearchInput:Ee,onSearchEscape:De,tabs:k,activeTabPath:A,selectedNode:j,openFile:Oe,closeTab:ke,activeTab:M,editorContainerRef:Ae,editorInstance:N,modelCache:P,getOrCreateModel:je,mountEditor:Me,focusEditor:F,get viewVisibilityObserver(){return I},set viewVisibilityObserver(e){I=e},setupViewVisibilityObserver:Ne,saveCurrentFile:Pe,handleKeydown:L,containerRef:R,sidebarWidth:Fe,get isResizing(){return z},set isResizing(e){z=e},get resizeStartX(){return B},set resizeStartX(e){B=e},get resizeStartW(){return V},set resizeStartW(e){V=e},startSidebarResize:Ie,onSidebarResize:Le,stopSidebarResize:Re,getNodeSpriteId:ze,inlineInput:H,renameInput:U,inlineInputRef:W,renameInputRef:Be,getTargetDir:G,startNewFile:Ve,startNewFolder:He,cancelInlineInput:Ue,confirmInlineInput:We,handleInlineKeydown:Ge,ctxMenu:K,ctxMenuRef:Ke,openContextMenu:qe,closeContextMenu:q,ctxNewFile:Je,ctxNewFolder:Ye,ctxRename:Xe,confirmRename:Ze,handleRenameKeydown:Qe,ctxDelete:$e,ctxRevealInExplorer:et,toWorkspaceRelative:tt,copyToClipboard:nt,ctxCopyAbsolutePath:rt,ctxCopyRelativePath:it,ctxOpenInVscode:at,PREVIEW_TEXT_EXTS:ot,IMAGE_EXTS:st,showPreview:J,showMindmap:Y,previewWidth:ct,activeTabRef:X,activeTabIsImage:lt,activeExt:Z,isPreviewable:ut,mindmapTitleCount:dt,isMindmapable:ft,togglePreview:pt,toggleMindmap:mt,previewSrcdoc:ht,get isPreviewResizing(){return Q},set isPreviewResizing(e){Q=e},get previewResizeStartX(){return gt},set previewResizeStartX(e){gt=e},get previewResizeStartW(){return $},set previewResizeStartW(e){$=e},startPreviewResize:_t,onPreviewResize:vt,stopPreviewResize:yt,get $t(){return E},get ElTooltip(){return r},ImagePreview:ve,MarkdownPreview:me,MindmapPreview:we,SvgIcon:re};return Object.defineProperty(bt,`__isScriptSetup`,{enumerable:!1,value:!0}),bt}}),De={class:`editor-view`,ref:`containerRef`},k={class:`sidebar-header`},A={class:`sidebar-title`},j={class:`sidebar-actions`},Oe={class:`sidebar-search`},ke=[`placeholder`,`title`],M=[`title`,`aria-label`],Ae={key:0,class:`sidebar-tree`},N={key:1,class:`tree-arrow-spacer`},P={class:`tree-icon mit-icon`,"aria-hidden":`true`},je=[`xlink:href`],Me=[`onClick`,`onContextmenu`],F={key:1,class:`tree-arrow-spacer`},I={key:2,class:`tree-icon mit-icon`,"aria-hidden":`true`},Ne=[`xlink:href`],Pe={key:3,class:`tree-icon mit-icon`,"aria-hidden":`true`},L=[`xlink:href`],R=[`title`],Fe={key:0,class:`tree-name-hit`},z={key:4,class:`tree-loading`},B={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning)`}},V={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-tertiary)`}},Ie=[`placeholder`],Le={key:0,class:`tree-node tree-inline-input-row`,style:{paddingLeft:`12px`}},Re={key:0,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--color-warning)`}},ze={key:1,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{"flex-shrink":`0`,color:`var(--text-tertiary)`}},H=[`placeholder`],U={key:1,class:`tree-empty`},W={key:1,class:`sidebar-loading`},Be={class:`editor-main`},G={key:0,class:`editor-tabs`},Ve=[`onClick`,`title`],He={class:`tab-name`},Ue={key:0,class:`tab-dirty-dot`},We=[`onClick`],Ge=[`title`],K=[`disabled`,`title`],Ke={key:1,class:`editor-empty`},qe={viewBox:`0 0 24 24`,width:`48`,height:`48`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.3`}},q={class:`editor-empty-hint`},Je={class:`editor-body`},Ye={key:0,class:`image-tab-placeholder`},Xe={viewBox:`0 0 24 24`,width:`56`,height:`56`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,style:{opacity:`.35`}},Ze={class:`image-tab-placeholder-title`},Qe={class:`image-tab-placeholder-hint`},$e={class:`preview-header`},et={class:`preview-title`},tt={class:`preview-ext-badge`},nt=[`title`],rt={class:`preview-body`},it=[`srcdoc`];function at(n,r,i,a,u,g){return l(),f(h,null,[d(`div`,De,[w(` 左侧文件树 `),d(`div`,{class:`editor-sidebar`,style:S({width:a.sidebarWidth+`px`})},[d(`div`,k,[d(`span`,A,T(a.$t(`@EDITOR:资源管理器`)),1),d(`div`,j,[s(a.ElTooltip,{content:a.$t(`@EDITOR:新建文件`),placement:`bottom`,"show-after":300},{default:o(()=>[d(`button`,{class:`sidebar-action-btn`,onClick:a.startNewFile},[w(` new-file icon `),r[9]||=d(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),d(`polyline`,{points:`14 2 14 8 20 8`}),d(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),d(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1)])]),_:1},8,[`content`]),s(a.ElTooltip,{content:a.$t(`@EDITOR:新建文件夹`),placement:`bottom`,"show-after":300},{default:o(()=>[d(`button`,{class:`sidebar-action-btn`,onClick:a.startNewFolder},[w(` new-folder icon `),r[10]||=d(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),d(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),d(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1)])]),_:1},8,[`content`]),s(a.ElTooltip,{content:a.$t(`@EDITOR:刷新`),placement:`bottom`,"show-after":300},{default:o(()=>[d(`button`,{class:`sidebar-action-btn`,onClick:a.initTree},r[11]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`polyline`,{points:`1 4 1 10 7 10`}),d(`polyline`,{points:`23 20 23 14 17 14`}),d(`path`,{d:`M20.49 9A9 9 0 0 0 5.64 5.64L1 10m22 4l-4.64 4.36A9 9 0 0 1 3.51 15`})],-1)])]),_:1},8,[`content`])])]),d(`div`,Oe,[r[13]||=d(`svg`,{class:`sidebar-search-icon`,viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[d(`circle`,{cx:`11`,cy:`11`,r:`7`}),d(`line`,{x1:`21`,y1:`21`,x2:`16.65`,y2:`16.65`})],-1),e(d(`input`,{ref:`searchInputRef`,"onUpdate:modelValue":r[0]||=e=>a.searchQuery=e,type:`text`,class:`sidebar-search-input`,placeholder:a.$t(`@EDITOR:搜索文件...`),title:a.$t(`@EDITOR:搜索文件...`),spellcheck:`false`,autocomplete:`off`,onKeydown:x(a.onSearchEscape,[`escape`])},null,40,ke),[[p,a.searchQuery]]),a.searchQuery?(l(),f(`button`,{key:0,class:`sidebar-search-clear`,title:a.$t(`@EDITOR:清除搜索`),"aria-label":a.$t(`@EDITOR:清除搜索`),onClick:a.clearSearch},r[12]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`},[d(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),d(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)],8,M)):w(`v-if`,!0)]),a.treeLoading?(l(),f(`div`,W,r[22]||=[d(`span`,{class:`spin-icon`},null,-1)])):(l(),f(`div`,Ae,[(l(!0),f(h,null,c(a.flattenTree(a.visibleTree),t=>(l(),f(h,{key:t.path},[w(` 重命名时用输入框替换节点 `),a.renameInput&&a.renameInput.node.path===t.path?(l(),f(`div`,{key:0,class:`tree-node tree-inline-input-row`,style:S({paddingLeft:12+t.depth*14+`px`})},[t.type===`directory`?(l(),f(`span`,{key:0,class:_([`tree-arrow`,{expanded:t.expanded}])},[...r[14]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(l(),f(`span`,N)),(l(),f(`svg`,P,[d(`use`,{"xlink:href":`#${a.getNodeSpriteId(t)}`},null,8,je)])),e(d(`input`,{ref_for:!0,ref:`renameInputRef`,"onUpdate:modelValue":r[1]||=e=>a.renameInput.value=e,onKeydown:a.handleRenameKeydown,onBlur:a.confirmRename,onClick:r[2]||=m(()=>{},[`stop`])},null,544),[[p,a.renameInput.value]])],4)):(l(),f(h,{key:1},[w(` 普通节点 `),d(`div`,{class:_([`tree-node`,{"tree-node--dir":t.type===`directory`,"tree-node--file":t.type===`file`,"tree-node--active":a.activeTabPath===t.path,"tree-node--selected":a.selectedNode?.path===t.path&&a.activeTabPath!==t.path}]),style:S({paddingLeft:12+t.depth*14+`px`}),onClick:e=>a.openFile(t),onContextmenu:e=>a.openContextMenu(e,t)},[w(` 展开箭头 `),t.type===`directory`?(l(),f(`span`,{key:0,class:_([`tree-arrow`,{expanded:t.expanded}])},[...r[15]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`10`,height:`10`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`polyline`,{points:`9 18 15 12 9 6`})],-1)]],2)):(l(),f(`span`,F)),w(` 图标 `),t.type===`directory`?(l(),f(`svg`,I,[d(`use`,{"xlink:href":`#${a.getNodeSpriteId(t)}`},null,8,Ne)])):(l(),f(`svg`,Pe,[d(`use`,{"xlink:href":`#${a.getNodeSpriteId(t)}`},null,8,L)])),w(` 名称(命中关键字高亮) `),d(`span`,{class:`tree-name`,title:t.path},[(l(!0),f(h,null,c(a.highlightName(t.name),(e,t)=>(l(),f(h,{key:t},[e.hit?(l(),f(`span`,Fe,T(e.text),1)):(l(),f(h,{key:1},[C(T(e.text),1)],64))],64))),128))],8,R),t.loading?(l(),f(`span`,z)):w(`v-if`,!0)],46,Me)],2112)),w(` 内联新建输入框:紧跟在 afterNode 之后 `),a.inlineInput&&a.inlineInput.afterNode?.path===t.path?(l(),f(`div`,{key:2,class:`tree-node tree-inline-input-row`,style:S({paddingLeft:12+a.inlineInput.depth*14+`px`})},[r[18]||=d(`span`,{class:`tree-arrow-spacer`},null,-1),a.inlineInput.kind===`directory`?(l(),f(`svg`,B,[...r[16]||=[d(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)]])):(l(),f(`svg`,V,[...r[17]||=[d(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),d(`polyline`,{points:`14 2 14 8 20 8`},null,-1)]])),e(d(`input`,{ref_for:!0,ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":r[3]||=e=>a.inlineInput.value=e,placeholder:a.inlineInput.kind===`file`?a.$t(`@EDITOR:输入文件名`):a.$t(`@EDITOR:输入文件夹名`),onKeydown:a.handleInlineKeydown,onBlur:a.cancelInlineInput,onClick:r[4]||=m(()=>{},[`stop`])},null,40,Ie),[[p,a.inlineInput.value]])],4)):w(`v-if`,!0)],64))),128)),w(` 根级输入框(无选中节点时出现在列表末尾) `),a.inlineInput&&a.inlineInput.afterNode===null?(l(),f(`div`,Le,[r[21]||=d(`span`,{class:`tree-arrow-spacer`},null,-1),a.inlineInput.kind===`directory`?(l(),f(`svg`,Re,r[19]||=[d(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`},null,-1)])):(l(),f(`svg`,ze,r[20]||=[d(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),d(`polyline`,{points:`14 2 14 8 20 8`},null,-1)])),e(d(`input`,{ref:`inlineInputRef`,class:`tree-inline-input`,"onUpdate:modelValue":r[5]||=e=>a.inlineInput.value=e,placeholder:a.inlineInput.kind===`file`?a.$t(`@EDITOR:输入文件名`):a.$t(`@EDITOR:输入文件夹名`),onKeydown:a.handleInlineKeydown,onBlur:a.cancelInlineInput,onClick:r[6]||=m(()=>{},[`stop`])},null,40,H),[[p,a.inlineInput.value]])])):w(`v-if`,!0),!a.inlineInput&&(a.noSearchResults||a.treeNodes.length===0)?(l(),f(`div`,U,T(a.noSearchResults?a.$t(`@EDITOR:未找到匹配文件`):a.$t(`@EDITOR:暂无文件`)),1)):w(`v-if`,!0)]))],4),w(` 拖拽分隔条 `),d(`div`,{class:`editor-resizer`,onMousedown:a.startSidebarResize},null,32),w(` 右侧编辑区 `),d(`div`,Be,[w(` 标签栏 `),a.tabs.length>0?(l(),f(`div`,G,[(l(!0),f(h,null,c(a.tabs,e=>(l(),f(`div`,{key:e.path,class:_([`editor-tab`,{active:a.activeTabPath===e.path,dirty:e.isDirty}]),onClick:t=>a.activeTabPath=e.path,title:e.path},[d(`span`,He,T(e.name),1),e.isDirty?(l(),f(`span`,Ue)):w(`v-if`,!0),d(`button`,{class:`tab-close`,onClick:t=>a.closeTab(e.path,t)},[...r[23]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`12`,height:`12`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[d(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),d(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)]],8,We)],10,Ve))),128)),r[26]||=d(`div`,{class:`editor-tabs-spacer`},null,-1),w(` 预览切换按钮 `),a.isPreviewable?(l(),f(`button`,{key:0,class:_([`preview-toggle-btn`,{active:a.showPreview}]),title:a.showPreview?a.$t(`@EDITOR:关闭预览`):a.$t(`@EDITOR:打开预览`),onClick:a.togglePreview},[r[24]||=d(`svg`,{viewBox:`0 0 24 24`,width:`14`,height:`14`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z`}),d(`circle`,{cx:`12`,cy:`12`,r:`3`})],-1),d(`span`,null,T(a.$t(`@EDITOR:预览`)),1)],10,Ge)):w(`v-if`,!0),w(` 思维导图:整篇 markdown 渲染为一张大导图 `),a.isMindmapable?(l(),f(`button`,{key:1,class:_([`preview-toggle-btn mindmap-toggle-btn`,{active:a.showMindmap,disabled:!a.isMindmapable}]),disabled:!a.isMindmapable,title:a.isMindmapable?a.showMindmap?a.$t(`@EDITOR:关闭思维导图`):a.$t(`@EDITOR:打开思维导图`):a.$t(`@EDITOR:需要至少一个 # 标题`),onClick:a.toggleMindmap},[r[25]||=t(`<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" data-v-fc2ebf13><circle cx="12" cy="12" r="2" data-v-fc2ebf13></circle><circle cx="5" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="6" r="1.6" data-v-fc2ebf13></circle><circle cx="5" cy="18" r="1.6" data-v-fc2ebf13></circle><circle cx="19" cy="18" r="1.6" data-v-fc2ebf13></circle><line x1="11" y1="11" x2="6.4" y2="7" data-v-fc2ebf13></line><line x1="13" y1="11" x2="17.6" y2="7" data-v-fc2ebf13></line><line x1="11" y1="13" x2="6.4" y2="17" data-v-fc2ebf13></line><line x1="13" y1="13" x2="17.6" y2="17" data-v-fc2ebf13></line></svg>`,1),d(`span`,null,T(a.$t(`@EDITOR:思维导图`)),1)],10,K)):w(`v-if`,!0)])):w(`v-if`,!0),w(` 无文件打开时的提示 `),a.tabs.length===0?(l(),f(`div`,Ke,[(l(),f(`svg`,qe,r[27]||=[d(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`},null,-1),d(`polyline`,{points:`14 2 14 8 20 8`},null,-1)])),d(`p`,null,T(a.$t(`@EDITOR:从左侧选择文件打开`)),1),d(`p`,q,T(a.$t(`@EDITOR:Ctrl+S 保存`)),1)])):w(`v-if`,!0),w(` Monaco 容器(始终挂载,tab 为空或 image tab 时隐藏) `),d(`div`,Je,[d(`div`,{class:_([`monaco-container`,{hidden:a.tabs.length===0||a.activeTabIsImage}]),ref:`editorContainerRef`},null,2),w(` 图片 tab 时的占位提示(主预览区在右侧 preview-panel) `),a.activeTabIsImage&&a.tabs.length>0&&!a.showPreview&&!a.showMindmap?(l(),f(`div`,Ye,[(l(),f(`svg`,Xe,r[28]||=[d(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`},null,-1),d(`circle`,{cx:`9`,cy:`9`,r:`2`},null,-1),d(`path`,{d:`m21 15-5-5L5 21`},null,-1)])),d(`p`,Ze,T(a.activeTabRef?.name),1),d(`p`,Qe,T(a.$t(`@EDITOR:这是图片文件,已在右侧预览面板中打开`)),1)])):w(`v-if`,!0),w(` 预览分隔条(在面板右侧,拉动调整面板宽度) `),(a.showPreview||a.showMindmap)&&a.tabs.length>0?(l(),f(`div`,{key:1,class:`preview-resizer`,onMousedown:a.startPreviewResize},null,32)):w(`v-if`,!0),w(` 预览面板 `),(a.showPreview||a.showMindmap)&&a.tabs.length>0?(l(),f(`div`,{key:2,class:`preview-panel`,style:S({flexBasis:a.previewWidth+`px`})},[d(`div`,$e,[d(`span`,et,T(a.showMindmap?a.$t(`@EDITOR:思维导图`):a.$t(`@EDITOR:预览`)),1),d(`span`,tt,T(a.activeExt.toUpperCase()),1),r[30]||=d(`div`,{class:`preview-header-spacer`},null,-1),d(`button`,{class:`preview-close-btn`,title:a.showMindmap?a.$t(`@EDITOR:关闭思维导图`):a.$t(`@EDITOR:关闭预览`),onClick:r[7]||=e=>a.showMindmap?a.showMindmap=!1:a.showPreview=!1},r[29]||=[d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2.5`,"stroke-linecap":`round`},[d(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),d(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})],-1)],8,nt)]),d(`div`,rt,[w(` 思维导图:整篇 markdown → 一张大导图 `),a.showMindmap&&a.activeExt===`md`&&a.activeTabRef?(l(),te(a.MindmapPreview,{key:0,content:a.activeTabRef.content,class:`preview-mindmap`},null,8,[`content`])):a.showPreview&&a.activeExt===`md`&&a.activeTabRef?(l(),f(h,{key:1},[w(` Markdown → in-app 渲染 `),s(a.MarkdownPreview,{content:a.activeTabRef.content,class:`preview-markdown`},null,8,[`content`])],2112)):a.showPreview&&[`html`,`htm`,`svg`].includes(a.activeExt)?(l(),f(h,{key:2},[w(` HTML / SVG → sandboxed iframe `),d(`iframe`,{class:`preview-iframe`,sandbox:`allow-same-origin`,srcdoc:a.previewSrcdoc},null,8,it)],2112)):a.showPreview&&a.IMAGE_EXTS.has(a.activeExt)&&a.activeTabRef?(l(),f(h,{key:3},[w(` 图片预览(使用增强版 ImagePreview,支持缩放/拖拽) `),s(a.ImagePreview,{"file-path":a.activeTabRef.path,"file-name":a.activeTabRef.name},null,8,[`file-path`,`file-name`])],2112)):w(`v-if`,!0)])],4)):w(`v-if`,!0)])])],512),w(` 右键菜单 `),(l(),te(b,{to:`body`},[a.ctxMenu?(l(),f(`div`,{key:0,ref:`ctxMenuRef`,class:`ctx-menu`,style:S({left:a.ctxMenu.x+`px`,top:a.ctxMenu.y+`px`}),onClick:r[8]||=m(()=>{},[`stop`])},[d(`button`,{class:`ctx-menu-item`,onClick:a.ctxNewFile},[r[31]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z`}),d(`polyline`,{points:`14 2 14 8 20 8`}),d(`line`,{x1:`12`,y1:`13`,x2:`12`,y2:`19`}),d(`line`,{x1:`9`,y1:`16`,x2:`15`,y2:`16`})],-1),C(` `+T(a.$t(`@EDITOR:新建文件`)),1)]),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxNewFolder},[r[32]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z`}),d(`line`,{x1:`12`,y1:`11`,x2:`12`,y2:`17`}),d(`line`,{x1:`9`,y1:`14`,x2:`15`,y2:`14`})],-1),C(` `+T(a.$t(`@EDITOR:新建文件夹`)),1)]),r[38]||=d(`div`,{class:`ctx-menu-sep`},null,-1),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxCopyAbsolutePath},[r[33]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`,ry:`2`}),d(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),C(` `+T(a.$t(`@EDITOR:复制绝对路径`)),1)]),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxCopyRelativePath},[r[34]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`}),d(`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`})],-1),C(` `+T(a.$t(`@EDITOR:复制相对路径`)),1)]),r[39]||=d(`div`,{class:`ctx-menu-sep`},null,-1),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxRevealInExplorer},[r[35]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z`}),d(`path`,{d:`M3 7v10a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2`})],-1),C(` `+T(a.$t(`@EDITOR:在资源管理器中打开`)),1)]),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxOpenInVscode},[s(a.SvgIcon,{"icon-class":`vscode`,"class-name":`ctx-menu-icon`}),C(` `+T(a.$t(`@EDITOR:在 VSCode 中打开`)),1)]),d(`button`,{class:`ctx-menu-item`,onClick:a.ctxRename},[r[36]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`path`,{d:`M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7`}),d(`path`,{d:`M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z`})],-1),C(` `+T(a.$t(`@EDITOR:重命名`)),1)]),d(`button`,{class:`ctx-menu-item ctx-menu-item--danger`,onClick:a.ctxDelete},[r[37]||=d(`svg`,{viewBox:`0 0 24 24`,width:`13`,height:`13`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[d(`polyline`,{points:`3 6 5 6 21 6`}),d(`path`,{d:`M19 6l-1 14a2 2 0 0 1-2 2H8a2 2 0 0 1-2-2L5 6`}),d(`path`,{d:`M10 11v6`}),d(`path`,{d:`M14 11v6`}),d(`path`,{d:`M9 6V4a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2`})],-1),C(` `+T(a.$t(`@EDITOR:删除`)),1)])],4)):w(`v-if`,!0)]))],64)}var ot=D(Ee,[[`render`,at],[`__scopeId`,`data-v-fc2ebf13`],[`__file`,`D:/xz_workspace/github_workspace/zen-gitsync/src/ui/client/src/views/EditorView.vue`]]);export{ot as default};