← Back
Editing: feature-FileEditor.js
;(() => { const stylesheetSelector = "link[rel=stylesheet]" const loaded = new Set(Array.from(document.querySelectorAll(stylesheetSelector)).map(link => link.href)) const version = "1795169270504" const findLoadedLink = href => Array.from(document.querySelectorAll(stylesheetSelector)).find(link => link.href === href) const removeAfterLoad = (freshLink, staleLink) => { const remove = () => staleLink.remove() if (freshLink.sheet) { requestAnimationFrame(remove) return } freshLink.addEventListener("load", remove, { once: true }) } for (const link of Array.from(document.querySelectorAll(stylesheetSelector))) { const url = new URL(link.href, location.href) if (url.origin !== location.origin || url.searchParams.get("v") === version) continue url.searchParams.set("v", version) if (loaded.has(url.href)) { const freshLink = findLoadedLink(url.href) if (freshLink && freshLink !== link) removeAfterLoad(freshLink, link) continue } const freshLink = document.createElement("link") freshLink.rel = "stylesheet" freshLink.href = url.href link.parentNode?.insertBefore(freshLink, link.nextSibling) loaded.add(url.href) removeAfterLoad(freshLink, link) } })(); const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/view-files.js?v=1795169270504","js/rolldown-runtime.js?v=1795169270504","js/vendor-utils.js?v=1795169270504","js/vendor-vue.js?v=1795169270504","js/vendor-naive.js?v=1795169270504","js/vendor.js?v=1795169270504","css/vendor.css?v=1795169270504","js/app.js?v=1795169270504","js/vendor-pdf.js?v=1795169270504","js/vendor-polyfills.js?v=1795169270504","js/app-icons.js?v=1795169270504","css/app.css?v=1795169270504","js/app-components.js?v=1795169270504","js/app-base.js?v=1795169270504","js/vendor-code-highlight.js?v=1795169270504","css/vendor-code-highlight.css?v=1795169270504","css/app-base.css?v=1795169270504","js/vendor-pay.js?v=1795169270504","css/app-components.css?v=1795169270504","js/app-shared.js?v=1795169270504","js/app-modal-ui.js?v=1795169270504","js/vendor-crypto.js?v=1795169270504","css/app-shared.css?v=1795169270504","js/feature-FilePicker.js?v=1795169270504","css/feature-FilePicker.css?v=1795169270504","js/app-form.js?v=1795169270504","css/app-form.css?v=1795169270504","js/view-database.js?v=1795169270504","js/app-temp.js?v=1795169270504","css/app-temp.css?v=1795169270504","css/view-database.css?v=1795169270504","js/vendor-terminal.js?v=1795169270504","css/vendor-terminal.css?v=1795169270504","css/view-files.css?v=1795169270504"])))=>i.map(i=>d[i]); import{a as e,r as t}from"./rolldown-runtime.js?v=1795169270504";import{$n as n,$r as r,An as i,Bn as a,Br as o,Cn as s,Dr as c,En as l,Fn as u,Ft as d,Gn as f,Hn as p,Jn as m,Ln as h,Mn as g,Mr as _,On as v,Or as y,S as b,Sn as x,Sr as S,Tn as C,Yn as w,Zn as T,_n as E,dr as D,fr as O,gr as k,hn as A,ii as j,jn as M,jr as N,kn as P,ln as F,lr as I,mn as ee,nr as te,p as ne,pn as re,pr as ie,sr as ae,ti as oe,ur as se,wn as L,wr as R,yr as z}from"./vendor-utils.js?v=1795169270504";import{f as ce,l as B,p as V}from"./vendor-vue.js?v=1795169270504";import{I as le,J as ue,Mt as de,Nt as fe,Q as pe,R as me,Tt as he,X as ge,_t as _e,et as ve,ft as ye,j as be,nt as xe,s as Se,v as Ce,x as we}from"./vendor-naive.js?v=1795169270504";import{Bf as Te,Gf as H,Hf as U,If as W,Jf as G,Mf as Ee,Oa as De,Op as K,Pa as Oe,Pf as ke,Rf as Ae,Tp as je,Vf as q,Yf as Me,en as Ne,hn as Pe,i as Fe,ja as Ie,jn as Le,kn as Re,mp as ze,o as Be,op as Ve,pn as He,qf as Ue,vn as We,wp as Ge,yp as Ke}from"./app.js?v=1795169270504";import{Ei as qe,_a as Je,aa as Ye,ei as Xe,ha as Ze,na as Qe,ra as $e,ti as et,va as tt}from"./app-components.js?v=1795169270504";import{$d as nt,Jd as rt,Kd as it,Xd as at,cf as ot,ef as st,lf as ct,nf as lt,qd as ut,rf as dt,tf as ft}from"./app-shared.js?v=1795169270504";import{a as pt,i as J}from"./vendor-pdf.js?v=1795169270504";import{c as mt}from"./app-base.js?v=1795169270504";import{a as ht,c as gt,i as _t,l as vt,n as yt,o as bt,r as xt,s as St,t as Ct,u as wt}from"./vendor-ace.js?v=1795169270504";import{o as Tt}from"./feature-EmailEditor.js?v=1795169270504";h(),o(),k(),gt(),St(),bt(),ht(),_t(),xt(),yt();var Et={style:{color:`var(--ace-editor-tip-color)`}},Dt={key:0,class:`w-140px`},Ot=g({__name:`index`,props:a({height:{default:`100%`},showTips:{type:Boolean,default:!0},showEncoding:{type:Boolean,default:!1},lang:{default:`nginx`},theme:{default:`chrome`},init:{type:Boolean,default:!1},readOnly:{type:Boolean,default:!1},load:{type:Boolean,default:!1}},{path:{default:``},pathModifiers:{},value:{default:``},valueModifiers:{},encoding:{default:`utf-8`},encodingModifiers:{}}),emits:a([`saved`],[`update:path`,`update:value`,`update:encoding`]),setup(e,{expose:t,emit:n}){let r=ke(),{theme:a}=V(r),o=e,c=n,u=ae(e,`path`),d=ae(e,`value`),f=ae(e,`encoding`),m=R({wrap:!0,showInvisibles:!1,showPrintMargin:!1,showFoldWidgets:!1,useSoftTabs:!0,tabSize:2,readOnly:o.readOnly}),h=[{label:`utf-8`,value:`utf-8`},{label:`GBK`,value:`GBK`},{label:`GB2312`,value:`GB2312`},{label:`BIG5`,value:`BIG5`}],g=e=>{(e.ctrlKey||e.metaKey)&&e.keyCode===83&&!o.readOnly&&(e.preventDefault(),x())},{loading:v,setLoading:y}=Oe(),b=async()=>{try{y(!0),await p();let{message:e}=await ot({path:u.value});K(e)&&(d.value=e.data,f.value=e.encoding)}finally{y(!1)}},x=async()=>{if(u.value===``)return;let{message:e}=await ct({path:u.value,data:d.value,encoding:f.value});K(e)&&H.success(e.msg),c(`saved`,d.value)};return o.init&&b(),t({getContent:b,saveFile:x}),(t,n)=>{let r=xe,o=me,c=Ce;return T(),l(`div`,null,[e.showTips?(T(),L(o,{key:0,class:`items-center mb-8px`,justify:`space-between`},{default:O(()=>[s(`div`,Et,j(t.$t(`Component.Editor.index_1`)),1),e.showEncoding?(T(),l(`div`,Dt,[i(r,{value:f.value,"onUpdate:value":n[0]||(n[0]=e=>f.value=e),options:h},null,8,[`value`])])):C(``,!0)]),_:1})):C(``,!0),i(c,{class:`h-full`,show:e.load||_(v)},{default:O(()=>[i(_(vt),{class:`aceBox`,value:d.value,"onUpdate:value":n[1]||(n[1]=e=>d.value=e),lang:e.lang,theme:_(a)===`dark`?`monokai`:e.theme,options:_(m),style:oe({height:_(de)(e.height)}),onKeydown:g},null,8,[`value`,`lang`,`theme`,`options`,`style`])]),_:1},8,[`show`])])}}}),kt=t({default:()=>At}),At=G(Ot,[[`__scopeId`,`data-v-4f3e3417`]]),jt={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,lineHeight:1.5,softLabel:!1,useSoftTabs:!0,tabSize:4,wrap:!0,indentedSoftWrap:!0,enableSnippets:!0,enableLiveAutocompletion:!0,enableBasicAutocompletion:!0,highlightActiveLine:!0,highlightSelectedWord:!0,animatedScroll:!1,showInvisibles:!0,showFoldWidgets:!0,showLineNumbers:!0,showGutter:!0,displayIndentGuides:!1},fontFamily:`'Consolas', 'Menlo', 'Monaco', 'Ubuntu Mono', 'source-code-pro', 'Courier New', monospace`,encoding:`utf-8`};k(),h();var Mt=`/www/server/panel/BTPanel/static/ace/ace.editor.config.json`,{t:Y}=Me.global,X=ce(`fileEditor`,()=>{let e=R(!1),t=R(!1),n=R(null),r=R({show:!1,type:null,data:{}}),i=R([]),a=R(-1),o=R(`/www`),s=R(0),c=R(!1),l=R(!1),u=R(d(jt)),f=R(null),p=R(!1),m=R(``),h=R(!1),g=x(()=>a.value>=0&&a.value<i.value.length?i.value[a.value]:null),_=e=>{let t=e.split(`/`).pop()||Y(`fileEditor.store.untitled`);return{path:e,type:e.split(`.`).pop()||`text`,name:t,loading:!1,lineEnding:`LF`,content:``,originalContent:``,encoding:``,st_mtime:0,onlyRead:!1,history:[]}},v=async e=>{let t=i.value.findIndex(t=>t.path===e);if(t!==-1){a.value=t;return}let{message:n}=await at({path:e});if(K(n)){let t=_(e),r=a.value+1;i.value.splice(r,0,t),a.value=r;let o=i.value[r];o.content=n.data,o.originalContent=n.data,o.encoding=n.encoding,o.st_mtime=Number(n.st_mtime),o.onlyRead=n.only_read,o.history=n.historys||[],o.onlyRead&&H.warning(Y(`fileEditor.store.fileTooLarge`))}},y=()=>{let e=`__shortcut__`,t=i.value.findIndex(t=>t.path===e);if(t!==-1){a.value=t;return}let n={path:e,type:`shortcut`,name:Y(`fileEditor.store.shortcutTabName`),loading:!1,lineEnding:`LF`,content:``,originalContent:``,encoding:`UTF-8`,st_mtime:0,onlyRead:!1,history:[]},r=a.value+1;i.value.splice(r,0,n),a.value=r},b=async(e,t)=>{let n=e.split(`/`).pop()||`Untitled`,r=`__diff__${e}__${t}`,o=i.value.findIndex(e=>e.path===r);if(o!==-1){a.value=o;return}let s={path:r,type:`diff`,name:`${n} <-> ${n}`,loading:!0,lineEnding:`LF`,content:``,originalContent:``,encoding:`UTF-8`,st_mtime:0,onlyRead:!0,history:[],originalPath:e,historyTime:t},c=a.value+1;i.value.splice(c,0,s),a.value=c;try{var l,u;let[n,r]=await Promise.all([at({path:e}),st({filename:e,history:t})]),o=i.value[a.value];n.message&&K(n.message)&&(o.rightContent=n.message.data,o.encoding=n.message.encoding),r.message&&K(r.message),o.leftContent=typeof r.message==`string`?r.message:(l=(u=r.message)==null?void 0:u.data)==null?``:l,o.loading=!1}catch(e){let t=i.value[a.value];t&&(t.loading=!1)}},S=async e=>{let{message:t}=await at({path:e});if(K(t)){let n=i.value.findIndex(t=>t.path===e);if(n!==-1){let e=i.value[n];e.content=t.data,e.originalContent=t.data,e.encoding=t.encoding,e.st_mtime=Number(t.st_mtime),e.history=t.historys||[]}}},C=async()=>{g.value&&g.value.type!==`shortcut`&&await S(g.value.path)},w=e=>{i.value.splice(e,1),a.value>=i.value.length&&(a.value=Math.max(0,i.value.length-1)),i.value.length===0&&(a.value=-1)},T=(e,t)=>{let n=i.value[e];n&&(n.content=t)},E=e=>{o.value=e},D=()=>{let e=o.value,t=e.lastIndexOf(`/`);t>0?o.value=e.substring(0,t):o.value=`/`},O=()=>{s.value++},k=e=>{p.value=e,e||(m.value=``,O())},A=(e,t)=>{m.value=e,h.value=t,O()},j=e=>{c.value=e},M=e=>{l.value=e},N=async()=>{let{message:e}=await at({path:Mt});if(K(e)){let t=JSON.parse(e.data);Object.assign(u.value,{...jt,...t})}},P=async()=>{await dt({data:JSON.stringify({supportedModes:u.value.supportedModes,nameOverrides:u.value.nameOverrides,encodingList:u.value.encodingList,themeList:u.value.themeList,aceEditor:u.value.aceEditor,fontFamily:u.value.fontFamily,encoding:u.value.encoding}),path:Mt,encoding:u.value.encoding||`UTF-8`,force:1})},F=(e,t=!0,n=!0)=>new Promise(async(r,a)=>{let o=i.value[e];if(o.type===`shortcut`)r();else try{let{message:e}=await dt({data:o.content,path:o.path,encoding:o.encoding,st_mtime:o.st_mtime,force:0},t);K(e)&&(e.status?(o.originalContent=o.content,o.history=e.historys||[],o.st_mtime=Number(e.st_mtime),n&&H.success(e.msg),r()):q({title:Y(`fileEditor.store.conflictTitle`),content:e.result||Y(`fileEditor.store.conflictContentFallback`),confirmText:Y(`fileEditor.store.forceSave`),confirmType:`warning`,onConfirm:async()=>{try{let{message:e}=await dt({data:o.content,path:o.path,encoding:o.encoding,st_mtime:o.st_mtime,force:1},!0);K(e)&&(o.originalContent=o.content,o.history=e.historys||[],o.st_mtime=Number(e.st_mtime),n&&H.success(e.msg),r())}catch(e){a(e)}},onCancel:()=>a(Error(`User cancelled override.`))}))}catch(e){a(e)}}),I=async(e,t=!0,n=!0)=>{await F(e,t,n),w(e)},ee=async()=>{g.value&&g.value.content!==g.value.originalContent&&await F(a.value)},te=async()=>{let e=H.loading(Y(`fileEditor.store.saveAllLoading`));try{let e=i.value.map((e,t)=>e.content!==e.originalContent&&e.type!==`shortcut`?F(t,!1,!1):null).filter(Boolean);e.length>0&&(await Promise.all(e),H.success(Y(`fileEditor.store.saveAllSuccess`)))}finally{e.close()}},ne=(e,t)=>t===`CRLF`?e.replace(/\r?\n/g,`\r `):t===`LF`?e.replace(/\r\n/g,` `):e;return{isOpen:e,isMinimize:t,unminimize:n,toolsModal:r,currentPath:o,fileList:i,currentFileIndex:a,currentFile:g,refreshKey:s,isLoading:c,isListLoading:l,editorConfig:u,creatingType:f,isSearchMode:p,searchWord:m,searchAll:h,openFile:v,openShortcutTab:y,openDiffTab:b,closeTab:w,updateTabContent:T,setCurrentPath:E,goToParent:D,refreshFileList:O,setLoading:j,setListLoading:M,getEditorConfig:N,saveEditorConfig:P,saveFileContent:F,saveFileContentAndClose:I,saveCurrentFileContent:ee,saveAllFile:te,getFileContent:S,changeLineEnding:async e=>{g.value&&g.value.type!==`shortcut`&&(g.value.content=ne(g.value.content,e),await ee(),g.value.lineEnding=e)},changeEncoding:async e=>{if(!g.value||g.value.type===`shortcut`)return;let t=g.value.path;u.value.aceEditor.encoding=e,await P(),g.value.encoding=e,await F(a.value,!0,!0),S(t)},changeTheme:async e=>{u.value.aceEditor.editorTheme=e,await P()},toggleSetting:async e=>{let t=u.value.aceEditor;t[e]=!t[e],await P()},updateTabSettings:async(e,t)=>{u.value.aceEditor.useSoftTabs=e!==`tab`,u.value.aceEditor.tabSize=t,await P(),H.success(Y(`fileEditor.store.tabSettingsRefreshed`))},getCurrentFileContent:C,startCreateNewItem:e=>{f.value=e},cancelCreateNewItem:()=>{f.value=null},confirmCreateNewItem:async e=>{if(!e.trim()){H.warning(Y(`fileEditor.store.nameRequired`));return}let t=f.value;t===`file`?await ut({path:`${o.value}/${e}`}):t===`folder`&&await it({path:`${o.value}/${e}`}),H.success(Y(`fileEditor.store.createSuccess`,{type:Y(t===`file`?`fileEditor.store.newFile`:`fileEditor.store.newFolder`)})),f.value=null,O()},toggleSearchMode:k,executeSearch:A,openToolsModal:(e,t)=>{r.value={show:!0,type:e,data:t||{}}},closeToolsModal:()=>{r.value={show:!1,type:null,data:{}}}}});h(),o(),k();var Nt={class:`title-left`},Pt={class:`title-right`},Ft=[`title`],It=[`title`],Lt={key:0,class:`i-ant-design-switcher-outlined`},Rt={key:1,class:`i-ant-design-border-outlined`},zt=[`title`],Bt=G(g({__name:`index`,props:{isMinimize:{type:Boolean},isMaximize:{type:Boolean}},emits:[`minimize`,`maximize`,`close`],setup(e,{emit:t}){let n=e,r=t,i=X(),a=R(null),o=()=>{r(`minimize`);let e=!n.isMinimize;a.value&&p(()=>{let t=Ge(a.value,`n-dialog`);if(t){if(!e)t.style.left=``,t.style.top=``;else{let e=document.documentElement.clientHeight-t.offsetHeight-68,n=parseFloat(t.style.left)||0,r=parseFloat(t.style.top)||0;t.style.left=`${n+216-t.offsetLeft}px`,t.style.top=`${r+e-t.offsetTop}px`}}})},c=()=>{r(`maximize`),!n.isMaximize&&a.value&&p(()=>{let e=Ge(a.value,`n-dialog`);e&&(e.style.left=``,e.style.top=``)})},u=()=>{r(`close`)};return m(()=>{i.unminimize=()=>{n.isMinimize&&o()}}),w(()=>{i.unminimize=null}),(t,n)=>{let r=te(`modal-drag`);return ie((T(),l(`div`,{ref_key:`titleRef`,ref:a,class:`editor-title`},[s(`div`,Nt,[s(`span`,null,j(t.$t(`fileEditor.title.onlineTextEditor`)),1)]),s(`div`,Pt,[!e.isMaximize&&!e.isMinimize?(T(),l(`div`,{key:0,class:`action-btn`,title:t.$t(`fileEditor.title.minimize`),onClick:o},[...n[1]||(n[1]=[s(`div`,{class:`i-ant-design-minus-outlined`},null,-1)])],8,Ft)):C(``,!0),s(`div`,{class:`action-btn`,title:e.isMinimize?t.$t(`fileEditor.title.restore`):e.isMaximize?t.$t(`fileEditor.title.restoreDown`):t.$t(`fileEditor.title.maximize`),onClick:n[0]||(n[0]=t=>e.isMinimize?o():c())},[e.isMinimize||e.isMaximize?(T(),l(`div`,Lt)):(T(),l(`div`,Rt))],8,It),s(`div`,{class:`action-btn close-btn`,onClick:u,title:t.$t(`fileEditor.title.close`)},[...n[2]||(n[2]=[s(`div`,{class:`i-ant-design-close-outlined`},null,-1)])],8,zt)])])),[[r]])}}}),[[`__scopeId`,`data-v-e102193c`]]);h(),o(),k(),F();var Vt={class:`toolbar-dialog`},Ht={class:`toolbar-title`},Ut={class:`fontsize-content flex items-center gap-16px`},Wt=G(g({__name:`index`,props:{currentSize:{type:Number,default:14},onChange:{type:Function}},emits:[`close`],setup(e,{emit:t}){let n=e,r=t,a=R(n.currentSize),o=R(null),c=()=>{let e=Number(a.value);if(!isNaN(e)&&e>0){var t;(t=n.onChange)==null||t.call(n,e),r(`close`)}};return m(()=>{var e;(e=o.value)==null||e.focus()}),(e,t)=>{let n=be,r=_e;return T(),l(`div`,Vt,[s(`div`,Ht,j(e.$t(`fileEditor.dialogs.fontSizeTitle`)),1),s(`div`,Ut,[i(n,{ref_key:`inputRef`,ref:o,value:_(a),"onUpdate:value":t[0]||(t[0]=e=>z(a)?a.value=e:null),"show-button":!1,class:`fontsize-input`,onKeyup:ee(c,[`enter`])},null,8,[`value`]),i(r,{type:`primary`,class:`fontsize-btn`,onClick:c},{default:O(()=>[P(j(e.$t(`fileEditor.common.save`)),1)]),_:1})])])}}}),[[`__scopeId`,`data-v-eefb830e`]]);h(),o();var Gt={class:`line-ending-select`},Kt=[`onClick`],qt={key:0,class:`i-fa6-solid-check`},Jt=G(g({__name:`LineSelect`,props:{value:{type:[String,Number,Array],default:``},options:{type:Array,default:()=>[]},onUpdateValue:[Function,Array],"onUpdate:value":[Function,Array]},setup(e){let t=e,i=(e,n)=>{let{onUpdateValue:r,"onUpdate:value":i}=t;r&&fe(r,e,n),i&&fe(i,e,n)};return(t,a)=>(T(),l(`div`,Gt,[(T(!0),l(E,null,n(e.options,t=>(T(),l(`div`,{key:t.value,class:r([`line-ending-item`,{active:e.value===t.value}]),onClick:e=>i(t.value,t)},[s(`span`,null,j(t.label),1),e.value===t.value?(T(),l(`i`,qt)):C(``,!0)],10,Kt))),128))]))}}),[[`__scopeId`,`data-v-9f1abe69`]]);h(),o(),k();var Yt={class:`toolbar-dialog`},Xt={class:`toolbar-title`},Zt=G(g({__name:`index`,props:{theme:{type:String,default:`monokai`},onChange:{type:Function}},setup(e){let{t}=B(),n=X(),{editorConfig:r}=V(n),a=e,o=R(a.theme||`monokai`),c=x(()=>({chrome:t(`fileEditor.dialogs.theme.chrome`),monokai:t(`fileEditor.dialogs.theme.monokai`)})),u=x(()=>r.value.themeList.map(e=>({label:c.value[e]||e,value:e}))),d=e=>{var t;(t=a.onChange)==null||t.call(a,e)};return(e,t)=>(T(),l(`div`,Yt,[s(`div`,Xt,j(e.$t(`fileEditor.dialogs.themeTitle`)),1),i(Jt,{value:_(o),"onUpdate:value":[t[0]||(t[0]=e=>z(o)?o.value=e:null),d],options:_(u)},null,8,[`value`,`options`])]))}}),[[`__scopeId`,`data-v-a095d4d8`]]);h(),o();var Qt={class:`toolbar-dialog`},$t={class:`toolbar-title`},en={class:`setting-list`},tn=[`onClick`],nn={key:0,class:`i-fa6-solid-check`},rn=G(g({__name:`index`,setup(e){let{t}=B(),r=X(),{editorConfig:i}=V(r),a=x(()=>i.value.aceEditor),o=x(()=>[{key:`wrap`,label:t(`fileEditor.dialogs.setting.wrap`)},{key:`enableLiveAutocompletion`,label:t(`fileEditor.dialogs.setting.enableLiveAutocompletion`)},{key:`enableSnippets`,label:t(`fileEditor.dialogs.setting.enableSnippets`)},{key:`showInvisibles`,label:t(`fileEditor.dialogs.setting.showInvisibles`)},{key:`showLineNumbers`,label:t(`fileEditor.dialogs.setting.showLineNumbers`)}]),c=async e=>{await r.toggleSetting(e)};return(e,t)=>(T(),l(`div`,Qt,[s(`div`,$t,j(e.$t(`fileEditor.dialogs.settingTitle`)),1),s(`div`,en,[(T(!0),l(E,null,n(o.value,e=>(T(),l(`div`,{key:e.key,class:`setting-item`,onClick:t=>c(e.key)},[s(`span`,null,j(e.label),1),a.value[e.key]?(T(),l(`i`,nn)):C(``,!0)],8,tn))),128))])]))}}),[[`__scopeId`,`data-v-81a9b969`]]);h(),o(),k();var an={class:`toolbar-dialog`},on={class:`toolbar-title`},sn=G(g({__name:`index`,props:{fileName:{type:String,default:``},lineEnding:{type:String,default:`LF`},onChange:{type:Function}},emits:[`close`],setup(e,{emit:t}){let n=e,{t:r}=B(),a=t,o=R(n.lineEnding),c=[{label:`CRLF`,value:`CRLF`},{label:`LF`,value:`LF`}],u=e=>{q({title:r(`fileEditor.dialogs.lineEndingChangeTitle`),confirmText:r(`fileEditor.common.save`),content:()=>i(E,null,[i(`div`,null,[r(`fileEditor.dialogs.lineEndingChangeContent1`,{file:n.fileName||``,from:o.value,to:e})]),i(`div`,{class:`mt-8px`},[r(`fileEditor.dialogs.lineEndingChangeContent2`,{save:r(`fileEditor.common.save`)})])]),onConfirm:async()=>{var t;await((t=n.onChange)==null?void 0:t.call(n,e)),a(`close`)}})};return(e,t)=>(T(),l(`div`,an,[s(`div`,on,j(e.$t(`fileEditor.dialogs.lineEndingTitle`)),1),i(Jt,{value:_(o),options:c,"onUpdate:value":u},null,8,[`value`])]))}}),[[`__scopeId`,`data-v-4c82ec83`]]);h(),o(),k();var cn={class:`toolbar-dialog`},ln={class:`toolbar-title`},un={class:`toolbar-title`},dn=G(g({__name:`index`,props:{useSoftTabs:{type:String,default:`tab`},tabSize:{type:Number,default:4},onChange:{type:Function}},setup(e){let{t}=B(),n=e,r=R(n.useSoftTabs),a=R(n.tabSize),o=x(()=>[{label:t(`fileEditor.dialogs.tabSize.useSpaces`),value:`space`},{label:t(`fileEditor.dialogs.tabSize.useTabs`),value:`tab`}]),c=[{label:`1`,value:1},{label:`2`,value:2},{label:`3`,value:3},{label:`4`,value:4},{label:`5`,value:5},{label:`6`,value:6}],u=()=>{f()},d=()=>{f()},f=()=>{var e;(e=n.onChange)==null||e.call(n,r.value,a.value)};return(e,t)=>(T(),l(`div`,cn,[s(`div`,ln,j(e.$t(`fileEditor.dialogs.tabSizeTitle`)),1),i(Jt,{value:_(r),"onUpdate:value":[t[0]||(t[0]=e=>z(r)?r.value=e:null),u],options:_(o)},null,8,[`value`,`options`]),s(`div`,un,j(e.$t(`fileEditor.dialogs.tabSizeLengthTitle`)),1),i(Jt,{value:_(a),"onUpdate:value":[t[1]||(t[1]=e=>z(a)?a.value=e:null),d],options:c},null,8,[`value`])]))}}),[[`__scopeId`,`data-v-efb6ea19`]]);h(),o(),k();var fn={class:`toolbar-dialog`},pn={class:`toolbar-title`},mn=G(g({__name:`index`,props:{encoding:{type:String,default:`UTF-8`},onChange:{type:Function}},setup(e){var t;let n=X(),{editorConfig:r}=V(n),a=e,o=R(((t=a.encoding)==null?void 0:t.toUpperCase())||`UTF-8`),c=x(()=>r.value.encodingList.map(e=>({label:e.toUpperCase(),value:e.toUpperCase()}))),u=e=>{var t;(t=a.onChange)==null||t.call(a,e)};return(e,t)=>(T(),l(`div`,fn,[s(`div`,pn,j(e.$t(`fileEditor.dialogs.encodingTitle`)),1),i(Jt,{value:_(o),"onUpdate:value":[t[0]||(t[0]=e=>z(o)?o.value=e:null),u],options:_(c)},null,8,[`value`,`options`])]))}}),[[`__scopeId`,`data-v-9ccb6b4e`]]);h(),o(),k(),F();var hn={class:`toolbar-dialog`},gn={class:`toolbar-title`},_n={class:`goto-content`},vn={class:`goto-hint`},yn=G(g({__name:`index`,props:{currentLine:{type:Number,default:1},currentColumn:{type:Number,default:1},maxLine:{type:Number,default:1},onChange:{type:Function}},emits:[`close`],setup(e,{expose:t,emit:n}){let r=e,a=n,o=R(r.currentLine),c=R(null),u=()=>{let e=Number(o.value);if(!isNaN(e)&&e>=1&&e<=r.maxLine){var t;(t=r.onChange)==null||t.call(r,e),a(`close`)}};return m(()=>{var e;(e=c.value)==null||e.focus()}),t({onClose:()=>{a(`close`)}}),(t,n)=>(T(),l(`div`,hn,[s(`div`,gn,j(t.$t(`fileEditor.dialogs.goToLineTitle`)),1),s(`div`,_n,[i(_(be),{value:o.value,"onUpdate:value":n[0]||(n[0]=e=>o.value=e),ref_key:`inputRef`,ref:c,"show-button":!1,class:`goto-input`,placeholder:``,onKeydown:ee(u,[`enter`])},null,8,[`value`]),s(`div`,vn,j(t.$t(`fileEditor.dialogs.goToLineHint`,{line:e.currentLine,column:e.currentColumn,max:e.maxLine})),1)])]))}}),[[`__scopeId`,`data-v-cb231c72`]]);h(),k(),o();var bn={class:`toolbar-list`},xn=[`onClick`],Sn=G(g({__name:`index`,emits:[`action`],setup(e,{emit:t}){let a=t,{t:o}=B(),c=X(),{editorConfig:u,toolsModal:d}=V(c),f=I(`toolbarWrapperRef`),p=x(()=>{var e;return(e=f.value)==null?void 0:e}),m=x(()=>{switch(d.value.type){case`fontSize`:return Wt;case`theme`:return Zt;case`setting`:return rn;case`lineEnding`:return sn;case`tabSize`:return dn;case`encoding`:return mn;case`goToLine`:return yn;default:return}}),h=x(()=>{switch(d.value.type){case`fontSize`:return{currentSize:Number(u.value.aceEditor.fontSize),onChange:b};case`theme`:return{theme:u.value.aceEditor.editorTheme,onChange:S};case`setting`:return{};case`lineEnding`:case`tabSize`:case`encoding`:case`goToLine`:return d.value.data;default:return{}}}),g=x(()=>[{key:`save`,label:o(`fileEditor.toolbar.save`),icon:`i-ep-select`},{key:`saveAll`,label:o(`fileEditor.toolbar.saveAll`),icon:`i-ep-document-copy`},{key:`refresh`,label:o(`fileEditor.toolbar.refresh`),icon:`i-ep-refresh-right`},{key:`search`,label:o(`fileEditor.toolbar.search`),icon:`i-ep-search`},{key:`replace`,label:o(`fileEditor.toolbar.replace`),icon:`i-ep-document`},{key:`goToLine`,label:o(`fileEditor.toolbar.jumpLine`),icon:`i-ep-location`},{key:`fontSize`,label:o(`fileEditor.toolbar.fontSize`),icon:`i-ep-monitor`},{key:`theme`,label:o(`fileEditor.toolbar.theme`),icon:`i-ep-operation`},{key:`setting`,label:o(`fileEditor.toolbar.setting`),icon:`i-ep-setting`},{key:`shortcut`,label:o(`fileEditor.toolbar.shortcut`),icon:`i-ep-question-filled`}]),v=e=>{switch(e){case`save`:c.saveCurrentFileContent();break;case`saveAll`:c.saveAllFile();break;case`refresh`:y();break;case`search`:case`replace`:a(`action`,e);break;case`goToLine`:a(`action`,e);break;case`fontSize`:case`theme`:case`setting`:c.openToolsModal(e);break;case`shortcut`:c.openShortcutTab()}},y=async()=>{let e=H.loading(o(`fileEditor.toolbar.refreshing`));try{await c.getCurrentFileContent(),H.success(o(`fileEditor.toolbar.refreshed`))}finally{e.close()}},b=async e=>{u.value.aceEditor.fontSize=e,await c.saveEditorConfig(),H.success(o(`fileEditor.toolbar.fontSizeSaved`)),c.closeToolsModal()},S=async e=>{await c.changeTheme(e),c.closeToolsModal()};return(e,t)=>{let a=Ee;return T(),l(`div`,{ref_key:`toolbarWrapperRef`,ref:f,class:`toolbar-wrapper`},[s(`div`,bn,[(T(!0),l(E,null,n(_(g),e=>(T(),l(`div`,{key:e.key,class:`tools-btn`,onClick:t=>v(e.key)},[s(`i`,{class:r(e.icon)},null,2),s(`span`,null,j(e.label),1)],8,xn))),128))]),i(a,{show:_(d).show,"onUpdate:show":t[0]||(t[0]=e=>_(d).show=e),component:_(m),data:_(h),to:_(p),width:420,footer:!1,"show-mask":!1,"hide-close":!0,"mask-closable":!0},null,8,[`show`,`component`,`data`,`to`])],512)}}}),[[`__scopeId`,`data-v-0064f6ea`]]);h(),o(),k();var Cn={class:`breadcrumb-wrapper`},wn={class:`flex-1 w-0`},Tn=G(g({__name:`Breadcrumb`,setup(e){let t=X(),{currentPath:n}=V(t);return(e,t)=>{let r=ge;return T(),l(`div`,Cn,[s(`div`,null,j(e.$t(`fileEditor.fileExplorer.directory`))+`:`,1),s(`div`,wn,[i(r,null,{default:O(()=>[P(j(_(n)),1)]),_:1})])])}}}),[[`__scopeId`,`data-v-0123ab4c`]]),En={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`]},Dn=(e=300)=>{let t=new Map;return(n=`default`)=>{var r;let i=Date.now();return i-((r=t.get(n))==null?-1/0:r)<e?!1:(t.set(n,i),!0)}},On=e=>{let t=e.match(/\.([0-9A-z]*)$/),n=Array.isArray(t)?t[1]:`text`;for(let e in En){let t=En[e][0].split(`|`),r=e.toLowerCase();for(let i=0;i<t.length;i++)if(n.toLowerCase()==t[i].toLowerCase())return{name:e,mode:r}}return{name:`Text`,mode:`text`}};h(),k(),o(),F();var kn={class:`action-btn`},An={key:1,class:`search-panel`},jn={class:`search-title`},Mn={class:`title-text`},Nn={class:`search-input-wrap`},Pn={class:`search-options`},Fn=G(g({__name:`Action`,setup(e){let{t}=B(),n=X(),{isLoading:a,creatingType:o,isListLoading:c}=V(n),d=e=>()=>u(`i`,{class:[`tree-icon`,e],style:`font-size: 16px; font-style: normal; display: inline-flex; align-items: center;`}),f=x(()=>[{label:t(`fileEditor.fileExplorer.newFolder`),key:`folder`,icon:d(`folder-icon`)},{label:t(`fileEditor.fileExplorer.newFile`),key:`file`,icon:d(`text-icon`)}]),p=e=>{n.startCreateNewItem(e)},m=Dn(400),h=()=>{if(c.value||!m())return;let e=n.currentPath,t=e.substring(0,e.lastIndexOf(`/`))||`/`;n.setCurrentPath(t===``?`/`:t)},g=()=>{n.refreshFileList()},v=R(n.searchWord),y=R(n.searchAll),b=()=>{v.value=n.searchWord,y.value=n.searchAll,n.toggleSearchMode(!0)},S=()=>{n.toggleSearchMode(!1),v.value=``,y.value=!1},C=()=>{n.executeSearch(v.value,y.value)};return(e,t)=>{let c=ue,u=he,d=ye;return T(),l(`div`,{class:r([`action-wrapper`,{"is-search-mode":_(n).isSearchMode}])},[_(n).isSearchMode?(T(),l(`div`,An,[s(`div`,jn,[s(`span`,Mn,j(e.$t(`fileEditor.fileExplorer.searchPanelTitle`)),1),s(`span`,{class:`close-btn`,onClick:S},[t[5]||(t[5]=s(`i`,{class:`i-ep-close`},null,-1)),P(` `+j(e.$t(`fileEditor.fileExplorer.close`)),1)])]),s(`div`,Nn,[i(u,{value:_(v),"onUpdate:value":t[0]||(t[0]=e=>z(v)?v.value=e:null),placeholder:e.$t(`fileEditor.fileExplorer.searchPlaceholder`),onKeydown:ee(C,[`enter`])},{suffix:O(()=>[s(`div`,{class:`search-icon-btn`,onClick:C},[...t[6]||(t[6]=[s(`i`,{class:`i-ep-search`},null,-1)])])]),_:1},8,[`value`,`placeholder`])]),s(`div`,Pn,[i(d,{checked:_(y),"onUpdate:checked":t[1]||(t[1]=e=>z(y)?y.value=e:null)},{default:O(()=>[P(j(e.$t(`fileEditor.fileExplorer.includeSubdir`)),1)]),_:1},8,[`checked`])])])):(T(),l(E,{key:0},[s(`div`,{class:`action-btn`,onClick:h},[t[2]||(t[2]=s(`i`,{class:`i-ep-top`},null,-1)),s(`span`,null,j(e.$t(`fileEditor.fileExplorer.up`)),1)]),s(`div`,{class:`action-btn`,onClick:g},[s(`i`,{class:r([`i-ep-refresh-right`,{"is-loading":_(a)}])},null,2),s(`span`,null,j(e.$t(`fileEditor.fileExplorer.refresh`)),1)]),i(c,{trigger:`click`,disabled:_(o)!==null,options:_(f),placement:`bottom`,"show-arrow":!0,"arrow-point-to-center":!0,onSelect:p},{default:O(()=>[s(`div`,kn,[t[3]||(t[3]=s(`i`,{class:`i-ep-plus`},null,-1)),s(`span`,null,j(e.$t(`fileEditor.fileExplorer.new`)),1)])]),_:1},8,[`disabled`,`options`]),s(`div`,{class:`action-btn`,onClick:b},[t[4]||(t[4]=s(`i`,{class:`i-ep-search`},null,-1)),s(`span`,null,j(e.$t(`fileEditor.fileExplorer.search`)),1)])],64))],2)}}}),[[`__scopeId`,`data-v-4b13f5e5`]]);k();function In(e,t,n){let r=R(!0),i=R(0),a=R(0),o=R(0),s=R(0),c=R(0),l=R(0),u=R(0),d=R(0);function f(){let e=null;return t?()=>{e||(e=setTimeout(()=>{t({m_flag:r,m_left:i,m_right:a,m_bottom:s,m_top:o,m_x:u,m_y:d,m_height:c,m_width:l}),clearTimeout(e),e=null},10))}:!1}let p;z(e)?p=e.value:typeof e==`string`?p=document.querySelector(e):e instanceof Element&&(p=e);let m=f();function h(e){let{left:t,right:n,top:r,bottom:f,height:p,width:m,x:h,y:g}=e.getBoundingClientRect();i.value=t,a.value=n,o.value=r,s.value=f,c.value=p,l.value=m,u.value=h,d.value=g}return p&&(p.onmousedown=e=>{if(n&&n(e,{m_flag:r,m_left:i,m_right:a,m_bottom:s,m_top:o,m_x:u,m_y:d,m_height:c,m_width:l}),!r.value)return;let{left:t,right:f,top:g,bottom:_}=p.getBoundingClientRect(),v=document.createElement(`div`),y=e.clientX,b=e.clientY;v.style.position=`absolute`,v.style.left=y-t+`px`,v.style.top=b-g+`px`,v.style.width=`0px`,v.style.height=`0px`,v.style.backgroundColor=`rgba(135, 182, 130, 0.1)`,v.classList.add(`district-wrapper`),p.appendChild(v),e.preventDefault();let x=e=>{e.preventDefault(),!w.value&&!D.value&&(y<=e.clientX?v.style.width=e.clientX-y+`px`:(v.style.width=y-e.clientX+`px`,v.style.marginLeft=-(y-e.clientX)+`px`),b<=e.clientY?(v.style.height=e.clientY-b+k+`px`,v.style.marginTop=-k+`px`):(v.style.height=b-e.clientY+A+`px`,v.style.marginTop=-(b-e.clientY)+`px`),e.clientX<t&&(v.style.width=y-t+`px`,v.style.marginLeft=-(y-t)+`px`),e.clientX>f&&(v.style.width=f-y+`px`)),e.clientY>_&&C(),e.clientY<g&&E(),h(v),m&&m()},{pause:S,resume:C,isActive:w}=ne(()=>{O.scrollTop>=O.scrollHeight-O.clientHeight?S():(v.style.height=v.offsetHeight+10+`px`,v.style.marginTop=parseInt(getComputedStyle(v).marginTop)-10+`px`,O.scrollTop+=10,k=O.scrollTop,h(v),m&&m())},{immediate:!1}),{pause:T,resume:E,isActive:D}=ne(()=>{O.scrollTop<=0?T():(v.style.height=v.offsetHeight+10+`px`,O.scrollTop-=10,A+=10,h(v),m&&m())},{immediate:!1}),O=p.querySelector(`.n-scrollbar-container`),k=0,A=0;document.onmousemove=x,document.onmouseup=()=>{document.onmousemove=null,p.contains(v)&&p.removeChild(v)}}),{m_flag:r,m_x:u,m_y:d,m_left:i,m_right:a,m_top:o,m_bottom:s,m_height:c,m_width:l}}function Ln(e,t){let n=N(e.m_left),r=N(e.m_right),i=N(e.m_top),a=N(e.m_bottom),o=N(t.left),s=N(t.right),c=N(t.top),l=N(t.bottom);return!(s<n||o>r||l<i||c>a)}function Rn(e){e.card_hover=!0}function zn(e){e.card_hover=!1}h(),pt();var Bn=(e,t)=>{let n=X();n.isOpen?(n.openFile(e),n.unminimize&&n.unminimize()):U({width:`1440px`,height:`80vh`,bgColor:`transparent`,hideClose:!0,showMask:!1,data:{filePath:e,currentPath:t},component:M(()=>J(()=>Promise.resolve().then(()=>Ns),void 0))})};h(),k(),pt();var Vn=b(e=>dr(e),100),{t:Hn}=Me.global;async function Z(e,t){let{tableLoading:n,currentPath:r,favoriteList:i,fileRecycle:a,fileList:o,filesView:s,directoryCount:c,fileCount:l,total:u,page:d,size:f,sort:m,reverse:h,diskMountPoint:g,currentFile:_,currentDirSize:v,uploadFileList:y,dragUploadRef:b}=e;n.value=!0;try{var x;let n=await ja(r.value,e=>{i.value=e.store,a.value=e.file_recycle,c.value=e.dir.length,l.value=e.files.length,u.value=Ke(e.page),g.value=e.disk,r.value=e.path},{p:d.value,showRow:f.value,...m.value?{sort:m.value,reverse:h.value}:{},disk:!0,...t});_.value=null,v.value=-1;let S=await Wn(e),C=[];S.length&&(C=S.map(e=>e.key)),o.value=n.map(e=>(e.remarks_hover=!1,e.isEditRemarks=!1,e.isCreate=!1,e.card_hover=!1,e.card_choosed=!1,e.isRenameForCard=!1,e.operation_show=!1,e.isFavorite=!!C.includes(e.path),e.isShare=Number(e.durl)===0?0:Number(e.durl),e)),y.value=[],(x=b.value)==null||x.listenDragEvent(),p(()=>{s.value==`list`&&(Un(e),Xn(e))}),Pa(e)}catch(e){console.warn(e)}finally{n.value=!1}}function Un(e){let{tableRef:t}=e;t.value&&In(t.value.querySelector(`.n-data-table-base-table-body`),t=>Gn(e,t),(t,n)=>Kn(t,n,e))}async function Wn(e){let{resetFavoriteOptions:t,favoriteOptions:n}=e;try{let e=(await W.post(`/files?action=get_files_store`,{},{requestOptions:{isOriginalResult:!0}})).message.map(e=>({type:e.type,icon:e.type,label:e.name,key:e.path}));return t(),n.value=[...e,...n.value],n.value}catch(e){return console.warn(e),[]}}function Gn(e,t){let{trRectArr:n,choosedKeys:r}=e,i=[];for(let e=0;e<n.value.length;e++){let[[r,a]]=Object.entries(n.value[e]);Ln(t,a.getClientRects()[0])&&i.push(r)}r.value=[...new Set(i)]}function Kn(e,t,n){let{choosedKeys:r}=n;if(!e.target.closest(`.n-checkbox-box`)){if(e.target.classList.contains(`file-checkbox`)){let t=e.target.closest(`tr`).dataset.key;r.value.includes(t)?r.value=r.value.filter(e=>e!==t):r.value.push(t)}else{if(qn(n),e.target.closest(`tr`)){let t=e.target.closest(`tr`).dataset.key;if(e.button==0&&(r.value=[t]),e.button==2){if(r.value.includes(t))return;r.value=[t]}}e.target.nodeName==`INPUT`?t.m_flag.value=!1:t.m_flag.value=!0}}}function qn(e){var t;let{normalTrList:n,trRectArr:r,tableRef:i}=e,a=(t=i.value)==null?void 0:t.querySelector(`.n-data-table-base-table-body`);n.value=a?a.querySelectorAll(`tr[data-key]`):[];let o=[];for(let e=0;e<n.value.length;e++){let t=n.value[e].dataset.key;o.push({[t]:n.value[e]})}r.value=o}function Jn(e,t){let{currentPath:n}=e;t.type==`dir`?(n.value=n.value==`/`?`/${t.nm}`:n.value+`/`+t.nm,Z(e)):Oa(t)?ar(e,t.path):Aa(t.ext)?$(e,`Decompress`,e=>e.value.open()):Da(t.ext)?or(e,t):ta(e)}function Yn(e,t,n){let{currentPath:r}=e,{type:i,name:a}=n,o=Sa(a,i);i==`dir`?(r.value=t,Z(e)):ka(o)?ar(e,t):Aa(o)?$(e,`Decompress`,e=>e.value.open(t,o)):Da(o)?or(e,{path:t,nm:n.name}):Bn(t,t.substring(0,t.lastIndexOf(`/`)))}function Xn(e){let{tableRef:t,choosePathRef:n}=e,r=0,i=setInterval(()=>{if(r<10?r++:clearInterval(i),t.value){let r=t.value;r.querySelector(`.n-data-table-base-table-body`)&&Un(e),r.oncontextmenu=t=>{t.preventDefault(),Zn(t,e)},r.onclick=t=>{t.target.nodeName!=`INPUT`&&(Vn(e),n.value.handleEnterDown())},clearInterval(i)}else return},1e3)}function Zn(e,t){let{choosedKeys:n,contextRef:r}=t,i=`empty`;e.target.closest(`tr`)&&(i=n.value.length>1?`multiple`:n.value.length==1?`single`:`empty`),r.value.filesOperation(e,i)}function Qn(){var e;let t=(e=document.querySelector(`#createInput`))==null?void 0:e.querySelector(`input`);t==null||t.focus(),t==null||t.select()}var $n=b((e,t)=>{let{choosedKeys:n}=e;if(t.type==`dir`)n.value=[t.nm],na(e);else return},200);async function er(e,t){if(Fe().isFree){Ze(71);return}let{close:n}=H.loading(`Processing, please wait...`);try{await Le(`tamper_core`,71);let{message:n}=await W.post(`/tamper_core/get_effective_path.json`,{path:t.path},{requestOptions:{isOriginalResult:!0}});if(K(n)&&n.status){let{data:r}=n;t.type===`dir`?tr(e,t,r):nr(e,t,r)}}finally{n()}}function tr(e,t,n){let{pid:r,lock:i,action:a}=n,o=(i?`Turning off protection `:`Turning on protection `)+`[${t.path}]`,s=Hn(i?`file.tableController.afterTurningOffProtectionDir`:`file.tableController.afterTurningOnProtectionDir`);q({width:480,title:o,content:s,onConfirm:async()=>{if(a[0]===`create`&&r===0){await rr(t.path,[]),Z(e);return}let n=[];i?n.push({key:t.path.indexOf(`/www/server/panel/class`)==-1?a[0]:`add_wd`,values:[t.path]}):n.push({key:a[0],values:[t.path]}),await ir(r,n),Z(e)}})}function nr(e,t,n){let{pid:r,lock:a,action:o}=n,s=Hn(a?`file.tableController.turningOffProtection`:`file.tableController.turningOnProtection`,{path:t.path}),c=Hn(a?`file.tableController.afterTurningOffProtectionFile`:`file.tableController.afterTurningOnProtectionFile`),l=R(!1),u=R(!0);q({title:s,width:480,content:()=>i(E,null,[i(`div`,null,[c]),i(`div`,{class:`mt-8px`},[i(ye,{checked:u.value,"onUpdate:checked":e=>u.value=e},{default:()=>[i(`span`,null,[Hn(a?`file.tableController.turningOffProtectionFile`:`file.tableController.turningOnProtectionFile`,{path:t.nm})])]})]),i(`div`,{class:`mt-8px`},[i(ye,{checked:l.value,"onUpdate:checked":e=>l.value=e},{default:()=>[i(`span`,null,[Hn(a?`file.tableController.turningOffProtectionSuffix`:`file.tableController.turningOnProtectionSuffix`,{suffix:t.ext})])]})])]),onConfirm:async()=>{if(o[0]===`create`&&r===0){let n=t.path.substring(0,t.path.lastIndexOf(`/`)),r=[];if(u.value){let e=t.path.split(`/`),n=e.length>=2?e[e.length-2]:``;r.push(`${n}/${t.nm}`)}l.value&&r.push(`.`+t.ext),await rr(n,r),Z(e);return}let n=[];a?(u.value&&(n.push({key:`remove_bf`,values:[t.path]}),n.push({key:`add_wf`,values:[t.path]})),l.value&&n.push({key:`remove_bf`,values:[`.`+t.ext]})):(u.value&&(n.push({key:`add_bf`,values:[t.path]}),n.push({key:`remove_wf`,values:[t.path]})),l.value&&n.push({key:`add_bf`,values:[`.`+t.ext]})),await ir(r,n),Z(e)}})}async function rr(e,t){let{message:n}=await W.post(`/tamper_core/create_path.json`,{path:e,exts:JSON.stringify(t)},{requestOptions:{loading:Hn(`file.tableController.creatingDirectoryProtection`),isOriginalResult:!0}});if(K(n)){if(n.status)H.success(n.msg);else return H.error(n.msg),Promise.reject()}}async function ir(e,t){let{message:n}=await W.post(`/tamper_core/batch_setting.json`,{pid:e,settings:JSON.stringify(t)},{requestOptions:{loading:Hn(`file.tableController.executing`),isOriginalResult:!0}});if(K(n)){if(n.status)H.success(n.msg);else return H.error(n.msg),Promise.reject()}}function ar(e,t){let{currentPreviewImg:n,previewShow:r}=e;n.value=t,r.value=!0}function or(e,t){let{currentPreviewVideo:n,previewVideoShow:r}=e;n.value={path:t.path,name:t.nm},r.value=!0}async function sr(e){await W.post(`/files?action=set_file_ps`,e,{requestOptions:{successMessage:!0}})}async function cr(e){let{currentFile:t,currentPath:n}=e;if(t.value&&(t.value.isCreate&&t.value.isRename||t.value.isRenameForCard)&&(t.value.editName||(t.value.isCreate=!1),t.value.editName==t.value.nm&&(t.value.isCreate=!1),t.value.isCreate&&t.value.isRename||t.value.isRenameForCard)){if(t.value.editName!==t.value.nm){try{await Xi(t.value.path,n.value+`/`+t.value.editName),Z(e)}catch(e){console.log(e)}finally{t.value.isCreate=!1,t.value.isRenameForCard=!1,t.value.isRename=!1}return!0}t.value.isCreate=!1,t.value.isRenameForCard=!1,t.value.isRename=!1}}async function lr(e){let{currentFile:t,currentPath:n,fileList:r}=e;if(t.value&&t.value.isCreate&&!t.value.isRename){if(t.value.editName==``)r.value.shift();else try{return t.value.type==`dir`?await Fr(n.value+`/`+t.value.editName):await Ir(n.value+`/`+t.value.editName),await Z(e),!0}catch(e){r.value.shift(),console.warn(e)}}}async function ur(e){let{currentFile:t}=e;if(t.value&&t.value.isEditRemarks)return t.value.editRemarks==t.value.rmk?(t.value.isEditRemarks=!1,t.value.remarks_hover=!1,!1):(await sr({filename:t.value.path,ps_type:0,ps_body:t.value.editRemarks}),await Z(e),!0)}async function dr(e){await ur(e)||await cr(e)||await lr(e)}async function fr(){return W.post(`/task?action=get_task_lists`,{status:-3})}async function pr(e){if(document.querySelector(`.file-task-modal`))return;let{message:t}=await fr();je(t)&&t.length>0&&U({title:Hn(`file.tableController.realtimeTaskQueue`),width:510,class:`file-task-modal`,unstableShowMask:!1,data:{store:e,taskList:t},component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.O),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}async function mr(e){return W.post(`/task?action=remove_task`,{id:e},{requestOptions:{loading:Hn(`file.tableController.deletingTask`),successMessage:!0}})}var{t:hr}=Me.global,gr=e=>W.post(`/files?action=get_download_url_list`,e),_r=e=>W.post(`/files?action=create_download_url`,e,{requestOptions:{loading:hr(`file.shareModal.creatingShareLink`)}}),vr=e=>W.post(`/files?action=remove_download_url`,e,{requestOptions:{loading:hr(`file.shareModal.deletingShare`),successMessage:!0}}),yr=e=>W.post(`/files?action=get_download_url_find`,e);h(),k();var br={class:`share-list-modal`},xr={class:`flex justify-end items-center mb-10px`},Sr={class:`mt-10px flex justify-end items-center`},Cr=G(g({__name:`index`,props:{fileStore:{}},setup(e){let t=e,{t:n}=B(),r=x(()=>t.fileStore),a=R([]),o=R(``),c=R(1),u=R(12),d=R(0),f=R(!1),h=async()=>{try{f.value=!0;let e=o.value.trim(),{message:t}=await gr({p:c.value,row:u.value,...e?{filename:e}:{}});a.value=t.data,d.value=Ke(t.page)}finally{f.value=!1}};function g(){c.value=1,p(()=>{h()})}let v=R([{key:`ps`,title:n(`file.shareListModal.shareName`)},{key:`filename`,title:n(`file.shareListModal.shareAddress`)},{key:`expire`,title:n(`file.shareListModal.expirationDate`),render:e=>Ve(e.expire)},Ne({width:120,options:e=>[{label:n(`Public.Btn.Details`),onClick:()=>{b(e)}},{label:n(`Public.Btn.Delete`),onClick:()=>{y(e)}}]})]);function y(e){let t=r.value;q({title:n(`file.shareListModal.cancelShareTitle`),content:n(`file.shareListModal.cancelShareMessage`,{filename:e.filename}),onConfirm:async()=>{await vr({id:e.id}),t&&await Z(t),await h()}})}async function b(e){jr(e,r.value)}return m(h),(e,t)=>{let r=mt,p=$e,m=Ye;return T(),l(`section`,br,[s(`div`,xr,[i(r,{value:_(o),"onUpdate:value":t[0]||(t[0]=e=>z(o)?o.value=e:null),width:`240`,clearable:``,placeholder:_(n)(`file.shareListModal.searchPlaceholder`),onSearch:g,onClear:g},null,8,[`value`,`placeholder`])]),i(p,{loading:_(f),data:_(a),columns:_(v)},null,8,[`loading`,`data`,`columns`]),s(`div`,Sr,[i(m,{page:_(c),"onUpdate:page":t[1]||(t[1]=e=>z(c)?c.value=e:null),"page-size":_(u),"onUpdate:pageSize":t[2]||(t[2]=e=>z(u)?u.value=e:null),"item-count":_(d),"show-size-picker":!1,"show-quick-jumper":!1,onRefresh:h},null,8,[`page`,`page-size`,`item-count`])])])}}}),[[`__scopeId`,`data-v-6846c345`]]);h(),k(),o();var wr={class:`p-20px`},Tr=g({__name:`details`,props:{detail:{},fileStore:{}},emits:[`close`],setup(e,{expose:t,emit:n}){let r=e,a=n,{t:o}=B(),c=`${window.location.origin}/down/`,u=x(()=>r.fileStore),d=r.detail,f=R({filename:``,ps:``,token:``,expire:``,total:0,password:``,addtime:0,id:0});function p(e){return!!(e.filename&&e.ps&&e.token)}function m(e){f.value={filename:e.filename,ps:e.ps,token:e.token,expire:Ve(e.expire),total:e.total,password:e.password,addtime:e.addtime,id:e.id}}async function h(e){let{message:t}=await yr({id:e});m(t)}function g(){d&&(p(d)?m(d):d.id&&h(d.id))}g();async function v(){return q({title:o(`file.shareModal.cancelSharing`),content:o(`file.shareModal.confirmStopSharing`,{filename:f.value.filename}),async onConfirm(){await vr({id:f.value.id}),a(`close`),u.value&&Z(u.value)}}),!1}let y=x(()=>`${c}${f.value.token}`);function b(){Pe(y.value)}function S(){Pe(o(`file.shareModal.linkAndCode`,{link:y.value,code:f.value.password}))}return t({onConfirm:v}),(e,t)=>{let n=he,r=le,a=Ue,c=_e,u=Qe,d=He;return T(),l(`div`,wr,[i(u,null,{default:O(()=>[i(r,{label:_(o)(`file.shareModal.shareName`)},{default:O(()=>[i(n,{value:_(f).ps,"onUpdate:value":t[0]||(t[0]=e=>_(f).ps=e)},null,8,[`value`])]),_:1},8,[`label`]),i(r,{label:_(o)(`file.shareModal.shareChain`)},{default:O(()=>[i(n,{class:`mr-10px`,readonly:!0,value:_(y)},null,8,[`value`]),i(c,{type:`primary`,onClick:b},{icon:O(()=>[i(a,{name:`common-copy`,size:`16`})]),_:1})]),_:1},8,[`label`]),_(f).password?(T(),L(r,{key:0,label:_(o)(`file.shareModal.extractionCode`)},{default:O(()=>[i(n,{class:`mr-10px`,value:`${_(f).password}`,readonly:``},null,8,[`value`]),i(c,{type:`primary`,onClick:S},{default:O(()=>[P(j(_(o)(`file.shareModal.copyLinkAndCode`)),1)]),_:1})]),_:1},8,[`label`])):C(``,!0),i(r,{label:_(o)(`file.shareModal.expirationDate`)},{default:O(()=>[P(j(_(f).expire),1)]),_:1},8,[`label`])]),_:1}),i(d,null,{default:O(()=>[s(`li`,null,j(_(o)(`file.shareModal.securityTip`)),1)]),_:1})])}}});h(),k(),o();var Er={class:`p-20px`},Dr=g({__name:`create`,props:{file:{},fileStore:{}},setup(e,{expose:t}){let n=e,{t:r}=B(),a=x(()=>n.fileStore),o=n.file,c=R({filename:(o==null?void 0:o.path)||``,ps:(o==null?void 0:o.nm)||``,password:``,expire:24});async function u(){let{message:e}=await _r(y(c.value));if(K(e))jr(e,a.value),a.value&&Z(a.value);else return!1}function d(){c.value.password=Tt(8)}return t({onConfirm:u}),(e,t)=>{let n=he,a=le,o=ve,u=pe,f=_e,p=Qe,m=He;return T(),l(`div`,Er,[i(p,null,{default:O(()=>[i(a,{label:_(r)(`file.shareModal.shareName`)},{default:O(()=>[i(n,{value:_(c).ps,"onUpdate:value":t[0]||(t[0]=e=>_(c).ps=e)},null,8,[`value`])]),_:1},8,[`label`]),i(a,{label:_(r)(`file.shareModal.expirationDate`)},{default:O(()=>[i(u,{value:_(c).expire,"onUpdate:value":t[1]||(t[1]=e=>_(c).expire=e)},{default:O(()=>[i(o,{value:24},{default:O(()=>[P(j(_(r)(`file.shareModal.aDay`)),1)]),_:1}),i(o,{value:168},{default:O(()=>[P(j(_(r)(`file.shareModal.aWeek`)),1)]),_:1}),i(o,{value:1130800},{default:O(()=>[P(j(_(r)(`file.shareModal.permanent`)),1)]),_:1})]),_:1},8,[`value`])]),_:1},8,[`label`]),i(a,{label:_(r)(`file.shareModal.extractionCode`)},{default:O(()=>[i(n,{value:_(c).password,"onUpdate:value":t[2]||(t[2]=e=>_(c).password=e)},null,8,[`value`]),i(f,{class:`ml-10px`,type:`primary`,onClick:d},{default:O(()=>[P(j(_(r)(`file.shareModal.random`)),1)]),_:1})]),_:1},8,[`label`])]),_:1}),i(m,null,{default:O(()=>[s(`li`,null,j(_(r)(`file.shareModal.securityTip`)),1)]),_:1})])}}}),{t:Or}=Me.global;function kr(e){return U({title:Or(`file.shareListModal.title`),width:850,data:{fileStore:e},component:Cr})}function Ar(e){let t=e.fileList.value.find(t=>t.nm===e.choosedKeys.value[0]);if(t)return U({title:t.type==`dir`?Or(`file.shareModal.setShareFolder`,{name:t.nm}):Or(`file.shareModal.setShareFile`,{name:t.nm}),width:560,footer:!0,confirmText:Or(`file.shareModal.create`),data:{file:t,fileStore:e},component:Dr})}function jr(e,t){return U({title:Or(`file.shareModal.shareDetails`,{name:e.ps||e.filename||e.id}),width:560,footer:!0,confirmType:`error`,confirmText:Or(`file.shareModal.closeSharingChain`),data:{detail:e,fileStore:t},component:Tr})}function Mr(e,t){jr({id:e},t)}function Nr(e,t){let n=Number(e.isShare||e.durl);n&&Mr(n,t)}h(),pt();var{t:Pr}=Me.global;async function Fr(e){try{await W.post(`/files?action=CreateDir`,{path:e},{requestOptions:{loading:Pr(`file.buttonGroup.loading.creatingDirectory`),successMessage:!0}})}catch(e){console.warn(e)}}async function Ir(e){try{await W.post(`/files?action=CreateFile`,{path:e},{requestOptions:{loading:Pr(`file.buttonGroup.loading.creatingFile`),successMessage:!0}})}catch(e){console.warn(e)}}async function Lr(e,t){try{await W.post(`/files?action=CreateLink`,{sfile:e,dfile:t},{requestOptions:{loading:Pr(`file.buttonGroup.loading.creatingSoftlink`),successMessage:!0}})}catch(e){console.warn(e)}}function Rr(e,t){let{filesView:n}=e;n.value=t}function zr(e){$(e,`UploadFile`,e=>{e.value.open()})}function Br(e){$(e,`RemoteDownload`,e=>{e.value.open()})}function Vr(e){return U({title:Pr(`file.searchFileContentModal.title`),width:1100,height:686,footer:!1,data:{fileStore:e,currentPath:e.currentPath.value},component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}function Hr(e){Vr(e)}var Ur=e=>{$(e,`FavoriteList`,e=>{e.value.open()})};function Wr(e,t,n){t==`management`?Ur(e):Yn(e,t,n)}function Gr(e){kr(e)}function Kr(e){let{currentPath:t}=e;t.value=`/`,Z(e)}function qr(e){$(e,`Backup`,e=>{e.value.open()})}function Jr(e){return U({title:Pr(`file.recycle.title`),width:1100,height:686,data:{fileStore:e},component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.n),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}function Yr(e){Jr(e)}function Xr(){return U({title:Pr(`file.buttonGroup.fileOperationRecord`),width:1100,height:640,footer:!1,component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.r),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}function Zr(e){$(e,`Terminal`,e=>{e.value.open()})}function Qr(e,t,n,r){let{fileList:i,currentFile:a}=e;a.value={nm:t,isCreate:!0,type:n,ext:r,path:``,editName:t},a.value.editName=a.value.nm,i.value.unshift(a.value),p(Qn)}function $r(e,t){switch(t){case`dir`:Qr(e,Pr(`file.buttonGroup.defaultNames.untitledDirectory`),`dir`,`folder`);break;case`file`:Qr(e,Pr(`file.buttonGroup.defaultNames.untitledFile`),`file`,`unknown`);break;case`softlink`:$(e,`Softlink`,e=>{e.value.open()})}}function ei(e){let{isMiniScreen:t}=e;t.value=window.innerWidth<1560}async function ti(e,t){try{await W.post(`/files?action=del_files_store`,{path:t},{requestOptions:{loading:Pr(`file.buttonGroup.loading.deletingFavorite`),successMessage:!0}}),Z(e)}catch(e){console.warn(e)}}h();var{t:ni}=Me.global,ri=(e,t)=>{let{fileRecycle:n}=e;return n.value?ii(e,t):ai(e,t)},ii=(e,t)=>new Promise(n=>{let{currentPath:r,choosedKeys:i,fileList:a}=e,o=t||a.value.filter(e=>i.value.includes(e.nm));q({title:o.length===1?ni(`file.deleteController.deleteSingleFileTitle`,{name:o[0].nm}):ni(`file.deleteController.batchDeleteTitle`),content:ni(`file.deleteController.recycleBinMessage`),width:400,onConfirm:async()=>{if(o.length===1)await oi(o[0].path,o[0].type);else{let e=r.value;if(t&&o.length>0){let t=o[0].path.lastIndexOf(`/`);t!==-1&&(e=o[0].path.substring(0,t))}await si(o.map(e=>e.nm),e)}Z(e),n()}})}),ai=(e,t)=>new Promise(n=>{let{currentPath:r,choosedKeys:a,fileList:o}=e,s=t||o.value.filter(e=>a.value.includes(e.nm));Te({title:s.length===1?ni(`file.deleteController.deleteSingleFileTitle`,{name:s[0].nm}):ni(`file.deleteController.batchDeleteTitle`),content:()=>i(`span`,{class:`text-error`},[ni(`file.deleteController.permanentDeleteMessage`)]),width:400,onConfirm:async()=>{if(s.length===1)await oi(s[0].path,s[0].type);else{let e=r.value;if(t&&s.length>0){let t=s[0].path.lastIndexOf(`/`);t!==-1&&(e=s[0].path.substring(0,t))}await si(s.map(e=>e.nm),e)}Z(e),n()}})});async function oi(e,t){await W.post(`/files?action=${t===`dir`?`DeleteDir`:`DeleteFile`}`,{path:e},{requestOptions:{loading:ni(`file.deleteController.deletingSingle`),successMessage:!0}})}async function si(e,t){await W.post(`/files?action=SetBatchData`,{data:JSON.stringify(e),type:4,path:t},{requestOptions:{loading:ni(`file.deleteController.deletingBatch`),successMessage:!0}})}var ci={ftp:{key:`ftp`,labelKey:`file.contextMenu.cloudStorage.ftp`,icon:`/static/img/soft_ico/ico-ftp.png`,defaultPath:`/`,capabilities:{canUpload:!0,canCreateFolder:!0,canSearch:!0,canDelete:!0}},aws_s3:{key:`aws_s3`,labelKey:`file.contextMenu.cloudStorage.awsS3`,icon:`/static/img/soft_ico/ico-aws_s3.png`,defaultPath:`/`,capabilities:{canUpload:!0,canCreateFolder:!0,canSearch:!0,canDelete:!0}},gdrive:{key:`gdrive`,labelKey:`file.contextMenu.cloudStorage.gdrive`,icon:`/static/img/soft_ico/ico-gdrive.png`,defaultPath:`/`,capabilities:{canUpload:!0,canCreateFolder:!0,canSearch:!0,canDelete:!1}},gcloud_storage:{key:`gcloud_storage`,labelKey:`file.contextMenu.cloudStorage.gcloudStorage`,icon:`/static/img/soft_ico/ico-gcloud_storage.png`,defaultPath:`/`,capabilities:{canUpload:!0,canCreateFolder:!0,canSearch:!0,canDelete:!1}}},{t:li}=Me.global,ui=()=>W.post(`/mod/cloud_storage/cloud_storage/GetProviders`),di=e=>W.post(`/mod/cloud_storage/cloud_storage/List`,e),fi=e=>W.post(`/mod/cloud_storage/cloud_storage/CreateFolder`,e,{requestOptions:{loading:li(`file.buttonGroup.loading.creatingDirectory`),successMessage:!0}}),pi=e=>W.post(`/mod/cloud_storage/cloud_storage/Delete`,{...e,items:JSON.stringify(e.items)},{requestOptions:{loading:li(`file.deleteController.deletingSingle`)}}),mi=e=>{var t;return W.post(`/mod/cloud_storage/cloud_storage/UploadLocal`,{...e,local_paths:JSON.stringify(e.local_paths),background:(t=e.background)==null||t},{requestOptions:{loading:li(`file.uploadModal.statusUploading`)}})},hi=(e,t)=>W.post(`/mod/cloud_storage/cloud_storage/file_upload`,e,{headers:{"Content-Type":`multipart/form-data`},onUploadProgress:e=>{t==null||t(e)}}),gi=e=>{var t,n;return W.post(`/mod/cloud_storage/cloud_storage/DownloadToLocal`,{...e,items:JSON.stringify(e.items),background:(t=e.background)==null||t},{requestOptions:{loading:li(`file.uploadModal.statusUploading`),successMessage:!((n=e.background)==null||n)}})},_i=()=>W.post(`/mod/cloud_storage/cloud_storage/TaskStatus`);h(),o(),k(),F();var vi={class:`ftp-storage-demo`},yi={class:`surface-header`},bi={class:`pane-head`},xi={class:`file-list`},Si={class:`table-head`},Ci=[`aria-checked`,`aria-label`,`onClick`],wi={class:`file-main`},Ti={class:`file-name`},Ei=[`aria-label`,`onClick`],Di={class:`pane-footer`},Oi=[`onClick`],ki={class:`transfer-file`},Ai=G(g({__name:`feature-demo`,props:{storageName:{}},setup(e){let t=e,{t:i}=B(),a=x(()=>i(`proFeatureFile.file.ftpStorageFeature.sendToStorage`,{storage:t.storageName})),o=[{key:`local`,source:`wp-content`,files:[{name:`wp-content`,appearsAt:0},{name:`wp-admin`,appearsAt:0},{name:`wp-includes`,appearsAt:0},{name:`backup`,appearsAt:4930},{name:`index.php`,appearsAt:0}]},{key:`ftp`,source:`backup`,files:[{name:`wp-content`,appearsAt:2650},{name:`wordpress`,appearsAt:0},{name:`backup`,appearsAt:0},{name:`site`,appearsAt:0},{name:`aaPanel`,appearsAt:5350},{name:`ftp_main.py`,appearsAt:0}]}],c=R(0),u=R({local:!1,ftp:!1}),d=x(()=>c.value>=800&&c.value<2650?`local`:c.value>=3160&&c.value<4930?`ftp`:null),f=x(()=>c.value>=1500&&c.value<2650?`right`:c.value>=3780&&c.value<4930?`left`:null),p=x(()=>c.value>=6510?`aaPanel`:`aaPanel`.slice(0,Math.max(0,Math.floor((c.value-5520)/125)+1))),h=x(()=>c.value>=360&&c.value<1e3?{x:6.4,y:35.5,clicking:c.value>=800}:c.value>=1e3&&c.value<1500?{x:12,y:87,clicking:c.value>=1370}:c.value>=2800&&c.value<3330?{x:54.2,y:51,clicking:c.value>=3160}:c.value>=3330&&c.value<3780?{x:60.5,y:87,clicking:c.value>=3660}:null),g,v,y=()=>{g!==void 0&&clearInterval(g),g=void 0,c.value=7e3},b=(e=0)=>{if(g!==void 0&&clearInterval(g),g=void 0,u.value={local:!1,ftp:!1},v!=null&&v.matches){y();return}c.value=e;let t=performance.now()-e;g=setInterval(()=>{c.value=performance.now()-t,c.value>=7e3&&y()},50)},S=()=>{v!=null&&v.matches?y():b()};return m(()=>{v=window.matchMedia(`(prefers-reduced-motion: reduce)`),v.addEventListener(`change`,S),b()}),w(()=>{g!==void 0&&clearInterval(g),v==null||v.removeEventListener(`change`,S)}),(e,m)=>(T(),l(`div`,vi,[s(`div`,yi,j(t.storageName),1),(T(),l(E,null,n(o,e=>s(`section`,{key:e.key,class:r([`file-pane`,e.key])},[s(`div`,bi,j(e.key===`local`?_(i)(`proFeatureFile.file.ftpStorageFeature.localFiles`):t.storageName),1),s(`div`,xi,[s(`div`,Si,[s(`button`,{type:`button`,class:r([`header-check`,{checked:u.value[e.key]}]),role:`checkbox`,"aria-checked":u.value[e.key],"aria-label":e.key===`local`?_(i)(`proFeatureFile.file.ftpStorageFeature.selectLocal`):_(i)(`proFeatureFile.file.ftpStorageFeature.selectRemote`),onClick:t=>u.value[e.key]=!u.value[e.key]},[...m[0]||(m[0]=[s(`i`,{class:`i-lucide:check`,"aria-hidden":`true`},null,-1)])],10,Ci),s(`span`,null,j(_(i)(`proFeatureFile.file.ftpStorageFeature.fileName`)),1),s(`span`,null,j(_(i)(`proFeatureFile.file.ftpStorageFeature.operation`)),1)]),(T(!0),l(E,null,n(e.files,t=>ie((T(),l(`div`,{key:t.name,class:r([`file-row`,{selected:u.value[e.key]||d.value===e.key&&t.name===e.source,incoming:t.appearsAt>0&&(t.name!==`aaPanel`||c.value>=6510),editing:t.name===`aaPanel`&&c.value<6510}])},[m[1]||(m[1]=s(`span`,{class:`box`,"aria-hidden":`true`},[s(`i`,{class:`i-lucide:check`})],-1)),s(`span`,wi,[s(`i`,{class:r(t.name.includes(`.`)?`i-mdi:file-document text-#86a9c6`:`i-mdi:folder text-#efb448`),"aria-hidden":`true`},null,2),s(`span`,Ti,j(t.name===`aaPanel`?p.value:t.name),1)]),t.appearsAt===0||t.name===`aaPanel`?(T(),l(`button`,{key:0,type:`button`,class:`row-action`,"aria-label":e.key===`local`?a.value:_(i)(`proFeatureFile.file.ftpStorageFeature.sendToLocal`),onClick:t=>b(e.key===`local`?1370:3660)},[s(`i`,{class:r(e.key===`local`?`i-lucide:arrow-right`:`i-lucide:arrow-left`),"aria-hidden":`true`},null,2)],8,Ei)):C(``,!0)],2)),[[re,c.value>=t.appearsAt]])),128))]),s(`div`,Di,[s(`button`,{type:`button`,class:r([`send-button`,{"is-clicked":e.key===`local`?c.value>=1370&&c.value<1500:c.value>=3660&&c.value<3780}]),onClick:t=>b(e.key===`local`?0:3160)},j(e.key===`local`?a.value:_(i)(`proFeatureFile.file.ftpStorageFeature.sendToLocal`)),11,Oi)])],2)),64)),f.value?(T(),l(`div`,{key:0,class:r([`transfer-layer`,f.value]),"aria-hidden":`true`},[m[3]||(m[3]=s(`div`,{class:`transfer-line`},null,-1)),s(`div`,ki,[m[2]||(m[2]=s(`i`,{class:`i-mdi:folder text-#efb448`},null,-1)),P(` `+j(f.value===`right`?`wp-content`:`backup`),1)])],2)):C(``,!0),h.value?(T(),l(`svg`,{key:1,class:r([`demo-cursor`,{clicking:h.value.clicking}]),style:oe({left:`${h.value.x}%`,top:`${h.value.y}%`}),viewBox:`0 0 26 32`,"aria-hidden":`true`},[...m[4]||(m[4]=[s(`path`,{d:`M3 2.5v22l5.4-5.2 4.2 9.2 4.3-2-4.1-8.8h7.7L3 2.5z`},null,-1)])],6)):C(``,!0)]))}}),[[`__scopeId`,`data-v-d856ba35`]]);h(),k(),o();var ji=g({__name:`feature`,props:{storageName:{}},setup(e){let t=e,{t:n}=B(),r=Fe();return(e,a)=>(T(),L(Je,{title:_(n)(`proFeatureFile.file.ftpStorageFeature.title`),description:_(n)(`proFeatureFile.file.ftpStorageFeature.description`,{storage:t.storageName}),benefits:[_(n)(`proFeatureFile.file.ftpStorageFeature.benefitTransfer`),_(n)(`proFeatureFile.file.ftpStorageFeature.benefitFolders`,{storage:t.storageName})],"demo-label":_(n)(`proFeatureFile.file.ftpStorageFeature.demo`,{storage:t.storageName}),"show-purchase":_(r).isFree,"action-text":_(n)(`proFeatureCommon.common.proFeature.upgrade`),"voucher-text":_(n)(`proFeatureFile.file.ftpStorageFeature.voucher`),"redeem-text":_(n)(`proFeatureFile.file.ftpStorageFeature.redeem`),onAction:a[0]||(a[0]=e=>_(Be)({source:73})),onRedeem:a[1]||(a[1]=e=>_(Be)({source:73}))},{title:O(()=>[P(j(_(n)(`proFeatureFile.file.ftpStorageFeature.title`))+` `,1),s(`span`,null,j(_(n)(`proFeatureFile.file.ftpStorageFeature.highlight`,{storage:t.storageName})),1)]),demo:O(()=>[i(Ai,{"storage-name":t.storageName},null,8,[`storage-name`])]),_:1},8,[`title`,`description`,`benefits`,`demo-label`,`show-purchase`,`action-text`,`voucher-text`,`redeem-text`]))}});h(),pt();var{t:Q}=Me.global,Mi={zip:`ZIP`,rar:`RAR`,gz:`GZ`,"tar.gz":`GZ`,tgz:`GZ`},Ni=Object.keys(Mi);function Pi(e){return Ni.includes(e.toLowerCase())}function Fi(e){let t=e.toLowerCase();return Mi[t]||t.split(`.`).pop().toUpperCase()}function Ii(e){return Q(`file.contextMenu.archivePreviewWithType`,{type:Fi(e)})}function Li(e){return e in ci}var Ri={ftp:[`ftp`],aws_s3:[`aws_s3`],gdrive:[`gdrive`],gcloud_storage:[`gcloud_storage`,`gcloud`,`google_cloud`,`google_cloud_storage`]};function zi(e,t){let n=t.value.trim().toLowerCase();return Ri[e].includes(n)}function Bi(e,t){return(t==null?void 0:t.name)||Q(ci[e].labelKey)}async function Vi(e){let t=await Xe(e);t&&Ie(t.row,void 0,t.softInfo)}function Hi(e,t){let n=Bi(e,t);t!=null&&t.install?et(t)?Vi(e):Re({name:e,title:n,admin:!0}):De(e)}async function Ui(e){let{message:t}=await ui();return(Array.isArray(t)?t:K(t)&&Array.isArray(t.list)?t.list:[]).find(t=>zi(e,t))}async function Wi(e,t){if(Fe().isFree){tt({component:ji,data:{storageName:Bi(t)}});return}let n=await Ui(t);n!=null&&n.install?et(n)?await Vi(t):n.config?va(e,t):Hi(t,n):Hi(t,n)}async function Gi(e,t){return(await W.post(`/files?action=CheckExistsFiles`,{dfile:e,filename:t},{requestOptions:{isOriginalResult:!0}})).message.length>0}async function Ki(e,t,n){return await W.post(`/files?action=SetBatchData`,{data:JSON.stringify(e),type:t,path:n},{requestOptions:{loading:Q(`file.contextMenu.loading.batchSetting`),successMessage:!0}})}async function qi(e,t){return await W.post(`/files?action=CopyFile`,{sfile:e,dfile:t},{requestOptions:{loading:Q(`file.contextMenu.loading.copying`),successMessage:!0}})}async function Ji(e,t){return await W.post(`/files?action=BatchPaste`,{type:e,path:t},{requestOptions:{loading:Q(`file.contextMenu.loading.pasting`),successMessage:!0}})}async function Yi(e,t,n){return await W.post(`/files?action=MvFile`,{sfile:e,dfile:t,...n},{requestOptions:{loading:Q(`file.contextMenu.loading.moving`),successMessage:!0}})}function Xi(e,t){return Yi(e,t,{rename:!0})}async function Zi(e,t,n,r,i=!1){let{message:a}=await W.post(`/files?action=${i?`ZipAndDownload`:`Zip`}`,{sfile:e,dfile:t,z_type:n,path:r},{requestOptions:{loading:Q(`file.contextMenu.loading.compressing`),successMessage:!i}});if(i&&K(a)){if(a.task_id)return a.msg;ze(a.result)}return``}async function Qi(e){await W.post(`/files?action=UnZip`,e,{requestOptions:{loading:Q(`file.contextMenu.loading.decompressing`),successMessage:!0}})}function $i(e,t){return t.map(t=>e[t])}function ea(e,t){let{fileList:n,choosedKeys:r}=e,i=Na(n.value,r.value)[0],a=[`share`,`favorite`,`permission`,`copy`,`copyPath`,`cut`,`rename`,`del`,`compression`,`attrs`];if(!i)return $i(t.value,[`refresh`,`upload`,`create`,`terminal`]);i.type==`dir`?a.unshift(`open`,`openNewWindow`):a.unshift(`edit`,`download`);let o=a.findIndex(e=>e===`permission`);if(a.splice(o,0,`uploadToCloud`),Oa(i)&&(a.unshift(`preview`),a=a.filter(e=>e!==`edit`)),Da(i.ext)&&(a.unshift(`playVideo`),a=a.filter(e=>e!==`edit`)),i.isFavorite){let e=a.findIndex(e=>e==`favorite`);a[e]=`unfavorite`}if(i.isShare){let e=a.findIndex(e=>e==`share`);a[e]=`unShare`}Aa(i.ext)&&(a.unshift(`decompress`),Pi(i.ext)&&a.splice(1,0,`compressionPreview`),a=a.filter(e=>e!==`edit`));let s=$i(t.value,a),c=s.findIndex(e=>e.key===`compressionPreview`);return c>-1&&(s[c]={...s[c],label:Ii(i.ext)}),s}function ta(e){let{choosedKeys:t,currentPath:n,fileList:r}=e,i=r.value.find(e=>e.nm==t.value[0]);i&&Bn(i.path,n.value)}function na(e){let{choosedKeys:t,currentPath:n,fileList:r}=e,i=r.value.find(e=>e.nm==t.value[0]);e.page.value=1,n.value=i.path,Z(e)}async function ra(e){let{choosedKeys:t,fileList:n}=e,r=n.value.find(e=>e.nm==t.value[0]);try{await W.post(`/files?action=add_files_store`,{path:r.path},{requestOptions:{loading:Q(`file.contextMenu.loading.addingToFavorites`),successMessage:!0}}),Wn(e),Z(e)}catch(e){console.warn(e)}}async function ia(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0];r&&q({title:Q(`file.favoriteListModal.cancelFavoriteTitle`),content:Q(`file.favoriteListModal.cancelFavoriteMessage`,{name:r.nm}),onConfirm:async()=>{await ti(e,r.path)}})}async function aa(e,t,n){let{choosedKeys:r,fileList:i,fileCopyCache:a,waitForPaste:o,copiedFile:s,currentPath:c}=e;if(r.value.length==1)H.success(t),a.value=JSON.parse(JSON.stringify(r.value)),s.value=Na(i.value,a.value)[0],o.value=!0;else try{(await Ki(r.value,n,c.value)).status==0&&(a.value=JSON.parse(JSON.stringify(r.value)),o.value=!0)}catch(e){console.warn(e)}}async function oa(e){let{fileCopyCache:t,fileOperationFlag:n,currentPath:r,copiedFile:i,waitForPaste:a}=e;t.value.length>1?await Ji(n.value,r.value):t.value.length==1&&(n.value==1?await qi(i.value.path,r.value+`/`+i.value.nm):n.value==2&&await Yi(i.value.path,r.value+`/`+i.value.nm)),Z(e),a.value=!1}async function sa(e){let{fileOperationFlag:t,waitForPaste:n}=e;t.value=1,await aa(e,Q(`file.contextMenu.messages.copySuccess`),1),n.value=!0}async function ca(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0];r&&Pe(r.path)}async function la(e){let{fileOperationFlag:t,waitForPaste:n}=e;t.value=2,await aa(e,Q(`file.contextMenu.messages.cutSuccess`),2),n.value=!0}async function ua(e){let{fileCopyCache:t,currentPath:n,waitForPaste:r}=e;if(!r.value)return;let i=!1;t.value.length==1?i=await Gi(n.value,t.value[0]):t.value.length>1&&(i=await Gi(n.value)),i?t.value.length==1?$(e,`PasteSingleConfirm`,e=>e.value.open()):t.value.length>1&&$(e,`PasteConfirm`,e=>e.value.open()):oa(e)}async function da(e){let{currentPath:t,choosedKeys:n}=e;ze(`${t.value===`/`?``:t.value}/${n.value[0]}`)}async function fa(e){let{choosedKeys:t,fileList:n,currentFile:r,filesView:i}=e,a=Na(n.value,t.value)[0];r.value=a,i.value===`card`?(r.value.isRenameForCard=!0,r.value.editName=r.value.nm):(a.isCreate=!0,a.isRename=!0,a.editName=a.nm,p(Qn))}function pa(e){$(e,`Compression`,e=>e.value.open())}function ma(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0];r&&U({title:Q(`file.archivePreviewModal.titleWithTypeFile`,{type:Fi(r.ext),name:r.nm}),width:720,height:560,footer:!1,data:{file:r,fileStore:e},component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.a),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}function ha(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0];ar(e,r.path)}async function ga(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0],i=Number((r==null?void 0:r.isShare)||(r==null?void 0:r.durl));i&&(await vr({id:i}),Z(e))}function _a(e){let{choosedKeys:t,fileList:n}=e,r=Na(n.value,t.value)[0];or(e,r)}function va(e,t){let n=ci[t];U({title:()=>u(`div`,{class:`flex items-center gap-8px`},[u(`img`,{class:`inline-block h-18px max-h-18px max-w-18px w-18px object-contain align-middle`,src:n.icon,alt:``}),u(`span`,Q(n.labelKey))]),width:1100,height:686,footer:!1,data:{initialLocalPath:e.currentPath.value,providerKey:t},component:M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))})}function ya(e,t){let{menuShow:n}=t;if(typeof e==`string`&&e.startsWith(`uploadToCloud:`)){let r=e.slice(14);Li(r)?Wi(t,r):H.warning(Q(`file.contextMenu.messages.cloudUploadNotConnected`)),n.value=!1}else{switch(e){case`edit`:ta(t);break;case`copy`:sa(t);break;case`copyPath`:ca(t);break;case`cut`:la(t);break;case`paste`:ua(t);break;case`permission`:$(t,`Permission`,e=>e.value.open());break;case`compression`:pa(t);break;case`decompress`:$(t,`Decompress`,e=>e.value.open());break;case`compressionPreview`:ma(t);break;case`conversion`:console.log(`conversion`);break;case`del`:ri(t);break;case`refresh`:Z(t);break;case`upload`:$(t,`UploadFile`,e=>e.value.open());break;case`createFile`:Qr(t,Q(`file.contextMenu.defaultNames.untitledFile`),`file`,`file`);break;case`createDir`:Qr(t,Q(`file.contextMenu.defaultNames.untitledDirectory`),`dir`,`folder`);break;case`download`:da(t);break;case`terminal`:$(t,`Terminal`,e=>e.value.open());break;case`open`:na(t);break;case`share`:Ar(t);break;case`unShare`:ga(t);break;case`favorite`:ra(t);break;case`unfavorite`:ia(t);break;case`rename`:fa(t);break;case`attrs`:$(t,`Properties`,e=>e.value.open());break;case`preview`:ha(t);break;case`playVideo`:_a(t)}n.value=!1}}h();function ba(e){let{type:t,list:n,path:r}=e,i=[];for(let e of n)i.push(xa({type:t,item:e,path:r}));return i}function xa(e){let{type:t,item:n,path:r}=e,{nm:i,sz:a,is_link:o,lnk:s,mt:c,ctime:l,atime:u,gid:d,uid:f,group:p,user:m,acc:h,rmk:g,durl:_,cmp:v,fav:y,top:b,sn:x}=n;return{ext:Sa(n.nm,t),nm:i,sz:a,mt:c,acc:h,user:m,is_link:o?s:``,lnk:s,durl:_,cmp:v,fav:y,rmk:g,top:b,sn:x,path:Ca(r,i),ctime:l,atime:u,gid:d,uid:f,group:p,type:t}}function Sa(e,t){if(t===`dir`)return`folder`;let n=[`tar.gz`],r=e.toLowerCase();for(let e of n)if(r.endsWith(e))return e;let i=r.lastIndexOf(`.`);return i===-1?`file`:r.substring(i+1)}function Ca(e,t){return wa(`${e}/${t}`)}function wa(e){return e.replace(/\/\//g,`/`)}function Ta(e){let t=[`folder`],n=[`txt`,`rtf`,`md`,`log`,`conf`],r=[`json`],i=[`htm`,`html`,`xhtml`],a=[`css`,`less`,`scss`],o=[`js`,`ts`],s=[`php`],c=[`pdf`,`pdfa`,`pdfx`,`pdfu`],l=[`doc`,`docx`,`docm`,`dot`,`dotx`,`dotm`],u=[`xlsx`,`xlsm`,`xltx`,`xltm`],d=`jpg.jpeg.png.gif.bmp.webp.tiff.tif.psd.ai.eps.cr2.cr3.nef.nrw.dng.svg.cdr.wmf.emf.apng.heic.ico.xbm.xpm.xcf.iff.pnm`.split(`.`),f=`py.java.js.ts.c.cpp.cs.php.rb.go.swift.kt.html.css.jsx.vue.scss.less.tsx.json.xml.yaml.yml.ini.properties.env.sql.pl.sh.bat.ps1.m.swift.kt.gradle.makefile.cmake.jar.war.exe.md.gitignore.dockerfile.yml.ipynb.asm.lua.rs.hs`.split(`.`);return t.includes(e)?`file-dir`:n.includes(e)?`file-txt`:r.includes(e)?`file-json`:i.includes(e)?`file-html`:a.includes(e)?`file-css`:o.includes(e)?`file-js`:s.includes(e)?`file-php`:l.includes(e)?`file-doc`:c.includes(e)?`file-pdf`:u.includes(e)?`file-excel`:d.includes(e)?`file-img`:f.includes(e)?`file-sh`:[`zip`,`rar`,`7z`,`tar`,`tar.gz`,`gz`,`tgz`,`tar.bz2`,`tar.xz`,`cab`,`iso`,`msi`,`rpm`,`deb`,`xz`,`zipx`,`lz4`,`zst`,`rar5`,`part1.rar`,`rar.part1`,`z01`,`z02`].includes(e)?`file-compression`:`file-unknown-file`}function Ea(e){return!![`file-txt`,`file-json`,`file-html`,`file-css`,`file-js`,`file-php`,`file-doc`,`file-sh`].includes(Ta(e.ext))}function Da(e){return[`mp3`,`mp4`,`avi`,`mov`,`mkv`,`wmv`,`flv`,`3gp`,`3g2`,`vob`,`webm`,`ogv`].includes(e)}function Oa(e){return Ta(e.ext)===`file-img`}function ka(e){return Ta(e)===`file-img`}function Aa(e){return Ta(e)===`file-compression`}async function ja(e,t,n){try{let{message:r}=await W.post(`/files?action=GetDirNew`,{path:e,is_operating:!0,...n});t&&t(r);let i=ba({type:`dir`,list:r.dir,path:r.path}),a=ba({type:`file`,list:r.files,path:r.path});return i=i.map((e,t)=>({...e,protected:r.tamper_data.dirs&&r.tamper_data.dirs[t]?Number(r.tamper_data.dirs[t].split(`;`)[0]):0,protected_rule:r.tamper_data.dirs&&r.tamper_data.dirs[t]?Number(r.tamper_data.dirs[t].split(`;`)[1]):0})),a=a.map((e,t)=>({...e,protected:r.tamper_data.files&&r.tamper_data.files[t]?Number(r.tamper_data.files[t].split(`;`)[0]):0,protected_rule:r.tamper_data.files&&r.tamper_data.files[t]?Number(r.tamper_data.files[t].split(`;`)[1]):0})),[...i,...a]}catch(e){return console.warn(e),[]}}async function Ma(e,t,n,r,i,a){let o=[],s=Math.ceil(e.size/n);for(let t=0;t<s;t++){let i=t*n,a=Math.min(i+n,e.size),s=e.slice(i,a),c=new FormData;c.append(`f_path`,r),c.append(`f_name`,e.name),c.append(`f_size`,`${e.size}`),c.append(`f_start`,`${i}`),c.append(`blob`,s),o.push(c)}try{for(let e=0;e<o.length;e++){let n=await W.post(t,o[e],{headers:{"Content-Type":`multipart/form-data`},requestOptions:{isOriginalResult:!0}});typeof n.message==`number`&&a&&a(n),i(Math.round(e/o.length*100),n)}i(100,null)}catch(e){return console.log(e),Promise.reject({msg:e.message})}}function Na(e,t){return e.filter(e=>t.includes(e.nm))}async function $(e,t,n){let{dynamicCmptObj:r,dynamicCmpt:i,dynamicCmptRef:a}=e,o=r[t]();await o.__asyncLoader(),i.value=o,p(()=>{n&&n(a)})}function Pa(e){let{choosedKeys:t}=e;t.value=[]}k();var Fa=R([]),Ia=R(!1),La=R(null),Ra=R(1);k(),h(),pt();var{t:za}=Me.global;function Ba(){let e=R(),t=R(`list`),n=R(`/www`),r=R([]),i=R(!1),a=R([]),o=R([]),s=R([]),l=R(),u=R(),d=R(),f=R([]),p=R([]),m=R({url:`http://`,path:n.value,filename:``}),h=R({reference:``,per:0,speed:`0`,used:`0`,except:`--`,total:0}),g=R(!1),_=R([]),v=R({text:``,exts:`html,php`,path:n.value,is_subdir:0,mode:0,isword:0,iscase:1,noword:0});function y(){v.value={text:``,exts:`html,php`,path:n.value,is_subdir:0,mode:0,isword:0,iscase:1,noword:0}}let b=R({}),S=R({files:0,times:0}),C=R([]),w=R([{label:za(`file.favoriteListModal.management`),key:`management`,icon:`settings`}]);function T(){w.value=[{label:za(`file.favoriteListModal.management`),key:`management`,icon:`settings`}]}let E=R([]),D=R({back_sub_dir:1,path:``,remark:``}),O=Ra,k=Fa,A=Ia,j=La,N={PasteConfirm:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.d),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),PasteSingleConfirm:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.u),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),UploadFile:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.D),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),RemoteDownload:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.w),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),SearchFileContent:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.C),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),FavoriteList:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.T),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Backup:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.E),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Terminal:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.h),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Softlink:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.S),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Permission:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.l),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Properties:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.s),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Del:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.f),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Compression:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.m),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33]))),Decompress:()=>M(()=>J(()=>import(`./view-files.js?v=1795169270504`).then(e=>e.p),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33])))},P=c(null),F=R(),I=R(!1),ee=R(!1),te=R([]),ne=R(!1),re=R(!1),ie=R(!1),ae=R(!1),oe=R(),se=R(!1),L=x(()=>r.value.filter(e=>Oa(e)).map(e=>e.path)),z=x(()=>r.value.filter(e=>Da(e.ext)).map(e=>({path:e.path,name:e.nm}))),ce=R(``),B=R({path:``,name:``}),V=R(!1),le=R(!1),ue=R(1),de=R(0),fe=R(0),pe=R(1),me=R(100),he=(()=>{try{return JSON.parse(sessionStorage.getItem(`fileSortState`)||`{}`)}catch(e){return{}}})(),ge=R(he.sort||``),_e=R(he.reverse||`False`),ve=R(0),ye=R(null),be=R(),xe=R([]),Se=R(-1),Ce=R(),we=R({reqEnd:!1,isSetup:!1,isBuy:!1});async function Te(){if(!we.value.reqEnd)try{let{message:e}=await qe({sName:`disk_analysis`});if(K(e)){we.value={reqEnd:!0,isSetup:e.status&&e.setup&&e.endtime>-1,isBuy:e.endtime>-1};return}}catch(e){}finally{we.value.reqEnd=!0}}return{mainRef:e,filesView:t,currentPath:n,fileList:r,tableLoading:i,normalTrList:a,trRectArr:o,choosedKeys:s,tableRef:l,dataTableRef:u,contextRef:d,normalCardList:f,cardRectArr:p,downloadFileFormData:m,downloadProgressData:h,downloadProgressShow:g,resourceManagerWindow:_,searchFileContentFormData:v,resetSearchFileContentFormData:y,searchRes:b,searchStatistics:S,favoriteList:C,favoriteOptions:w,resetFavoriteOptions:T,backupList:E,backupForm:D,fileOperationFlag:O,fileCopyCache:k,waitForPaste:A,copiedFile:j,dynamicCmptObj:N,dynamicCmpt:P,dynamicCmptRef:F,fileRecycle:I,menuShow:ee,uploadFileList:te,uploadShow:ne,uploadComplete:re,startUpload:ie,fileConflictShow:ae,optionToolsRef:oe,isMiniScreen:se,imgWaitPreview:L,videoWaitPreview:z,currentPreviewImg:ce,currentPreviewVideo:B,previewShow:V,previewVideoShow:le,operationType:ue,directoryCount:de,fileCount:fe,page:pe,size:me,sort:ge,reverse:_e,total:ve,currentFile:ye,choosePathRef:be,diskMountPoint:xe,currentDirSize:Se,dragUploadRef:Ce,diskAnalysis:we,initDiskAnalysis:Te}}h(),k();var Va={class:`tree-wrapper`},Ha=G(g({__name:`Tree`,setup(e){let{t}=B(),n=Ba(),r=X(),{currentPath:a,refreshKey:o,fileList:s,creatingType:c,isSearchMode:u,searchWord:d,searchAll:f,currentFile:h}=V(r),g=R([]),v=R(``),y=R([]),b=R(null),S=R(null),C=R(null),w=R(``),E=R(null),D=R(!1),O=R(0),k=R(0),A=R([]),j=R(null),M=()=>{let e=new Set;return async(t,n)=>{if(!e.has(t)){e.add(t);try{await n()}finally{e.delete(t)}}}},N=M(),P=M(),F=Dn(),I=(e,t)=>()=>i(`i`,{class:[e,t,`text-16px`]},null),ee=[{label:t(`fileEditor.tree.rename`),key:`rename`,icon:I(`i-lucide-text-cursor-input`,`text-gray-500`)},{label:t(`fileEditor.tree.download`),key:`download`,icon:I(`i-lucide-arrow-down`,`text-[#2080f0]`)},{label:t(`fileEditor.tree.delete`),key:`delete`,icon:I(`i-lucide-x`,`text-[#d03050]`)}],te=[{label:t(`fileEditor.tree.refresh`),key:`refresh`,icon:I(`i-lucide-refresh-cw`,`text-gray-500`)},{label:t(`fileEditor.tree.openDir`),key:`open_dir`,icon:I(`i-lucide-search`,`text-[#2080f0]`)},{label:t(`fileEditor.tree.newFolder`),key:`new_folder`,icon:I(`i-lucide-folder-plus`,`text-[#f0a020]`)},{label:t(`fileEditor.tree.newFile`),key:`new_file`,icon:I(`i-lucide-file-plus`,`text-gray-500`)},{label:t(`fileEditor.tree.rename`),key:`rename`,icon:I(`i-lucide-text-cursor-input`,`text-gray-500`)},{label:t(`fileEditor.tree.delete`),key:`delete`,icon:I(`i-lucide-x`,`text-[#d03050]`)}],ne=e=>{D.value=!1;let t=j.value;if(t&&F(e))switch(e){case`refresh`:P(t.key,()=>be(t));break;case`download`:ze(t.key);break;case`rename`:ce();break;case`delete`:re();break;case`new_folder`:ae(`folder`);break;case`new_file`:ae(`file`);break;case`open_dir`:r.setCurrentPath(t.key)}},re=async()=>{if(!j.value)return;let e={path:j.value.key,type:j.value.type===`dir`||j.value.type===`folder`?`dir`:`file`,nm:j.value.label},t=de(g.value,e.path);await ri(n,[e]),s.value.map((e,t)=>({path:e.path,index:t})).filter(t=>t.path===e.path||t.path.startsWith(`${e.path}/`)).sort((e,t)=>t.index-e.index).forEach(e=>{r.closeTab(e.index)}),t?be(t):U(!0)},ie=()=>{D.value=!1},ae=async e=>{let t=j.value;if(!t)return;!t.children&&t.type===`dir`&&await be(t);let n=t.key;y.value.includes(n)||y.value.push(n),oe(),b.value=e,S.value=t,v.value=``;let r={key:`__local_creating__`,label:``,type:e,isLeaf:!0,isCreating:!0,__isLocal:!0};t.children||(t.children=[]),t.children.unshift(r)},oe=()=>{S.value&&S.value.children&&(S.value.children=S.value.children.filter(e=>e.key!==`__local_creating__`)),b.value=null,S.value=null},L=async()=>{let e=v.value;if(!e.trim()){H.warning(t(`fileEditor.store.nameRequired`));return}let n=b.value,i=S.value;if(!i)return;let a=`${i.key}/${e}`;try{r.setLoading(!0),n===`file`?await ut({path:a}):n===`folder`&&await it({path:a}),H.success(t(`fileEditor.store.createSuccess`,{type:t(n===`file`?`fileEditor.store.newFile`:`fileEditor.store.newFolder`)})),oe(),await be(i)}finally{r.setLoading(!1)}},ce=()=>{if(!j.value)return;let e=j.value.key;s.value.some(t=>t.path===e||t.path.startsWith(`${e}/`))?H.warning(t(`fileEditor.tree.renameOpenedWarning`)):(C.value=e,w.value=j.value.label,E.value=de(g.value,C.value))},le=()=>{C.value=null,w.value=``,E.value=null},de=(e,t)=>{for(let n of e)if(n.children){if(n.children.some(e=>e.key===t))return n;let e=de(n.children,t);if(e)return e}return null},fe=async()=>{let e=w.value;if(!e.trim()){H.warning(t(`fileEditor.store.nameRequired`));return}if(!C.value)return;let n=C.value,i=n.lastIndexOf(`/`),a=`${n.substring(0,i)}/${e}`;if(n===a)le();else try{r.setLoading(!0),await lt({sfile:n,dfile:a});let e=E.value;le(),e?await be(e):await U(!0)}finally{r.setLoading(!1)}},pe=x(()=>s.value.map(e=>e.path)),me=(e,t,n)=>{let r=(e||[]).map(e=>{let t=(n===`/`?`/`:`${n}/`)+e.nm;return{label:e.nm,key:t,type:`dir`,isLeaf:!1}}),i=(t||[]).map(e=>{let t=(n===`/`?`/`:`${n}/`)+e.nm;return{label:e.nm,key:t,type:`file`,isLeaf:!0}});return[...r,...i]},he=({option:e})=>{if(e.type===`dir`||e.type===`folder`)return i(`i`,{class:`tree-icon folder-icon`},null);let t=C.value===e.key,{mode:n}=On(`${e.isCreating?v.value:t?w.value:e.label}`);return i(`i`,{class:[`tree-icon`,`${n}-icon`]},null)},_e=({option:e,selected:n})=>{let a=C.value===e.key;return e.isCreating||a?i(`div`,{class:`creating-node`},[i(`input`,{class:`creating-input`,value:a?w.value:v.value,onInput:e=>a?w.value=e.target.value:v.value=e.target.value,onKeyup:t=>{t.key===`Enter`?(t.stopPropagation(),a?fe():e.__isLocal?L():r.confirmCreateNewItem(v.value)):t.key===`Escape`&&(t.stopPropagation(),a?le():e.__isLocal?oe():r.cancelCreateNewItem())},onClick:e=>e.stopPropagation(),placeholder:e.type===`file`?t(`fileEditor.tree.newFilePlaceholder`):t(`fileEditor.tree.newFolderPlaceholder`),ref:e=>{e&&setTimeout(()=>e.focus(),50)}},null),i(`i`,{class:`i-ep-check text-primary`,onClick:t=>{t.stopPropagation(),a?fe():e.__isLocal?L():r.confirmCreateNewItem(v.value)}},null),i(`i`,{class:`i-ep-close text-error`,onClick:t=>{t.stopPropagation(),a?le():e.__isLocal?oe():r.cancelCreateNewItem()}},null)]):i(ge,{class:n?`text-[#cca700]`:``},{default:()=>[e.label]})},ve=({option:e})=>e.type===`dir`?`toggleExpand`:`default`,ye=({option:e})=>({onClick(){if(e.type===`file`&&!e.isCreating){let t=e.key;N(t,()=>r.openFile(t))}},onContextmenu(t){t.preventDefault(),D.value=!1,p(()=>{j.value=e,O.value=t.clientX,k.value=t.clientY,e.type===`dir`||e.type===`folder`?A.value=te:A.value=ee,D.value=!0})}}),be=async e=>{try{e.isLoading=!0;let t=e.key,{message:n}=await nt({path:t,p:1,showRow:99999,sort:`name`,reverse:`False`});K(n)&&(e.children=me(n.dir,n.files,n.path),(!n.dir||n.dir.length===0)&&(e.hideSwitcher=!0))}finally{e.isLoading=!1}},xe=``,Ce=!1,we=()=>`${a.value}|${u.value}|${d.value}|${f.value}`,Te=async()=>{r.setLoading(!0);try{let e={path:a.value,p:1,showRow:99999,sort:`name`,reverse:`False`};u.value&&d.value&&(e.search=d.value,f.value&&(e.all=`True`));let{message:t}=await nt(e);K(t)&&(n.fileRecycle.value=t.file_recycle,g.value=me(t.dir,t.files,t.path),c.value&&W())}finally{r.setLoading(!1)}},U=async(e=!1)=>{if(r.isListLoading)(e||we()!==xe)&&(Ce=!0);else{r.setListLoading(!0);try{do Ce=!1,xe=we(),await Te();while(Ce)}finally{r.setListLoading(!1)}}},W=()=>{if(c.value&&!g.value.find(e=>e.key===`__creating__`)){v.value=``;let e={key:`__creating__`,label:``,type:c.value,isLeaf:!0,isCreating:!0};g.value.unshift(e)}},G=()=>{g.value=g.value.filter(e=>e.key!==`__creating__`)};se(c,e=>{e?W():G()}),se([a,o],()=>{U()}),se(u,e=>{e&&(g.value=[])});let Ee=()=>{h.value&&p(()=>{setTimeout(()=>{let e=document.querySelector(`.tree-wrapper .n-tree-node--selected`);e&&e.scrollIntoView({behavior:`smooth`,block:`center`})},500)})};return m(async()=>{await U(),await p(),Ee()}),(e,t)=>{let n=Se,r=ue;return T(),l(`div`,Va,[i(n,{ref:`treeRef`,"block-line":``,data:_(g),"on-load":be,"expand-on-click":``,selectable:``,"expanded-keys":_(y),"onUpdate:expandedKeys":t[0]||(t[0]=e=>z(y)?y.value=e:null),"render-prefix":he,"render-label":_e,"override-default-node-click-behavior":ve,"selected-keys":_(pe),"node-props":ye},null,8,[`data`,`expanded-keys`,`selected-keys`]),i(r,{trigger:`manual`,placement:`bottom-start`,show:_(D),options:_(A),x:_(O),y:_(k),onSelect:ne,onClickoutside:ie},null,8,[`show`,`options`,`x`,`y`])])}}}),[[`__scopeId`,`data-v-f79b7cfa`]]);h(),k(),o();var Ua={class:`sidebar-content`},Wa=G(g({__name:`index`,setup(e){let t=R(!1),n=()=>{t.value=!t.value};return(e,a)=>(T(),l(`aside`,{class:r([`sidebar-wrapper`,{"is-collapsed":_(t)}])},[s(`div`,Ua,[i(Tn),i(Fn),i(Ha)]),s(`div`,{class:`toggle-btn`,onClick:n})],2))}}),[[`__scopeId`,`data-v-c942a726`]]);h(),o(),F(),k();var Ga={class:`editor-header-wrapper`},Ka=[`title`,`onClick`,`onContextmenu`],qa=[`onClick`],Ja=[`onClick`],Ya=G(g({__name:`header`,props:a({data:{default:()=>[]},save:{}},{value:{},valueModifiers:{}}),emits:a([`select`,`close`],[`update:value`]),setup(e,{emit:t}){let a=e,o=ae(e,`value`),{t:c}=B(),u=t,d=I(`headerRef`),f=()=>{p(()=>{setTimeout(()=>{if(d.value){let e=d.value.querySelector(`.editor-tab.active`);e&&e.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})}},100)})};se(o,()=>{f()}),m(()=>{f()});let h=e=>{o.value=e,u(`select`,e)},g=e=>{let{mode:t}=On(e);return`${t}-icon`},v=e=>{o.value!==void 0&&e<o.value&&--o.value,u(`close`,e)},y=e=>{q({title:c(`fileEditor.editorHeader.tipTitle`),content:c(`fileEditor.editorHeader.modifiedSaveConfirm`),confirmText:c(`fileEditor.common.save`),cancelText:c(`fileEditor.editorHeader.dontSave`),onConfirm:async()=>{await a.save(e),v(e)},onCancel:()=>{v(e)}})},b=e=>e.type===`shortcut`||e.type===`diff`||e.onlyRead?!1:e.content!==e.originalContent,x=R(!1),S=R(0),C=R(0),w=R(-1),D=[{label:c(`fileEditor.editorHeader.close`),key:`close`},{label:c(`fileEditor.editorHeader.closeOthers`),key:`closeOthers`},{label:c(`fileEditor.editorHeader.closeAll`),key:`closeAll`}],k=(e,t)=>{x.value=!1,p(()=>{x.value=!0,S.value=e.clientX,C.value=e.clientY,w.value=t})},M=()=>{x.value=!1},N=e=>{x.value=!1;let t=w.value;if(t!==-1){if(e===`close`){let e=a.data[t];b(e)?y(t):v(t)}else if(e===`closeOthers`){for(let e=a.data.length-1;e>=0;e--)if(e!==t){let t=a.data[e];b(t)||v(e)}}else if(e===`closeAll`)for(let e=a.data.length-1;e>=0;e--){let t=a.data[e];b(t)||v(e)}}};return(t,a)=>{let c=ge,u=we,f=ue;return T(),l(`div`,Ga,[i(u,{"x-scrollable":``,trigger:`none`},{default:O(()=>[s(`div`,{class:`editor-header`,ref_key:`headerRef`,ref:d},[(T(!0),l(E,null,n(e.data,(e,t)=>(T(),l(`div`,{key:t,class:r([`editor-tab`,{active:o.value===t}]),title:e.path,onClick:e=>h(t),onContextmenu:A(e=>k(e,t),[`prevent`])},[s(`div`,{class:r([`tree-icon tab-icon`,g(e.name)])},null,2),i(c,{class:`mx-10px`},{default:O(()=>[s(`span`,null,j(e.name),1)]),_:2},1024),b(e)?(T(),l(`div`,{key:0,class:`tab-dirty`,onClick:A(e=>y(t),[`stop`])},null,8,qa)):(T(),l(`div`,{key:1,class:`tab-close i-ep-close-bold`,onClick:A(e=>v(t),[`stop`])},null,8,Ja))],42,Ka))),128))],512)]),_:1}),i(f,{placement:`bottom-start`,trigger:`manual`,x:_(S),y:_(C),options:D,show:_(x),"on-clickoutside":M,onSelect:N},null,8,[`x`,`y`,`show`])])}}}),[[`__scopeId`,`data-v-59f49b3b`]]);h();var Xa=e(wt(),1),Za=G(g({__name:`main`,props:a({mode:{type:String,default:`Text`}},{value:{},valueModifiers:{}}),emits:a([`cursor-change`],[`update:value`]),setup(e,{expose:t,emit:n}){let r=e,i=n,a=X(),{editorConfig:o,currentFile:s}=V(a),c=ae(e,`value`),u=I(`editorRef`),d=null,f=new Map,p=e=>new Promise(t=>{Xa.default.config.loadModule(e,()=>t())}),h=()=>{var e,t;if(!d)return;let n=(e=s.value)==null?void 0:e.path;if(!n)return;let i=a.fileList.map(e=>e.path);for(let e of f.keys())i.includes(e)||f.delete(e);let l=f.get(n);if(!l){var u;l=Xa.default.createEditSession((u=c.value)==null?``:u,d.session.getMode()),l.setUndoManager(new Xa.default.UndoManager);let{useSoftTabs:e,tabSize:t,wrap:r}=o.value.aceEditor;l.setUseSoftTabs(e),l.setTabSize(t),l.setUseWrapMode(r),f.set(n,l)}if(l.setMode(`ace/mode/${(t=r.mode)==null?void 0:t.toLocaleLowerCase()}`),d.getSession()!==l){var p;d.setSession(l),d.setReadOnly(((p=s.value)==null?void 0:p.onlyRead)||!1);let{useSoftTabs:e,tabSize:t,wrap:n}=o.value.aceEditor;l.setUseSoftTabs(e),l.setTabSize(t),l.setUseWrapMode(n)}};se(()=>{var e;return(e=s.value)==null?void 0:e.path},()=>{h()}),se(()=>c.value,e=>{if(!d)return;let t=d.getValue();if(e!==void 0&&e!==t){let t=d.getSession(),n=t.selection.getCursor(),r=t.getScrollTop(),i=t.getScrollLeft();d.setValue(e,-1),d.moveCursorToPosition(n),t.setScrollTop(r),t.setScrollLeft(i)}});let g=async()=>{var e,t;if(Xa.default.config.set(`basePath`,`/static/ace`),await p(`ace/ext/language_tools`),!u.value)return;let{editorTheme:n}=o.value.aceEditor,a=`ace/theme/${n}`;if(await p(a),!u.value)return;let{fontSize:l,lineHeight:f,fontFamily:m,showInvisibles:g,showLineNumbers:v,useSoftTabs:y,tabSize:b,keyboardHandler:x,enableLiveAutocompletion:S,enableSnippets:C,enableBasicAutocompletion:w,wrap:T,indentedSoftWrap:E,highlightActiveLine:D,highlightSelectedWord:O,animatedScroll:k,showFoldWidgets:A,showGutter:j,displayIndentGuides:M}=o.value.aceEditor;d=Xa.default.edit(u.value,{value:c.value,theme:a,mode:`ace/mode/${(e=r.mode)==null?void 0:e.toLocaleLowerCase()}`,fontSize:l,fontFamily:m,showInvisibles:g,showLineNumbers:v,useSoftTabs:y,tabSize:b,showPrintMargin:!1,keyboardHandler:x,enableLiveAutocompletion:S,enableSnippets:C,enableBasicAutocompletion:w,wrap:T,indentedSoftWrap:E,highlightActiveLine:D,highlightSelectedWord:O,animatedScroll:k,showFoldWidgets:A,showGutter:j,displayIndentGuides:M,readOnly:((t=s.value)==null?void 0:t.onlyRead)||!1}),d.container.style.lineHeight=f,d.renderer.updateFontSize();let N=()=>{if(!d)return;let e=d.getCursorPosition();i(`cursor-change`,{line:e.row+1,column:e.column+1})};h(),N(),d.selection.on(`changeCursor`,()=>{N()}),d.on(`change`,()=>{c.value=d==null?void 0:d.getValue()}),_(d)},_=e=>{e.commands.addCommand({name:`saveFile`,bindKey:{win:`Ctrl-S`,mac:`Command-S`},readOnly:!0,exec:()=>{a.saveCurrentFileContent()}}),e.commands.addCommand({name:`saveAllFile`,bindKey:{win:`Ctrl-Shift-S`,mac:`Command-Shift-S`},readOnly:!0,exec:()=>{a.saveAllFile()}}),e.commands.addCommand({name:`closeFile`,bindKey:{win:`Alt-W`,mac:`Option-W`},readOnly:!0,exec:()=>{a.closeTab(a.currentFileIndex)}}),e.commands.addCommand({name:`undo`,bindKey:{win:`Ctrl-Z`,mac:`Command-Z`},readOnly:!0,exec:()=>{e.undo()}})};return D(()=>{let{editorTheme:e,fontSize:t,lineHeight:n,fontFamily:r,showInvisibles:i,showLineNumbers:a,useSoftTabs:c,tabSize:l,keyboardHandler:u,enableLiveAutocompletion:f,enableSnippets:p,enableBasicAutocompletion:m,wrap:h,indentedSoftWrap:g,highlightActiveLine:_,highlightSelectedWord:v,animatedScroll:y,showFoldWidgets:b,showGutter:x,displayIndentGuides:S}=o.value.aceEditor;if(d){var C;d.setTheme(`ace/theme/${e}`),d.setOptions({fontSize:t,fontFamily:r,showInvisibles:i,showLineNumbers:a,useSoftTabs:c,tabSize:l,keyboardHandler:u,enableLiveAutocompletion:f,enableSnippets:p,enableBasicAutocompletion:m,wrap:h,indentedSoftWrap:g,highlightActiveLine:_,highlightSelectedWord:v,animatedScroll:y,showFoldWidgets:b,showGutter:x,displayIndentGuides:S,readOnly:((C=s.value)==null?void 0:C.onlyRead)||!1}),d.container.style.lineHeight=n,d.renderer.updateFontSize()}}),m(()=>{g()}),t({execCommand:e=>{d&&d.execCommand(e)},jumpToLine:e=>{d.gotoLine(e,0,!0),requestAnimationFrame(()=>{d.focus()})}}),(e,t)=>(T(),l(`div`,{ref_key:`editorRef`,ref:u,class:`ace-editor w-full h-full`},null,512))}}),[[`__scopeId`,`data-v-cd594c09`]]);h(),k();var Qa={class:`file-history`},$a=G(g({__name:`index`,emits:[`close`],setup(e,{emit:t}){let{t:n}=B(),r=t,a=X(),{currentFile:o}=V(a),s=x(()=>{let e=o.value;return e?e.history.map(t=>({time:t,path:e.path})):[]}),c=[{key:`time`,title:n(`fileEditor.dialogs.fileHistory.time`),render:e=>Ve(e.time)},Ne({title:n(`fileEditor.dialogs.fileHistory.actions`),width:210,options:e=>[{label:n(`fileEditor.dialogs.fileHistory.diff`),onClick:()=>{r(`close`),a.openDiffTab(e.path,e.time)}},{label:n(`fileEditor.dialogs.fileHistory.recover`),onClick:()=>{q({title:n(`fileEditor.dialogs.fileHistory.recoverTitle`),content:n(`fileEditor.dialogs.fileHistory.recoverContent`,{time:Ve(e.time)}),onConfirm:async()=>{await ft({filename:e.path,history:e.time}),H.success(n(`fileEditor.dialogs.fileHistory.fileContentUpdated`)),a.getFileContent(e.path)}})}},{label:n(`fileEditor.dialogs.fileHistory.delete`),onClick:()=>{q({title:n(`fileEditor.dialogs.fileHistory.deleteTitle`),content:n(`fileEditor.dialogs.fileHistory.deleteContent`,{time:Ve(e.time)}),onConfirm:async()=>{await rt({filename:e.path,history:e.time}),d(e.path)}})}}]})],u=R(!1),d=async e=>{try{u.value=!0,await a.getFileContent(e)}finally{u.value=!1}};return(e,t)=>{let n=$e;return T(),l(`div`,Qa,[i(n,{loading:_(u),columns:c,data:_(s),"max-height":400},null,8,[`loading`,`data`])])}}}),[[`__scopeId`,`data-v-1701a30e`]]);h(),k(),o();var eo={key:0,class:`footer-path`},to={key:1,class:`footer-path diff-path`},no={class:`mr-6px`},ro={key:2,class:`footer-tools`},io={class:`footer-item`},ao={key:0,class:`footer-item readonly-badge`},oo=G(g({__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(e,{emit:t}){let n=e,a=t,o=X(),{currentFile:c,editorConfig:u}=V(o),{t:d}=B(),f=x(()=>c.value?c.value.history.length:0),p=x(()=>{var e;return((e=c.value)==null?void 0:e.onlyRead)||!1}),m=()=>{U({title:d(`fileEditor.dialogs.fileHistory.title`),component:$a})},h=()=>{o.openToolsModal(`lineEnding`,{lineEnding:n.lineEnding,onChange:async e=>{await o.changeLineEnding(e)}})},g=()=>{o.openToolsModal(`tabSize`,{useSoftTabs:n.useSoftTabs?`space`:`tab`,tabSize:n.tabSize,onChange:(e,t)=>{o.updateTabSettings(e,t)}})},v=()=>{o.openToolsModal(`encoding`,{encoding:u.value.aceEditor.encoding,onChange:async e=>{await o.changeEncoding(e)}})},y=()=>{var e,t,r;o.openToolsModal(`goToLine`,{currentLine:(e=n.cursor)==null?void 0:e.line,currentColumn:(t=n.cursor)==null?void 0:t.column,maxLine:(r=c.value)!=null&&r.content?c.value.content.split(` `).length:1,onChange:e=>{a(`jump-line`,e)}})},b=()=>{if(!c.value||c.value.type!==`diff`)return;let e={path:c.value.originalPath,time:c.value.historyTime};q({title:d(`fileEditor.dialogs.fileHistory.recoverTitle`),content:d(`fileEditor.dialogs.fileHistory.recoverContent`,{time:Ve(e.time)}),onConfirm:async()=>{await ft({filename:e.path,history:e.time}),H.success(d(`fileEditor.dialogs.fileHistory.fileContentUpdated`)),o.getFileContent(e.path),o.closeTab(o.currentFileIndex)}})};return(t,n)=>{var a,o,u,d,x;let S=ge,w=We;return T(),l(`div`,{class:r([`editor-footer`,{"diff-footer":((a=_(c))==null?void 0:a.type)===`diff`}])},[((o=_(c))==null?void 0:o.type)===`diff`?(T(),l(`div`,to,[s(`span`,no,j(t.$t(`fileEditor.editorFooter.readOnlyHistory`,{path:(u=_(c))==null?void 0:u.originalPath,time:_(Ve)((d=_(c))==null?void 0:d.historyTime)})),1),i(w,{onClick:b},{default:O(()=>[P(j(t.$t(`fileEditor.editorFooter.clickRecoverLeft`)),1)]),_:1})])):(T(),l(`div`,eo,[i(S,null,{default:O(()=>[P(j(t.$t(`fileEditor.editorFooter.fileLocation`,{path:e.filePath})),1)]),_:1})])),((x=_(c))==null?void 0:x.type)===`diff`?C(``,!0):(T(),l(`div`,ro,[s(`span`,{class:`footer-item`,onClick:h},j(e.lineEnding),1),s(`span`,{class:`footer-item`,onClick:y},j(t.$t(`fileEditor.editorFooter.lineColumn`,{line:e.cursor.line,column:e.cursor.column})),1),s(`span`,{class:`footer-item`,onClick:m},j(t.$t(`fileEditor.editorFooter.historyCount`,{count:_(f)})),1),s(`span`,{class:`footer-item`,onClick:g},j(t.$t(`fileEditor.editorFooter.tabSize`,{size:e.tabSize})),1),s(`span`,{class:`footer-item`,onClick:v},j(t.$t(`fileEditor.editorFooter.encoding`,{encoding:e.encoding})),1),s(`span`,io,j(t.$t(`fileEditor.editorFooter.language`,{language:e.language})),1),_(p)?(T(),l(`span`,ao,j(t.$t(`fileEditor.editorFooter.readOnlyMode`)),1)):C(``,!0)]))],2)}}}),[[`__scopeId`,`data-v-f3c99d32`]]);h();var so=G(g({__name:`diff`,props:{mode:{type:String,default:`Text`}},setup(e){let t=e,n=X(),{editorConfig:r,currentFile:i}=V(n),a=I(`diffRef`),o=null,s=e=>new Promise(t=>{Xa.default.config.loadModule(e,()=>t())}),c=async()=>{var e,n,c;if(Xa.default.config.set(`basePath`,`/static/ace`),await s(`ace/ext/language_tools`),!a.value)return;let{editorTheme:l}=r.value.aceEditor,u=`ace/theme/${l}`;if(await s(u),!a.value)return;let{fontSize:d,fontFamily:f,showInvisibles:p,showLineNumbers:m,useSoftTabs:h,tabSize:g}=r.value.aceEditor,_=`ace/mode/${(e=t.mode)==null?void 0:e.toLocaleLowerCase()}`;o=new Ct({ace:Xa.default,element:a.value,theme:u,mode:_,left:{content:((n=i.value)==null?void 0:n.leftContent)||``,editable:!1,copyLinkEnabled:!1},right:{content:((c=i.value)==null?void 0:c.rightContent)||``,editable:!1,copyLinkEnabled:!1}});let v=o.getEditors();[v.left,v.right].forEach(e=>{e.setOptions({fontSize:d,fontFamily:f,showInvisibles:p,showLineNumbers:m,useSoftTabs:h,tabSize:g,showPrintMargin:!1,wrap:!0,indentedSoftWrap:!0})}),se(()=>{var e;return(e=i.value)==null?void 0:e.leftContent},e=>{o&&o.getEditors().left.setValue(e||``,-1)}),se(()=>{var e;return(e=i.value)==null?void 0:e.rightContent},e=>{o&&o.getEditors().right.setValue(e||``,-1)})};return m(()=>{c()}),f(()=>{o&&o.destroy()}),D(()=>{let{editorTheme:e,fontSize:t,fontFamily:n,showInvisibles:i,showLineNumbers:a,useSoftTabs:s,tabSize:c}=r.value.aceEditor;if(o){let r=o.getEditors();[r.left,r.right].forEach(r=>{r.setTheme(`ace/theme/${e}`),r.setOptions({fontSize:t,fontFamily:n,showInvisibles:i,showLineNumbers:a,useSoftTabs:s,tabSize:c})})}}),(e,t)=>(T(),l(`div`,{ref_key:`diffRef`,ref:a,class:`ace-diff-container w-full h-full`},null,512))}}),[[`__scopeId`,`data-v-3cd40f25`]]);o(),h();var co={},lo={class:`flex-1 bg-[#262626] overflow-y-auto w-full h-full text-[#ccc]`},uo={class:`flex gap-60px max-w-[1200px] mx-auto py-30px px-50px justify-center`},fo={class:`flex-1`},po={class:`text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary`},mo={class:`flex flex-col gap-[14px] text-[14px]`},ho={class:`flex items-center`},go={class:`text-[#a4a4a4] ml-[16px]`},_o={class:`flex items-center`},vo={class:`text-[#a4a4a4] ml-[16px]`},yo={class:`flex items-center`},bo={class:`text-[#a4a4a4] ml-[16px]`},xo={class:`flex items-center`},So={class:`text-[#a4a4a4] ml-[16px]`},Co={class:`flex items-center`},wo={class:`text-[#a4a4a4] ml-[16px]`},To={class:`flex items-center`},Eo={class:`text-[#a4a4a4] ml-[16px]`},Do={class:`flex items-center`},Oo={class:`text-[#a4a4a4] ml-[16px]`},ko={class:`flex items-center`},Ao={class:`text-[#a4a4a4] ml-[16px]`},jo={class:`flex items-center`},Mo={class:`text-[#a4a4a4] ml-[16px]`},No={class:`flex items-center`},Po={class:`text-[#a4a4a4] ml-[16px]`},Fo={class:`mt-[40px]`},Io={class:`text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary`},Lo={class:`flex flex-col gap-[14px] text-[14px]`},Ro={class:`flex items-center`},zo={class:`text-[#a4a4a4] ml-[16px]`},Bo={class:`flex items-center`},Vo={class:`text-[#a4a4a4] ml-[16px]`},Ho={class:`flex items-center`},Uo={class:`text-[#a4a4a4] ml-[16px]`},Wo={class:`flex items-center`},Go={class:`text-[#a4a4a4] ml-[16px]`},Ko={class:`flex-1`},qo={class:`text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary`},Jo={class:`flex flex-col gap-[14px] text-[14px]`},Yo={class:`flex items-center`},Xo={class:`flex items-center gap-[6px] min-w-[260px] text-white`},Zo={class:`flex items-center`},Qo={class:`text-[#a4a4a4] ml-[16px]`},$o={class:`flex items-center`},es={class:`text-[#a4a4a4] ml-[16px]`},ts={class:`flex items-center`},ns={class:`flex items-center gap-[6px] min-w-[260px] text-white`},rs={class:`text-[#a4a4a4] ml-[16px]`},is={class:`mt-[40px]`},as={class:`text-[20px] text-[#e0e0e0] mb-[24px] pl-[12px] border-l-[3px] border-l-solid border-l-primary`},os={class:`flex flex-col gap-[14px] text-[14px]`},ss={class:`flex items-center`},cs={class:`text-[#a4a4a4] ml-[16px]`},ls={class:`flex items-center`},us={class:`text-[#a4a4a4] ml-[16px]`},ds={class:`flex items-center`},fs={class:`text-[#a4a4a4] ml-[16px]`},ps={class:`flex items-center`},ms={class:`text-[#a4a4a4] ml-[16px]`},hs={class:`flex items-center`},gs={class:`text-[#a4a4a4] ml-[16px]`},_s={class:`flex items-center`},vs={class:`text-[#a4a4a4] ml-[16px]`},ys={class:`flex items-center`},bs={class:`text-[#a4a4a4] ml-[16px]`},xs={class:`flex items-center`},Ss={class:`text-[#a4a4a4] ml-[16px]`},Cs={class:`flex items-center`},ws={class:`text-[#a4a4a4] ml-[16px]`};function Ts(e,t){return T(),l(`div`,lo,[s(`div`,uo,[s(`div`,fo,[s(`div`,null,[s(`div`,po,j(e.$t(`fileEditor.shortcut.common.title`)),1),s(`div`,mo,[s(`div`,ho,[t[0]||(t[0]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`S`)],-1)),s(`div`,go,j(e.$t(`fileEditor.shortcut.common.saveFile`)),1)]),s(`div`,_o,[t[1]||(t[1]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`C`)],-1)),s(`div`,vo,j(e.$t(`fileEditor.shortcut.common.copy`)),1)]),s(`div`,yo,[t[2]||(t[2]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`X`)],-1)),s(`div`,bo,j(e.$t(`fileEditor.shortcut.common.cut`)),1)]),s(`div`,xo,[t[3]||(t[3]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`V`)],-1)),s(`div`,So,j(e.$t(`fileEditor.shortcut.common.paste`)),1)]),s(`div`,Co,[t[4]||(t[4]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`A`)],-1)),s(`div`,wo,j(e.$t(`fileEditor.shortcut.common.selectAll`)),1)]),s(`div`,To,[t[5]||(t[5]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`Z`)],-1)),s(`div`,Eo,j(e.$t(`fileEditor.shortcut.common.undo`)),1)]),s(`div`,Do,[t[6]||(t[6]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`Y`)],-1)),s(`div`,Oo,j(e.$t(`fileEditor.shortcut.common.redo`)),1)]),s(`div`,ko,[t[7]||(t[7]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`F`)],-1)),s(`div`,Ao,j(e.$t(`fileEditor.shortcut.common.find`)),1)]),s(`div`,jo,[t[8]||(t[8]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`H`)],-1)),s(`div`,Mo,j(e.$t(`fileEditor.shortcut.common.replace`)),1)]),s(`div`,No,[t[9]||(t[9]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Esc`)],-1)),s(`div`,Po,j(e.$t(`fileEditor.shortcut.common.esc`)),1)])])]),s(`div`,Fo,[s(`div`,Io,j(e.$t(`fileEditor.shortcut.cursorMove.title`)),1),s(`div`,Lo,[t[14]||(t[14]=s(`div`,{class:`flex items-center`},[s(`div`,{class:`flex items-center flex-wrap gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Home`),P(` / `),s(`kbd`,null,`End`),P(` / `),s(`kbd`,null,`Up`),P(` / `),s(`kbd`,null,`Left`),P(` / `),s(`kbd`,null,`Down`),P(` / `),s(`kbd`,null,`Right`)])],-1)),s(`div`,Ro,[t[10]||(t[10]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`Home`),P(` / `),s(`kbd`,null,`End`)],-1)),s(`div`,zo,j(e.$t(`fileEditor.shortcut.cursorMove.docStartEnd`)),1)]),s(`div`,Bo,[t[11]||(t[11]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`P`)],-1)),s(`div`,Vo,j(e.$t(`fileEditor.shortcut.cursorMove.matchingTag`)),1)]),s(`div`,Ho,[t[12]||(t[12]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`PageUp`),P(` / `),s(`kbd`,null,`PageDown`)],-1)),s(`div`,Uo,j(e.$t(`fileEditor.shortcut.cursorMove.pageUpDown`)),1)]),s(`div`,Wo,[t[13]||(t[13]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Alt`),P(` + `),s(`kbd`,null,`Left`),P(` / `),s(`kbd`,null,`Right`)],-1)),s(`div`,Go,j(e.$t(`fileEditor.shortcut.cursorMove.lineStartEnd`)),1)])])])]),s(`div`,Ko,[s(`div`,null,[s(`div`,qo,j(e.$t(`fileEditor.shortcut.selection.title`)),1),s(`div`,Jo,[s(`div`,Yo,[s(`div`,Xo,[s(`kbd`,null,j(e.$t(`fileEditor.shortcut.selection.mouseBox`)),1),t[15]||(t[15]=P(` —— `,-1)),s(`kbd`,null,j(e.$t(`fileEditor.shortcut.selection.drag`)),1)])]),t[20]||(t[20]=v(`<div class="flex items-center" data-v-38e00b50><div class="flex items-center flex-wrap gap-[6px] min-w-[260px] text-white" data-v-38e00b50><kbd data-v-38e00b50>Shift</kbd> + <kbd data-v-38e00b50>Home</kbd> / <kbd data-v-38e00b50>End</kbd> / <kbd data-v-38e00b50>Up</kbd> / <kbd data-v-38e00b50>Left</kbd> / <kbd data-v-38e00b50>Down</kbd> / <kbd data-v-38e00b50>Right</kbd></div></div>`,1)),s(`div`,Zo,[t[16]||(t[16]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Shift`),P(` + `),s(`kbd`,null,`PageUp`),P(` / `),s(`kbd`,null,`PageDown`)],-1)),s(`div`,Qo,j(e.$t(`fileEditor.shortcut.selection.pageSelect`)),1)]),s(`div`,$o,[t[17]||(t[17]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`Shift`),P(` + `),s(`kbd`,null,`Home`),P(` / `),s(`kbd`,null,`End`)],-1)),s(`div`,es,j(e.$t(`fileEditor.shortcut.selection.cursorToStartEnd`)),1)]),s(`div`,ts,[s(`div`,ns,[t[18]||(t[18]=s(`kbd`,null,`Alt`,-1)),t[19]||(t[19]=P(` + `,-1)),s(`kbd`,null,j(e.$t(`fileEditor.shortcut.selection.mouseDrag`)),1)]),s(`div`,rs,j(e.$t(`fileEditor.shortcut.selection.blockSelect`)),1)])])]),s(`div`,is,[s(`div`,as,j(e.$t(`fileEditor.shortcut.edit.title`)),1),s(`div`,os,[s(`div`,ss,[t[21]||(t[21]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`/`)],-1)),s(`div`,cs,j(e.$t(`fileEditor.shortcut.edit.toggleComment`)),1)]),s(`div`,ls,[t[22]||(t[22]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Tab`)],-1)),s(`div`,us,j(e.$t(`fileEditor.shortcut.edit.indent`)),1)]),s(`div`,ds,[t[23]||(t[23]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Shift`),P(` + `),s(`kbd`,null,`Tab`)],-1)),s(`div`,fs,j(e.$t(`fileEditor.shortcut.edit.outdent`)),1)]),s(`div`,ps,[t[24]||(t[24]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Delete`)],-1)),s(`div`,ms,j(e.$t(`fileEditor.shortcut.edit.delete`)),1)]),s(`div`,hs,[t[25]||(t[25]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`D`)],-1)),s(`div`,gs,j(e.$t(`fileEditor.shortcut.edit.deleteLine`)),1)]),s(`div`,_s,[t[26]||(t[26]=s(`div`,{class:`flex items-center flex-wrap gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Alt`),P(` + `),s(`kbd`,null,`Shift`),P(` + `),s(`kbd`,null,`Up`),P(` / `),s(`kbd`,null,`Down`)],-1)),s(`div`,vs,j(e.$t(`fileEditor.shortcut.edit.copyLineUpDown`)),1)]),s(`div`,ys,[t[27]||(t[27]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Alt`),P(` + `),s(`kbd`,null,`Delete`)],-1)),s(`div`,bs,j(e.$t(`fileEditor.shortcut.edit.deleteRight`)),1)]),s(`div`,xs,[t[28]||(t[28]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Alt`),P(` + `),s(`kbd`,null,`Up`),P(` / `),s(`kbd`,null,`Down`)],-1)),s(`div`,Ss,j(e.$t(`fileEditor.shortcut.edit.swapLineUpDown`)),1)]),s(`div`,Cs,[t[29]||(t[29]=s(`div`,{class:`flex items-center gap-[6px] min-w-[260px] text-white`},[s(`kbd`,null,`Ctrl`),P(` + `),s(`kbd`,null,`Shift`),P(` + `),s(`kbd`,null,`D`)],-1)),s(`div`,ws,j(e.$t(`fileEditor.shortcut.edit.copyLineDown`)),1)])])])])])])}var Es=G(co,[[`render`,Ts],[`__scopeId`,`data-v-38e00b50`]]);h(),k();var Ds={class:`flex-1 flex flex-col h-full bg-[#1e1e1e] overflow-hidden`},Os={class:`flex-1 overflow-hidden relative`},ks=g({__name:`index`,setup(e,{expose:t}){let n=X(),{fileList:r,currentFileIndex:a,currentFile:o,editorConfig:c}=V(n),{saveFileContentAndClose:u,closeTab:d,updateTabContent:f}=n,p=I(`editorMainRef`),m=x({get:()=>{var e;return((e=o.value)==null?void 0:e.content)||``},set:e=>{a.value!==-1&&f(a.value,e)}}),h=S({line:1,column:1}),g=x(()=>Number(c.value.aceEditor.tabSize)),v=x(()=>c.value.aceEditor.useSoftTabs),y=x(()=>{var e;return((e=o.value)==null?void 0:e.encoding)||``}),b=x(()=>{let e=new Map,t=Object.entries(c.value.supportedModes||{});for(let[n,r]of t){let t=r[0].split(`|`);for(let r of t)e.set(r,n)}return e}),w=x(()=>{var e;let t=(e=o.value)==null?void 0:e.type;return t&&b.value.get(t)||`Text`}),D=x(()=>{var e,t;let n=w.value;return(e=(t=c.value.nameOverrides)==null?void 0:t[n])==null?n:e}),O=async e=>{await u(e)},k=e=>{d(e)},A=e=>{h.line=e.line,h.column=e.column},j=e=>{if(e===`search`){var t;(t=p.value)==null||t.execCommand(`find`)}else if(e===`replace`){var r;(r=p.value)==null||r.execCommand(`replace`)}else if(e===`goToLine`){var i;n.openToolsModal(`goToLine`,{currentLine:h.line,currentColumn:h.column,maxLine:(i=o.value)!=null&&i.content?o.value.content.split(` `).length:1,onChange:e=>{var t;(t=p.value)==null||t.jumpToLine(e)}})}},M=e=>{var t;(t=p.value)==null||t.jumpToLine(e)};return t({handleToolbarAction:j}),n.getEditorConfig(),(e,t)=>(T(),l(`div`,Ds,[i(Ya,{value:_(a),"onUpdate:value":t[0]||(t[0]=e=>z(a)?a.value=e:null),data:_(r),save:O,onClose:k},null,8,[`value`,`data`]),_(o)?(T(),l(E,{key:0},[s(`div`,Os,[_(o).type===`shortcut`?(T(),L(Es,{key:0})):_(o).type===`diff`?(T(),L(so,{key:1,mode:_(w)},null,8,[`mode`])):(T(),L(Za,{key:2,ref_key:`editorMainRef`,ref:p,value:_(m),"onUpdate:value":t[1]||(t[1]=e=>z(m)?m.value=e:null),mode:_(w),onCursorChange:A},null,8,[`value`,`mode`]))]),_(o).type===`shortcut`?C(``,!0):(T(),L(oo,{key:0,"file-path":_(o).path,encoding:_(y),"line-ending":_(o).lineEnding,cursor:_(h),"tab-size":_(g),"use-soft-tabs":_(v),language:_(D),onJumpLine:M},null,8,[`file-path`,`encoding`,`line-ending`,`cursor`,`tab-size`,`use-soft-tabs`,`language`]))],64)):C(``,!0)]))}});h(),k(),F();var As={class:`editor-container`},js={class:`editor-body`},Ms=g({__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(e){let t=e,n=I(`codeEditorRef`),{t:r}=B(),a=X(),{isMinimize:o}=V(a),c=e=>{(e.key===`F5`||e.key===`r`&&(e.metaKey||e.ctrlKey))&&(e.preventDefault(),H.info(r(`fileEditor.messages.noRefresh`)))};a.setCurrentPath(t.currentPath),m(()=>{window.addEventListener(`keydown`,c,{capture:!0}),a.isOpen=!0,a.openFile(t.filePath)}),w(()=>{window.removeEventListener(`keydown`,c,{capture:!0}),a.isOpen=!1,a.isMinimize=!1,a.fileList=[],a.currentFileIndex=-1,a.currentPath=``,a.creatingType=null,a.isSearchMode=!1,a.closeToolsModal()});let u=R(!1),d=x({get:()=>o.value,set:e=>{o.value=e}}),f=e=>{n.value&&n.value.handleToolbarAction(e)},p=()=>{d.value=!d.value,t.onMinimize()},h=()=>{u.value=!u.value,t.onMaximize()},g=()=>{let e=a.fileList.some(e=>e.content!==e.originalContent&&e.type!==`shortcut`),n=()=>{Ae(),t.onClose&&t.onClose()};e?q({title:r(`fileEditor.editorHeader.tipTitle`),content:r(`fileEditor.editorHeader.modifiedSaveConfirm`),confirmText:r(`fileEditor.common.save`),cancelText:r(`fileEditor.editorHeader.dontSave`),onConfirm:async()=>{await a.saveAllFile(),n()},onCancel:()=>{n()}}):n()};return(e,t)=>(T(),l(`div`,As,[i(Bt,{"is-minimize":_(d),"is-maximize":_(u),onMinimize:p,onMaximize:h,onClose:g},null,8,[`is-minimize`,`is-maximize`]),ie(i(Sn,{onAction:f},null,512),[[re,!_(d)]]),ie(s(`main`,js,[i(Wa),i(ks,{ref_key:`codeEditorRef`,ref:n},null,512)],512),[[re,!_(d)]])]))}}),Ns=t({default:()=>Ps}),Ps=G(Ms,[[`__scopeId`,`data-v-615a4f3c`]]);export{Nr as $,di as A,Hr as B,ya as C,fi as D,ea as E,ri as F,Gr as G,$r as H,ei as I,zr as J,Yr as K,Fr as L,hi as M,mi as N,pi as O,ci as P,Rr as Q,Lr as R,Wi as S,ua as T,Kr as U,Wr as V,qr as W,Xr as X,Ur as Y,Zr as Z,qi as _,At as _t,Sa as a,$n as at,ta as b,Oa as c,Yn as ct,Ma as d,er as dt,dr as et,Ji as f,Bn as ft,sa as g,In as gt,Qi as h,Ln as ht,Na as i,Jn as it,_i as j,gi as k,ba as l,ar as lt,Zi as m,zn as mt,Ba as n,pr as nt,Ea as o,Un as ot,Gi as p,Rn as pt,Br as q,$ as r,fr as rt,Aa as s,Zn as st,Ns as t,Z as tt,ja as u,mr as ut,pa as v,kt as vt,na as w,$i as x,la as y,ti as z};
Save File
Cancel