Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); const async = require('../async.js'); const instrumentFetch = require('./worker/instrumentFetch.js'); const instrumentQueue = require('./worker/instrumentQueue.js'); const instrumentScheduled = require('./worker/instrumentScheduled.js'); const instrumentTail = require('./worker/instrumentTail.js'); const options = require('../options.js'); const instrumentContext = require('../utils/instrumentContext.js'); const instrumentEnv = require('./worker/instrumentEnv.js'); function instrumentWorkerEntrypoint(optionsCallback, WorkerEntrypointClass) { async.setAsyncLocalStorageAsyncContextStrategy(); return new Proxy(WorkerEntrypointClass, { construct(target, [ctx, env]) { const context = instrumentContext.instrumentContext(ctx); const options$1 = options.getFinalOptions(optionsCallback(env), env); const instrumentedEnv = instrumentEnv.instrumentEnv(env, options$1); const obj = new target(context, instrumentedEnv); if ("ctx" in obj) { Object.defineProperty(obj, "ctx", { value: context, writable: true, enumerable: true, configurable: true }); } if ("env" in obj) { Object.defineProperty(obj, "env", { value: instrumentedEnv, writable: true, enumerable: true, configurable: true }); } Object.defineProperty(obj, "__SENTRY_CONTEXT__", { value: context, enumerable: false, writable: false, configurable: false }); Object.defineProperty(obj, "__SENTRY_OPTIONS__", { value: options$1, enumerable: false, writable: false, configurable: false }); instrumentFetch.instrumentWorkerEntrypointFetch(obj, options$1, context); instrumentScheduled.instrumentWorkerEntrypointScheduled(obj, options$1, context); instrumentQueue.instrumentWorkerEntrypointQueue(obj, options$1, context); instrumentTail.instrumentWorkerEntrypointTail(obj, options$1, context); return obj; } }); } exports.instrumentWorkerEntrypoint = instrumentWorkerEntrypoint; //# sourceMappingURL=instrumentWorkerEntrypoint.js.map