import{MenuController}from"../menu.mjs";import{promptFiles,isEmpty}from"../../base/helpers.mjs";class OpenFileController extends MenuController{static menuName="Open";static menuIcon="fa-solid fa-file-arrow-up";async onClick(){let e;try{e=await promptFiles("*/json")}catch(e){}if(!isEmpty(e)){let t=new FileReader;t.onload=e=>{try{let t=JSON.parse(e.target.result);this.application.setState(t)}catch(e){this.notify("error","Couldn't Load",`${e}`)}},t.readAsText(e)}}}export{OpenFileController as MenuController};
