import{execFile as e}from"node:child_process";const t=new Set([`http:`,`https:`]),n=/[\u0000-\u0020\u007F-\u009F"'`\\&|<>^()$;{}[\]*?!~]/;function r(e,t){console.warn(`Could not auto-open browser (${t}); visit ${e} manually`)}function i(i){let a;try{a=new URL(i)}catch{r(i,`invalid URL`);return}if(!t.has(a.protocol)){r(i,`unsupported scheme '${a.protocol}'`);return}if(n.test(i)){r(i,`URL contains unsafe characters`);return}e(process.platform===`darwin`?`open`:process.platform===`win32`?`cmd`:`xdg-open`,process.platform===`win32`?[`/c`,`start`,``,i]:[i],e=>{e&&console.warn(`Could not auto-open browser (${e.message}); visit ${i} manually`)})}export{i as openBrowser};
//# sourceMappingURL=open-browser-DHTbHSqx.mjs.map