import{parentPort as n}from"node:worker_threads";import{W as f}from"./AsyncSqlite-8sGv3lfc.mjs";import{u as m,p as s,a,t as g,s as u,b as h,R as w,n as b}from"./worker-data-F9FnDIF_.mjs";import{parentPort as p}from"worker_threads";import{s as y}from"./setup-jOmJhQLK.mjs";import{l as E}from"./logger-D_9t6p_W.mjs";import{i as S}from"./util-4MLVQf5_.mjs";import{l as k}from"./sentry-buffer-BNqrS-8_.mjs";import"os";import"./sentry-common-ai21LIAw.mjs";import"./_commonjsHelpers-CLLqo0NO.mjs";import"./index-7t_wvw7g.mjs";import"./constants-DED7MIJj.mjs";import"path";import"url";import"fs";import"./package-uaSG8XjZ.mjs";import"./machine-id-D3_purtu.mjs";import"perf_hooks";import"child_process";import"./index-Cl8VihPn.mjs";import"timers/promises";import"async_hooks";import"./dev-fp014L8f.mjs";import"node:module";import"node:path";import"node:url";import"./register-proxy-C4V2Z2tW.mjs";import"./index-66F80Yco.mjs";import"domain";import"http";import"https";import"./index-HJDsW6S6.mjs";import"net";import"tls";import"./inject-globals-v3dPEknE.mjs";import"./got-BLig4ziO.mjs";import"events";import"util";import"stream";import"dns";import"buffer";import"zlib";import"http2";import"./got-fetch-D7dM7Qr-.mjs";import"./system-stats-DIGFNPck.mjs";import"module";import"crypto";import"vm";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};r.SENTRY_RELEASE={id:"4.2.860"}}catch{}})();try{(function(){var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new r.Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="87833c86-7490-4709-ba98-178823133685",r._sentryDebugIdIdentifier="sentry-dbid-87833c86-7490-4709-ba98-178823133685")})()}catch{}let R=0;function P(r,o){const t=R++;return new Promise((l,c)=>{p.once("message",i=>{i?.reqID===t&&("error"in i?c(new Error(i.error.message)):l(i.result))}),p.postMessage({reqID:t,methodName:r,args:o})})}const e=new Proxy({},{get:(r,o)=>(...t)=>P(o,t)});function d(r){if(!S(r))return;const o=r instanceof Error?r:new Error(String(r));e.handleError({errorMessage:o.message,errorStack:o.stack||""})}process.on("uncaughtException",d);process.on("unhandledRejection",d);await y(f.PLATFORM_WORKER,{injectGlobals:{userDataDirPath:m,overriddenGlobalMethods:{openBrowserWindow:e.openBrowserWindow}},registerSystemStatsReporting:!0});globalThis.reportStartupCheckpoint=(r,o=Date.now())=>{Promise.resolve(e.startupCheckpoint({name:r,at:o})).catch(t=>{logger.warn("[StartupCheckpoint] Failed to report checkpoint to main thread",r,t)})};import("./index-CWMjvWgF.mjs").then(r=>r.ax).then(async({default:r})=>{if(E(`Running PAS on ${s}:${a}`),await r({hostname:s,port:a,transportNonce:g,serverEnv:u,userDataDirPath:m,userAgent:h,proxyFileURLs:w,mainThread:e,onExit(o){n.on("message",async t=>{t==="cleanup"&&(await o(),n?.postMessage({cleanup:!0}))})}}),n?.postMessage("PASInitComplete"),!b){const o=globalThis.pas.beeperClient.sdkStarted.promise;k({awaitBeforeImport:o})}}).catch(r=>{e.handleError({errorMessage:r.message,errorStack:r.stack})});
//# sourceMappingURL=platform-worker-B8i2PgyQ.mjs.map
