"use strict";var m=Object.defineProperty;var t=(e,n)=>m(e,"name",{value:n,configurable:!0});var h=require("node:net"),p=require("node:path"),a=require("node:os");const{geteuid:f}=process,P=f?f():a.userInfo().username,u=p.join(a.tmpdir(),`tsx-${P}`),v=process.platform==="win32",B=t(e=>{const n=p.join(u,`${e}.pipe`);return v?`\\\\?\\pipe\\${n}`:n},"getPipePath");let r=[];const l=t(()=>new Promise(e=>{const n=B(process.ppid),o=h.createConnection(n,()=>{e(t(g=>{const c=Buffer.from(JSON.stringify(g)),i=Buffer.alloc(4);i.writeInt32BE(c.length,0),o.write(Buffer.concat([i,c]))},"sendToParent"))});o.on("error",()=>{e()}),o.unref()}),"connectToServer"),s={send:t(e=>{r.push(e)},"send")},d=l();d.then(e=>{if(e)for(const n of r)e(n);r=[],s.send=e},()=>{r=[],s.send=void 0}),exports.connectingToServer=d,exports.parent=s,exports.tmpdir=u;