"use strict";var d=Object.create;var h=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var f=Object.getOwnPropertyNames;var m=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var g=(t,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of f(n))!P.call(t,o)&&o!==e&&h(t,o,{get:()=>n[o],enumerable:!(s=l(n,o))||s.enumerable});return t};var w=(t,n,e)=>(e=t!=null?d(m(t)):{},g(n||!t||!t.__esModule?h(e,"default",{value:t,enumerable:!0}):e,t));var p=w(require("http")),i=class{constructor(n){this.handlerName=n;let e=process.env.VSCODE_GIT_IPC_HANDLE;if(!e)throw new Error("Missing VSCODE_GIT_IPC_HANDLE");this.ipcHandlePath=e}handlerName;ipcHandlePath;call(n){let e={socketPath:this.ipcHandlePath,path:`/${this.handlerName}`,method:"POST"};return new Promise((s,o)=>{let a=p.request(e,r=>{if(r.statusCode!==200)return o(new Error(`Bad status code: ${r.statusCode}`));let c=[];r.on("data",u=>c.push(u)),r.on("end",()=>s(JSON.parse(Buffer.concat(c).toString("utf8"))))});a.on("error",r=>o(r)),a.write(JSON.stringify(n)),a.end()})}};function C(t){console.error(t),process.exit(1)}function E(t){let n=new i("git-editor"),e=t[t.length-1];n.call({commitMessagePath:e}).then(()=>{setTimeout(()=>process.exit(0),0)}).catch(s=>C(s))}E(process.argv);
//# sourceMappingURL=git-editor-main.js.map
