const{app:app,BrowserWindow:BrowserWindow}=require("electron"),path=require("path"),url=require("url");let win;function createWindow(){(win=new BrowserWindow({width:800,height:600})).loadURL(url.format({pathname:path.join(__dirname,"www/index.html"),protocol:"file:",slashes:!0})),win.webContents.openDevTools(),win.on("closed",()=>{win=null})}app.on("ready",createWindow),app.on("window-all-closed",()=>{"darwin"!==process.platform&&app.quit()}),app.on("activate",()=>{null===win&&createWindow()});