import{MenuController}from"../menu.mjs";import{truncate,promptFiles,isEmpty}from"../../base/helpers.mjs";class LoadImageController extends MenuController{static menuName="Load Image";static menuIcon="fa-regular fa-image";async onClick(){let e;try{e=await promptFiles("image/*")}catch(e){}if(!isEmpty(e)){let a=new FileReader;a.onload=a=>this.images.addImageNode(a.target.result,truncate(e.name,16)),a.readAsDataURL(e)}}}export{LoadImageController as ToolbarController};
