(()=>{"use strict";var e={658:function(e,r,n){var o=this&&this.__awaiter||function(e,r,n,o){return new(n||(n=Promise))((function(t,i){function s(e){try{u(o.next(e))}catch(e){i(e)}}function c(e){try{u(o.throw(e))}catch(e){i(e)}}function u(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(e){e(r)}))).then(s,c)}u((o=o.apply(e,r||[])).next())}))};Object.defineProperty(r,"__esModule",{value:!0}),r.runServer=void 0;const t=n(81),i=n(147),s=n(37),c=n(17),u=e=>{const r="node_modules/@omega-edit/server",n=[c.join(e,r,"bin"),c.join(e,r,"out","bin")];for(let e=0;e<n.length;e++)if(i.existsSync(n[e]))return c.resolve(n[e]);return d(c.join(e,".."))},d=e=>e.endsWith("node_modules")?u(e.replace("node_modules","")):i.readdirSync(e).includes("node_modules")?u(e):d(c.join(e,".."));r.runServer=function(e,r="127.0.0.1",n,u){return o(this,void 0,void 0,(function*(){const a=[`--interface=${r}`,`--port=${e}`];return n&&a.push(`--pidfile=${n}`),u&&i.existsSync(u)&&a.push(`-Dlogback.configurationFile=${u}`),yield function(e){return o(this,void 0,void 0,(function*(){const r=c.join(d(c.resolve(__dirname)),"win32"===s.platform()?"omega-edit-grpc-server.bat":"omega-edit-grpc-server");i.chmodSync(r,"755");const n=(0,t.spawn)(r,e,{cwd:c.dirname(r),stdio:"ignore",detached:!0});return n.on("error",(e=>{if(!e.message.includes("Call cancelled"))throw e})),n}))}(a)}))}},81:e=>{e.exports=require("child_process")},147:e=>{e.exports=require("fs")},37:e=>{e.exports=require("os")},17:e=>{e.exports=require("path")}},r={},n=function n(o){var t=r[o];if(void 0!==t)return t.exports;var i=r[o]={exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}(658);module.exports=n})();
//# sourceMappingURL=index.js.map