| "use strict"; |
| Object.defineProperty(exports, "__esModule", { |
| value: true |
| }); |
| 0 && (module.exports = { |
| edgeInstrumentationOnRequestError: null, |
| ensureInstrumentationRegistered: null, |
| getEdgeInstrumentationModule: null |
| }); |
| function _export(target, all) { |
| for(var name in all)Object.defineProperty(target, name, { |
| enumerable: true, |
| get: all[name] |
| }); |
| } |
| _export(exports, { |
| edgeInstrumentationOnRequestError: function() { |
| return edgeInstrumentationOnRequestError; |
| }, |
| ensureInstrumentationRegistered: function() { |
| return ensureInstrumentationRegistered; |
| }, |
| getEdgeInstrumentationModule: function() { |
| return getEdgeInstrumentationModule; |
| } |
| }); |
| async function getEdgeInstrumentationModule() { |
| const instrumentation = '_ENTRIES' in globalThis && _ENTRIES.middleware_instrumentation && await _ENTRIES.middleware_instrumentation; |
| return instrumentation; |
| } |
| let instrumentationModulePromise = null; |
| async function registerInstrumentation() { |
| |
| if (process.env.NEXT_PHASE === 'phase-production-build') return; |
| if (!instrumentationModulePromise) { |
| instrumentationModulePromise = getEdgeInstrumentationModule(); |
| } |
| const instrumentation = await instrumentationModulePromise; |
| if (instrumentation == null ? void 0 : instrumentation.register) { |
| try { |
| await instrumentation.register(); |
| } catch (err) { |
| err.message = `An error occurred while loading instrumentation hook: ${err.message}`; |
| throw err; |
| } |
| } |
| } |
| async function edgeInstrumentationOnRequestError(...args) { |
| const instrumentation = await getEdgeInstrumentationModule(); |
| try { |
| var _instrumentation_onRequestError; |
| await (instrumentation == null ? void 0 : (_instrumentation_onRequestError = instrumentation.onRequestError) == null ? void 0 : _instrumentation_onRequestError.call(instrumentation, ...args)); |
| } catch (err) { |
| |
| console.error('Error in instrumentation.onRequestError:', err); |
| } |
| } |
| let registerInstrumentationPromise = null; |
| function ensureInstrumentationRegistered() { |
| if (!registerInstrumentationPromise) { |
| registerInstrumentationPromise = registerInstrumentation(); |
| } |
| return registerInstrumentationPromise; |
| } |
| function getUnsupportedModuleErrorMessage(module1) { |
| |
| return `The edge runtime does not support Node.js '${module1}' module. |
| Learn More: https://nextjs.org/docs/messages/node-module-in-edge-runtime`; |
| } |
| function __import_unsupported(moduleName) { |
| const proxy = new Proxy(function() {}, { |
| get (_obj, prop) { |
| if (prop === 'then') { |
| return {}; |
| } |
| throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", { |
| value: "E394", |
| enumerable: false, |
| configurable: true |
| }); |
| }, |
| construct () { |
| throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", { |
| value: "E394", |
| enumerable: false, |
| configurable: true |
| }); |
| }, |
| apply (_target, _this, args) { |
| if (typeof args[0] === 'function') { |
| return args[0](proxy); |
| } |
| throw Object.defineProperty(new Error(getUnsupportedModuleErrorMessage(moduleName)), "__NEXT_ERROR_CODE", { |
| value: "E394", |
| enumerable: false, |
| configurable: true |
| }); |
| } |
| }); |
| return new Proxy({}, { |
| get: ()=>proxy |
| }); |
| } |
| function enhanceGlobals() { |
| if (process.env.NEXT_RUNTIME !== 'edge') { |
| return; |
| } |
| |
| if (process !== global.process) { |
| |
| process.env = global.process.env; |
| global.process = process; |
| } |
| |
| |
| try { |
| Object.defineProperty(globalThis, '__import_unsupported', { |
| value: __import_unsupported, |
| enumerable: false, |
| configurable: false |
| }); |
| } catch {} |
| |
| void ensureInstrumentationRegistered(); |
| } |
| enhanceGlobals(); |
|
|
| |