"use strict";(function(){const{ipcRenderer:o,webFrame:n,contextBridge:u,webUtils:a}=require("electron");function t(e){if(!e?.startsWith("vscode:"))throw new Error(`Unsupported event IPC channel '${e}'`);return!0}function v(e){for(const r of process.argv)if(r.indexOf(`--${e}=`)===0)return r.split("=")[1]}let s;const i=(async()=>{const e=v("vscode-window-config");if(!e)throw new Error("Preload: did not find expected vscode-window-config in renderer process arguments list.");try{t(e);const r=s=await o.invoke(e);return Object.assign(process.env,r.userEnv),n.setZoomLevel(r.zoomLevel??0),r}catch(r){throw new Error(`Preload: unable to fetch vscode-window-config: ${r}`)}})(),f=(async()=>{const[e,r]=await Promise.all([(async()=>(await i).userEnv)(),o.invoke("vscode:fetchShellEnv")]);return{...process.env,...r,...e}})(),d={ipcRenderer:{send(e,...r){t(e)&&o.send(e,...r)},invoke(e,...r){return t(e),o.invoke(e,...r)},on(e,r){return t(e),o.on(e,r),this},once(e,r){return t(e),o.once(e,r),this},removeListener(e,r){return t(e),o.removeListener(e,r),this}},ipcMessagePort:{acquire(e,r){if(t(e)){const c=(p,l)=>{r===l&&(o.off(e,c),window.postMessage(r,"*",p.ports))};o.on(e,c)}}},webFrame:{setZoomLevel(e){typeof e=="number"&&n.setZoomLevel(e)}},webUtils:{getPathForFile(e){return a.getPathForFile(e)}},process:{get platform(){return process.platform},get arch(){return process.arch},get env(){return{...process.env}},get versions(){return process.versions},get type(){return"renderer"},get execPath(){return process.execPath},cwd(){return process.env.VSCODE_CWD||process.execPath.substr(0,process.execPath.lastIndexOf(process.platform==="win32"?"\\":"/"))},shellEnv(){return f},getProcessMemoryInfo(){return process.getProcessMemoryInfo()},on(e,r){process.on(e,r)}},context:{configuration(){return s},async resolveConfiguration(){return i}}};try{u.exposeInMainWorld("vscode",d)}catch(e){console.error(e)}})();

//# sourceMappingURL=https://main.vscode-cdn.net/sourcemaps/c9d77990917f3102ada88be140d28b038d1dd7c7/core/vs/base/parts/sandbox/electron-browser/preload.js.map
