varace,OS;!function(t){lete;!function(e){classiextendse.BaseApplication{constructor(t){super("CodePad",t),this.currdir=void0,this.sdk=void0}main(){this.extensions={},this.eum=news,this.fileview=this.find("fileview"),this.sidebar=this.find("sidebar"),this.bottombar=this.find("bottombar"),this.langstat=this.find("langstat"),this.editorstat=this.find("editorstat"),this.filestat=this.find("current-file-lbl"),this.logger=newa(this.find("output-tab")),this.split_mode=!0,this.eum.add(newe.ACEModel(this,this.find("left-tabbar"),this.find("left-editorarea"))).add(newe.ACEModel(this,this.find("right-tabbar"),this.find("right-editorarea"))),this.eum.onstatuschange=t=>this.updateStatus(t),this.fileview.fetch=t=>newPromise((asyncfunction(e,i){lets;s="string"==typeoft?t.asFileHandle():t;try{constt=awaits.read();returnt.error?i(t.error):e(t.result)}catch(t){returni(__e(t))}}));lett="Untitled".asFileHandle();returnthis.args&&this.args.length>0&&(this.addRecent(this.args[0].path),"dir"===this.args[0].type?this.currdir=this.args[0].path.asFileHandle():(t=this.args[0].path.asFileHandle(),this.currdir=t.parent())),this.setup(),this.eum.active.openFile(t)}setup(){this.setting.recent||(this.setting.recent=[]),this.fileview.onfileopen=t=>{if(t.data&&t.data.path&&"dir"!==t.data.type)returnthis.addRecent(t.data.path),this.eum.active.openFile(t.data.path.asFileHandle())},this.fileview.onfileselect=t=>{t.data&&t.data.path&&"dir"!==t.data.type&&this.eum.active.selectFile(t.data.path)},this.on("resize",()=>this.eum.resize()),this.on("focus",()=>this.eum.active.focus()),this.eum.contextmenuHandle=(t,e)=>(e.items=[{text:__("Change theme"),onmenuselect:asynct=>{try{constt=this.eum.active.getThemes(),e=awaitthis.openDialog("SelectionDialog",{title:__("Select theme"),data:t});this.eum.active.setTheme(e.theme)}catch(t){this.error(__("Unable to set theme"),t)}}},{text:__("Change language mode"),onmenuselect:asynct=>{try{constt=this.eum.active.getModes().map(t=>({text:t.text,mode:t.mode})),e=awaitthis.openDialog("SelectionDialog",{title:__("Select language"),data:t});this.eum.active.setMode(e)}catch(t){this.error(__("Unable to set language mode"),t)}}},{text:__("Build with AntOSDK"),shortcut:" (CTRL-ALT-B)",onmenuselect:asynct=>{try{this.build()}catch(t){this.error(__("Unable to build with AntOSDK: {0}",t.toString()),t)}}}],e.show(t)),this.fileview.contextmenuHandle=(t,e)=>(e.items=[{text:"__(New file)",id:"new"},{text:"__(New folder)",id:"newdir"},{text:"__(Rename)",id:"rename"},{text:"__(Delete)",id:"delete"}],e.onmenuselect=t=>this.ctxFileMenuHandle(t),e.show(t)),this.bindKey("ALT-N",()=>this.menuAction("new")),this.bindKey("ALT-O",()=>this.menuAction("open")),this.bindKey("ALT-F",()=>this.menuAction("opendir")),this.bindKey("CTRL-S",()=>this.menuAction("save")),this.bindKey("ALT-W",()=>this.menuAction("saveas")),this.bindKey("CTRL-ALT-B",()=>this.build()),this.fileview.ondragndrop=t=>{conste=t.data.from.data.path.asFileHandle(),i=t.data.to.data.path;returne.move(`${i}/${e.basename}`).then((function(s){consta=i,o=e.parent().path;a.length<o.length?(t.data.to.update(a),t.data.from.parent.update(o)):(t.data.from.parent.update(o),t.data.to.update(a))})).catch(t=>this.error(__("Unable to move file/folder"),t))},this.on("filechange",t=>{let{path:e}=t.file;return"file"===t.type&&({path:e}=t.file.parent()),this.fileview.update(e)}),this.find("logger-clear").onbtclick=()=>{this.logger.clear()},void0===this.setting.showBottomBar&&(this.setting.showBottomBar=!1),this.toggleSideBar(),this.toggleSplitMode(),this.applyAllSetting()}build(){this.currdir&&t.API.requires("pkg://libantosdk/main.js").then(async()=>{try{if(!t.API.AntOSDKBuilder)return;this.sdk||(this.sdk=newt.API.AntOSDKBuilder(this.logger,"")),this.logger.clear(),this.showBottomBar(!0);conste=(this.currdir.path+"/build.json").asFileHandle(),i=awaite.read("json");i.root=this.currdir.path;consts=Object.keys(i.targets).map(t=>({text:t})),a=awaitthis.openDialog("SelectionDialog",{title:__("Select a build target"),data:s});awaitthis.load(this.sdk.batch([a.text],i))}catch(t