Files
yakpanel-core/YakPanel/static/vite/js/index-CXfbSKqD.js
2026-04-07 02:04:22 +05:30

2 lines
77 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
var xt=Object.defineProperty;var wt=(t,e,i)=>e in t?xt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i;var B=(t,e,i)=>wt(t,typeof e!="symbol"?e+"":e,i);import{a4 as Et,r as H,c as G,k as D,aw as St,l as Pe,$ as S,Z as $,_ as a,aa as _,ak as ue,n as Ee,o as ge,a0 as F,ai as De,X as se,S as x,a9 as ne,j as L,F as me,P as Ie,L as ae,R as Q,a6 as K,m as kt,al as Ce,w as ye,an as gt,aj as je,ao as Fe,G as Lt,y as mt,b as $t,ax as Tt,e as Mt,a8 as Le,K as Ft,v as Be}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{i as te,m as j,h as he,a3 as At,co as qe,c as R,h8 as ie,w as we,_ as It,h9 as Ot}from"./index-BTglIPU2.js?v=1773287522785";import{b as $e,r as zt,d as He,c as Ht,a as Nt,e as We,f as vt,h as Pt}from"./files-BUbkyTRl.js?v=1773287522785";import{p as Dt,_ as bt,B as Rt,ay as Ke,n as Oe,ai as Gt,b as Ut,al as Vt,b5 as jt,aI as Bt}from"./naive-ui--dJnpVcV.js?v=1773287522785";import{a as fe}from"./ace-CNnfDSio.js?v=1773287522785";import{_ as qt}from"./index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785";import{u as Wt}from"./useTableColumns-DDeyYvje.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";import"./data-BVsViUMm.js?v=1773287522785";import"./index-S15tYq5l.js?v=1773287522785";import"./copy-D-wIKr0q.js?v=1773287522785";import"./index-DIKmrNCq.js?v=1773287522785";import"./index.vue_vue_type_script_setup_true_lang-DeTfbeeM.js?v=1773287522785";import"./index-Cg6fMjw6.js?v=1773287522785";const Je={supportedModes:{Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],CSS:["css"],HTML:["html|htm|xhtml|vue|we|wpy"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSP:["jsp"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],MySQL:["mysql"],Nginx:["nginx|conf"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Powershell:["ps1"],Python:["py"],SQL:["sql"],SQLServer:["sqlserver"],Text:["txt"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],YAML:["yaml|yml"],images:["icon|jpg|jpeg|png|bmp|gif|tif|emf"]},nameOverrides:{PHP_Laravel_blade:"PHP (Blade Template)"},encodingList:["ASCII","UTF-8","GBK","GB2312","BIG5"],themeList:["chrome","monokai","tomorrow_night_bright"],aceEditor:{editorTheme:"monokai",fontSize:14,softLabel:!1,useSoftTabs:!0,tabSize:4,wrap:!0,enableSnippets:!0,enableLiveAutocompletion:!0,highlightActiveLine:!0,highlightSelectedWord:!0,animatedScroll:!1,showInvisibles:!0,showFoldWidgets:!0,showLineNumbers:!0,showGutter:!0,displayIndentGuides:!1},fontFamily:"12px/normal 'Consolas', 'Menlo', 'Monaco', 'Ubuntu Mono', 'source-code-pro', 'Courier New', monospace",encoding:"utf-8"},Ye="/www/server/panel/YakPanel/static/ace/ace.editor.config.json",{t:q}=At.global,W=Et("fileEditor",()=>{const t=H([]),e=H(-1),i=H("/www"),o=H(0),n=H(!1),s=H(Dt(Je)),l=H(null),c=H(!1),f=H(""),d=H(!1),r=G(()=>e.value>=0&&e.value<t.value.length?t.value[e.value]:null),u=v=>{const E=v.split("/").pop()||q("fileEditor.store.untitled"),N=v.split(".").pop()||"text";return{path:v,type:N,name:E,loading:!1,lineEnding:"LF",content:"",originalContent:"",encoding:"",st_mtime:0,onlyRead:!1,history:[]}},h=async v=>{const E=t.value.findIndex(z=>z.path===v);if(E!==-1){e.value=E;return}const N=u(v),P=e.value+1;t.value.splice(P,0,N),e.value=P;const{message:U}=await $e({path:v});if(te(U)){const z=t.value[P];z.content=U.data,z.originalContent=U.data,z.encoding=U.encoding,z.st_mtime=Number(U.st_mtime),z.onlyRead=U.only_read,z.history=U.historys||[],z.onlyRead&&j.warning(q("fileEditor.store.fileTooLarge"))}},g=()=>{const v="__shortcut__",E=t.value.findIndex(U=>U.path===v);if(E!==-1){e.value=E;return}const N={path:v,type:"shortcut",name:q("fileEditor.store.shortcutTabName"),loading:!1,lineEnding:"LF",content:"",originalContent:"",encoding:"UTF-8",st_mtime:0,onlyRead:!1,history:[]},P=e.value+1;t.value.splice(P,0,N),e.value=P},b=async(v,E)=>{var ee,Ve;const N=v.split("/").pop()||"Untitled",P="__diff__".concat(v,"__").concat(E),U=t.value.findIndex(re=>re.path===P);if(U!==-1){e.value=U;return}const z={path:P,type:"diff",name:"".concat(N," <-> ").concat(N),loading:!0,lineEnding:"LF",content:"",originalContent:"",encoding:"UTF-8",st_mtime:0,onlyRead:!0,history:[],originalPath:v,historyTime:E},Y=e.value+1;t.value.splice(Y,0,z),e.value=Y;try{const[re,le]=await Promise.all([$e({path:v}),zt({filename:v,history:E})]),ke=t.value[e.value];re.message&&te(re.message)&&(ke.rightContent=re.message.data,ke.encoding=re.message.encoding),le.message&&te(le.message),ke.leftContent=typeof le.message=="string"?le.message:(Ve=(ee=le.message)==null?void 0:ee.data)!=null?Ve:"",ke.loading=!1}catch(re){const le=t.value[e.value];le&&(le.loading=!1)}},y=async v=>{const{message:E}=await $e({path:v});if(te(E)){const N=t.value.findIndex(P=>P.path===v);if(N!==-1){const P=t.value[N];P.content=E.data,P.originalContent=E.data,P.encoding=E.encoding,P.st_mtime=Number(E.st_mtime),P.history=E.historys||[]}}},p=async()=>{r.value&&r.value.type!=="shortcut"&&await y(r.value.path)},w=v=>{t.value.splice(v,1),e.value>=t.value.length&&(e.value=Math.max(0,t.value.length-1)),t.value.length===0&&(e.value=-1)},M=(v,E)=>{const N=t.value[v];N&&(N.content=E)},T=v=>{i.value=v},I=()=>{const v=i.value,E=v.lastIndexOf("/");E>0?i.value=v.substring(0,E):i.value="/"},O=()=>{o.value++},A=v=>{c.value=v,v||(f.value="",O())},V=(v,E)=>{f.value=v,d.value=E,O()},J=v=>{n.value=v},m=async()=>{const{message:v}=await $e({path:Ye});if(te(v)){const E=JSON.parse(v.data);Object.assign(s.value,{...Je,...E})}},k=async()=>{await He({data:JSON.stringify({supportedModes:s.value.supportedModes,nameOverrides:s.value.nameOverrides,encodingList:s.value.encodingList,themeList:s.value.themeList,aceEditor:s.value.aceEditor,fontFamily:s.value.fontFamily,encoding:s.value.encoding}),path:Ye,encoding:s.value.encoding||"UTF-8",force:1})},C=(v,E=!0,N=!0)=>new Promise(async(P,U)=>{const z=t.value[v];if(z.type==="shortcut"){P();return}try{const{message:Y}=await He({data:z.content,path:z.path,encoding:z.encoding,st_mtime:z.st_mtime,force:0},E);te(Y)&&(Y.status?(z.originalContent=z.content,z.history=Y.historys||[],z.st_mtime=Number(Y.st_mtime),N&&j.success(Y.msg),P()):he({title:q("fileEditor.store.conflictTitle"),content:Y.result||q("fileEditor.store.conflictContentFallback"),confirmText:q("fileEditor.store.forceSave"),confirmType:"warning",onConfirm:async()=>{try{const{message:ee}=await He({data:z.content,path:z.path,encoding:z.encoding,st_mtime:z.st_mtime,force:1},!0);te(ee)&&(z.originalContent=z.content,z.history=ee.historys||[],z.st_mtime=Number(ee.st_mtime),N&&j.success(ee.msg),P())}catch(ee){U(ee)}},onCancel:()=>U(new Error("User cancelled override."))}))}catch(Y){U(Y)}}),oe=async(v,E=!0,N=!0)=>{await C(v,E,N),w(v)},X=async()=>{r.value&&r.value.content!==r.value.originalContent&&await C(e.value)},Z=async()=>{const v=j.loading(q("fileEditor.store.saveAllLoading"));try{const E=t.value.map((N,P)=>N.content!==N.originalContent&&N.type!=="shortcut"?C(P,!1,!1):null).filter(Boolean);E.length>0&&(await Promise.all(E),j.success(q("fileEditor.store.saveAllSuccess")))}finally{v.close()}},xe=(v,E)=>E==="CRLF"?v.replace(/\r?\n/g,"\r\n"):E==="LF"?v.replace(/\r\n/g,"\n"):v;return{currentPath:i,fileList:t,currentFileIndex:e,currentFile:r,refreshKey:o,isLoading:n,editorConfig:s,creatingType:l,isSearchMode:c,searchWord:f,searchAll:d,openFile:h,openShortcutTab:g,openDiffTab:b,closeTab:w,updateTabContent:M,setCurrentPath:T,goToParent:I,refreshFileList:O,setLoading:J,getEditorConfig:m,saveEditorConfig:k,saveFileContent:C,saveFileContentAndClose:oe,saveCurrentFileContent:X,saveAllFile:Z,getFileContent:y,changeLineEnding:async v=>{!r.value||r.value.type==="shortcut"||(r.value.content=xe(r.value.content,v),await X(),r.value.lineEnding=v)},changeEncoding:async v=>{if(!r.value||r.value.type==="shortcut")return;const E=r.value.path;s.value.aceEditor.encoding=v,await k(),r.value.encoding=v,await C(e.value,!0,!0),y(E)},changeTheme:async v=>{s.value.aceEditor.editorTheme=v,await k()},toggleSetting:async v=>{const E=s.value.aceEditor;E[v]=!E[v],await k()},updateTabSettings:async(v,E)=>{s.value.aceEditor.useSoftTabs=v==="tab",s.value.aceEditor.tabSize=E,await k(),j.success(q("fileEditor.store.tabSettingsRefreshed"))},getCurrentFileContent:p,startCreateNewItem:v=>{l.value=v},cancelCreateNewItem:()=>{l.value=null},confirmCreateNewItem:async v=>{if(!v.trim()){j.warning(q("fileEditor.store.nameRequired"));return}const E=l.value;E==="file"?await Ht({path:"".concat(i.value,"/").concat(v)}):E==="folder"&&await Nt({path:"".concat(i.value,"/").concat(v),name:v}),j.success(q("fileEditor.store.createSuccess",{type:q(E==="file"?"fileEditor.store.newFile":"fileEditor.store.newFolder")})),l.value=null,O()},toggleSearchMode:A,executeSearch:V}}),Kt={class:"title-left"},Jt={class:"title-right"},Yt=["title"],Qt=["title"],Xt={key:0,class:"i-ant-design-switcher-outlined"},Zt={key:1,class:"i-ant-design-border-outlined"},ei=["title"],ti=D({__name:"index",props:{isMinimize:{type:Boolean},isMaximize:{type:Boolean}},emits:["minimize","maximize","close"],setup(t,{emit:e}){const i=t,o=e,n=H(null),s=()=>{o("minimize");const f=!i.isMinimize;n.value&&Ee(()=>{const d=qe(n.value,"n-dialog");if(d)if(!f)d.style.left="",d.style.top="";else{const r=document.documentElement.clientHeight,u=d.offsetHeight,h=216,g=r-u-68;d.style.left="".concat(h-d.offsetLeft,"px"),d.style.top="".concat(g-d.offsetTop,"px")}})},l=()=>{o("maximize"),!i.isMaximize&&n.value&&Ee(()=>{const d=qe(n.value,"n-dialog");d&&(d.style.left="",d.style.top="")})},c=()=>{o("close")};return(f,d)=>{const r=St("modal-drag");return Pe((S(),$("div",{ref_key:"titleRef",ref:n,class:"editor-title"},[a("div",Kt,[a("span",null,_(f.$t("fileEditor.title.onlineTextEditor")),1)]),a("div",Jt,[!f.isMaximize&&!f.isMinimize?(S(),$("div",{key:0,class:"action-btn",title:f.$t("fileEditor.title.minimize"),onClick:s},d[1]||(d[1]=[a("div",{class:"i-ant-design-minus-outlined"},null,-1)]),8,Yt)):ue("",!0),a("div",{class:"action-btn",title:f.isMinimize?f.$t("fileEditor.title.restore"):f.isMaximize?f.$t("fileEditor.title.restoreDown"):f.$t("fileEditor.title.maximize"),onClick:d[0]||(d[0]=u=>f.isMinimize?s():l())},[f.isMinimize||f.isMaximize?(S(),$("div",Xt)):(S(),$("div",Zt))],8,Qt),a("div",{class:"action-btn close-btn",onClick:c,title:f.$t("fileEditor.title.close")},d[2]||(d[2]=[a("div",{class:"i-ant-design-close-outlined"},null,-1)]),8,ei)])])),[[r]])}}}),ii=R(ti,[["__scopeId","data-v-319eda2d"]]),ni={class:"toolbar-dialog"},si={class:"toolbar-title"},oi={class:"fontsize-content flex items-center gap-16px"},li=D({__name:"index",props:{currentSize:{type:Number,default:14},onChange:{type:Function}},emits:["close"],setup(t,{emit:e}){const i=t,o=e,n=H(i.currentSize),s=H(null),l=()=>{var f;const c=Number(n.value);!isNaN(c)&&c>0&&((f=i.onChange)==null||f.call(i,c),o("close"))};return ge(()=>{var c;(c=s.value)==null||c.focus()}),(c,f)=>{const d=bt,r=Rt;return S(),$("div",ni,[a("div",si,_(c.$t("fileEditor.dialogs.fontSizeTitle")),1),a("div",oi,[F(d,{ref_key:"inputRef",ref:s,value:x(n),"onUpdate:value":f[0]||(f[0]=u=>se(n)?n.value=u:null),"show-button":!1,class:"fontsize-input",onKeyup:De(l,["enter"])},null,8,["value"]),F(r,{type:"primary",class:"fontsize-btn",onClick:l},{default:ne(()=>[L(_(c.$t("fileEditor.common.save")),1)]),_:1})])])}}}),ai=R(li,[["__scopeId","data-v-cd363012"]]),ri={class:"line-ending-select"},ci=["onClick"],di={key:0,class:"i-fa6-solid-check"},fi=D({__name:"LineSelect",props:{value:{type:[String,Number,Array],default:""},options:{type:Array,default:()=>[]},onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array]},setup(t){const e=t,i=(o,n)=>{const{onUpdateValue:s,"onUpdate:value":l}=e;s&&Ke(s,o,n),l&&Ke(l,o,n)};return(o,n)=>(S(),$("div",ri,[(S(!0),$(me,null,Ie(t.options,s=>(S(),$("div",{key:s.value,class:ae(["line-ending-item",{active:t.value===s.value}]),onClick:l=>i(s.value,s)},[a("span",null,_(s.label),1),t.value===s.value?(S(),$("i",di)):ue("",!0)],10,ci))),128))]))}}),Se=R(fi,[["__scopeId","data-v-3b563599"]]),ui={class:"toolbar-dialog"},hi={class:"toolbar-title"},pi=D({__name:"index",props:{theme:{type:String,default:"monokai"},onChange:{type:Function}},setup(t){const{t:e}=Q(),i=W(),{editorConfig:o}=K(i),n=t,s=H(n.theme||"monokai"),l=G(()=>({chrome:e("fileEditor.dialogs.theme.chrome"),monokai:e("fileEditor.dialogs.theme.monokai")})),c=G(()=>o.value.themeList.map(d=>({label:l.value[d]||d,value:d}))),f=d=>{var r;(r=n.onChange)==null||r.call(n,d)};return(d,r)=>(S(),$("div",ui,[a("div",hi,_(d.$t("fileEditor.dialogs.themeTitle")),1),F(Se,{value:x(s),"onUpdate:value":[r[0]||(r[0]=u=>se(s)?s.value=u:null),f],options:x(c)},null,8,["value","options"])]))}}),gi=R(pi,[["__scopeId","data-v-fd78c99a"]]),mi={class:"toolbar-dialog"},vi={class:"toolbar-title"},bi={class:"setting-list"},_i=["onClick"],yi={key:0,class:"i-fa6-solid-check"},Ci=D({__name:"index",setup(t){const{t:e}=Q(),i=W(),{editorConfig:o}=K(i),n=G(()=>o.value.aceEditor),s=G(()=>[{key:"wrap",label:e("fileEditor.dialogs.setting.wrap")},{key:"enableLiveAutocompletion",label:e("fileEditor.dialogs.setting.enableLiveAutocompletion")},{key:"enableSnippets",label:e("fileEditor.dialogs.setting.enableSnippets")},{key:"showInvisibles",label:e("fileEditor.dialogs.setting.showInvisibles")},{key:"showLineNumbers",label:e("fileEditor.dialogs.setting.showLineNumbers")}]),l=async c=>{await i.toggleSetting(c)};return(c,f)=>(S(),$("div",mi,[a("div",vi,_(c.$t("fileEditor.dialogs.settingTitle")),1),a("div",bi,[(S(!0),$(me,null,Ie(s.value,d=>(S(),$("div",{key:d.key,class:"setting-item",onClick:r=>l(d.key)},[a("span",null,_(d.label),1),n.value[d.key]?(S(),$("i",yi)):ue("",!0)],8,_i))),128))])]))}}),xi=R(Ci,[["__scopeId","data-v-0f74f1f1"]]),wi={class:"toolbar-list"},Ei=["onClick"],Si=D({__name:"index",emits:["action"],setup(t,{emit:e}){const{t:i}=Q(),o=W(),{editorConfig:n}=K(o),s=e,l=G(()=>[{key:"save",label:i("fileEditor.toolbar.save"),icon:"i-ep-select"},{key:"saveAll",label:i("fileEditor.toolbar.saveAll"),icon:"i-ep-document-copy"},{key:"refresh",label:i("fileEditor.toolbar.refresh"),icon:"i-ep-refresh-right"},{key:"search",label:i("fileEditor.toolbar.search"),icon:"i-ep-search"},{key:"replace",label:i("fileEditor.toolbar.replace"),icon:"i-ep-document"},{key:"jumpLine",label:i("fileEditor.toolbar.jumpLine"),icon:"i-ep-location"},{key:"fontSize",label:i("fileEditor.toolbar.fontSize"),icon:"i-ep-monitor"},{key:"theme",label:i("fileEditor.toolbar.theme"),icon:"i-ep-operation"},{key:"setting",label:i("fileEditor.toolbar.setting"),icon:"i-ep-setting"},{key:"shortcut",label:i("fileEditor.toolbar.shortcut"),icon:"i-ep-question-filled"}]),c=g=>{switch(g){case"save":o.saveCurrentFileContent();break;case"saveAll":o.saveAllFile();break;case"refresh":f();break;case"search":case"replace":case"jumpLine":s("action",g);break;case"fontSize":d();break;case"theme":r();break;case"setting":u();break;case"shortcut":h();break}},f=async()=>{const g=j.loading(i("fileEditor.toolbar.refreshing"));try{await o.getCurrentFileContent(),j.success(i("fileEditor.toolbar.refreshed"))}finally{g.close()}},d=()=>{ie({width:420,footer:!1,showMask:!1,data:{currentSize:Number(n.value.aceEditor.fontSize),onChange:async g=>{n.value.aceEditor.fontSize=g,await o.saveEditorConfig(),j.success(i("fileEditor.toolbar.fontSizeSaved"))}},component:ai})},r=()=>{ie({width:420,footer:!1,showMask:!1,data:{theme:n.value.aceEditor.editorTheme,onChange:async g=>{await o.changeTheme(g)}},component:gi})},u=()=>{ie({width:420,footer:!1,showMask:!1,component:xi})},h=()=>{o.openShortcutTab()};return(g,b)=>(S(),$("div",wi,[(S(!0),$(me,null,Ie(x(l),y=>(S(),$("div",{key:y.key,class:"tools-btn",onClick:p=>c(y.key)},[a("i",{class:ae(y.icon)},null,2),a("span",null,_(y.label),1)],8,Ei))),128))]))}}),ki=R(Si,[["__scopeId","data-v-ebc2c2ac"]]),Li={class:"breadcrumb-wrapper"},$i={class:"flex-1 w-0"},Ti=D({__name:"Breadcrumb",setup(t){const e=W(),{currentPath:i}=K(e);return(o,n)=>{const s=Oe;return S(),$("div",Li,[a("div",null,_(o.$t("fileEditor.fileExplorer.directory"))+"",1),a("div",$i,[F(s,null,{default:ne(()=>[L(_(x(i)),1)]),_:1})])])}}}),Mi=R(Ti,[["__scopeId","data-v-54af520c"]]),Fi={class:"action-btn"},Ai={key:1,class:"search-panel"},Ii={class:"search-title"},Oi={class:"title-text"},zi={class:"search-input-wrap"},Hi={class:"search-options"},Ni=D({__name:"Action",setup(t){const{t:e}=Q(),i=W(),{isLoading:o,creatingType:n}=K(i),s=y=>()=>kt("i",{class:["tree-icon",y],style:"font-size: 16px; font-style: normal; display: inline-flex; align-items: center;"}),l=G(()=>[{label:e("fileEditor.fileExplorer.newFolder"),key:"folder",icon:s("folder-icon")},{label:e("fileEditor.fileExplorer.newFile"),key:"file",icon:s("text-icon")}]),c=y=>{i.startCreateNewItem(y)},f=()=>{const y=i.currentPath,p=y.substring(0,y.lastIndexOf("/"))||"/";i.setCurrentPath(p===""?"/":p)},d=()=>{i.refreshFileList()},r=H(i.searchWord),u=H(i.searchAll),h=()=>{r.value=i.searchWord,u.value=i.searchAll,i.toggleSearchMode(!0)},g=()=>{i.toggleSearchMode(!1),r.value="",u.value=!1},b=()=>{i.executeSearch(r.value,u.value)};return(y,p)=>{const w=Gt,M=Ut,T=Vt;return S(),$("div",{class:ae(["action-wrapper",{"is-search-mode":x(i).isSearchMode}])},[x(i).isSearchMode?(S(),$("div",Ai,[a("div",Ii,[a("span",Oi,_(y.$t("fileEditor.fileExplorer.searchPanelTitle")),1),a("span",{class:"close-btn",onClick:g},[p[5]||(p[5]=a("i",{class:"i-ep-close"},null,-1)),L(" "+_(y.$t("fileEditor.fileExplorer.close")),1)])]),a("div",zi,[F(M,{value:x(r),"onUpdate:value":p[0]||(p[0]=I=>se(r)?r.value=I:null),placeholder:y.$t("fileEditor.fileExplorer.searchPlaceholder"),onKeydown:De(b,["enter"])},{suffix:ne(()=>[a("div",{class:"search-icon-btn",onClick:b},p[6]||(p[6]=[a("i",{class:"i-ep-search"},null,-1)]))]),_:1},8,["value","placeholder"])]),a("div",Hi,[F(T,{checked:x(u),"onUpdate:checked":p[1]||(p[1]=I=>se(u)?u.value=I:null)},{default:ne(()=>[L(_(y.$t("fileEditor.fileExplorer.includeSubdir")),1)]),_:1},8,["checked"])])])):(S(),$(me,{key:0},[a("div",{class:"action-btn",onClick:f},[p[2]||(p[2]=a("i",{class:"i-ep-top"},null,-1)),a("span",null,_(y.$t("fileEditor.fileExplorer.up")),1)]),a("div",{class:"action-btn",onClick:d},[a("i",{class:ae(["i-ep-refresh-right",{"is-loading":x(o)}])},null,2),a("span",null,_(y.$t("fileEditor.fileExplorer.refresh")),1)]),F(w,{trigger:"click",disabled:x(n)!==null,options:x(l),placement:"bottom","show-arrow":!0,"arrow-point-to-center":!0,onSelect:c},{default:ne(()=>[a("div",Fi,[p[3]||(p[3]=a("i",{class:"i-ep-plus"},null,-1)),a("span",null,_(y.$t("fileEditor.fileExplorer.new")),1)])]),_:1},8,["disabled","options"]),a("div",{class:"action-btn",onClick:h},[p[4]||(p[4]=a("i",{class:"i-ep-search"},null,-1)),a("span",null,_(y.$t("fileEditor.fileExplorer.search")),1)])],64))],2)}}}),Pi=R(Ni,[["__scopeId","data-v-e49ff329"]]),Qe={Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],BatchFile:["bat|cmd"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],CSharp:["cs"],CSS:["css"],Dockerfile:["^Dockerfile"],golang:["go"],HTML:["html|htm|xhtml|vue|we|wpy"],Java:["java"],JavaScript:["js|jsm|jsx"],JSON:["json"],JSP:["jsp"],LESS:["less"],Lua:["lua"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],MySQL:["mysql"],Nginx:["nginx|conf"],INI:["ini|conf|cfg|prefs"],ObjectiveC:["m|mm"],Perl:["pl|pm"],Perl6:["p6|pl6|pm6"],pgSQL:["pgsql"],PHP_Laravel_blade:["blade.php"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],Powershell:["ps1"],Python:["py"],R:["r"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SASS:["sass"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SQL:["sql"],SQLServer:["sqlserver"],Swift:["swift"],Text:["txt"],Typescript:["ts|typescript|str"],VBScript:["vbs|vb"],Verilog:["v|vh|sv|svh"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],YAML:["yaml|yml"],Compress:["tar|zip|7z|rar|gz|arj|z"],images:["icon|jpg|jpeg|png|bmp|gif|tif|emf"]},_t=t=>{const e=t.match(/\.([0-9A-z]*)$/),i=Array.isArray(e)?e[1]:"text";for(const o in Qe){const n=Qe[o],s=n[0].split("|"),l=o.toLowerCase();for(let c=0;c<s.length;c++)if(i.toLowerCase()==s[c].toLowerCase())return{name:o,mode:l}}return{name:"Text",mode:"text"}},Di={class:"tree-wrapper"},Ri=D({__name:"Tree",setup(t){const{t:e}=Q(),i=W(),{currentPath:o,refreshKey:n,fileList:s,creatingType:l,isSearchMode:c,searchWord:f,searchAll:d,currentFile:r}=K(i),u=H([]),h=H(""),g=Ce("treeInstRef"),b=G(()=>s.value.map(m=>m.path)),y=(m,k,C)=>{const oe=(m||[]).map(Z=>{const xe=(C!=="/"?"".concat(C,"/"):"/")+Z.nm;return{label:Z.nm,key:xe,type:"dir",isLeaf:!1}}),X=(k||[]).map(Z=>{const xe=(C!=="/"?"".concat(C,"/"):"/")+Z.nm;return{label:Z.nm,key:xe,type:"file",isLeaf:!0}});return[...oe,...X]},p=({option:m})=>{if(m.type==="dir"||m.type==="folder")return F("i",{class:"tree-icon folder-icon"},null);const k=m.isCreating?h.value:m.label,{mode:C}=_t("".concat(k));return F("i",{class:["tree-icon","".concat(C,"-icon")]},null)},w=({option:m,selected:k})=>m.isCreating?F("div",{class:"creating-node"},[F("input",{class:"creating-input",value:h.value,onInput:C=>h.value=C.target.value,onKeyup:C=>{C.key==="Enter"?(C.stopPropagation(),i.confirmCreateNewItem(h.value)):C.key==="Escape"&&(C.stopPropagation(),i.cancelCreateNewItem())},onClick:C=>C.stopPropagation(),placeholder:m.type==="file"?e("fileEditor.tree.newFilePlaceholder"):e("fileEditor.tree.newFolderPlaceholder"),ref:C=>{C&&setTimeout(()=>C.focus(),50)}},null),F("i",{class:"i-ep-check text-primary",onClick:C=>{C.stopPropagation(),i.confirmCreateNewItem(h.value)}},null),F("i",{class:"i-ep-close text-error",onClick:C=>{C.stopPropagation(),i.cancelCreateNewItem()}},null)]):F(Oe,{class:k?"text-[#cca700]":""},{default:()=>[m.label]}),M=({option:m})=>m.type==="dir"?"toggleExpand":"default",T=({option:m})=>({onClick(){m.type==="file"&&!m.isCreating&&i.openFile(m.key)}}),I=async m=>{const k=m.key,{message:C}=await We({path:k,p:1,showRow:99999,sort:"name",reverse:"False"});return te(C)&&(m.children=y(C.dir,C.files,C.path),(!C.dir||C.dir.length===0)&&(m.hideSwitcher=!0)),Promise.resolve()},O=async()=>{i.setLoading(!0);try{const m={path:o.value,p:1,showRow:99999,sort:"name",reverse:"False"};c.value&&f.value&&(m.search=f.value,d.value&&(m.all="True"));const{message:k}=await We(m);te(k)&&(u.value=y(k.dir,k.files,k.path),l.value&&A())}finally{i.setLoading(!1)}},A=()=>{if(!l.value)return;if(!u.value.find(k=>k.key==="__creating__")){h.value="";const k={key:"__creating__",label:"",type:l.value,isLeaf:!0,isCreating:!0};u.value.unshift(k)}},V=()=>{u.value=u.value.filter(m=>m.key!=="__creating__")};ye(l,m=>{m?A():V()}),ye([o,n],()=>{O()}),ye(c,m=>{m&&(u.value=[])});const J=()=>{r.value&&Ee(()=>{setTimeout(()=>{const m=document.querySelector(".tree-wrapper .n-tree-node--selected");m&&m.scrollIntoView({behavior:"smooth",block:"center"})},500)})};return ge(async()=>{await O(),await Ee(),J()}),(m,k)=>{const C=jt;return S(),$("div",Di,[F(C,{ref_key:"treeInstRef",ref:g,"block-line":"",data:x(u),"on-load":I,"expand-on-click":"",selectable:"","render-prefix":p,"render-label":w,"override-default-node-click-behavior":M,"selected-keys":x(b),"node-props":T},null,8,["data","selected-keys"])])}}}),Gi=R(Ri,[["__scopeId","data-v-8adcf4ca"]]),Ui={class:"sidebar-content"},Vi=D({__name:"index",setup(t){const e=H(!1),i=()=>{e.value=!e.value};return(o,n)=>(S(),$("aside",{class:ae(["sidebar-wrapper",{"is-collapsed":x(e)}])},[a("div",Ui,[F(Mi),F(Pi),F(Gi)]),a("div",{class:"toggle-btn",onClick:i})],2))}}),ji=R(Vi,[["__scopeId","data-v-4a4cb5df"]]),Bi={class:"editor-header-wrapper"},qi=["title","onClick"],Wi=["onClick"],Ki=["onClick"],Ji=D({__name:"header",props:Fe({data:{default:()=>[]},save:{}},{value:{},valueModifiers:{}}),emits:Fe(["select","close"],["update:value"]),setup(t,{emit:e}){const i=t,o=gt(t,"value"),{t:n}=Q(),s=e,l=Ce("headerRef"),c=()=>{Ee(()=>{setTimeout(()=>{if(l.value){const g=l.value.querySelector(".editor-tab.active");g&&g.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}},100)})};ye(o,()=>{c()}),ge(()=>{c()});const f=g=>{o.value=g,s("select",g)},d=g=>{const{mode:b}=_t(g);return"".concat(b,"-icon")},r=g=>{o.value!==void 0&&g<o.value&&(o.value-=1),s("close",g)},u=g=>{he({title:n("fileEditor.editorHeader.tipTitle"),content:n("fileEditor.editorHeader.modifiedSaveConfirm"),confirmText:n("fileEditor.common.save"),cancelText:n("fileEditor.editorHeader.dontSave"),onConfirm:async()=>{await i.save(g),r(g)},onCancel:()=>{r(g)}})},h=g=>g.type==="shortcut"||g.type==="diff"||g.onlyRead?!1:g.content!==g.originalContent;return(g,b)=>{const y=Oe,p=Bt;return S(),$("div",Bi,[F(p,{"x-scrollable":"",trigger:"none"},{default:ne(()=>[a("div",{class:"editor-header",ref_key:"headerRef",ref:l},[(S(!0),$(me,null,Ie(g.data,(w,M)=>(S(),$("div",{key:M,class:ae(["editor-tab",{active:o.value===M}]),title:w.path,onClick:T=>f(M)},[a("div",{class:ae(["tree-icon tab-icon",d(w.name)])},null,2),F(y,{class:"mx-10px"},{default:ne(()=>[a("span",null,_(w.name),1)]),_:2},1024),h(w)?(S(),$("div",{key:0,class:"tab-dirty",onClick:je(T=>u(M),["stop"])},null,8,Wi)):(S(),$("div",{key:1,class:"tab-close i-mdi-close",onClick:je(T=>r(M),["stop"])},null,8,Ki))],10,qi))),128))],512)]),_:1})])}}}),Yi=R(Ji,[["__scopeId","data-v-d03633e2"]]),Qi=D({__name:"main",props:Fe({mode:{type:String,default:"Text"}},{value:{},valueModifiers:{}}),emits:Fe(["cursor-change","show-goto-line"],["update:value"]),setup(t,{expose:e,emit:i}){const o=t,n=i,s=W(),{editorConfig:l,currentFile:c}=K(s),f=gt(t,"value"),d=Ce("editorRef");let r=null;const u=b=>new Promise(y=>{fe.config.loadModule(b,()=>y())}),h=async()=>{var C,oe;if(fe.config.set("basePath","/static/ace"),await u("ace/ext/language_tools"),!d.value)return;const{editorTheme:b}=l.value.aceEditor,y="ace/theme/".concat(b);if(await u(y),!d.value)return;const{fontSize:p,fontFamily:w,showInvisibles:M,showLineNumbers:T,useSoftTabs:I,tabSize:O,keyboardHandler:A,enableLiveAutocompletion:V,enableSnippets:J,enableBasicAutocompletion:m}=l.value.aceEditor;r=fe.edit(d.value,{value:f.value,theme:y,mode:"ace/mode/".concat((C=o.mode)==null?void 0:C.toLocaleLowerCase()),fontSize:p,fontFamily:w,showInvisibles:M,showLineNumbers:T,useSoftTabs:I,tabSize:O,showPrintMargin:!1,keyboardHandler:A,enableLiveAutocompletion:V,enableSnippets:J,enableBasicAutocompletion:m,wrap:!0,indentedSoftWrap:!0,readOnly:((oe=c.value)==null?void 0:oe.onlyRead)||!1});const k=()=>{if(!r)return;const X=r.getCursorPosition();n("cursor-change",{line:X.row+1,column:X.column+1})};k(),r.selection.on("changeCursor",k),r.on("change",()=>{f.value=r==null?void 0:r.getValue()}),g(r)},g=b=>{b.commands.addCommand({name:"saveFile",bindKey:{win:"Ctrl-S",mac:"Command-S"},readOnly:!0,exec:()=>{s.saveCurrentFileContent()}}),b.commands.addCommand({name:"saveAllFile",bindKey:{win:"Ctrl-Shift-S",mac:"Command-Shift-S"},readOnly:!0,exec:()=>{s.saveAllFile()}}),b.commands.addCommand({name:"closeFile",bindKey:{win:"Alt-W",mac:"Option-W"},readOnly:!0,exec:()=>{s.closeTab(s.currentFileIndex)}}),b.commands.addCommand({name:"goToLine",bindKey:{win:"Ctrl-I",mac:"Command-I"},readOnly:!0,exec:()=>{n("show-goto-line")}}),b.commands.addCommand({name:"undo",bindKey:{win:"Ctrl-Z",mac:"Command-Z"},readOnly:!0,exec:()=>{b.undo()}})};return Lt(()=>{var y,p;if(!r)return;r.setOptions({mode:"ace/mode/".concat((y=o.mode)==null?void 0:y.toLocaleLowerCase())});const b=(p=f.value)!=null?p:"";r.getValue()!==b&&(r.setValue(b,-1),r.getSession().setUndoManager(new fe.UndoManager))}),mt(()=>{var m;const{editorTheme:b,fontSize:y,fontFamily:p,showInvisibles:w,showLineNumbers:M,useSoftTabs:T,tabSize:I,keyboardHandler:O,enableLiveAutocompletion:A,enableSnippets:V,enableBasicAutocompletion:J}=l.value.aceEditor;r&&(r.setTheme("ace/theme/".concat(b)),r.setOptions({fontSize:y,fontFamily:p,showInvisibles:w,showLineNumbers:M,useSoftTabs:T,tabSize:I,keyboardHandler:O,enableLiveAutocompletion:A,enableSnippets:V,enableBasicAutocompletion:J,readOnly:((m=c.value)==null?void 0:m.onlyRead)||!1}))}),ge(()=>{h()}),e({gotoLine:b=>{r&&(r.gotoLine(b,0,!0),r.focus())},execCommand:b=>{r&&r.execCommand(b)}}),(b,y)=>(S(),$("div",{ref_key:"editorRef",ref:d,class:"ace-editor w-full h-full"},null,512))}}),Xi=R(Qi,[["__scopeId","data-v-2b76de93"]]),Zi={class:"file-history"},en=D({__name:"index",emits:["close"],setup(t,{emit:e}){const{t:i}=Q(),o=e,n=W(),{currentFile:s}=K(n),l=G(()=>{const r=s.value;return r?r.history.map(u=>({time:u,path:r.path})):[]}),c=[{key:"time",title:i("fileEditor.dialogs.fileHistory.time"),render:r=>we(r.time)},Wt({title:i("fileEditor.dialogs.fileHistory.actions"),width:210,options:r=>[{label:i("fileEditor.dialogs.fileHistory.diff"),onClick:()=>{o("close"),n.openDiffTab(r.path,r.time)}},{label:i("fileEditor.dialogs.fileHistory.recover"),onClick:()=>{he({title:i("fileEditor.dialogs.fileHistory.recoverTitle"),content:i("fileEditor.dialogs.fileHistory.recoverContent",{time:we(r.time)}),onConfirm:async()=>{await vt({filename:r.path,history:r.time}),j.success(i("fileEditor.dialogs.fileHistory.fileContentUpdated")),n.getFileContent(r.path)}})}},{label:i("fileEditor.dialogs.fileHistory.delete"),onClick:()=>{he({title:i("fileEditor.dialogs.fileHistory.deleteTitle"),content:i("fileEditor.dialogs.fileHistory.deleteContent",{time:we(r.time)}),onConfirm:async()=>{await Pt({filename:r.path,history:r.time}),d(r.path)}})}}]})],f=H(!1),d=async r=>{try{f.value=!0,await n.getFileContent(r)}finally{f.value=!1}};return(r,u)=>{const h=qt;return S(),$("div",Zi,[F(h,{loading:x(f),columns:c,data:x(l),"max-height":400},null,8,["loading","data"])])}}}),tn=R(en,[["__scopeId","data-v-654b4dcd"]]),nn={class:"toolbar-dialog"},sn={class:"toolbar-title"},on=D({__name:"index",props:{fileName:{type:String,default:""},lineEnding:{type:String,default:"LF"},onChange:{type:Function}},emits:["close"],setup(t,{emit:e}){const i=t,{t:o}=Q(),n=e,s=H(i.lineEnding),l=[{label:"CRLF",value:"CRLF"},{label:"LF",value:"LF"}],c=f=>{he({title:o("fileEditor.dialogs.lineEndingChangeTitle"),confirmText:o("fileEditor.common.save"),content:()=>F(me,null,[F("div",null,[o("fileEditor.dialogs.lineEndingChangeContent1",{file:i.fileName||"",from:s.value,to:f})]),F("div",{class:"mt-8px"},[o("fileEditor.dialogs.lineEndingChangeContent2",{save:o("fileEditor.common.save")})])]),onConfirm:async()=>{var d;await((d=i.onChange)==null?void 0:d.call(i,f)),n("close")}})};return(f,d)=>(S(),$("div",nn,[a("div",sn,_(f.$t("fileEditor.dialogs.lineEndingTitle")),1),F(Se,{value:x(s),options:l,"onUpdate:value":c},null,8,["value"])]))}}),ln=R(on,[["__scopeId","data-v-34b64179"]]),an={class:"toolbar-dialog"},rn={class:"toolbar-title"},cn={class:"toolbar-title"},dn=D({__name:"index",props:{useSoftTabs:{type:String,default:"tab"},tabSize:{type:Number,default:4},onChange:{type:Function}},setup(t){const{t:e}=Q(),i=t,o=H(i.useSoftTabs),n=H(i.tabSize),s=G(()=>[{label:e("fileEditor.dialogs.tabSize.useSpaces"),value:"space"},{label:e("fileEditor.dialogs.tabSize.useTabs"),value:"tab"}]),l=[{label:"1",value:1},{label:"2",value:2},{label:"3",value:3},{label:"4",value:4},{label:"5",value:5},{label:"6",value:6}],c=()=>{d()},f=()=>{d()},d=()=>{var r;(r=i.onChange)==null||r.call(i,o.value,n.value)};return(r,u)=>(S(),$("div",an,[a("div",rn,_(r.$t("fileEditor.dialogs.tabSizeTitle")),1),F(Se,{value:x(o),"onUpdate:value":[u[0]||(u[0]=h=>se(o)?o.value=h:null),c],options:x(s)},null,8,["value","options"]),a("div",cn,_(r.$t("fileEditor.dialogs.tabSizeLengthTitle")),1),F(Se,{value:x(n),"onUpdate:value":[u[1]||(u[1]=h=>se(n)?n.value=h:null),f],options:l},null,8,["value"])]))}}),fn=R(dn,[["__scopeId","data-v-9b2e7d57"]]),un={class:"toolbar-dialog"},hn={class:"toolbar-title"},pn=D({__name:"index",props:{encoding:{type:String,default:"UTF-8"},onChange:{type:Function}},setup(t){var c;const e=W(),{editorConfig:i}=K(e),o=t,n=H(((c=o.encoding)==null?void 0:c.toUpperCase())||"UTF-8"),s=G(()=>i.value.encodingList.map(f=>({label:f.toUpperCase(),value:f.toUpperCase()}))),l=f=>{var d;(d=o.onChange)==null||d.call(o,f)};return(f,d)=>(S(),$("div",un,[a("div",hn,_(f.$t("fileEditor.dialogs.encodingTitle")),1),F(Se,{value:x(n),"onUpdate:value":[d[0]||(d[0]=r=>se(n)?n.value=r:null),l],options:x(s)},null,8,["value","options"])]))}}),gn=R(pn,[["__scopeId","data-v-60c1d667"]]),mn={class:"toolbar-dialog"},vn={class:"toolbar-title"},bn={class:"goto-content"},_n={class:"goto-hint"},yn=D({__name:"index",props:{currentLine:{type:Number,default:1},currentColumn:{type:Number,default:1},maxLine:{type:Number,default:1},onChange:{type:Function}},emits:["close"],setup(t,{emit:e}){const i=t,o=e,n=H(null),s=H(null),l=()=>{var f;const c=Number(n.value);!isNaN(c)&&c>=1&&c<=i.maxLine&&((f=i.onChange)==null||f.call(i,c),o("close"))};return ge(()=>{var c;(c=s.value)==null||c.focus()}),(c,f)=>(S(),$("div",mn,[a("div",vn,_(c.$t("fileEditor.dialogs.goToLineTitle")),1),a("div",bn,[F(x(bt),{value:n.value,"onUpdate:value":f[0]||(f[0]=d=>n.value=d),ref_key:"inputRef",ref:s,"show-button":!1,class:"goto-input",placeholder:"",onKeyup:De(l,["enter"])},null,8,["value"]),a("div",_n,_(c.$t("fileEditor.dialogs.goToLineHint",{line:t.currentLine,column:t.currentColumn,max:t.maxLine})),1)])]))}}),yt=R(yn,[["__scopeId","data-v-aaadbccb"]]),Cn={key:0,class:"footer-path"},xn={key:1,class:"footer-path diff-path"},wn={class:"mr-6px"},En={key:2,class:"footer-tools"},Sn={class:"footer-item"},kn={key:0,class:"footer-item readonly-badge"},Ln=D({__name:"footer",props:{filePath:{default:""},encoding:{default:"UTF-8"},lineEnding:{default:"LF"},cursor:{default:()=>({line:1,column:1})},tabSize:{default:4},useSoftTabs:{type:Boolean,default:!0},language:{default:"Text"}},emits:["jump-line"],setup(t,{emit:e}){const i=t,o=e,n=W(),{currentFile:s,editorConfig:l}=K(n),{t:c}=Q(),f=G(()=>s.value?s.value.history.length:0),d=G(()=>{var p;return((p=s.value)==null?void 0:p.onlyRead)||!1}),r=()=>{ie({title:c("fileEditor.dialogs.fileHistory.title"),component:tn})},u=()=>{ie({width:420,footer:!1,showMask:!1,data:{lineEnding:i.lineEnding,onChange:async p=>{await n.changeLineEnding(p)}},component:ln})},h=()=>{ie({width:420,footer:!1,showMask:!1,data:{useSoftTabs:i.useSoftTabs?"tab":"space",tabSize:i.tabSize,onChange:(p,w)=>{n.updateTabSettings(p,w)}},component:fn})},g=()=>{ie({width:420,footer:!1,showMask:!1,data:{encoding:l.value.aceEditor.encoding,onChange:async p=>{await n.changeEncoding(p)}},component:gn})},b=()=>{var p,w,M;ie({width:420,footer:!1,showMask:!1,data:{currentLine:(p=i.cursor)==null?void 0:p.line,currentColumn:(w=i.cursor)==null?void 0:w.column,maxLine:(M=s.value)!=null&&M.content?s.value.content.split("\n").length:1,onChange:T=>{o("jump-line",T)}},component:yt})},y=()=>{if(!s.value||s.value.type!=="diff")return;const p={path:s.value.originalPath,time:s.value.historyTime};he({title:c("fileEditor.dialogs.fileHistory.recoverTitle"),content:c("fileEditor.dialogs.fileHistory.recoverContent",{time:we(p.time)}),onConfirm:async()=>{await vt({filename:p.path,history:p.time}),j.success(c("fileEditor.dialogs.fileHistory.fileContentUpdated")),n.getFileContent(p.path),n.closeTab(n.currentFileIndex)}})};return(p,w)=>{var I,O,A,V,J;const M=Oe,T=It;return S(),$("div",{class:ae(["editor-footer",{"diff-footer":((I=x(s))==null?void 0:I.type)==="diff"}])},[((O=x(s))==null?void 0:O.type)!=="diff"?(S(),$("div",Cn,[F(M,null,{default:ne(()=>[L(_(p.$t("fileEditor.editorFooter.fileLocation",{path:p.filePath})),1)]),_:1})])):(S(),$("div",xn,[a("span",wn,_(p.$t("fileEditor.editorFooter.readOnlyHistory",{path:(A=x(s))==null?void 0:A.originalPath,time:x(we)((V=x(s))==null?void 0:V.historyTime)})),1),F(T,{onClick:y},{default:ne(()=>[L(_(p.$t("fileEditor.editorFooter.clickRecoverLeft")),1)]),_:1})])),((J=x(s))==null?void 0:J.type)!=="diff"?(S(),$("div",En,[a("span",{class:"footer-item",onClick:u},_(p.lineEnding),1),a("span",{class:"footer-item",onClick:b},_(p.$t("fileEditor.editorFooter.lineColumn",{line:p.cursor.line,column:p.cursor.column})),1),a("span",{class:"footer-item",onClick:r},_(p.$t("fileEditor.editorFooter.historyCount",{count:x(f)})),1),a("span",{class:"footer-item",onClick:h},_(p.$t("fileEditor.editorFooter.tabSize",{size:p.tabSize})),1),a("span",{class:"footer-item",onClick:g},_(p.$t("fileEditor.editorFooter.encoding",{encoding:p.encoding})),1),a("span",Sn,_(p.$t("fileEditor.editorFooter.language",{language:p.language})),1),x(d)?(S(),$("span",kn,_(p.$t("fileEditor.editorFooter.readOnlyMode")),1)):ue("",!0)])):ue("",!0)],2)}}}),$n=R(Ln,[["__scopeId","data-v-cd20a3bc"]]);function Re(t){let[e,i]=t;return[e,i]}function Xe(t,e){let i=t,o=e,n=i.length,s=o.length;if(n===0||s===0)return 0;n>s?i=i.substring(n-s):n<s&&(o=o.substring(0,n));let l=Math.min(n,s);if(i===o)return l;let c=0,f=1;for(let d=0;d!==-1;){let r=i.substring(l-f);if(d=o.indexOf(r),d===-1)return c;f+=d,(d===0||i.substring(l-f)===o.substring(0,f))&&(c=f,f++)}return c}function Ge(t,e){if(!t||!e||t[0]!==e[0])return 0;let i=0,o=Math.min(t.length,e.length),n=o,s=0;for(;i<n;)t.substring(s,n)===e.substring(s,n)?(i=n,s=i):o=n,n=Math.floor((o-i)/2+i);return n}function ze(t,e){if(!t||!e||t[t.length-1]!==e[e.length-1])return 0;let i=0,o=Math.min(t.length,e.length),n=o,s=0;for(;i<n;)t.substring(t.length-n,t.length-s)===e.substring(e.length-n,e.length-s)?(i=n,s=i):o=n,n=Math.floor((o-i)/2+i);return n}function Tn(t){let e=t.charCodeAt(0);return e>=55296&&e<=56319}function Mn(t){let e=t.charCodeAt(0);return e>=56320&&e<=57343}function Fn(t,e,i){let o=t.length,n=e.length,s=Math.ceil((o+n)/2),l=s,c=2*s,f=Array(c),d=Array(c);for(let p=0;p<c;p++)f[p]=-1,d[p]=-1;f[l+1]=0,d[l+1]=0;let r=o-n,u=r%2!=0,h=0,g=0,b=0,y=0;for(let p=0;p<s&&!(Date.now()>i);p++){for(let w=-p+h;w<=p-g;w+=2){let M=l+w,T;T=w===-p||w!==p&&f[M-1]<f[M+1]?f[M+1]:f[M-1]+1;let I=T-w;for(;T<o&&I<n&&t.charAt(T)===e.charAt(I);)T++,I++;if(f[M]=T,T>o)g+=2;else if(I>n)h+=2;else if(u){let O=l+r-w;if(O>=0&&O<c&&d[O]!==-1){let A=o-d[O];if(T>=A)return Ze(t,e,T,I,i)}}}for(let w=-p+b;w<=p-y;w+=2){let M=l+w,T;T=w===-p||w!==p&&d[M-1]<d[M+1]?d[M+1]:d[M-1]+1;let I=T-w;for(;T<o&&I<n&&t.charAt(o-T-1)===e.charAt(n-I-1);)T++,I++;if(d[M]=T,T>o)y+=2;else if(I>n)b+=2;else if(!u){let O=l+r-w;if(O>=0&&O<c&&f[O]!==-1){let A=f[O],V=l+A-O;if(T=o-T,A>=T)return Ze(t,e,A,V,i)}}}}return[[ve,t],[be,e]]}function Ze(t,e,i,o,n){let s=t.substring(0,i),l=e.substring(0,o),c=t.substring(i),f=e.substring(o),d=pe(s,l,{checkLines:!1,deadline:n}),r=pe(c,f,{checkLines:!1,deadline:n});return d.concat(r)}function An(t,e,i=1){if(i<=0)return null;let o=t.length>e.length?t:e,n=t.length>e.length?e:t;if(o.length<4||n.length*2<o.length)return null;let s=et(o,n,Math.ceil(o.length/4)),l=et(o,n,Math.ceil(o.length/2)),c;if(s&&l)c=s[4].length>l[4].length?s:l;else{if(!s&&!l)return null;l?s||(c=l):c=s}if(!c)throw Error("Unable to find a half match.");let f,d,r,u;t.length>e.length?(f=c[0],d=c[1],r=c[2],u=c[3]):(r=c[0],u=c[1],f=c[2],d=c[3]);let h=c[4];return[f,d,r,u,h]}function et(t,e,i){let o=t.slice(i,i+Math.floor(t.length/4)),n=-1,s="",l,c,f,d;for(;(n=e.indexOf(o,n+1))!==-1;){let r=Ge(t.slice(i),e.slice(n)),u=ze(t.slice(0,i),e.slice(0,n));s.length<u+r&&(s=e.slice(n-u,n)+e.slice(n,n+r),l=t.slice(0,i-u),c=t.slice(i+r),f=e.slice(0,n-u),d=e.slice(n+r))}return s.length*2>=t.length?[l||"",c||"",f||"",d||"",s||""]:null}function In(t,e){for(let i=0;i<t.length;i++){let o=t[i][1],n=[];for(let s=0;s<o.length;s++)n[s]=e[o.charCodeAt(s)];t[i][1]=n.join("")}}function On(t,e){let i=[],o={};i[0]="";function n(c){let f="",d=0,r=-1,u=i.length;for(;r<c.length-1;){r=c.indexOf("\n",d),r===-1&&(r=c.length-1);let h=c.slice(d,r+1);(o.hasOwnProperty?o.hasOwnProperty(h):o[h]!==void 0)?f+=String.fromCharCode(o[h]):(u===s&&(h=c.slice(d),r=c.length),f+=String.fromCharCode(u),o[h]=u,i[u++]=h),d=r+1}return f}let s=4e4,l=n(t);return s=65535,{chars1:l,chars2:n(e),lineArray:i}}function zn(t,e,i){let o=t,n=e,s=On(o,n);o=s.chars1,n=s.chars2;let l=s.lineArray,c=pe(o,n,{checkLines:!1,deadline:i.deadline});In(c,l),c=Ct(c),c.push([Ae,""]);let f=0,d=0,r=0,u="",h="";for(;f<c.length;){switch(c[f][0]){case be:r++,h+=c[f][1];break;case ve:d++,u+=c[f][1];break;case Ae:if(d>=1&&r>=1){c.splice(f-d-r,d+r),f=f-d-r;let g=pe(u,h,{checkLines:!1,deadline:i.deadline});for(let b=g.length-1;b>=0;b--)c.splice(f,0,g[b]);f+=g.length}r=0,d=0,u="",h="";break;default:throw Error("Unknown diff operation.")}f++}return c.pop(),c}function Hn(t,e,i){let o;if(!t)return[[be,e]];if(!e)return[[ve,t]];let n=t.length>e.length?t:e,s=t.length>e.length?e:t,l=n.indexOf(s);if(l!==-1)return o=[[be,n.substring(0,l)],[Ae,s],[be,n.substring(l+s.length)]],t.length>e.length&&(o[0][0]=ve,o[2][0]=ve),o;if(s.length===1)return[[ve,t],[be,e]];let c=An(t,e);if(c){let f=c[0],d=c[1],r=c[2],u=c[3],h=c[4],g=pe(f,r,i),b=pe(d,u,i);return g.concat([[Ae,h]],b)}return i.checkLines&&t.length>100&&e.length>100?zn(t,e,i):Fn(t,e,i.deadline)}var Nn=Object.defineProperty,tt=Object.getOwnPropertySymbols,Pn=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable,it=(t,e,i)=>e in t?Nn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[e]=i,Rn=(t,e)=>{for(var i in e||(e={}))Pn.call(e,i)&&it(t,i,e[i]);if(tt)for(var i of tt(e))Dn.call(e,i)&&it(t,i,e[i]);return t};const ve=-1,be=1,Ae=0;function Gn(t,e,i){if(t===null||e===null)throw Error("Null input. (diff)");let o=pe(t,e,Vn({}));return Bn(o),o}function pe(t,e,i){let o=t,n=e;if(o===n)return o?[[0,o]]:[];let s=Ge(o,n),l=o.substring(0,s);o=o.substring(s),n=n.substring(s),s=ze(o,n);let c=o.substring(o.length-s);o=o.substring(0,o.length-s),n=n.substring(0,n.length-s);let f=Hn(o,n,i);return l&&f.unshift([0,l]),c&&f.push([0,c]),f=Ue(f),f}function Un(t){let e=1;return typeof t<"u"&&(e=t<=0?Number.MAX_VALUE:t),Date.now()+e*1e3}function Vn(t){return Rn({checkLines:!0,deadline:Un(t.timeout||1)},t)}function Te(t,e,i){return i===1?t+e:e+t}function Me(t,e){return e===1?[t.substring(0,t.length-1),t[t.length-1]]:[t.substring(1),t[0]]}function jn(t,e,i,o){return o===1?t[e][1][t[e][1].length-1]===t[i][1][t[i][1].length-1]:t[e][1][0]===t[i][1][0]}function nt(t,e,i){let o=i===1?-1:1,n=null,s=null,l=e+i;for(;l>=0&&l<t.length&&(n===null||s===null);l+=i){let[d,r]=t[l];if(r.length!==0){if(d===1){n===null&&(n=l);continue}else if(d===-1){s===null&&(s=l);continue}else if(d===0){if(n===null&&s===null){let[u,h]=Me(t[e][1],i);t[e][1]=u,t[l][1]=Te(t[l][1],h,o);return}break}}}if(n!==null&&s!==null&&jn(t,n,s,i)){let[d,r]=Me(t[n][1],o),[u]=Me(t[s][1],o);t[n][1]=d,t[s][1]=u,t[e][1]=Te(t[e][1],r,i);return}let[c,f]=Me(t[e][1],i);t[e][1]=c,n===null?(t.splice(l,0,[1,f]),s!==null&&s>=l&&s++):t[n][1]=Te(t[n][1],f,o),s===null?t.splice(l,0,[-1,f]):t[s][1]=Te(t[s][1],f,o)}function Bn(t){for(let e=0;e<t.length;e++){let[i,o]=t[e];if(o.length===0)continue;let n=o[0],s=o[o.length-1];Tn(s)&&i===0&&nt(t,e,1),Mn(n)&&i===0&&nt(t,e,-1)}for(let e=0;e<t.length;e++)t[e][1].length===0&&t.splice(e,1)}function Ct(t){let e=t.map(u=>Re(u)),i=!1,o=[],n=0,s=null,l=0,c=0,f=0,d=0,r=0;for(;l<e.length;)e[l][0]===0?(o[n++]=l,c=d,f=r,d=0,r=0,s=e[l][1]):(e[l][0]===1?d+=e[l][1].length:r+=e[l][1].length,s&&s.length<=Math.max(c,f)&&s.length<=Math.max(d,r)&&(e.splice(o[n-1],0,[-1,s]),e[o[n-1]+1][0]=1,n--,n--,l=n>0?o[n-1]:-1,c=0,f=0,d=0,r=0,s=null,i=!0)),l++;for(i&&(e=Ue(e)),e=Kn(e),l=1;l<e.length;){if(e[l-1][0]===-1&&e[l][0]===1){let u=e[l-1][1],h=e[l][1],g=Xe(u,h),b=Xe(h,u);g>=b?(g>=u.length/2||g>=h.length/2)&&(e.splice(l,0,[0,h.substring(0,g)]),e[l-1][1]=u.substring(0,u.length-g),e[l+1][1]=h.substring(g),l++):(b>=u.length/2||b>=h.length/2)&&(e.splice(l,0,[0,u.substring(0,b)]),e[l-1][0]=1,e[l-1][1]=h.substring(0,h.length-b),e[l+1][0]=-1,e[l+1][1]=u.substring(b),l++),l++}l++}return e}const st=/[^a-zA-Z0-9]/,ot=/\s/,lt=/[\r\n]/,qn=/\n\r?\n$/,Wn=/^\r?\n\r?\n/;function Kn(t){let e=t.map(n=>Re(n));function i(n,s){if(!n||!s)return 6;let l=n.charAt(n.length-1),c=s.charAt(0),f=l.match(st),d=c.match(st),r=f&&l.match(ot),u=d&&c.match(ot),h=r&&l.match(lt),g=u&&c.match(lt),b=h&&n.match(qn),y=g&&s.match(Wn);return b||y?5:h||g?4:f&&!r&&u?3:r||u?2:f||d?1:0}let o=1;for(;o<e.length-1;){if(e[o-1][0]===0&&e[o+1][0]===0){let n=e[o-1][1],s=e[o][1],l=e[o+1][1],c=ze(n,s);if(c){let h=s.substring(s.length-c);n=n.substring(0,n.length-c),s=h+s.substring(0,s.length-c),l=h+l}let f=n,d=s,r=l,u=i(n,s)+i(s,l);for(;s.charAt(0)===l.charAt(0);){n+=s.charAt(0),s=s.substring(1)+l.charAt(0),l=l.substring(1);let h=i(n,s)+i(s,l);h>=u&&(u=h,f=n,d=s,r=l)}e[o-1][1]!==f&&(f?e[o-1][1]=f:(e.splice(o-1,1),o--),e[o][1]=d,r?e[o+1][1]=r:(e.splice(o+1,1),o--))}o++}return e}function Ue(t){let e=t.map(d=>Re(d));e.push([0,""]);let i=0,o=0,n=0,s="",l="",c;for(;i<e.length;)switch(e[i][0]){case 1:n++,l+=e[i][1],i++;break;case-1:o++,s+=e[i][1],i++;break;case 0:o+n>1?(o!==0&&n!==0&&(c=Ge(l,s),c!==0&&(i-o-n>0&&e[i-o-n-1][0]===0?e[i-o-n-1][1]+=l.substring(0,c):(e.splice(0,0,[0,l.substring(0,c)]),i++),l=l.substring(c),s=s.substring(c)),c=ze(l,s),c!==0&&(e[i][1]=l.substring(l.length-c)+e[i][1],l=l.substring(0,l.length-c),s=s.substring(0,s.length-c))),i-=o+n,e.splice(i,o+n),s.length&&(e.splice(i,0,[-1,s]),i++),l.length&&(e.splice(i,0,[1,l]),i++),i++):i!==0&&e[i-1][0]===0?(e[i-1][1]+=e[i][1],e.splice(i,1)):i++,n=0,o=0,s="",l="";break;default:throw Error("Unknown diff operation")}e[e.length-1][1]===""&&e.pop();let f=!1;for(i=1;i<e.length-1;)e[i-1][0]===0&&e[i+1][0]===0&&(e[i][1].substring(e[i][1].length-e[i-1][1].length)===e[i-1][1]?(e[i][1]=e[i-1][1]+e[i][1].substring(0,e[i][1].length-e[i-1][1].length),e[i+1][1]=e[i-1][1]+e[i+1][1],e.splice(i-1,1),f=!0):e[i][1].substring(0,e[i+1][1].length)===e[i+1][1]&&(e[i-1][1]+=e[i+1][1],e[i][1]=e[i][1].substring(e[i+1][1].length)+e[i+1][1],e.splice(i+1,1),f=!0)),i++;return f&&(e=Ue(e)),e}function at(t,e,i=!1){let o=null,n=!0;return function(...s){let l=i&&n,c=()=>{t.apply(this,s),o=null};l&&(n=!1,c()),o||(o=setTimeout(c,e))}}function Jn(t,e){let i;return function(...o){clearTimeout(i),i=setTimeout(()=>t.apply(this,o),e)}}function rt(t=""){return(t!=null?t:"").replace(/\r\n/g,"\n")}function ct(t,e,i,o){let n=t+(i-t)/2;return"M ".concat(t," ").concat(e," C ").concat(n,",").concat(e," ").concat(n,",").concat(o," ").concat(i,",").concat(o)}const _e="right",de="left",Yn="specific",Qn="broad";var dt={SVG_NS:"http://www.w3.org/2000/svg"};function ft(t,e){var o,n;let{mode:i}=t.options;return e===de&&t.options.left.mode!==null&&(i=(o=t.options.left.mode)!=null?o:i),e===_e&&t.options.right.mode!==null&&(i=(n=t.options.right.mode)!=null?n:i),i}function ut(t,e){var o,n;let{theme:i}=t.options;return e===de&&t.options.left.theme!==null&&(i=(o=t.options.left.theme)!=null?o:i),e===_e&&t.options.right.theme!==null&&(i=(n=t.options.right.theme)!=null?n:i),i}function Xn(t,e){return t.ace.getSession().doc.getLine(e)}function Zn(t){var i,o;let e=t.options.left.id;return e&&(o=(i=document.getElementById(e))==null?void 0:i.offsetHeight)!=null?o:0}function ht(t){let e=document.createElement("div"),i={class:t.className,style:"top:".concat(t.topOffset,"px"),title:t.tooltip,"data-diff-index":t.diffIndex};for(let o in i)e.setAttribute(o,String(i[o]));return e.innerHTML=t.arrowContent,e}function Ne(t,e){let i="js-".concat(e,"-").concat(Math.random().toString(36).substr(2,5)),o=t.querySelector(".".concat(e));if(o)return o.id=o.id||i,o.id;let n=document.createElement("div");return t.appendChild(n),n.className=e,n.id=i,n.id}function pt(t,e,i,o){let n=t==="document"?document:document.querySelector(t);n&&n.addEventListener(e,s=>{let l=n.querySelectorAll(i),c=s.target;for(let f=0,d=l.length;f<d;f+=1){let r=c,u=l[f];for(;r&&r!==n;)r===u&&o.call(u,s),r=r.parentNode}})}let ce=null;function es(t){if(t.Range)return t.Range;let e=t.acequire||t.require;return e?e("ace/range"):!1}const ts={ace:void 0,mode:null,theme:null,element:null,diffGranularity:Qn,lockScrolling:!0,showDiffs:!0,showConnectors:!0,charDiffs:!0,maxDiffs:5e3,left:{id:null,content:null,mode:null,theme:null,editable:!0,copyLinkEnabled:!0},right:{id:null,content:null,mode:null,theme:null,editable:!0,copyLinkEnabled:!0},classes:{gutterID:"acediff__gutter",diff:"acediff__diffLine",diffChar:"acediff__diffChar",diffGutter:"acediff__diffGutter",connector:"acediff__connector",newCodeConnectorLink:"acediff__newCodeConnector",newCodeConnectorLinkContent:"&#8594;",deletedCodeConnectorLink:"acediff__deletedCodeConnector",deletedCodeConnectorLinkContent:"&#8592;",copyRightContainer:"acediff__copy--right",copyLeftContainer:"acediff__copy--left"},connectorYOffset:0,onDiffReady:null};var is=class{constructor(t={}){B(this,"options");B(this,"el");B(this,"editors");B(this,"diffs",[]);B(this,"lineHeight",0);B(this,"gutterSVG",null);B(this,"gutterWidth",0);B(this,"gutterHeight",0);B(this,"copyLeftContainer",null);B(this,"copyRightContainer",null);B(this,"connectorYOffset",0);B(this,"removeEventHandlers",null);var s,l,c,f,d,r;let e=JSON.parse(JSON.stringify(ts));this.options={...e,...t,left:{...e.left,...t.left},right:{...e.right,...t.right},classes:{...e.classes,...t.classes}};let i=()=>typeof window<"u"?window.ace:void 0;this.options.ace||(this.options.ace=i());let{ace:o}=this.options;if(!o){let u="No ace editor found nor supplied - `options.ace` or `window.ace` is missing";throw console.error(u),Error(u)}let n=es(o);if(!n){let u="Could not require Range module for Ace. Depends on your bundling strategy, but it usually comes with Ace itself. See https://ace.c9.io/api/range.html, open an issue on GitHub ace-diff/ace-diff";throw console.error(u),Error(u)}if(ce=n,this.options.element===null){let u="You need to specify an element for Ace-diff - `options.element` is missing";throw console.error(u),Error(u)}if(this.options.element instanceof HTMLElement)this.el=this.options.element;else{let u=document.body.querySelector(this.options.element);if(!u){let h="Can't find the specified element ".concat(this.options.element);throw console.error(h),Error(h)}this.el=u}this.options.left.id=Ne(this.el,"acediff__left"),this.options.classes.gutterID=Ne(this.el,"acediff__gutter"),this.options.right.id=Ne(this.el,"acediff__right"),this.el.innerHTML='<div class="acediff acediff__wrap">'.concat(this.el.innerHTML,"</div>"),this.editors={left:{ace:o.edit(this.options.left.id),markers:[],lineLengths:[],diffGutters:[]},right:{ace:o.edit(this.options.right.id),markers:[],lineLengths:[],diffGutters:[]},editorHeight:null},this.editors.left.ace.getSession().setMode((s=ft(this,de))!=null?s:""),this.editors.right.ace.getSession().setMode((l=ft(this,_e))!=null?l:""),this.editors.left.ace.setReadOnly(!this.options.left.editable),this.editors.right.ace.setReadOnly(!this.options.right.editable),this.editors.left.ace.setShowFoldWidgets(!1),this.editors.right.ace.setShowFoldWidgets(!1),this.editors.left.ace.setTheme((c=ut(this,de))!=null?c:""),this.editors.right.ace.setTheme((f=ut(this,_e))!=null?f:""),this.editors.left.ace.setValue(rt((d=this.options.left.content)!=null?d:null),-1),this.editors.right.ace.setValue(rt((r=this.options.right.content)!=null?r:null),-1),this.editors.editorHeight=Zn(this),setTimeout(()=>{this.lineHeight=this.editors.left.ace.renderer.lineHeight,this.addEventHandlers(),this.createCopyContainers(),this.createGutter(),this.diff()},1)}setOptions(t){this.options={...this.options,...t,left:{...this.options.left,...t.left},right:{...this.options.right,...t.right},classes:{...this.options.classes,...t.classes}},this.diff()}getNumDiffs(){return this.diffs.length}getEditors(){return{left:this.editors.left.ace,right:this.editors.right.ace}}diff(){let t=this.editors.left.ace.getSession().getValue(),e=Ct(Gn(this.editors.right.ace.getSession().getValue(),t));this.editors.left.lineLengths=this.getLineLengths(this.editors.left),this.editors.right.lineLengths=this.getLineLengths(this.editors.right);let i=[],o={left:0,right:0};e.forEach(n=>{let s=n[0],l=n[1];l.length!==0&&(s===0?(o.left+=l.length,o.right+=l.length):s===-1?(i.push(this.computeDiff(-1,o.left,o.right,l)),o.right+=l.length):s===1&&(i.push(this.computeDiff(1,o.left,o.right,l)),o.left+=l.length))}),this.diffs=this.simplifyDiffs(i),!(this.diffs.length>this.options.maxDiffs)&&(this.clearDiffs(),this.decorate(),typeof this.options.onDiffReady=="function"&&this.options.onDiffReady(this.diffs))}clear(){this.clearDiffs(),this.clearGutter(),this.clearArrows()}destroy(){var s,l,c;let t=this.editors.left.ace.getValue();this.editors.left.ace.destroy();let e=this.editors.left.ace.container,i=e.cloneNode(!1);i.textContent=t,(s=e.parentNode)==null||s.replaceChild(i,e);let o=this.editors.right.ace.getValue();this.editors.right.ace.destroy(),e=this.editors.right.ace.container,i=e.cloneNode(!1),i.textContent=o,(l=e.parentNode)==null||l.replaceChild(i,e);let n=document.getElementById(this.options.classes.gutterID);n&&(n.innerHTML=""),(c=this.removeEventHandlers)==null||c.call(this)}addEventHandlers(){let t=!1,e=(n,s)=>{if(!this.options.lockScrolling||t)return;let l=n.ace.getSession(),c=s.ace.getSession(),f=l.getScrollTop(),d=l.getLength()*this.lineHeight,r=n.ace.renderer.$size.scrollerHeight,u=Math.max(0,d-r),h=u>0?f/u:0,g=c.getLength()*this.lineHeight,b=s.ace.renderer.$size.scrollerHeight,y=h*Math.max(0,g-b);t=!0,c.setScrollTop(y),t=!1};this.editors.left.ace.getSession().on("changeScrollTop",at(()=>{e(this.editors.left,this.editors.right),this.updateGap()},16)),this.editors.right.ace.getSession().on("changeScrollTop",at(()=>{e(this.editors.right,this.editors.left),this.updateGap()},16));let i=this.diff.bind(this);this.editors.left.ace.on("change",i),this.editors.right.ace.on("change",i),this.options.left.copyLinkEnabled&&pt("#".concat(this.options.classes.gutterID),"click",".".concat(this.options.classes.newCodeConnectorLink),n=>this.copy(n,"ltr")),this.options.right.copyLinkEnabled&&pt("#".concat(this.options.classes.gutterID),"click",".".concat(this.options.classes.deletedCodeConnectorLink),n=>this.copy(n,"rtl"));let o=Jn(()=>{let n=document.getElementById(this.options.left.id);n&&(this.editors.availableHeight=n.offsetHeight),this.diff()},250);window.addEventListener("resize",o),this.removeEventHandlers=()=>{window.removeEventListener("resize",o)}}copy(t,e){var p;let i=t.target,o=parseInt((p=i.getAttribute("data-diff-index"))!=null?p:"0",10),n=this.diffs[o];if(!n||e==="ltr"&&!this.options.right.editable||e==="rtl"&&!this.options.left.editable)return;let s,l,c,f,d,r;e==="ltr"?(s=this.editors.left,l=this.editors.right,c=n.leftStartOffset,f=n.leftEndOffset,d=n.rightStartOffset,r=n.rightEndOffset):(s=this.editors.right,l=this.editors.left,c=n.rightStartOffset,f=n.rightEndOffset,d=n.leftStartOffset,r=n.leftEndOffset);let u=s.ace.getValue().substring(c,f),h=l.ace.getSession().doc,g=h.indexToPosition(d,0),b=h.indexToPosition(r,0),y=l.ace.getSession().getScrollTop();ce&&l.ace.getSession().replace(new ce(g.row,g.column,b.row,b.column),u),l.ace.getSession().setScrollTop(parseInt(String(y),10)),this.diff()}getLineLengths(t){return t.ace.getSession().doc.getAllLines().map(e=>e.length+1)}showDiff(t,e,i,o,n){let s=this.editors[t],l=i;l<e&&(l=e);let c="".concat(n," ").concat(l>e?"lines":"targetOnly"," ").concat(t),f=l;if(f>e&&--f,ce&&s.markers.push(s.ace.session.addMarker(new ce(e,0,f,1),c,"fullLine")),this.options.charDiffs&&o&&o.length>0){let r="".concat(this.options.classes.diffChar," ").concat(t);o.forEach(u=>{ce&&s.markers.push(s.ace.session.addMarker(new ce(u.lineStart,u.start,u.lineEnd-1,u.end),r,"text"))})}let d="".concat(this.options.classes.diffGutter," ").concat(t);for(let r=e;r<l;r+=1)s.ace.session.addGutterDecoration(r,d),s.diffGutters.push({line:r,className:d})}updateGap(){this.clearDiffs(),this.decorate(),this.positionCopyContainers()}clearDiffs(){this.editors.left.markers.forEach(t=>{this.editors.left.ace.getSession().removeMarker(t)}),this.editors.right.markers.forEach(t=>{this.editors.right.ace.getSession().removeMarker(t)}),this.editors.left.markers=[],this.editors.right.markers=[],this.editors.left.diffGutters.forEach(t=>{this.editors.left.ace.session.removeGutterDecoration(t.line,t.className)}),this.editors.right.diffGutters.forEach(t=>{this.editors.right.ace.session.removeGutterDecoration(t.line,t.className)}),this.editors.left.diffGutters=[],this.editors.right.diffGutters=[]}addConnector(t,e,i,o){var p,w;let n=this.editors.left.ace.getSession().getScrollTop(),s=this.editors.right.ace.getSession().getScrollTop();this.connectorYOffset=1;let l=t*this.lineHeight-n+.5,c=this.gutterWidth+1,f=i*this.lineHeight-s+.5,d=e*this.lineHeight-n+this.connectorYOffset+.5,r=this.gutterWidth+1,u=o*this.lineHeight-s+this.connectorYOffset+.5,h=ct(-1,l,c,f),g=ct(r,u,-1,d),b="".concat(h," ").concat("L".concat(c,",").concat(f," ").concat(r,",").concat(u)," ").concat(g," ").concat("L-1,".concat(d," -1,").concat(l)),y=document.createElementNS(dt.SVG_NS,"path");y.setAttribute("d",b),y.setAttribute("class",(p=this.options.classes.connector)!=null?p:""),(w=this.gutterSVG)==null||w.appendChild(y)}addCopyArrows(t,e){var i,o,n,s,l,c;if(t.leftEndLine>t.leftStartLine&&this.options.left.copyLinkEnabled&&this.options.right.editable){let f=ht({className:(i=this.options.classes.newCodeConnectorLink)!=null?i:"",topOffset:t.leftStartLine*this.lineHeight,tooltip:"Copy to right",diffIndex:e,arrowContent:(o=this.options.classes.newCodeConnectorLinkContent)!=null?o:""});(n=this.copyRightContainer)==null||n.appendChild(f)}if(t.rightEndLine>t.rightStartLine&&this.options.right.copyLinkEnabled&&this.options.left.editable){let f=ht({className:(s=this.options.classes.deletedCodeConnectorLink)!=null?s:"",topOffset:t.rightStartLine*this.lineHeight,tooltip:"Copy to left",diffIndex:e,arrowContent:(l=this.options.classes.deletedCodeConnectorLinkContent)!=null?l:""});(c=this.copyLeftContainer)==null||c.appendChild(f)}}positionCopyContainers(){let t=this.editors.left.ace.getSession().getScrollTop(),e=this.editors.right.ace.getSession().getScrollTop();this.copyRightContainer&&(this.copyRightContainer.style.cssText="top: ".concat(-t,"px")),this.copyLeftContainer&&(this.copyLeftContainer.style.cssText="top: ".concat(-e,"px"))}computeDiff(t,e,i,o){let n={};if(t===1){let s=this.getSingleDiffInfo(this.editors.left,e,o),l=this.getLineForCharPosition(this.editors.right,i),c=this.getCharsOnLine(this.editors.right,l),f=this.getCharsOnLine(this.editors.left,s.startLine),d=l,r=s.startLine===s.endLine,u=0;(s.startChar>0||r&&o.length<f)&&c>0&&s.startChar<f&&u++,n={leftStartLine:s.startLine,leftEndLine:s.endLine+1,rightStartLine:d,rightEndLine:d+u,leftStartOffset:e,leftEndOffset:e+o.length,rightStartOffset:i,rightEndOffset:i,leftStartChar:s.startChar,leftEndChar:s.endChar}}else{let s=this.getSingleDiffInfo(this.editors.right,i,o),l=this.getLineForCharPosition(this.editors.left,e),c=this.getCharsOnLine(this.editors.left,l),f=this.getCharsOnLine(this.editors.right,s.startLine),d=l,r=s.startLine===s.endLine,u=0;(s.startChar>0||r&&o.length<f)&&c>0&&s.startChar<f&&u++,n={leftStartLine:d,leftEndLine:d+u,rightStartLine:s.startLine,rightEndLine:s.endLine+1,leftStartOffset:e,leftEndOffset:e,rightStartOffset:i,rightEndOffset:i+o.length,rightStartChar:s.startChar,rightEndChar:s.endChar}}return n}getSingleDiffInfo(t,e,i){let o={startLine:0,startChar:0,endLine:0,endChar:0},n=e+i.length,s=0,l=!1,c=!1;t.lineLengths.forEach((d,r)=>{s+=d,!l&&e<s&&(o.startLine=r,o.startChar=e-s+d,l=!0),!c&&n<=s&&(o.endLine=r,o.endChar=n-s+d,c=!0)}),o.startChar>0&&this.getCharsOnLine(t,o.startLine)===o.startChar&&(o.startLine++,o.startChar=0),o.endChar===0&&o.endLine--;let f=/\n$/.test(i);return o.startChar>0&&f&&o.endLine++,o}getCharsOnLine(t,e){return Xn(t,e).length}getLineForCharPosition(t,e){let i=t.ace.getSession().doc.getAllLines(),o=0,n=0;for(let s=0;s<i.length;s+=1){let l=i[s];if(l!==void 0&&(n+=l.length+1),e<=n){o=s,e===n&&s<i.length-1&&(o+=1);break}}return n>=t.ace.getSession().getValue().length&&(o+=1),o}createGutter(){let t=document.getElementById(this.options.classes.gutterID);if(!t)return;this.gutterHeight=t.clientHeight,this.gutterWidth=t.clientWidth;let e=this.getTotalHeight(de),i=this.getTotalHeight(_e),o=Math.max(e,i,this.gutterHeight);this.gutterSVG=document.createElementNS(dt.SVG_NS,"svg"),this.gutterSVG.setAttribute("width",String(this.gutterWidth)),this.gutterSVG.setAttribute("height",String(o)),t.appendChild(this.gutterSVG)}getTotalHeight(t){return(t===de?this.editors.left:this.editors.right).ace.getSession().getLength()*this.lineHeight}createCopyContainers(){var e,i;this.copyRightContainer=document.createElement("div"),this.copyRightContainer.setAttribute("class",(e=this.options.classes.copyRightContainer)!=null?e:""),this.copyLeftContainer=document.createElement("div"),this.copyLeftContainer.setAttribute("class",(i=this.options.classes.copyLeftContainer)!=null?i:"");let t=document.getElementById(this.options.classes.gutterID);t&&(t.appendChild(this.copyRightContainer),t.appendChild(this.copyLeftContainer))}clearGutter(){let t=document.getElementById(this.options.classes.gutterID);t&&this.gutterSVG&&t.removeChild(this.gutterSVG),this.createGutter()}clearArrows(){this.copyLeftContainer&&(this.copyLeftContainer.innerHTML=""),this.copyRightContainer&&(this.copyRightContainer.innerHTML="")}simplifyDiffs(t){let e=[],i=n=>this.options.diffGranularity===Yn?n<1:n<=1,o=n=>{var l,c,f,d,r,u;let s={...n,leftChars:[],rightChars:[]};return n.leftEndChar!==void 0&&s.leftChars.push({start:(l=n.leftStartChar)!=null?l:0,end:n.leftEndChar,lineStart:(c=n.leftStartLine)!=null?c:0,lineEnd:(f=n.leftEndLine)!=null?f:0}),n.rightEndChar!==void 0&&s.rightChars.push({start:(d=n.rightStartChar)!=null?d:0,end:n.rightEndChar,lineStart:(r=n.rightStartLine)!=null?r:0,lineEnd:(u=n.rightEndLine)!=null?u:0}),s};return t.forEach((n,s)=>{var c,f;if(s===0){e.push(o(n));return}let l=!1;for(let d=0;d<e.length;d+=1)if(i(Math.abs(n.leftStartLine-e[d].leftEndLine))&&i(Math.abs(n.rightStartLine-e[d].rightEndLine))){e[d].leftStartLine=Math.min(n.leftStartLine,e[d].leftStartLine),e[d].rightStartLine=Math.min(n.rightStartLine,e[d].rightStartLine),e[d].leftEndLine=Math.max(n.leftEndLine,e[d].leftEndLine),e[d].rightEndLine=Math.max(n.rightEndLine,e[d].rightEndLine),e[d].leftStartOffset=Math.min(n.leftStartOffset,e[d].leftStartOffset),e[d].leftEndOffset=Math.max(n.leftEndOffset,e[d].leftEndOffset),e[d].rightStartOffset=Math.min(n.rightStartOffset,e[d].rightStartOffset),e[d].rightEndOffset=Math.max(n.rightEndOffset,e[d].rightEndOffset),n.leftEndChar!==void 0&&e[d].leftChars.push({start:(c=n.leftStartChar)!=null?c:0,end:n.leftEndChar,lineStart:n.leftStartLine,lineEnd:n.leftEndLine}),n.rightEndChar!==void 0&&e[d].rightChars.push({start:(f=n.rightStartChar)!=null?f:0,end:n.rightEndChar,lineStart:n.rightStartLine,lineEnd:n.rightEndLine}),l=!0;break}l||e.push(o(n))}),e.filter(n=>!(n.leftStartLine===n.leftEndLine&&n.rightStartLine===n.rightEndLine))}decorate(){this.clearGutter(),this.clearArrows(),this.diffs.forEach((t,e)=>{var i,o;this.options.showDiffs&&(this.showDiff(de,t.leftStartLine,t.leftEndLine,t.leftChars,(i=this.options.classes.diff)!=null?i:""),this.showDiff(_e,t.rightStartLine,t.rightEndLine,t.rightChars,(o=this.options.classes.diff)!=null?o:""),this.options.showConnectors&&this.addConnector(t.leftStartLine,t.leftEndLine,t.rightStartLine,t.rightEndLine),this.addCopyArrows(t,e))})}};const ns=D({__name:"diff",props:{mode:{type:String,default:"Text"}},setup(t){const e=t,i=W(),{editorConfig:o,currentFile:n}=K(i),s=Ce("diffRef");let l=null;const c=d=>new Promise(r=>{fe.config.loadModule(d,()=>r())}),f=async()=>{var T,I,O;if(fe.config.set("basePath","/static/ace"),await c("ace/ext/language_tools"),!s.value)return;const{editorTheme:d}=o.value.aceEditor,r="ace/theme/".concat(d);if(await c(r),!s.value)return;const{fontSize:u,fontFamily:h,showInvisibles:g,showLineNumbers:b,useSoftTabs:y,tabSize:p}=o.value.aceEditor,w="ace/mode/".concat((T=e.mode)==null?void 0:T.toLocaleLowerCase());l=new is({ace:fe,element:s.value,theme:r,mode:w,left:{content:((I=n.value)==null?void 0:I.leftContent)||"",editable:!1,copyLinkEnabled:!1},right:{content:((O=n.value)==null?void 0:O.rightContent)||"",editable:!1,copyLinkEnabled:!1}});const M=l.getEditors();[M.left,M.right].forEach(A=>{A.setOptions({fontSize:u,fontFamily:h,showInvisibles:g,showLineNumbers:b,useSoftTabs:y,tabSize:p,showPrintMargin:!1,wrap:!0,indentedSoftWrap:!0})}),ye(()=>{var A;return(A=n.value)==null?void 0:A.leftContent},A=>{l&&l.getEditors().left.setValue(A||"",-1)}),ye(()=>{var A;return(A=n.value)==null?void 0:A.rightContent},A=>{l&&l.getEditors().right.setValue(A||"",-1)})};return ge(()=>{f()}),$t(()=>{l&&l.destroy()}),mt(()=>{const{editorTheme:d,fontSize:r,fontFamily:u,showInvisibles:h,showLineNumbers:g,useSoftTabs:b,tabSize:y}=o.value.aceEditor;if(l){const p=l.getEditors();[p.left,p.right].forEach(w=>{w.setTheme("ace/theme/".concat(d)),w.setOptions({fontSize:r,fontFamily:u,showInvisibles:h,showLineNumbers:g,useSoftTabs:b,tabSize:y})})}}),(d,r)=>(S(),$("div",{ref_key:"diffRef",ref:s,class:"ace-diff-container w-full h-full"},null,512))}}),ss=R(ns,[["__scopeId","data-v-4b286035"]]),os={},ls={class:"flex-1 bg-[#262626] overflow-y-auto w-full h-full text-[#ccc]"},as={class:"flex gap-60px max-w-[1200px] mx-auto py-30px px-50px justify-center"},rs={class:"flex-1"},cs={class:"text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary"},ds={class:"flex flex-col gap-[14px] text-[14px]"},fs={class:"flex items-center"},us={class:"text-[#a4a4a4] ml-[16px]"},hs={class:"flex items-center"},ps={class:"text-[#a4a4a4] ml-[16px]"},gs={class:"flex items-center"},ms={class:"text-[#a4a4a4] ml-[16px]"},vs={class:"flex items-center"},bs={class:"text-[#a4a4a4] ml-[16px]"},_s={class:"flex items-center"},ys={class:"text-[#a4a4a4] ml-[16px]"},Cs={class:"flex items-center"},xs={class:"text-[#a4a4a4] ml-[16px]"},ws={class:"flex items-center"},Es={class:"text-[#a4a4a4] ml-[16px]"},Ss={class:"flex items-center"},ks={class:"text-[#a4a4a4] ml-[16px]"},Ls={class:"flex items-center"},$s={class:"text-[#a4a4a4] ml-[16px]"},Ts={class:"flex items-center"},Ms={class:"text-[#a4a4a4] ml-[16px]"},Fs={class:"mt-[40px]"},As={class:"text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary"},Is={class:"flex flex-col gap-[14px] text-[14px]"},Os={class:"flex items-center"},zs={class:"text-[#a4a4a4] ml-[16px]"},Hs={class:"flex items-center"},Ns={class:"text-[#a4a4a4] ml-[16px]"},Ps={class:"flex items-center"},Ds={class:"text-[#a4a4a4] ml-[16px]"},Rs={class:"flex items-center"},Gs={class:"text-[#a4a4a4] ml-[16px]"},Us={class:"flex-1"},Vs={class:"text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary"},js={class:"flex flex-col gap-[14px] text-[14px]"},Bs={class:"flex items-center"},qs={class:"flex items-center gap-[6px] min-w-[260px] text-white"},Ws={class:"flex items-center"},Ks={class:"text-[#a4a4a4] ml-[16px]"},Js={class:"flex items-center"},Ys={class:"text-[#a4a4a4] ml-[16px]"},Qs={class:"flex items-center"},Xs={class:"flex items-center gap-[6px] min-w-[260px] text-white"},Zs={class:"text-[#a4a4a4] ml-[16px]"},eo={class:"mt-[40px]"},to={class:"text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary"},io={class:"flex flex-col gap-[14px] text-[14px]"},no={class:"flex items-center"},so={class:"text-[#a4a4a4] ml-[16px]"},oo={class:"flex items-center"},lo={class:"text-[#a4a4a4] ml-[16px]"},ao={class:"flex items-center"},ro={class:"text-[#a4a4a4] ml-[16px]"},co={class:"flex items-center"},fo={class:"text-[#a4a4a4] ml-[16px]"},uo={class:"flex items-center"},ho={class:"text-[#a4a4a4] ml-[16px]"},po={class:"flex items-center"},go={class:"text-[#a4a4a4] ml-[16px]"},mo={class:"flex items-center"},vo={class:"text-[#a4a4a4] ml-[16px]"},bo={class:"flex items-center"},_o={class:"text-[#a4a4a4] ml-[16px]"},yo={class:"flex items-center"},Co={class:"text-[#a4a4a4] ml-[16px]"};function xo(t,e){return S(),$("div",ls,[a("div",as,[a("div",rs,[a("div",null,[a("div",cs,_(t.$t("fileEditor.shortcut.common.title")),1),a("div",ds,[a("div",fs,[e[0]||(e[0]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"S")],-1)),a("div",us,_(t.$t("fileEditor.shortcut.common.saveFile")),1)]),a("div",hs,[e[1]||(e[1]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"C")],-1)),a("div",ps,_(t.$t("fileEditor.shortcut.common.copy")),1)]),a("div",gs,[e[2]||(e[2]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"X")],-1)),a("div",ms,_(t.$t("fileEditor.shortcut.common.cut")),1)]),a("div",vs,[e[3]||(e[3]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"V")],-1)),a("div",bs,_(t.$t("fileEditor.shortcut.common.paste")),1)]),a("div",_s,[e[4]||(e[4]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"A")],-1)),a("div",ys,_(t.$t("fileEditor.shortcut.common.selectAll")),1)]),a("div",Cs,[e[5]||(e[5]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"Z")],-1)),a("div",xs,_(t.$t("fileEditor.shortcut.common.undo")),1)]),a("div",ws,[e[6]||(e[6]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"Y")],-1)),a("div",Es,_(t.$t("fileEditor.shortcut.common.redo")),1)]),a("div",Ss,[e[7]||(e[7]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"F")],-1)),a("div",ks,_(t.$t("fileEditor.shortcut.common.find")),1)]),a("div",Ls,[e[8]||(e[8]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"H")],-1)),a("div",$s,_(t.$t("fileEditor.shortcut.common.replace")),1)]),a("div",Ts,[e[9]||(e[9]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Esc")],-1)),a("div",Ms,_(t.$t("fileEditor.shortcut.common.esc")),1)])])]),a("div",Fs,[a("div",As,_(t.$t("fileEditor.shortcut.cursorMove.title")),1),a("div",Is,[e[14]||(e[14]=a("div",{class:"flex items-center"},[a("div",{class:"flex items-center flex-wrap gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Home"),L(" / "),a("kbd",null,"End"),L(" / "),a("kbd",null,"Up"),L(" / "),a("kbd",null,"Left"),L(" / "),a("kbd",null,"Down"),L(" / "),a("kbd",null,"Right")])],-1)),a("div",Os,[e[10]||(e[10]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"Home"),L(" / "),a("kbd",null,"End")],-1)),a("div",zs,_(t.$t("fileEditor.shortcut.cursorMove.docStartEnd")),1)]),a("div",Hs,[e[11]||(e[11]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"P")],-1)),a("div",Ns,_(t.$t("fileEditor.shortcut.cursorMove.matchingTag")),1)]),a("div",Ps,[e[12]||(e[12]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"PageUp"),L(" / "),a("kbd",null,"PageDown")],-1)),a("div",Ds,_(t.$t("fileEditor.shortcut.cursorMove.pageUpDown")),1)]),a("div",Rs,[e[13]||(e[13]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Alt"),L(" + "),a("kbd",null,"Left"),L(" / "),a("kbd",null,"Right")],-1)),a("div",Gs,_(t.$t("fileEditor.shortcut.cursorMove.lineStartEnd")),1)])])])]),a("div",Us,[a("div",null,[a("div",Vs,_(t.$t("fileEditor.shortcut.selection.title")),1),a("div",js,[a("div",Bs,[a("div",qs,[a("kbd",null,_(t.$t("fileEditor.shortcut.selection.mouseBox")),1),e[15]||(e[15]=L(" —— ")),a("kbd",null,_(t.$t("fileEditor.shortcut.selection.drag")),1)])]),e[20]||(e[20]=Tt('<div class="flex items-center" data-v-fccb0a32><div class="flex items-center flex-wrap gap-[6px] min-w-[260px] text-white" data-v-fccb0a32><kbd data-v-fccb0a32>Shift</kbd> + <kbd data-v-fccb0a32>Home</kbd> / <kbd data-v-fccb0a32>End</kbd> / <kbd data-v-fccb0a32>Up</kbd> / <kbd data-v-fccb0a32>Left</kbd> / <kbd data-v-fccb0a32>Down</kbd> / <kbd data-v-fccb0a32>Right</kbd></div></div>',1)),a("div",Ws,[e[16]||(e[16]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Shift"),L(" + "),a("kbd",null,"PageUp"),L(" / "),a("kbd",null,"PageDown")],-1)),a("div",Ks,_(t.$t("fileEditor.shortcut.selection.pageSelect")),1)]),a("div",Js,[e[17]||(e[17]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"Shift"),L(" + "),a("kbd",null,"Home"),L(" / "),a("kbd",null,"End")],-1)),a("div",Ys,_(t.$t("fileEditor.shortcut.selection.cursorToStartEnd")),1)]),a("div",Qs,[a("div",Xs,[e[18]||(e[18]=a("kbd",null,"Alt",-1)),e[19]||(e[19]=L(" + ")),a("kbd",null,_(t.$t("fileEditor.shortcut.selection.mouseDrag")),1)]),a("div",Zs,_(t.$t("fileEditor.shortcut.selection.blockSelect")),1)])])]),a("div",eo,[a("div",to,_(t.$t("fileEditor.shortcut.edit.title")),1),a("div",io,[a("div",no,[e[21]||(e[21]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"/")],-1)),a("div",so,_(t.$t("fileEditor.shortcut.edit.toggleComment")),1)]),a("div",oo,[e[22]||(e[22]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Tab")],-1)),a("div",lo,_(t.$t("fileEditor.shortcut.edit.indent")),1)]),a("div",ao,[e[23]||(e[23]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Shift"),L(" + "),a("kbd",null,"Tab")],-1)),a("div",ro,_(t.$t("fileEditor.shortcut.edit.outdent")),1)]),a("div",co,[e[24]||(e[24]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Delete")],-1)),a("div",fo,_(t.$t("fileEditor.shortcut.edit.delete")),1)]),a("div",uo,[e[25]||(e[25]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"D")],-1)),a("div",ho,_(t.$t("fileEditor.shortcut.edit.deleteLine")),1)]),a("div",po,[e[26]||(e[26]=a("div",{class:"flex items-center flex-wrap gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Alt"),L(" + "),a("kbd",null,"Shift"),L(" + "),a("kbd",null,"Up"),L(" / "),a("kbd",null,"Down")],-1)),a("div",go,_(t.$t("fileEditor.shortcut.edit.copyLineUpDown")),1)]),a("div",mo,[e[27]||(e[27]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Alt"),L(" + "),a("kbd",null,"Delete")],-1)),a("div",vo,_(t.$t("fileEditor.shortcut.edit.deleteRight")),1)]),a("div",bo,[e[28]||(e[28]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Alt"),L(" + "),a("kbd",null,"Up"),L(" / "),a("kbd",null,"Down")],-1)),a("div",_o,_(t.$t("fileEditor.shortcut.edit.swapLineUpDown")),1)]),a("div",yo,[e[29]||(e[29]=a("div",{class:"flex items-center gap-[6px] min-w-[260px] text-white"},[a("kbd",null,"Ctrl"),L(" + "),a("kbd",null,"Shift"),L(" + "),a("kbd",null,"D")],-1)),a("div",Co,_(t.$t("fileEditor.shortcut.edit.copyLineDown")),1)])])])])])])}const wo=R(os,[["render",xo],["__scopeId","data-v-fccb0a32"]]),Eo={class:"flex-1 flex flex-col h-full bg-[#1e1e1e] overflow-hidden"},So={class:"flex-1 overflow-hidden relative"},ko=D({__name:"index",setup(t,{expose:e}){const i=W(),{fileList:o,currentFileIndex:n,currentFile:s,editorConfig:l}=K(i),{saveFileContentAndClose:c,closeTab:f,updateTabContent:d}=i,r=Ce("editorMainRef"),u=G({get:()=>{var m;return((m=s.value)==null?void 0:m.content)||""},set:m=>{n.value!==-1&&d(n.value,m)}}),h=Mt({line:1,column:1}),g=G(()=>Number(l.value.aceEditor.tabSize)),b=G(()=>l.value.aceEditor.useSoftTabs),y=G(()=>{var m;return((m=s.value)==null?void 0:m.encoding)||""}),p=G(()=>{const m=new Map,k=Object.entries(l.value.supportedModes||{});for(const[C,oe]of k){const X=oe[0].split("|");for(const Z of X)m.set(Z,C)}return m}),w=G(()=>{var k;const m=(k=s.value)==null?void 0:k.type;return m&&p.value.get(m)||"Text"}),M=G(()=>{var k,C;const m=w.value;return(C=(k=l.value.nameOverrides)==null?void 0:k[m])!=null?C:m}),T=async m=>{await c(m)},I=m=>{f(m)},O=m=>{h.line=m.line,h.column=m.column},A=m=>{var k;(k=r.value)==null||k.gotoLine(m)},V=()=>{var m;ie({width:420,footer:!1,showMask:!1,data:{currentLine:h==null?void 0:h.line,currentColumn:h==null?void 0:h.column,maxLine:(m=s.value)!=null&&m.content?s.value.content.split("\n").length:1,onChange:k=>{A(k)}},component:yt})};return e({handleToolbarAction:m=>{var k,C;m==="search"?(k=r.value)==null||k.execCommand("find"):m==="replace"?(C=r.value)==null||C.execCommand("replace"):m==="jumpLine"&&s.value&&V()}}),i.getEditorConfig(),(m,k)=>(S(),$("div",Eo,[F(Yi,{value:x(n),"onUpdate:value":k[0]||(k[0]=C=>se(n)?n.value=C:null),data:x(o),save:T,onClose:I},null,8,["value","data"]),x(s)?(S(),$(me,{key:0},[a("div",So,[x(s).type==="shortcut"?(S(),Le(wo,{key:0})):x(s).type==="diff"?(S(),Le(ss,{key:1,mode:x(w)},null,8,["mode"])):(S(),Le(Xi,{key:2,ref_key:"editorMainRef",ref:r,value:x(u),"onUpdate:value":k[1]||(k[1]=C=>se(u)?u.value=C:null),mode:x(w),onCursorChange:O,onShowGotoLine:V},null,8,["value","mode"]))]),x(s).type!=="shortcut"?(S(),Le($n,{key:0,"file-path":x(s).path,encoding:x(y),"line-ending":x(s).lineEnding,cursor:x(h),"tab-size":x(g),"use-soft-tabs":x(b),language:x(M),onJumpLine:A},null,8,["file-path","encoding","line-ending","cursor","tab-size","use-soft-tabs","language"])):ue("",!0)],64)):ue("",!0)]))}}),Lo={class:"editor-container"},$o={class:"editor-body"},To=D({__name:"index",props:{filePath:{type:String,required:!0},currentPath:{type:String,required:!0},onClose:{type:Function,required:!0},onMaximize:{type:Function,required:!0},onMinimize:{type:Function,required:!0}},setup(t){const e=t,i=Ce("codeEditorRef"),{t:o}=Q(),n=W(),s=h=>{if(h.key==="F5"||h.key==="r"&&(h.metaKey||h.ctrlKey)){h.preventDefault(),j.info(o("fileEditor.messages.noRefresh"));return}};n.setCurrentPath(e.currentPath),ge(()=>{window.addEventListener("keydown",s,{capture:!0}),n.openFile(e.filePath)}),Ft(()=>{window.removeEventListener("keydown",s,{capture:!0}),n.fileList=[],n.currentFileIndex=-1,n.currentPath="",n.creatingType=null,n.isSearchMode=!1});const l=H(!1),c=H(!1),f=h=>{i.value&&i.value.handleToolbarAction(h)},d=()=>{l.value=!l.value,e.onMinimize()},r=()=>{c.value=!c.value,e.onMaximize()},u=()=>{const h=n.fileList.some(b=>b.content!==b.originalContent&&b.type!=="shortcut"),g=()=>{Ot(),e.onClose&&e.onClose()};h?he({title:o("fileEditor.editorHeader.tipTitle"),content:o("fileEditor.editorHeader.modifiedSaveConfirm"),confirmText:o("fileEditor.common.save"),cancelText:o("fileEditor.editorHeader.dontSave"),onConfirm:async()=>{await n.saveAllFile(),g()},onCancel:()=>{g()}}):g()};return(h,g)=>(S(),$("div",Lo,[F(ii,{"is-minimize":x(l),"is-maximize":x(c),onMinimize:d,onMaximize:r,onClose:u},null,8,["is-minimize","is-maximize"]),Pe(F(ki,{onAction:f},null,512),[[Be,!x(l)]]),Pe(a("main",$o,[F(ji),F(ko,{ref_key:"codeEditorRef",ref:i},null,512)],512),[[Be,!x(l)]])]))}}),Zo=R(To,[["__scopeId","data-v-23722196"]]);export{Zo as default};