@echoteam/signoz-react 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { performance as performance$1 } from 'perf_hooks';
2
- import * as path$7 from 'path';
2
+ import * as path$4 from 'path';
3
3
  import path__default from 'path';
4
4
  import require$$1$3, { types } from 'util';
5
5
  import require$$1$4 from 'module';
6
6
  import require$$1$2 from 'tty';
7
7
  import os$2 from 'os';
8
8
  import require$$0, { readFileSync } from 'fs';
9
- import * as require$$2 from 'url';
10
- import require$$2__default from 'url';
9
+ import * as url$2 from 'url';
10
+ import url__default from 'url';
11
11
  import require$$3 from 'worker_threads';
12
12
  import * as http$2 from 'http';
13
13
  import * as https$2 from 'https';
@@ -3068,7 +3068,7 @@ function getEnvWithoutDefaults() {
3068
3068
  * See the License for the specific language governing permissions and
3069
3069
  * limitations under the License.
3070
3070
  */
3071
- var otperformance$3 = performance$1;
3071
+ var otperformance$4 = performance$1;
3072
3072
 
3073
3073
  /*
3074
3074
  * Copyright The OpenTelemetry Authors
@@ -3141,10 +3141,10 @@ function unrefTimer(timer) {
3141
3141
  * See the License for the specific language governing permissions and
3142
3142
  * limitations under the License.
3143
3143
  */
3144
- var NANOSECOND_DIGITS$3 = 9;
3144
+ var NANOSECOND_DIGITS$4 = 9;
3145
3145
  var NANOSECOND_DIGITS_IN_MILLIS$3 = 6;
3146
3146
  var MILLISECONDS_TO_NANOSECONDS$3 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$3);
3147
- var SECOND_TO_NANOSECONDS$3 = Math.pow(10, NANOSECOND_DIGITS$3);
3147
+ var SECOND_TO_NANOSECONDS$4 = Math.pow(10, NANOSECOND_DIGITS$4);
3148
3148
  /**
3149
3149
  * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
3150
3150
  * @param epochMillis
@@ -3158,9 +3158,9 @@ function millisToHrTime$3(epochMillis) {
3158
3158
  return [seconds, nanos];
3159
3159
  }
3160
3160
  function getTimeOrigin$3() {
3161
- var timeOrigin = otperformance$3.timeOrigin;
3161
+ var timeOrigin = otperformance$4.timeOrigin;
3162
3162
  if (typeof timeOrigin !== 'number') {
3163
- var perf = otperformance$3;
3163
+ var perf = otperformance$4;
3164
3164
  timeOrigin = perf.timing && perf.timing.fetchStart;
3165
3165
  }
3166
3166
  return timeOrigin;
@@ -3171,7 +3171,7 @@ function getTimeOrigin$3() {
3171
3171
  */
3172
3172
  function hrTime$3(performanceNow) {
3173
3173
  var timeOrigin = millisToHrTime$3(getTimeOrigin$3());
3174
- var now = millisToHrTime$3(typeof performanceNow === 'number' ? performanceNow : otperformance$3.now());
3174
+ var now = millisToHrTime$3(typeof performanceNow === 'number' ? performanceNow : otperformance$4.now());
3175
3175
  return addHrTimes$3(timeOrigin, now);
3176
3176
  }
3177
3177
  /**
@@ -3186,7 +3186,7 @@ function hrTimeDuration(startTime, endTime) {
3186
3186
  if (nanos < 0) {
3187
3187
  seconds -= 1;
3188
3188
  // negate
3189
- nanos += SECOND_TO_NANOSECONDS$3;
3189
+ nanos += SECOND_TO_NANOSECONDS$4;
3190
3190
  }
3191
3191
  return [seconds, nanos];
3192
3192
  }
@@ -3215,8 +3215,8 @@ function isTimeInput(value) {
3215
3215
  function addHrTimes$3(time1, time2) {
3216
3216
  var out = [time1[0] + time2[0], time1[1] + time2[1]];
3217
3217
  // Nanoseconds
3218
- if (out[1] >= SECOND_TO_NANOSECONDS$3) {
3219
- out[1] -= SECOND_TO_NANOSECONDS$3;
3218
+ if (out[1] >= SECOND_TO_NANOSECONDS$4) {
3219
+ out[1] -= SECOND_TO_NANOSECONDS$4;
3220
3220
  out[0] += 1;
3221
3221
  }
3222
3222
  return out;
@@ -4141,7 +4141,7 @@ var Span = /** @class */ (function () {
4141
4141
  this.kind = kind;
4142
4142
  this.links = links;
4143
4143
  var now = Date.now();
4144
- this._performanceStartTime = otperformance$3.now();
4144
+ this._performanceStartTime = otperformance$4.now();
4145
4145
  this._performanceOffset =
4146
4146
  now - (this._performanceStartTime + getTimeOrigin$3());
4147
4147
  this._startTimeProvided = startTime != null;
@@ -4282,7 +4282,7 @@ var Span = /** @class */ (function () {
4282
4282
  this._spanProcessor.onEnd(this);
4283
4283
  };
4284
4284
  Span.prototype._getTime = function (inp) {
4285
- if (typeof inp === 'number' && inp <= otperformance$3.now()) {
4285
+ if (typeof inp === 'number' && inp <= otperformance$4.now()) {
4286
4286
  // must be a performance timestamp
4287
4287
  // apply correction and convert to hrtime
4288
4288
  return hrTime$3(inp + this._performanceOffset);
@@ -4301,7 +4301,7 @@ var Span = /** @class */ (function () {
4301
4301
  // we can't use duration to calculate event/end times
4302
4302
  return millisToHrTime$3(Date.now());
4303
4303
  }
4304
- var msDuration = otperformance$3.now() - this._performanceStartTime;
4304
+ var msDuration = otperformance$4.now() - this._performanceStartTime;
4305
4305
  return addHrTimes$3(this.startTime, millisToHrTime$3(msDuration));
4306
4306
  };
4307
4307
  Span.prototype.isRecording = function () {
@@ -5862,20 +5862,20 @@ var PerformanceTimingNames$2;
5862
5862
  * See the License for the specific language governing permissions and
5863
5863
  * limitations under the License.
5864
5864
  */
5865
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH$2 = 'http.response_content_length';
5866
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$2 = 'http.response_content_length_uncompressed';
5865
+ var TMP_HTTP_RESPONSE_CONTENT_LENGTH$1 = 'http.response_content_length';
5866
+ var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = 'http.response_content_length_uncompressed';
5867
5867
  /**
5868
5868
  * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
5869
5869
  *
5870
5870
  * @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
5871
5871
  */
5872
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$2 = TMP_HTTP_RESPONSE_CONTENT_LENGTH$2;
5872
+ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH$1;
5873
5873
  /**
5874
5874
  * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
5875
5875
  *
5876
5876
  * @deprecated Use ATTR_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
5877
5877
  */
5878
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$2 = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$2;
5878
+ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1;
5879
5879
 
5880
5880
  /*
5881
5881
  * Copyright The OpenTelemetry Authors
@@ -5951,12 +5951,12 @@ function addSpanNetworkEvents$2(span, resource, ignoreNetworkEvents) {
5951
5951
  }
5952
5952
  var encodedLength = resource[PerformanceTimingNames$2.ENCODED_BODY_SIZE];
5953
5953
  if (encodedLength !== undefined) {
5954
- span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$2, encodedLength);
5954
+ span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1, encodedLength);
5955
5955
  }
5956
5956
  var decodedLength = resource[PerformanceTimingNames$2.DECODED_BODY_SIZE];
5957
5957
  // Spec: Not set if transport encoding not used (in which case encoded and decoded sizes match)
5958
5958
  if (decodedLength !== undefined && encodedLength !== decodedLength) {
5959
- span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$2, decodedLength);
5959
+ span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1, decodedLength);
5960
5960
  }
5961
5961
  }
5962
5962
  /**
@@ -6467,74 +6467,14 @@ function hexToBinary(hexStr) {
6467
6467
  * See the License for the specific language governing permissions and
6468
6468
  * limitations under the License.
6469
6469
  */
6470
- var otperformance$2 = performance$1;
6471
-
6472
- /*
6473
- * Copyright The OpenTelemetry Authors
6474
- *
6475
- * Licensed under the Apache License, Version 2.0 (the "License");
6476
- * you may not use this file except in compliance with the License.
6477
- * You may obtain a copy of the License at
6478
- *
6479
- * https://www.apache.org/licenses/LICENSE-2.0
6480
- *
6481
- * Unless required by applicable law or agreed to in writing, software
6482
- * distributed under the License is distributed on an "AS IS" BASIS,
6483
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6484
- * See the License for the specific language governing permissions and
6485
- * limitations under the License.
6486
- */
6487
- var NANOSECOND_DIGITS$2 = 9;
6488
- var NANOSECOND_DIGITS_IN_MILLIS$2 = 6;
6489
- var MILLISECONDS_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$2);
6490
- var SECOND_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS$2);
6491
- /**
6492
- * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
6493
- * @param epochMillis
6494
- */
6495
- function millisToHrTime$2(epochMillis) {
6496
- var epochSeconds = epochMillis / 1000;
6497
- // Decimals only.
6498
- var seconds = Math.trunc(epochSeconds);
6499
- // Round sub-nanosecond accuracy to nanosecond.
6500
- var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$2);
6501
- return [seconds, nanos];
6502
- }
6503
- function getTimeOrigin$2() {
6504
- var timeOrigin = otperformance$2.timeOrigin;
6505
- if (typeof timeOrigin !== 'number') {
6506
- var perf = otperformance$2;
6507
- timeOrigin = perf.timing && perf.timing.fetchStart;
6508
- }
6509
- return timeOrigin;
6510
- }
6511
- /**
6512
- * Returns an hrtime calculated via performance component.
6513
- * @param performanceNow
6514
- */
6515
- function hrTime$2(performanceNow) {
6516
- var timeOrigin = millisToHrTime$2(getTimeOrigin$2());
6517
- var now = millisToHrTime$2(otperformance$2.now());
6518
- return addHrTimes$2(timeOrigin, now);
6519
- }
6470
+ var NANOSECOND_DIGITS$3 = 9;
6471
+ var SECOND_TO_NANOSECONDS$3 = Math.pow(10, NANOSECOND_DIGITS$3);
6520
6472
  /**
6521
6473
  * Convert hrTime to nanoseconds.
6522
6474
  * @param time
6523
6475
  */
6524
6476
  function hrTimeToNanoseconds$2(time) {
6525
- return time[0] * SECOND_TO_NANOSECONDS$2 + time[1];
6526
- }
6527
- /**
6528
- * Given 2 HrTime formatted times, return their sum as an HrTime.
6529
- */
6530
- function addHrTimes$2(time1, time2) {
6531
- var out = [time1[0] + time2[0], time1[1] + time2[1]];
6532
- // Nanoseconds
6533
- if (out[1] >= SECOND_TO_NANOSECONDS$2) {
6534
- out[1] -= SECOND_TO_NANOSECONDS$2;
6535
- out[0] += 1;
6536
- }
6537
- return out;
6477
+ return time[0] * SECOND_TO_NANOSECONDS$3 + time[1];
6538
6478
  }
6539
6479
 
6540
6480
  /*
@@ -6558,23 +6498,6 @@ var ExportResultCode;
6558
6498
  ExportResultCode[ExportResultCode["FAILED"] = 1] = "FAILED";
6559
6499
  })(ExportResultCode || (ExportResultCode = {}));
6560
6500
 
6561
- /*
6562
- * Copyright The OpenTelemetry Authors
6563
- *
6564
- * Licensed under the Apache License, Version 2.0 (the "License");
6565
- * you may not use this file except in compliance with the License.
6566
- * You may obtain a copy of the License at
6567
- *
6568
- * https://www.apache.org/licenses/LICENSE-2.0
6569
- *
6570
- * Unless required by applicable law or agreed to in writing, software
6571
- * distributed under the License is distributed on an "AS IS" BASIS,
6572
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
6573
- * See the License for the specific language governing permissions and
6574
- * limitations under the License.
6575
- */
6576
- var TRACE_PARENT_HEADER = 'traceparent';
6577
-
6578
6501
  /*
6579
6502
  * Copyright The OpenTelemetry Authors
6580
6503
  *
@@ -7012,7 +6935,7 @@ var __assign$5 = (undefined && undefined.__assign) || function () {
7012
6935
  */
7013
6936
  function sendWithHttp(collector, data, contentType, onSuccess, onError) {
7014
6937
  var exporterTimeout = collector.timeoutMillis;
7015
- var parsedUrl = new require$$2.URL(collector.url);
6938
+ var parsedUrl = new url$2.URL(collector.url);
7016
6939
  var nodeVersion = Number(process.versions.node.split('.')[0]);
7017
6940
  var retryTimer;
7018
6941
  var req;
@@ -7138,7 +7061,7 @@ function createHttpAgent(config) {
7138
7061
  if (config.keepAlive === false || !config.url)
7139
7062
  return undefined;
7140
7063
  try {
7141
- var parsedUrl = new require$$2.URL(config.url);
7064
+ var parsedUrl = new url$2.URL(config.url);
7142
7065
  var Agent = parsedUrl.protocol === 'http:' ? http$2.Agent : https$2.Agent;
7143
7066
  return new Agent(__assign$5({ keepAlive: true }, config.httpAgentOptions));
7144
7067
  }
@@ -12456,15 +12379,124 @@ var hasRequiredNormalizeOptions;
12456
12379
  function requireNormalizeOptions () {
12457
12380
  if (hasRequiredNormalizeOptions) return normalizeOptions;
12458
12381
  hasRequiredNormalizeOptions = 1;
12459
- normalizeOptions = function (x, opts) {
12460
- /**
12461
- * This file is purposefully a passthrough. It's expected that third-party
12462
- * environments will override it at runtime in order to inject special logic
12463
- * into `resolve` (by manipulating the options). One such example is the PnP
12464
- * code path in Yarn.
12465
- */
12466
-
12467
- return opts || {};
12382
+ // Info: this file has been generated by Yarn with the approval of the
12383
+ // `resolve` maintainers. Bugs caused by a code located here should be
12384
+ // opened against the Yarn repository.
12385
+
12386
+ const path = path__default;
12387
+
12388
+ normalizeOptions = function (_, opts) {
12389
+ opts = opts || {};
12390
+
12391
+ if (opts.forceNodeResolution || !process.versions.pnp)
12392
+ return opts;
12393
+
12394
+ // It would be nice if we could throw, but that would break the transparent
12395
+ // compatibility with packages that use `resolve` today (such as Gulp). Since
12396
+ // it's the whole point of this patch, we don't.
12397
+ //
12398
+ // if (opts.packageIterator || opts.paths)
12399
+ // throw new Error(`The "packageIterator" and "paths" options cannot be used in PnP environments. Set "forceNodeResolution: true" if absolutely needed, or branch on process.versions.pnp otherwise.`);
12400
+
12401
+ const {findPnpApi} = require$$1$4;
12402
+
12403
+ const runPnpResolution = (request, basedir) => {
12404
+ // Extract the name of the package being requested (1=package name, 2=internal path)
12405
+ const parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
12406
+ if (!parts)
12407
+ throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
12408
+
12409
+ // Make sure that basedir ends with a slash
12410
+ if (basedir.charAt(basedir.length - 1) !== `/`)
12411
+ basedir = path.join(basedir, `/`);
12412
+
12413
+ const api = findPnpApi(basedir);
12414
+ if (api === null)
12415
+ return undefined;
12416
+
12417
+ // This is guaranteed to return the path to the "package.json" file from the given package
12418
+ let manifestPath;
12419
+ try {
12420
+ manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, {considerBuiltins: false});
12421
+ } catch (err) {
12422
+ return null;
12423
+ }
12424
+
12425
+ if (manifestPath === null)
12426
+ throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
12427
+
12428
+ // Strip the package.json to get the package folder
12429
+ const packagePath = path.dirname(manifestPath);
12430
+
12431
+ // Attach the internal path to the resolved package directory
12432
+ const unqualifiedPath = typeof parts[2] !== `undefined`
12433
+ ? path.join(packagePath, parts[2])
12434
+ : packagePath;
12435
+
12436
+ return {packagePath, unqualifiedPath};
12437
+ };
12438
+
12439
+ const runPnpResolutionOnArray = (request, paths) => {
12440
+ for (let i = 0; i < paths.length; i++) {
12441
+ const resolution = runPnpResolution(request, paths[i]);
12442
+ if (resolution || i === paths.length - 1) {
12443
+ return resolution;
12444
+ }
12445
+ }
12446
+
12447
+ return null;
12448
+ };
12449
+
12450
+ const originalPaths = Array.isArray(opts.paths) ? opts.paths : [];
12451
+
12452
+ const packageIterator = (request, basedir, getCandidates, opts) => {
12453
+ const pathsToTest = [basedir].concat(originalPaths);
12454
+ const resolution = runPnpResolutionOnArray(request, pathsToTest);
12455
+ if (resolution == null)
12456
+ return getCandidates();
12457
+
12458
+ return [resolution.unqualifiedPath];
12459
+ };
12460
+
12461
+ const paths = (request, basedir, getNodeModulePaths, opts) => {
12462
+ const pathsToTest = [basedir].concat(originalPaths);
12463
+ const resolution = runPnpResolutionOnArray(request, pathsToTest);
12464
+ if (resolution == null)
12465
+ return getNodeModulePaths().concat(originalPaths);
12466
+
12467
+ // Stip the local named folder
12468
+ let nodeModules = path.dirname(resolution.packagePath);
12469
+
12470
+ // Strip the scope named folder if needed
12471
+ if (request.match(/^@[^/]+\//))
12472
+ nodeModules = path.dirname(nodeModules);
12473
+
12474
+ return [nodeModules];
12475
+ };
12476
+
12477
+ // We need to keep track whether we're in `packageIterator` or not so that
12478
+ // the code is compatible with both `resolve` 1.9+ and `resolve` 1.15+
12479
+ let isInsideIterator = false;
12480
+
12481
+ if (!opts.__skipPackageIterator) {
12482
+ opts.packageIterator = function (request, basedir, getCandidates, opts) {
12483
+ isInsideIterator = true;
12484
+ try {
12485
+ return packageIterator(request, basedir, getCandidates, opts);
12486
+ } finally {
12487
+ isInsideIterator = false;
12488
+ }
12489
+ };
12490
+ }
12491
+
12492
+ opts.paths = function (request, basedir, getNodeModulePaths, opts) {
12493
+ if (isInsideIterator)
12494
+ return getNodeModulePaths().concat(originalPaths);
12495
+
12496
+ return paths(request, basedir, getNodeModulePaths);
12497
+ };
12498
+
12499
+ return opts;
12468
12500
  };
12469
12501
  return normalizeOptions;
12470
12502
  }
@@ -12625,7 +12657,7 @@ var _linklist$1 = "< 8";
12625
12657
  var module$1 = true;
12626
12658
  var net$1 = true;
12627
12659
  var os$1 = true;
12628
- var path$6 = true;
12660
+ var path$3 = true;
12629
12661
  var perf_hooks$1 = ">= 8.5";
12630
12662
  var process$2 = ">= 1";
12631
12663
  var punycode$1 = ">= 0.5";
@@ -12825,7 +12857,7 @@ var require$$1$1 = {
12825
12857
  ">= 14.18 && < 15",
12826
12858
  ">= 16"
12827
12859
  ],
12828
- path: path$6,
12860
+ path: path$3,
12829
12861
  "node:path": [
12830
12862
  ">= 14.18 && < 15",
12831
12863
  ">= 16"
@@ -13485,7 +13517,7 @@ var _linklist = "< 8";
13485
13517
  var module = true;
13486
13518
  var net = true;
13487
13519
  var os = true;
13488
- var path$5 = true;
13520
+ var path$2 = true;
13489
13521
  var perf_hooks = ">= 8.5";
13490
13522
  var process$1 = ">= 1";
13491
13523
  var punycode = ">= 0.5";
@@ -13685,7 +13717,7 @@ var require$$1 = {
13685
13717
  ">= 14.18 && < 15",
13686
13718
  ">= 16"
13687
13719
  ],
13688
- path: path$5,
13720
+ path: path$2,
13689
13721
  "node:path": [
13690
13722
  ">= 14.18 && < 15",
13691
13723
  ">= 16"
@@ -14164,7 +14196,7 @@ var bugs = {
14164
14196
  var require$$5 = {
14165
14197
  bugs: bugs};
14166
14198
 
14167
- const path$4 = path__default;
14199
+ const path$1 = path__default;
14168
14200
  const Module = require$$1$4;
14169
14201
  const debug$8 = srcExports('require-in-the-middle');
14170
14202
  const moduleDetailsFromPath = moduleDetailsFromPath$1;
@@ -14172,8 +14204,8 @@ const moduleDetailsFromPath = moduleDetailsFromPath$1;
14172
14204
  // Using the default export is discouraged, but kept for backward compatibility.
14173
14205
  // Use this instead:
14174
14206
  // const { Hook } = require('require-in-the-middle')
14175
- requireInTheMiddle.exports = Hook$4;
14176
- var Hook_1$4 = requireInTheMiddle.exports.Hook = Hook$4;
14207
+ requireInTheMiddle.exports = Hook$1;
14208
+ var Hook_1$1 = requireInTheMiddle.exports.Hook = Hook$1;
14177
14209
 
14178
14210
  let builtinModules; // Set<string>
14179
14211
 
@@ -14304,8 +14336,8 @@ class ExportsCache {
14304
14336
  }
14305
14337
  }
14306
14338
 
14307
- function Hook$4 (modules, options, onrequire) {
14308
- if ((this instanceof Hook$4) === false) return new Hook$4(modules, options, onrequire)
14339
+ function Hook$1 (modules, options, onrequire) {
14340
+ if ((this instanceof Hook$1) === false) return new Hook$1(modules, options, onrequire)
14309
14341
  if (typeof modules === 'function') {
14310
14342
  onrequire = modules;
14311
14343
  modules = null;
@@ -14437,7 +14469,7 @@ function Hook$4 (modules, options, onrequire) {
14437
14469
  moduleName = filename;
14438
14470
  } else if (hasWhitelist === true && modules.includes(filename)) {
14439
14471
  // whitelist includes the absolute path to the file including extension
14440
- const parsedPath = path$4.parse(filename);
14472
+ const parsedPath = path$1.parse(filename);
14441
14473
  moduleName = parsedPath.name;
14442
14474
  basedir = parsedPath.dir;
14443
14475
  } else {
@@ -14495,7 +14527,7 @@ function Hook$4 (modules, options, onrequire) {
14495
14527
  // this is a module-internal file
14496
14528
  if (internals === true) {
14497
14529
  // use the module-relative path to the file, prefixed by original module name
14498
- moduleName = moduleName + path$4.sep + path$4.relative(basedir, filename);
14530
+ moduleName = moduleName + path$1.sep + path$1.relative(basedir, filename);
14499
14531
  debug$8('preparing to process require of internal file: %s', moduleName);
14500
14532
  } else {
14501
14533
  debug$8('ignoring require of non-main module file: %s', res);
@@ -14518,7 +14550,7 @@ function Hook$4 (modules, options, onrequire) {
14518
14550
  }
14519
14551
  }
14520
14552
 
14521
- Hook$4.prototype.unhook = function () {
14553
+ Hook$1.prototype.unhook = function () {
14522
14554
  this._unhooked = true;
14523
14555
 
14524
14556
  if (this._require === Module.prototype.require) {
@@ -14539,10 +14571,44 @@ Hook$4.prototype.unhook = function () {
14539
14571
  };
14540
14572
 
14541
14573
  function resolveModuleName (stat) {
14542
- const normalizedPath = path$4.sep !== '/' ? stat.path.split(path$4.sep).join('/') : stat.path;
14543
- return path$4.posix.join(stat.name, normalizedPath).replace(normalize, '')
14574
+ const normalizedPath = path$1.sep !== '/' ? stat.path.split(path$1.sep).join('/') : stat.path;
14575
+ return path$1.posix.join(stat.name, normalizedPath).replace(normalize, '')
14544
14576
  }
14545
14577
 
14578
+ /*
14579
+ * Copyright The OpenTelemetry Authors
14580
+ *
14581
+ * Licensed under the Apache License, Version 2.0 (the "License");
14582
+ * you may not use this file except in compliance with the License.
14583
+ * You may obtain a copy of the License at
14584
+ *
14585
+ * https://www.apache.org/licenses/LICENSE-2.0
14586
+ *
14587
+ * Unless required by applicable law or agreed to in writing, software
14588
+ * distributed under the License is distributed on an "AS IS" BASIS,
14589
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14590
+ * See the License for the specific language governing permissions and
14591
+ * limitations under the License.
14592
+ */
14593
+ var otperformance$3 = performance$1;
14594
+
14595
+ /*
14596
+ * Copyright The OpenTelemetry Authors
14597
+ *
14598
+ * Licensed under the Apache License, Version 2.0 (the "License");
14599
+ * you may not use this file except in compliance with the License.
14600
+ * You may obtain a copy of the License at
14601
+ *
14602
+ * https://www.apache.org/licenses/LICENSE-2.0
14603
+ *
14604
+ * Unless required by applicable law or agreed to in writing, software
14605
+ * distributed under the License is distributed on an "AS IS" BASIS,
14606
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14607
+ * See the License for the specific language governing permissions and
14608
+ * limitations under the License.
14609
+ */
14610
+ var TRACE_PARENT_HEADER = 'traceparent';
14611
+
14546
14612
  /*
14547
14613
  * Copyright The OpenTelemetry Authors
14548
14614
  *
@@ -15354,7 +15420,7 @@ let SemVer$T = class SemVer {
15354
15420
  var semver$7 = SemVer$T;
15355
15421
 
15356
15422
  const SemVer$S = semver$7;
15357
- const parse$w = (version, options, throwErrors = false) => {
15423
+ const parse$t = (version, options, throwErrors = false) => {
15358
15424
  if (version instanceof SemVer$S) {
15359
15425
  return version
15360
15426
  }
@@ -15368,18 +15434,18 @@ const parse$w = (version, options, throwErrors = false) => {
15368
15434
  }
15369
15435
  };
15370
15436
 
15371
- var parse_1$3 = parse$w;
15437
+ var parse_1$3 = parse$t;
15372
15438
 
15373
- const parse$v = parse_1$3;
15439
+ const parse$s = parse_1$3;
15374
15440
  const valid$b = (version, options) => {
15375
- const v = parse$v(version, options);
15441
+ const v = parse$s(version, options);
15376
15442
  return v ? v.version : null
15377
15443
  };
15378
15444
  var valid_1$3 = valid$b;
15379
15445
 
15380
- const parse$u = parse_1$3;
15446
+ const parse$r = parse_1$3;
15381
15447
  const clean$7 = (version, options) => {
15382
- const s = parse$u(version.trim().replace(/^[=v]+/, ''), options);
15448
+ const s = parse$r(version.trim().replace(/^[=v]+/, ''), options);
15383
15449
  return s ? s.version : null
15384
15450
  };
15385
15451
  var clean_1$3 = clean$7;
@@ -15404,11 +15470,11 @@ const inc$7 = (version, release, options, identifier, identifierBase) => {
15404
15470
  };
15405
15471
  var inc_1$3 = inc$7;
15406
15472
 
15407
- const parse$t = parse_1$3;
15473
+ const parse$q = parse_1$3;
15408
15474
 
15409
15475
  const diff$7 = (version1, version2) => {
15410
- const v1 = parse$t(version1, null, true);
15411
- const v2 = parse$t(version2, null, true);
15476
+ const v1 = parse$q(version1, null, true);
15477
+ const v2 = parse$q(version2, null, true);
15412
15478
  const comparison = v1.compare(v2);
15413
15479
 
15414
15480
  if (comparison === 0) {
@@ -15475,9 +15541,9 @@ const SemVer$O = semver$7;
15475
15541
  const patch$7 = (a, loose) => new SemVer$O(a, loose).patch;
15476
15542
  var patch_1$3 = patch$7;
15477
15543
 
15478
- const parse$s = parse_1$3;
15544
+ const parse$p = parse_1$3;
15479
15545
  const prerelease$7 = (version, options) => {
15480
- const parsed = parse$s(version, options);
15546
+ const parsed = parse$p(version, options);
15481
15547
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
15482
15548
  };
15483
15549
  var prerelease_1$3 = prerelease$7;
@@ -15590,7 +15656,7 @@ const cmp$7 = (a, op, b, loose) => {
15590
15656
  var cmp_1$3 = cmp$7;
15591
15657
 
15592
15658
  const SemVer$L = semver$7;
15593
- const parse$r = parse_1$3;
15659
+ const parse$o = parse_1$3;
15594
15660
  const { safeRe: re$9, t: t$6 } = reExports$3;
15595
15661
 
15596
15662
  const coerce$7 = (version, options) => {
@@ -15646,16 +15712,16 @@ const coerce$7 = (version, options) => {
15646
15712
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
15647
15713
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
15648
15714
 
15649
- return parse$r(`${major}.${minor}.${patch}${prerelease}${build}`, options)
15715
+ return parse$o(`${major}.${minor}.${patch}${prerelease}${build}`, options)
15650
15716
  };
15651
15717
  var coerce_1$3 = coerce$7;
15652
15718
 
15653
15719
  var lrucache$3;
15654
- var hasRequiredLrucache$1;
15720
+ var hasRequiredLrucache$2;
15655
15721
 
15656
- function requireLrucache$1 () {
15657
- if (hasRequiredLrucache$1) return lrucache$3;
15658
- hasRequiredLrucache$1 = 1;
15722
+ function requireLrucache$2 () {
15723
+ if (hasRequiredLrucache$2) return lrucache$3;
15724
+ hasRequiredLrucache$2 = 1;
15659
15725
 
15660
15726
  class LRUCache {
15661
15727
  constructor () {
@@ -15921,7 +15987,7 @@ function requireRange$3 () {
15921
15987
 
15922
15988
  range$3 = Range;
15923
15989
 
15924
- const LRU = requireLrucache$1();
15990
+ const LRU = requireLrucache$2();
15925
15991
  const cache = new LRU();
15926
15992
 
15927
15993
  const parseOptions = parseOptions_1$3;
@@ -16960,7 +17026,7 @@ const internalRe$3 = reExports$3;
16960
17026
  const constants$6 = constants$7;
16961
17027
  const SemVer$G = semver$7;
16962
17028
  const identifiers$6 = identifiers$7;
16963
- const parse$q = parse_1$3;
17029
+ const parse$n = parse_1$3;
16964
17030
  const valid$9 = valid_1$3;
16965
17031
  const clean$6 = clean_1$3;
16966
17032
  const inc$6 = inc_1$3;
@@ -16998,7 +17064,7 @@ const intersects$6 = intersects_1$3;
16998
17064
  const simplifyRange$3 = simplify$3;
16999
17065
  const subset$6 = subset_1$3;
17000
17066
  var semver$6 = {
17001
- parse: parse$q,
17067
+ parse: parse$n,
17002
17068
  valid: valid$9,
17003
17069
  clean: clean$6,
17004
17070
  inc: inc$6,
@@ -17412,7 +17478,7 @@ var RequireInTheMiddleSingleton$3 = /** @class */ (function () {
17412
17478
  }
17413
17479
  RequireInTheMiddleSingleton.prototype._initialize = function () {
17414
17480
  var _this = this;
17415
- new Hook_1$4(
17481
+ new Hook_1$1(
17416
17482
  // Intercept all `require` calls; we will filter the matching ones below
17417
17483
  null, { internals: true }, function (exports, name, basedir) {
17418
17484
  var e_1, _a;
@@ -17476,28 +17542,28 @@ var RequireInTheMiddleSingleton$3 = /** @class */ (function () {
17476
17542
  * @returns {string} Normalized module name or path
17477
17543
  */
17478
17544
  function normalizePathSeparators$3(moduleNameOrPath) {
17479
- return path$7.sep !== ModuleNameSeparator$3
17480
- ? moduleNameOrPath.split(path$7.sep).join(ModuleNameSeparator$3)
17545
+ return path$4.sep !== ModuleNameSeparator$3
17546
+ ? moduleNameOrPath.split(path$4.sep).join(ModuleNameSeparator$3)
17481
17547
  : moduleNameOrPath;
17482
17548
  }
17483
17549
 
17484
- var importInTheMiddle$3 = {exports: {}};
17550
+ var importInTheMiddle = {exports: {}};
17485
17551
 
17486
- var register$7 = {};
17552
+ var register$1 = {};
17487
17553
 
17488
17554
  // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
17489
17555
  //
17490
17556
  // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
17491
17557
 
17492
- const importHooks$7 = []; // TODO should this be a Set?
17493
- const setters$3 = new WeakMap();
17494
- const getters$3 = new WeakMap();
17495
- const specifiers$7 = new Map();
17496
- const toHook$7 = [];
17558
+ const importHooks$1 = []; // TODO should this be a Set?
17559
+ const setters = new WeakMap();
17560
+ const getters = new WeakMap();
17561
+ const specifiers$1 = new Map();
17562
+ const toHook$1 = [];
17497
17563
 
17498
- const proxyHandler$3 = {
17564
+ const proxyHandler = {
17499
17565
  set (target, name, value) {
17500
- return setters$3.get(target)[name](value)
17566
+ return setters.get(target)[name](value)
17501
17567
  },
17502
17568
 
17503
17569
  get (target, name) {
@@ -17505,7 +17571,7 @@ const proxyHandler$3 = {
17505
17571
  return 'Module'
17506
17572
  }
17507
17573
 
17508
- const getter = getters$3.get(target)[name];
17574
+ const getter = getters.get(target)[name];
17509
17575
 
17510
17576
  if (typeof getter === 'function') {
17511
17577
  return getter()
@@ -17517,72 +17583,72 @@ const proxyHandler$3 = {
17517
17583
  throw new Error('Getters/setters are not supported for exports property descriptors.')
17518
17584
  }
17519
17585
 
17520
- return setters$3.get(target)[property](descriptor.value)
17586
+ return setters.get(target)[property](descriptor.value)
17521
17587
  }
17522
17588
  };
17523
17589
 
17524
- function register$6 (name, namespace, set, get, specifier) {
17525
- specifiers$7.set(name, specifier);
17526
- setters$3.set(namespace, set);
17527
- getters$3.set(namespace, get);
17528
- const proxy = new Proxy(namespace, proxyHandler$3);
17529
- importHooks$7.forEach(hook => hook(name, proxy));
17530
- toHook$7.push([name, proxy]);
17590
+ function register (name, namespace, set, get, specifier) {
17591
+ specifiers$1.set(name, specifier);
17592
+ setters.set(namespace, set);
17593
+ getters.set(namespace, get);
17594
+ const proxy = new Proxy(namespace, proxyHandler);
17595
+ importHooks$1.forEach(hook => hook(name, proxy));
17596
+ toHook$1.push([name, proxy]);
17531
17597
  }
17532
17598
 
17533
- let experimentalPatchInternals$3 = false;
17599
+ let experimentalPatchInternals = false;
17534
17600
 
17535
- function getExperimentalPatchInternals$7 () {
17536
- return experimentalPatchInternals$3
17601
+ function getExperimentalPatchInternals$1 () {
17602
+ return experimentalPatchInternals
17537
17603
  }
17538
17604
 
17539
- function setExperimentalPatchInternals$3 (value) {
17540
- experimentalPatchInternals$3 = value;
17605
+ function setExperimentalPatchInternals (value) {
17606
+ experimentalPatchInternals = value;
17541
17607
  }
17542
17608
 
17543
- register$7.register = register$6;
17544
- register$7.importHooks = importHooks$7;
17545
- register$7.specifiers = specifiers$7;
17546
- register$7.toHook = toHook$7;
17547
- register$7.getExperimentalPatchInternals = getExperimentalPatchInternals$7;
17548
- register$7.setExperimentalPatchInternals = setExperimentalPatchInternals$3;
17609
+ register$1.register = register;
17610
+ register$1.importHooks = importHooks$1;
17611
+ register$1.specifiers = specifiers$1;
17612
+ register$1.toHook = toHook$1;
17613
+ register$1.getExperimentalPatchInternals = getExperimentalPatchInternals$1;
17614
+ register$1.setExperimentalPatchInternals = setExperimentalPatchInternals;
17549
17615
 
17550
17616
  // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
17551
17617
  //
17552
17618
  // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
17553
17619
 
17554
- const path$3 = path__default;
17555
- const parse$p = moduleDetailsFromPath$1;
17556
- const { fileURLToPath: fileURLToPath$3 } = require$$2__default;
17557
- const { MessageChannel: MessageChannel$3 } = require$$3;
17620
+ const path = path__default;
17621
+ const parse$m = moduleDetailsFromPath$1;
17622
+ const { fileURLToPath } = url__default;
17623
+ const { MessageChannel } = require$$3;
17558
17624
 
17559
17625
  const {
17560
- importHooks: importHooks$6,
17561
- specifiers: specifiers$6,
17562
- toHook: toHook$6,
17563
- getExperimentalPatchInternals: getExperimentalPatchInternals$6
17564
- } = register$7;
17626
+ importHooks,
17627
+ specifiers,
17628
+ toHook,
17629
+ getExperimentalPatchInternals
17630
+ } = register$1;
17565
17631
 
17566
- function addHook$3 (hook) {
17567
- importHooks$6.push(hook);
17568
- toHook$6.forEach(([name, namespace]) => hook(name, namespace));
17632
+ function addHook (hook) {
17633
+ importHooks.push(hook);
17634
+ toHook.forEach(([name, namespace]) => hook(name, namespace));
17569
17635
  }
17570
17636
 
17571
- function removeHook$3 (hook) {
17572
- const index = importHooks$6.indexOf(hook);
17637
+ function removeHook (hook) {
17638
+ const index = importHooks.indexOf(hook);
17573
17639
  if (index > -1) {
17574
- importHooks$6.splice(index, 1);
17640
+ importHooks.splice(index, 1);
17575
17641
  }
17576
17642
  }
17577
17643
 
17578
- function callHookFn$3 (hookFn, namespace, name, baseDir) {
17644
+ function callHookFn (hookFn, namespace, name, baseDir) {
17579
17645
  const newDefault = hookFn(namespace, name, baseDir);
17580
17646
  if (newDefault && newDefault !== namespace) {
17581
17647
  namespace.default = newDefault;
17582
17648
  }
17583
17649
  }
17584
17650
 
17585
- let sendModulesToLoader$3;
17651
+ let sendModulesToLoader;
17586
17652
 
17587
17653
  /**
17588
17654
  * EXPERIMENTAL
@@ -17612,12 +17678,12 @@ let sendModulesToLoader$3;
17612
17678
  * await waitForAllMessagesAcknowledged()
17613
17679
  * ```
17614
17680
  */
17615
- function createAddHookMessageChannel$3 () {
17616
- const { port1, port2 } = new MessageChannel$3();
17681
+ function createAddHookMessageChannel () {
17682
+ const { port1, port2 } = new MessageChannel();
17617
17683
  let pendingAckCount = 0;
17618
17684
  let resolveFn;
17619
17685
 
17620
- sendModulesToLoader$3 = (modules) => {
17686
+ sendModulesToLoader = (modules) => {
17621
17687
  pendingAckCount++;
17622
17688
  port1.postMessage(modules);
17623
17689
  };
@@ -17651,8 +17717,8 @@ function createAddHookMessageChannel$3 () {
17651
17717
  return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
17652
17718
  }
17653
17719
 
17654
- function Hook$3 (modules, options, hookFn) {
17655
- if ((this instanceof Hook$3) === false) return new Hook$3(modules, options, hookFn)
17720
+ function Hook (modules, options, hookFn) {
17721
+ if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn)
17656
17722
  if (typeof modules === 'function') {
17657
17723
  hookFn = modules;
17658
17724
  modules = null;
@@ -17663,8 +17729,8 @@ function Hook$3 (modules, options, hookFn) {
17663
17729
  }
17664
17730
  const internals = options ? options.internals === true : false;
17665
17731
 
17666
- if (sendModulesToLoader$3 && Array.isArray(modules)) {
17667
- sendModulesToLoader$3(modules);
17732
+ if (sendModulesToLoader && Array.isArray(modules)) {
17733
+ sendModulesToLoader(modules);
17668
17734
  }
17669
17735
 
17670
17736
  this._iitmHook = (name, namespace) => {
@@ -17677,10 +17743,10 @@ function Hook$3 (modules, options, hookFn) {
17677
17743
  } else {
17678
17744
  if (name.startsWith('file://')) {
17679
17745
  try {
17680
- name = fileURLToPath$3(name);
17746
+ name = fileURLToPath(name);
17681
17747
  } catch (e) {}
17682
17748
  }
17683
- const details = parse$p(name);
17749
+ const details = parse$m(name);
17684
17750
  if (details) {
17685
17751
  name = details.name;
17686
17752
  baseDir = details.basedir;
@@ -17692,31 +17758,31 @@ function Hook$3 (modules, options, hookFn) {
17692
17758
  if (moduleName === name) {
17693
17759
  if (baseDir) {
17694
17760
  if (internals) {
17695
- name = name + path$3.sep + path$3.relative(baseDir, fileURLToPath$3(filename));
17761
+ name = name + path.sep + path.relative(baseDir, fileURLToPath(filename));
17696
17762
  } else {
17697
- if (!getExperimentalPatchInternals$6() && !baseDir.endsWith(specifiers$6.get(filename))) continue
17763
+ if (!getExperimentalPatchInternals() && !baseDir.endsWith(specifiers.get(filename))) continue
17698
17764
  }
17699
17765
  }
17700
- callHookFn$3(hookFn, namespace, name, baseDir);
17766
+ callHookFn(hookFn, namespace, name, baseDir);
17701
17767
  }
17702
17768
  }
17703
17769
  } else {
17704
- callHookFn$3(hookFn, namespace, name, baseDir);
17770
+ callHookFn(hookFn, namespace, name, baseDir);
17705
17771
  }
17706
17772
  };
17707
17773
 
17708
- addHook$3(this._iitmHook);
17774
+ addHook(this._iitmHook);
17709
17775
  }
17710
17776
 
17711
- Hook$3.prototype.unhook = function () {
17712
- removeHook$3(this._iitmHook);
17777
+ Hook.prototype.unhook = function () {
17778
+ removeHook(this._iitmHook);
17713
17779
  };
17714
17780
 
17715
- importInTheMiddle$3.exports = Hook$3;
17716
- var Hook_1$3 = importInTheMiddle$3.exports.Hook = Hook$3;
17717
- importInTheMiddle$3.exports.addHook = addHook$3;
17718
- importInTheMiddle$3.exports.removeHook = removeHook$3;
17719
- importInTheMiddle$3.exports.createAddHookMessageChannel = createAddHookMessageChannel$3;
17781
+ importInTheMiddle.exports = Hook;
17782
+ var Hook_1 = importInTheMiddle.exports.Hook = Hook;
17783
+ importInTheMiddle.exports.addHook = addHook;
17784
+ importInTheMiddle.exports.removeHook = removeHook;
17785
+ importInTheMiddle.exports.createAddHookMessageChannel = createAddHookMessageChannel;
17720
17786
 
17721
17787
  /*
17722
17788
  * Copyright The OpenTelemetry Authors
@@ -17944,7 +18010,7 @@ var InstrumentationBase$3 = /** @class */ (function (_super) {
17944
18010
  };
17945
18011
  InstrumentationBase.prototype._extractPackageVersion = function (baseDir) {
17946
18012
  try {
17947
- var json = readFileSync(path$7.join(baseDir, 'package.json'), {
18013
+ var json = readFileSync(path$4.join(baseDir, 'package.json'), {
17948
18014
  encoding: 'utf8',
17949
18015
  });
17950
18016
  var version = JSON.parse(json).version;
@@ -17991,7 +18057,7 @@ var InstrumentationBase$3 = /** @class */ (function (_super) {
17991
18057
  }
17992
18058
  // internal file
17993
18059
  var files = (_a = module.files) !== null && _a !== void 0 ? _a : [];
17994
- var normalizedName = path$7.normalize(name);
18060
+ var normalizedName = path$4.normalize(name);
17995
18061
  var supportedFileInstrumentations = files
17996
18062
  .filter(function (f) { return f.name === normalizedName; })
17997
18063
  .filter(function (f) {
@@ -18073,11 +18139,11 @@ var InstrumentationBase$3 = /** @class */ (function (_super) {
18073
18139
  // `RequireInTheMiddleSingleton` does not support absolute paths.
18074
18140
  // For an absolute paths, we must create a separate instance of the
18075
18141
  // require-in-the-middle `Hook`.
18076
- var hook = path$7.isAbsolute(module_2.name)
18077
- ? new Hook_1$4([module_2.name], { internals: true }, onRequire)
18142
+ var hook = path$4.isAbsolute(module_2.name)
18143
+ ? new Hook_1$1([module_2.name], { internals: true }, onRequire)
18078
18144
  : this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
18079
18145
  this_1._hooks.push(hook);
18080
- var esmHook = new Hook_1$3([module_2.name], { internals: false }, hookFn);
18146
+ var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
18081
18147
  this_1._hooks.push(esmHook);
18082
18148
  };
18083
18149
  var this_1 = this;
@@ -18212,8 +18278,8 @@ var PACKAGE_NAME$1 = '@opentelemetry/instrumentation-document-load';
18212
18278
  * See the License for the specific language governing permissions and
18213
18279
  * limitations under the License.
18214
18280
  */
18215
- const TMP_HTTP_URL$2 = 'http.url';
18216
- const TMP_HTTP_USER_AGENT$2 = 'http.user_agent';
18281
+ const TMP_HTTP_URL$1 = 'http.url';
18282
+ const TMP_HTTP_USER_AGENT$1 = 'http.user_agent';
18217
18283
  /**
18218
18284
  * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
18219
18285
  *
@@ -18221,13 +18287,13 @@ const TMP_HTTP_USER_AGENT$2 = 'http.user_agent';
18221
18287
  *
18222
18288
  * @deprecated Use ATTR_HTTP_URL in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
18223
18289
  */
18224
- const SEMATTRS_HTTP_URL$2 = TMP_HTTP_URL$2;
18290
+ const SEMATTRS_HTTP_URL$1 = TMP_HTTP_URL$1;
18225
18291
  /**
18226
18292
  * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
18227
18293
  *
18228
18294
  * @deprecated Use ATTR_HTTP_USER_AGENT in [incubating entry-point]({@link https://github.com/open-telemetry/opentelemetry-js/blob/main/semantic-conventions/README.md#unstable-semconv}).
18229
18295
  */
18230
- const SEMATTRS_HTTP_USER_AGENT$2 = TMP_HTTP_USER_AGENT$2;
18296
+ const SEMATTRS_HTTP_USER_AGENT$1 = TMP_HTTP_USER_AGENT$1;
18231
18297
 
18232
18298
  /*
18233
18299
  * Copyright The OpenTelemetry Authors
@@ -18268,7 +18334,7 @@ var EventNames$1;
18268
18334
  var getPerformanceNavigationEntries = function () {
18269
18335
  var _a, _b;
18270
18336
  var entries = {};
18271
- var performanceNavigationTiming = (_b = (_a = otperformance$2).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'navigation')[0];
18337
+ var performanceNavigationTiming = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'navigation')[0];
18272
18338
  if (performanceNavigationTiming) {
18273
18339
  var keys = Object.values(PerformanceTimingNames$2);
18274
18340
  keys.forEach(function (key) {
@@ -18282,7 +18348,7 @@ var getPerformanceNavigationEntries = function () {
18282
18348
  }
18283
18349
  else {
18284
18350
  // // fallback to previous version
18285
- var perf = otperformance$2;
18351
+ var perf = otperformance$3;
18286
18352
  var performanceTiming_1 = perf.timing;
18287
18353
  if (performanceTiming_1) {
18288
18354
  var keys = Object.values(PerformanceTimingNames$2);
@@ -18304,7 +18370,7 @@ var performancePaintNames = {
18304
18370
  };
18305
18371
  var addSpanPerformancePaintEvents = function (span) {
18306
18372
  var _a, _b;
18307
- var performancePaintTiming = (_b = (_a = otperformance$2).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'paint');
18373
+ var performancePaintTiming = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'paint');
18308
18374
  if (performancePaintTiming) {
18309
18375
  performancePaintTiming.forEach(function (_a) {
18310
18376
  var name = _a.name, startTime = _a.startTime;
@@ -18381,7 +18447,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
18381
18447
  DocumentLoadInstrumentation.prototype._addResourcesSpans = function (rootSpan) {
18382
18448
  var _this = this;
18383
18449
  var _a, _b;
18384
- var resources = (_b = (_a = otperformance$2).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'resource');
18450
+ var resources = (_b = (_a = otperformance$3).getEntriesByType) === null || _b === void 0 ? void 0 : _b.call(_a, 'resource');
18385
18451
  if (resources) {
18386
18452
  resources.forEach(function (resource) {
18387
18453
  _this._initResourceSpan(resource, rootSpan);
@@ -18405,7 +18471,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
18405
18471
  context.with(trace.setSpan(context.active(), rootSpan), function () {
18406
18472
  var fetchSpan = _this._startSpan(AttributeNames$3.DOCUMENT_FETCH, PerformanceTimingNames$2.FETCH_START, entries);
18407
18473
  if (fetchSpan) {
18408
- fetchSpan.setAttribute(SEMATTRS_HTTP_URL$2, location.href);
18474
+ fetchSpan.setAttribute(SEMATTRS_HTTP_URL$1, location.href);
18409
18475
  context.with(trace.setSpan(context.active(), fetchSpan), function () {
18410
18476
  var _a;
18411
18477
  if (!_this._getConfig().ignoreNetworkEvents) {
@@ -18416,8 +18482,8 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
18416
18482
  });
18417
18483
  }
18418
18484
  });
18419
- rootSpan.setAttribute(SEMATTRS_HTTP_URL$2, location.href);
18420
- rootSpan.setAttribute(SEMATTRS_HTTP_USER_AGENT$2, navigator.userAgent);
18485
+ rootSpan.setAttribute(SEMATTRS_HTTP_URL$1, location.href);
18486
+ rootSpan.setAttribute(SEMATTRS_HTTP_USER_AGENT$1, navigator.userAgent);
18421
18487
  _this._addResourcesSpans(rootSpan);
18422
18488
  if (!_this._getConfig().ignoreNetworkEvents) {
18423
18489
  addSpanNetworkEvent$2(rootSpan, PerformanceTimingNames$2.FETCH_START, entries);
@@ -18464,7 +18530,7 @@ var DocumentLoadInstrumentation = /** @class */ (function (_super) {
18464
18530
  var _a;
18465
18531
  var span = this._startSpan(AttributeNames$3.RESOURCE_FETCH, PerformanceTimingNames$2.FETCH_START, resource, parentSpan);
18466
18532
  if (span) {
18467
- span.setAttribute(SEMATTRS_HTTP_URL$2, resource.name);
18533
+ span.setAttribute(SEMATTRS_HTTP_URL$1, resource.name);
18468
18534
  if (!this._getConfig().ignoreNetworkEvents) {
18469
18535
  addSpanNetworkEvents$2(span, resource);
18470
18536
  }
@@ -19361,7 +19427,7 @@ let SemVer$F = class SemVer {
19361
19427
  var semver$5 = SemVer$F;
19362
19428
 
19363
19429
  const SemVer$E = semver$5;
19364
- const parse$o = (version, options, throwErrors = false) => {
19430
+ const parse$l = (version, options, throwErrors = false) => {
19365
19431
  if (version instanceof SemVer$E) {
19366
19432
  return version
19367
19433
  }
@@ -19375,18 +19441,18 @@ const parse$o = (version, options, throwErrors = false) => {
19375
19441
  }
19376
19442
  };
19377
19443
 
19378
- var parse_1$2 = parse$o;
19444
+ var parse_1$2 = parse$l;
19379
19445
 
19380
- const parse$n = parse_1$2;
19446
+ const parse$k = parse_1$2;
19381
19447
  const valid$8 = (version, options) => {
19382
- const v = parse$n(version, options);
19448
+ const v = parse$k(version, options);
19383
19449
  return v ? v.version : null
19384
19450
  };
19385
19451
  var valid_1$2 = valid$8;
19386
19452
 
19387
- const parse$m = parse_1$2;
19453
+ const parse$j = parse_1$2;
19388
19454
  const clean$5 = (version, options) => {
19389
- const s = parse$m(version.trim().replace(/^[=v]+/, ''), options);
19455
+ const s = parse$j(version.trim().replace(/^[=v]+/, ''), options);
19390
19456
  return s ? s.version : null
19391
19457
  };
19392
19458
  var clean_1$2 = clean$5;
@@ -19411,11 +19477,11 @@ const inc$5 = (version, release, options, identifier, identifierBase) => {
19411
19477
  };
19412
19478
  var inc_1$2 = inc$5;
19413
19479
 
19414
- const parse$l = parse_1$2;
19480
+ const parse$i = parse_1$2;
19415
19481
 
19416
19482
  const diff$5 = (version1, version2) => {
19417
- const v1 = parse$l(version1, null, true);
19418
- const v2 = parse$l(version2, null, true);
19483
+ const v1 = parse$i(version1, null, true);
19484
+ const v2 = parse$i(version2, null, true);
19419
19485
  const comparison = v1.compare(v2);
19420
19486
 
19421
19487
  if (comparison === 0) {
@@ -19482,9 +19548,9 @@ const SemVer$A = semver$5;
19482
19548
  const patch$5 = (a, loose) => new SemVer$A(a, loose).patch;
19483
19549
  var patch_1$2 = patch$5;
19484
19550
 
19485
- const parse$k = parse_1$2;
19551
+ const parse$h = parse_1$2;
19486
19552
  const prerelease$5 = (version, options) => {
19487
- const parsed = parse$k(version, options);
19553
+ const parsed = parse$h(version, options);
19488
19554
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
19489
19555
  };
19490
19556
  var prerelease_1$2 = prerelease$5;
@@ -19597,7 +19663,7 @@ const cmp$5 = (a, op, b, loose) => {
19597
19663
  var cmp_1$2 = cmp$5;
19598
19664
 
19599
19665
  const SemVer$x = semver$5;
19600
- const parse$j = parse_1$2;
19666
+ const parse$g = parse_1$2;
19601
19667
  const { safeRe: re$6, t: t$4 } = reExports$2;
19602
19668
 
19603
19669
  const coerce$5 = (version, options) => {
@@ -19653,16 +19719,16 @@ const coerce$5 = (version, options) => {
19653
19719
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
19654
19720
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
19655
19721
 
19656
- return parse$j(`${major}.${minor}.${patch}${prerelease}${build}`, options)
19722
+ return parse$g(`${major}.${minor}.${patch}${prerelease}${build}`, options)
19657
19723
  };
19658
19724
  var coerce_1$2 = coerce$5;
19659
19725
 
19660
19726
  var lrucache$2;
19661
- var hasRequiredLrucache;
19727
+ var hasRequiredLrucache$1;
19662
19728
 
19663
- function requireLrucache () {
19664
- if (hasRequiredLrucache) return lrucache$2;
19665
- hasRequiredLrucache = 1;
19729
+ function requireLrucache$1 () {
19730
+ if (hasRequiredLrucache$1) return lrucache$2;
19731
+ hasRequiredLrucache$1 = 1;
19666
19732
 
19667
19733
  class LRUCache {
19668
19734
  constructor () {
@@ -19928,7 +19994,7 @@ function requireRange$2 () {
19928
19994
 
19929
19995
  range$2 = Range;
19930
19996
 
19931
- const LRU = requireLrucache();
19997
+ const LRU = requireLrucache$1();
19932
19998
  const cache = new LRU();
19933
19999
 
19934
20000
  const parseOptions = parseOptions_1$2;
@@ -20967,7 +21033,7 @@ const internalRe$2 = reExports$2;
20967
21033
  const constants$4 = constants$5;
20968
21034
  const SemVer$s = semver$5;
20969
21035
  const identifiers$4 = identifiers$5;
20970
- const parse$i = parse_1$2;
21036
+ const parse$f = parse_1$2;
20971
21037
  const valid$6 = valid_1$2;
20972
21038
  const clean$4 = clean_1$2;
20973
21039
  const inc$4 = inc_1$2;
@@ -21005,7 +21071,7 @@ const intersects$4 = intersects_1$2;
21005
21071
  const simplifyRange$2 = simplify$2;
21006
21072
  const subset$4 = subset_1$2;
21007
21073
  var semver$4 = {
21008
- parse: parse$i,
21074
+ parse: parse$f,
21009
21075
  valid: valid$6,
21010
21076
  clean: clean$4,
21011
21077
  inc: inc$4,
@@ -21419,7 +21485,7 @@ var RequireInTheMiddleSingleton$2 = /** @class */ (function () {
21419
21485
  }
21420
21486
  RequireInTheMiddleSingleton.prototype._initialize = function () {
21421
21487
  var _this = this;
21422
- new Hook_1$4(
21488
+ new Hook_1$1(
21423
21489
  // Intercept all `require` calls; we will filter the matching ones below
21424
21490
  null, { internals: true }, function (exports, name, basedir) {
21425
21491
  var e_1, _a;
@@ -21483,248 +21549,11 @@ var RequireInTheMiddleSingleton$2 = /** @class */ (function () {
21483
21549
  * @returns {string} Normalized module name or path
21484
21550
  */
21485
21551
  function normalizePathSeparators$2(moduleNameOrPath) {
21486
- return path$7.sep !== ModuleNameSeparator$2
21487
- ? moduleNameOrPath.split(path$7.sep).join(ModuleNameSeparator$2)
21552
+ return path$4.sep !== ModuleNameSeparator$2
21553
+ ? moduleNameOrPath.split(path$4.sep).join(ModuleNameSeparator$2)
21488
21554
  : moduleNameOrPath;
21489
21555
  }
21490
21556
 
21491
- var importInTheMiddle$2 = {exports: {}};
21492
-
21493
- var register$5 = {};
21494
-
21495
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
21496
- //
21497
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
21498
-
21499
- const importHooks$5 = []; // TODO should this be a Set?
21500
- const setters$2 = new WeakMap();
21501
- const getters$2 = new WeakMap();
21502
- const specifiers$5 = new Map();
21503
- const toHook$5 = [];
21504
-
21505
- const proxyHandler$2 = {
21506
- set (target, name, value) {
21507
- return setters$2.get(target)[name](value)
21508
- },
21509
-
21510
- get (target, name) {
21511
- if (name === Symbol.toStringTag) {
21512
- return 'Module'
21513
- }
21514
-
21515
- const getter = getters$2.get(target)[name];
21516
-
21517
- if (typeof getter === 'function') {
21518
- return getter()
21519
- }
21520
- },
21521
-
21522
- defineProperty (target, property, descriptor) {
21523
- if ((!('value' in descriptor))) {
21524
- throw new Error('Getters/setters are not supported for exports property descriptors.')
21525
- }
21526
-
21527
- return setters$2.get(target)[property](descriptor.value)
21528
- }
21529
- };
21530
-
21531
- function register$4 (name, namespace, set, get, specifier) {
21532
- specifiers$5.set(name, specifier);
21533
- setters$2.set(namespace, set);
21534
- getters$2.set(namespace, get);
21535
- const proxy = new Proxy(namespace, proxyHandler$2);
21536
- importHooks$5.forEach(hook => hook(name, proxy));
21537
- toHook$5.push([name, proxy]);
21538
- }
21539
-
21540
- let experimentalPatchInternals$2 = false;
21541
-
21542
- function getExperimentalPatchInternals$5 () {
21543
- return experimentalPatchInternals$2
21544
- }
21545
-
21546
- function setExperimentalPatchInternals$2 (value) {
21547
- experimentalPatchInternals$2 = value;
21548
- }
21549
-
21550
- register$5.register = register$4;
21551
- register$5.importHooks = importHooks$5;
21552
- register$5.specifiers = specifiers$5;
21553
- register$5.toHook = toHook$5;
21554
- register$5.getExperimentalPatchInternals = getExperimentalPatchInternals$5;
21555
- register$5.setExperimentalPatchInternals = setExperimentalPatchInternals$2;
21556
-
21557
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
21558
- //
21559
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
21560
-
21561
- const path$2 = path__default;
21562
- const parse$h = moduleDetailsFromPath$1;
21563
- const { fileURLToPath: fileURLToPath$2 } = require$$2__default;
21564
- const { MessageChannel: MessageChannel$2 } = require$$3;
21565
-
21566
- const {
21567
- importHooks: importHooks$4,
21568
- specifiers: specifiers$4,
21569
- toHook: toHook$4,
21570
- getExperimentalPatchInternals: getExperimentalPatchInternals$4
21571
- } = register$5;
21572
-
21573
- function addHook$2 (hook) {
21574
- importHooks$4.push(hook);
21575
- toHook$4.forEach(([name, namespace]) => hook(name, namespace));
21576
- }
21577
-
21578
- function removeHook$2 (hook) {
21579
- const index = importHooks$4.indexOf(hook);
21580
- if (index > -1) {
21581
- importHooks$4.splice(index, 1);
21582
- }
21583
- }
21584
-
21585
- function callHookFn$2 (hookFn, namespace, name, baseDir) {
21586
- const newDefault = hookFn(namespace, name, baseDir);
21587
- if (newDefault && newDefault !== namespace) {
21588
- namespace.default = newDefault;
21589
- }
21590
- }
21591
-
21592
- let sendModulesToLoader$2;
21593
-
21594
- /**
21595
- * EXPERIMENTAL
21596
- * This feature is experimental and may change in minor versions.
21597
- * **NOTE** This feature is incompatible with the {internals: true} Hook option.
21598
- *
21599
- * Creates a message channel with a port that can be used to add hooks to the
21600
- * list of exclusively included modules.
21601
- *
21602
- * This can be used to only wrap modules that are Hook'ed, however modules need
21603
- * to be hooked before they are imported.
21604
- *
21605
- * ```ts
21606
- * import { register } from 'module'
21607
- * import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
21608
- *
21609
- * const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
21610
- *
21611
- * register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
21612
- *
21613
- * Hook(['fs'], (exported, name, baseDir) => {
21614
- * // Instrument the fs module
21615
- * })
21616
- *
21617
- * // Ensure that the loader has acknowledged all the modules
21618
- * // before we allow execution to continue
21619
- * await waitForAllMessagesAcknowledged()
21620
- * ```
21621
- */
21622
- function createAddHookMessageChannel$2 () {
21623
- const { port1, port2 } = new MessageChannel$2();
21624
- let pendingAckCount = 0;
21625
- let resolveFn;
21626
-
21627
- sendModulesToLoader$2 = (modules) => {
21628
- pendingAckCount++;
21629
- port1.postMessage(modules);
21630
- };
21631
-
21632
- port1.on('message', () => {
21633
- pendingAckCount--;
21634
-
21635
- if (resolveFn && pendingAckCount <= 0) {
21636
- resolveFn();
21637
- }
21638
- }).unref();
21639
-
21640
- function waitForAllMessagesAcknowledged () {
21641
- // This timer is to prevent the process from exiting with code 13:
21642
- // 13: Unsettled Top-Level Await.
21643
- const timer = setInterval(() => { }, 1000);
21644
- const promise = new Promise((resolve) => {
21645
- resolveFn = resolve;
21646
- }).then(() => { clearInterval(timer); });
21647
-
21648
- if (pendingAckCount === 0) {
21649
- resolveFn();
21650
- }
21651
-
21652
- return promise
21653
- }
21654
-
21655
- const addHookMessagePort = port2;
21656
- const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
21657
-
21658
- return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
21659
- }
21660
-
21661
- function Hook$2 (modules, options, hookFn) {
21662
- if ((this instanceof Hook$2) === false) return new Hook$2(modules, options, hookFn)
21663
- if (typeof modules === 'function') {
21664
- hookFn = modules;
21665
- modules = null;
21666
- options = null;
21667
- } else if (typeof options === 'function') {
21668
- hookFn = options;
21669
- options = null;
21670
- }
21671
- const internals = options ? options.internals === true : false;
21672
-
21673
- if (sendModulesToLoader$2 && Array.isArray(modules)) {
21674
- sendModulesToLoader$2(modules);
21675
- }
21676
-
21677
- this._iitmHook = (name, namespace) => {
21678
- const filename = name;
21679
- const isBuiltin = name.startsWith('node:');
21680
- let baseDir;
21681
-
21682
- if (isBuiltin) {
21683
- name = name.replace(/^node:/, '');
21684
- } else {
21685
- if (name.startsWith('file://')) {
21686
- try {
21687
- name = fileURLToPath$2(name);
21688
- } catch (e) {}
21689
- }
21690
- const details = parse$h(name);
21691
- if (details) {
21692
- name = details.name;
21693
- baseDir = details.basedir;
21694
- }
21695
- }
21696
-
21697
- if (modules) {
21698
- for (const moduleName of modules) {
21699
- if (moduleName === name) {
21700
- if (baseDir) {
21701
- if (internals) {
21702
- name = name + path$2.sep + path$2.relative(baseDir, fileURLToPath$2(filename));
21703
- } else {
21704
- if (!getExperimentalPatchInternals$4() && !baseDir.endsWith(specifiers$4.get(filename))) continue
21705
- }
21706
- }
21707
- callHookFn$2(hookFn, namespace, name, baseDir);
21708
- }
21709
- }
21710
- } else {
21711
- callHookFn$2(hookFn, namespace, name, baseDir);
21712
- }
21713
- };
21714
-
21715
- addHook$2(this._iitmHook);
21716
- }
21717
-
21718
- Hook$2.prototype.unhook = function () {
21719
- removeHook$2(this._iitmHook);
21720
- };
21721
-
21722
- importInTheMiddle$2.exports = Hook$2;
21723
- var Hook_1$2 = importInTheMiddle$2.exports.Hook = Hook$2;
21724
- importInTheMiddle$2.exports.addHook = addHook$2;
21725
- importInTheMiddle$2.exports.removeHook = removeHook$2;
21726
- importInTheMiddle$2.exports.createAddHookMessageChannel = createAddHookMessageChannel$2;
21727
-
21728
21557
  /*
21729
21558
  * Copyright The OpenTelemetry Authors
21730
21559
  *
@@ -21951,7 +21780,7 @@ var InstrumentationBase$2 = /** @class */ (function (_super) {
21951
21780
  };
21952
21781
  InstrumentationBase.prototype._extractPackageVersion = function (baseDir) {
21953
21782
  try {
21954
- var json = readFileSync(path$7.join(baseDir, 'package.json'), {
21783
+ var json = readFileSync(path$4.join(baseDir, 'package.json'), {
21955
21784
  encoding: 'utf8',
21956
21785
  });
21957
21786
  var version = JSON.parse(json).version;
@@ -21998,7 +21827,7 @@ var InstrumentationBase$2 = /** @class */ (function (_super) {
21998
21827
  }
21999
21828
  // internal file
22000
21829
  var files = (_a = module.files) !== null && _a !== void 0 ? _a : [];
22001
- var normalizedName = path$7.normalize(name);
21830
+ var normalizedName = path$4.normalize(name);
22002
21831
  var supportedFileInstrumentations = files
22003
21832
  .filter(function (f) { return f.name === normalizedName; })
22004
21833
  .filter(function (f) {
@@ -22080,11 +21909,11 @@ var InstrumentationBase$2 = /** @class */ (function (_super) {
22080
21909
  // `RequireInTheMiddleSingleton` does not support absolute paths.
22081
21910
  // For an absolute paths, we must create a separate instance of the
22082
21911
  // require-in-the-middle `Hook`.
22083
- var hook = path$7.isAbsolute(module_2.name)
22084
- ? new Hook_1$4([module_2.name], { internals: true }, onRequire)
21912
+ var hook = path$4.isAbsolute(module_2.name)
21913
+ ? new Hook_1$1([module_2.name], { internals: true }, onRequire)
22085
21914
  : this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
22086
21915
  this_1._hooks.push(hook);
22087
- var esmHook = new Hook_1$2([module_2.name], { internals: false }, hookFn);
21916
+ var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
22088
21917
  this_1._hooks.push(esmHook);
22089
21918
  };
22090
21919
  var this_1 = this;
@@ -22197,7 +22026,7 @@ var _globalThis$2 = typeof globalThis === 'object' ? globalThis : global;
22197
22026
  * See the License for the specific language governing permissions and
22198
22027
  * limitations under the License.
22199
22028
  */
22200
- var otperformance$1 = performance$1;
22029
+ var otperformance$2 = performance$1;
22201
22030
 
22202
22031
  /*
22203
22032
  * Copyright The OpenTelemetry Authors
@@ -22214,50 +22043,50 @@ var otperformance$1 = performance$1;
22214
22043
  * See the License for the specific language governing permissions and
22215
22044
  * limitations under the License.
22216
22045
  */
22217
- var TMP_HTTP_METHOD$1 = 'http.method';
22218
- var TMP_HTTP_URL$1 = 'http.url';
22219
- var TMP_HTTP_HOST$1 = 'http.host';
22220
- var TMP_HTTP_SCHEME$1 = 'http.scheme';
22221
- var TMP_HTTP_STATUS_CODE$1 = 'http.status_code';
22222
- var TMP_HTTP_USER_AGENT$1 = 'http.user_agent';
22223
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH$1 = 'http.response_content_length';
22224
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = 'http.response_content_length_uncompressed';
22046
+ var TMP_HTTP_METHOD = 'http.method';
22047
+ var TMP_HTTP_URL = 'http.url';
22048
+ var TMP_HTTP_HOST = 'http.host';
22049
+ var TMP_HTTP_SCHEME = 'http.scheme';
22050
+ var TMP_HTTP_STATUS_CODE = 'http.status_code';
22051
+ var TMP_HTTP_USER_AGENT = 'http.user_agent';
22052
+ var TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length';
22053
+ var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';
22225
22054
  /**
22226
22055
  * HTTP request method.
22227
22056
  */
22228
- var SEMATTRS_HTTP_METHOD$1 = TMP_HTTP_METHOD$1;
22057
+ var SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD;
22229
22058
  /**
22230
22059
  * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
22231
22060
  *
22232
22061
  * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute&#39;s value should be `https://www.example.com/`.
22233
22062
  */
22234
- var SEMATTRS_HTTP_URL$1 = TMP_HTTP_URL$1;
22063
+ var SEMATTRS_HTTP_URL = TMP_HTTP_URL;
22235
22064
  /**
22236
22065
  * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.
22237
22066
  *
22238
22067
  * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.
22239
22068
  */
22240
- var SEMATTRS_HTTP_HOST$1 = TMP_HTTP_HOST$1;
22069
+ var SEMATTRS_HTTP_HOST = TMP_HTTP_HOST;
22241
22070
  /**
22242
22071
  * The URI scheme identifying the used protocol.
22243
22072
  */
22244
- var SEMATTRS_HTTP_SCHEME$1 = TMP_HTTP_SCHEME$1;
22073
+ var SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME;
22245
22074
  /**
22246
22075
  * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
22247
22076
  */
22248
- var SEMATTRS_HTTP_STATUS_CODE$1 = TMP_HTTP_STATUS_CODE$1;
22077
+ var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
22249
22078
  /**
22250
22079
  * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
22251
22080
  */
22252
- var SEMATTRS_HTTP_USER_AGENT$1 = TMP_HTTP_USER_AGENT$1;
22081
+ var SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
22253
22082
  /**
22254
22083
  * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
22255
22084
  */
22256
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH$1;
22085
+ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH;
22257
22086
  /**
22258
22087
  * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
22259
22088
  */
22260
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1;
22089
+ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED;
22261
22090
 
22262
22091
  /*
22263
22092
  * Copyright The OpenTelemetry Authors
@@ -22274,26 +22103,26 @@ var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1 = TMP_HTTP_RESPONSE_CON
22274
22103
  * See the License for the specific language governing permissions and
22275
22104
  * limitations under the License.
22276
22105
  */
22277
- var NANOSECOND_DIGITS$1 = 9;
22278
- var NANOSECOND_DIGITS_IN_MILLIS$1 = 6;
22279
- var MILLISECONDS_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$1);
22280
- var SECOND_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS$1);
22106
+ var NANOSECOND_DIGITS$2 = 9;
22107
+ var NANOSECOND_DIGITS_IN_MILLIS$2 = 6;
22108
+ var MILLISECONDS_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$2);
22109
+ var SECOND_TO_NANOSECONDS$2 = Math.pow(10, NANOSECOND_DIGITS$2);
22281
22110
  /**
22282
22111
  * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
22283
22112
  * @param epochMillis
22284
22113
  */
22285
- function millisToHrTime$1(epochMillis) {
22114
+ function millisToHrTime$2(epochMillis) {
22286
22115
  var epochSeconds = epochMillis / 1000;
22287
22116
  // Decimals only.
22288
22117
  var seconds = Math.trunc(epochSeconds);
22289
22118
  // Round sub-nanosecond accuracy to nanosecond.
22290
- var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$1);
22119
+ var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$2);
22291
22120
  return [seconds, nanos];
22292
22121
  }
22293
- function getTimeOrigin$1() {
22294
- var timeOrigin = otperformance$1.timeOrigin;
22122
+ function getTimeOrigin$2() {
22123
+ var timeOrigin = otperformance$2.timeOrigin;
22295
22124
  if (typeof timeOrigin !== 'number') {
22296
- var perf = otperformance$1;
22125
+ var perf = otperformance$2;
22297
22126
  timeOrigin = perf.timing && perf.timing.fetchStart;
22298
22127
  }
22299
22128
  return timeOrigin;
@@ -22302,10 +22131,10 @@ function getTimeOrigin$1() {
22302
22131
  * Returns an hrtime calculated via performance component.
22303
22132
  * @param performanceNow
22304
22133
  */
22305
- function hrTime$1(performanceNow) {
22306
- var timeOrigin = millisToHrTime$1(getTimeOrigin$1());
22307
- var now = millisToHrTime$1(typeof performanceNow === 'number' ? performanceNow : otperformance$1.now());
22308
- return addHrTimes$1(timeOrigin, now);
22134
+ function hrTime$2(performanceNow) {
22135
+ var timeOrigin = millisToHrTime$2(getTimeOrigin$2());
22136
+ var now = millisToHrTime$2(typeof performanceNow === 'number' ? performanceNow : otperformance$2.now());
22137
+ return addHrTimes$2(timeOrigin, now);
22309
22138
  }
22310
22139
  /**
22311
22140
  *
@@ -22319,16 +22148,16 @@ function timeInputToHrTime$1(time) {
22319
22148
  }
22320
22149
  else if (typeof time === 'number') {
22321
22150
  // Must be a performance.now() if it's smaller than process start time.
22322
- if (time < getTimeOrigin$1()) {
22323
- return hrTime$1(time);
22151
+ if (time < getTimeOrigin$2()) {
22152
+ return hrTime$2(time);
22324
22153
  }
22325
22154
  else {
22326
22155
  // epoch milliseconds or performance.timeOrigin
22327
- return millisToHrTime$1(time);
22156
+ return millisToHrTime$2(time);
22328
22157
  }
22329
22158
  }
22330
22159
  else if (time instanceof Date) {
22331
- return millisToHrTime$1(time.getTime());
22160
+ return millisToHrTime$2(time.getTime());
22332
22161
  }
22333
22162
  else {
22334
22163
  throw TypeError('Invalid input type');
@@ -22339,7 +22168,7 @@ function timeInputToHrTime$1(time) {
22339
22168
  * @param time
22340
22169
  */
22341
22170
  function hrTimeToNanoseconds$1(time) {
22342
- return time[0] * SECOND_TO_NANOSECONDS$1 + time[1];
22171
+ return time[0] * SECOND_TO_NANOSECONDS$2 + time[1];
22343
22172
  }
22344
22173
  /**
22345
22174
  * check if time is HrTime
@@ -22354,11 +22183,11 @@ function isTimeInputHrTime$1(value) {
22354
22183
  /**
22355
22184
  * Given 2 HrTime formatted times, return their sum as an HrTime.
22356
22185
  */
22357
- function addHrTimes$1(time1, time2) {
22186
+ function addHrTimes$2(time1, time2) {
22358
22187
  var out = [time1[0] + time2[0], time1[1] + time2[1]];
22359
22188
  // Nanoseconds
22360
- if (out[1] >= SECOND_TO_NANOSECONDS$1) {
22361
- out[1] -= SECOND_TO_NANOSECONDS$1;
22189
+ if (out[1] >= SECOND_TO_NANOSECONDS$2) {
22190
+ out[1] -= SECOND_TO_NANOSECONDS$2;
22362
22191
  out[0] += 1;
22363
22192
  }
22364
22193
  return out;
@@ -22545,12 +22374,12 @@ function addSpanNetworkEvents$1(span, resource) {
22545
22374
  addSpanNetworkEvent$1(span, PerformanceTimingNames$1.RESPONSE_END, resource);
22546
22375
  var encodedLength = resource[PerformanceTimingNames$1.ENCODED_BODY_SIZE];
22547
22376
  if (encodedLength !== undefined) {
22548
- span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH$1, encodedLength);
22377
+ span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH, encodedLength);
22549
22378
  }
22550
22379
  var decodedLength = resource[PerformanceTimingNames$1.DECODED_BODY_SIZE];
22551
22380
  // Spec: Not set if transport encoding not used (in which case encoded and decoded sizes match)
22552
22381
  if (decodedLength !== undefined && encodedLength !== decodedLength) {
22553
- span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED$1, decodedLength);
22382
+ span.setAttribute(SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED, decodedLength);
22554
22383
  }
22555
22384
  }
22556
22385
  /**
@@ -22829,14 +22658,14 @@ var FetchInstrumentation = /** @class */ (function (_super) {
22829
22658
  */
22830
22659
  FetchInstrumentation.prototype._addFinalSpanAttributes = function (span, response) {
22831
22660
  var parsedUrl = parseUrl$1(response.url);
22832
- span.setAttribute(SEMATTRS_HTTP_STATUS_CODE$1, response.status);
22661
+ span.setAttribute(SEMATTRS_HTTP_STATUS_CODE, response.status);
22833
22662
  if (response.statusText != null) {
22834
22663
  span.setAttribute(AttributeNames$2.HTTP_STATUS_TEXT, response.statusText);
22835
22664
  }
22836
- span.setAttribute(SEMATTRS_HTTP_HOST$1, parsedUrl.host);
22837
- span.setAttribute(SEMATTRS_HTTP_SCHEME$1, parsedUrl.protocol.replace(':', ''));
22665
+ span.setAttribute(SEMATTRS_HTTP_HOST, parsedUrl.host);
22666
+ span.setAttribute(SEMATTRS_HTTP_SCHEME, parsedUrl.protocol.replace(':', ''));
22838
22667
  if (typeof navigator !== 'undefined') {
22839
- span.setAttribute(SEMATTRS_HTTP_USER_AGENT$1, navigator.userAgent);
22668
+ span.setAttribute(SEMATTRS_HTTP_USER_AGENT, navigator.userAgent);
22840
22669
  }
22841
22670
  };
22842
22671
  /**
@@ -22904,8 +22733,8 @@ var FetchInstrumentation = /** @class */ (function (_super) {
22904
22733
  kind: SpanKind.CLIENT,
22905
22734
  attributes: (_a = {},
22906
22735
  _a[AttributeNames$2.COMPONENT] = this.moduleName,
22907
- _a[SEMATTRS_HTTP_METHOD$1] = method,
22908
- _a[SEMATTRS_HTTP_URL$1] = url,
22736
+ _a[SEMATTRS_HTTP_METHOD] = method,
22737
+ _a[SEMATTRS_HTTP_URL] = url,
22909
22738
  _a),
22910
22739
  });
22911
22740
  };
@@ -22957,8 +22786,8 @@ var FetchInstrumentation = /** @class */ (function (_super) {
22957
22786
  */
22958
22787
  FetchInstrumentation.prototype._endSpan = function (span, spanData, response) {
22959
22788
  var _this = this;
22960
- var endTime = millisToHrTime$1(Date.now());
22961
- var performanceEndTime = hrTime$1();
22789
+ var endTime = millisToHrTime$2(Date.now());
22790
+ var performanceEndTime = hrTime$2();
22962
22791
  this._addFinalSpanAttributes(span, response);
22963
22792
  setTimeout(function () {
22964
22793
  var _a;
@@ -23081,7 +22910,7 @@ var FetchInstrumentation = /** @class */ (function (_super) {
23081
22910
  * @param spanUrl
23082
22911
  */
23083
22912
  FetchInstrumentation.prototype._prepareSpanData = function (spanUrl) {
23084
- var startTime = hrTime$1();
22913
+ var startTime = hrTime$2();
23085
22914
  var entries = [];
23086
22915
  if (typeof PerformanceObserver !== 'function') {
23087
22916
  return { entries: entries, startTime: startTime, spanUrl: spanUrl };
@@ -23939,7 +23768,7 @@ let SemVer$r = class SemVer {
23939
23768
  var semver$3 = SemVer$r;
23940
23769
 
23941
23770
  const SemVer$q = semver$3;
23942
- const parse$g = (version, options, throwErrors = false) => {
23771
+ const parse$e = (version, options, throwErrors = false) => {
23943
23772
  if (version instanceof SemVer$q) {
23944
23773
  return version
23945
23774
  }
@@ -23953,18 +23782,18 @@ const parse$g = (version, options, throwErrors = false) => {
23953
23782
  }
23954
23783
  };
23955
23784
 
23956
- var parse_1$1 = parse$g;
23785
+ var parse_1$1 = parse$e;
23957
23786
 
23958
- const parse$f = parse_1$1;
23787
+ const parse$d = parse_1$1;
23959
23788
  const valid$5 = (version, options) => {
23960
- const v = parse$f(version, options);
23789
+ const v = parse$d(version, options);
23961
23790
  return v ? v.version : null
23962
23791
  };
23963
23792
  var valid_1$1 = valid$5;
23964
23793
 
23965
- const parse$e = parse_1$1;
23794
+ const parse$c = parse_1$1;
23966
23795
  const clean$3 = (version, options) => {
23967
- const s = parse$e(version.trim().replace(/^[=v]+/, ''), options);
23796
+ const s = parse$c(version.trim().replace(/^[=v]+/, ''), options);
23968
23797
  return s ? s.version : null
23969
23798
  };
23970
23799
  var clean_1$1 = clean$3;
@@ -23989,11 +23818,11 @@ const inc$3 = (version, release, options, identifier, identifierBase) => {
23989
23818
  };
23990
23819
  var inc_1$1 = inc$3;
23991
23820
 
23992
- const parse$d = parse_1$1;
23821
+ const parse$b = parse_1$1;
23993
23822
 
23994
23823
  const diff$3 = (version1, version2) => {
23995
- const v1 = parse$d(version1, null, true);
23996
- const v2 = parse$d(version2, null, true);
23824
+ const v1 = parse$b(version1, null, true);
23825
+ const v2 = parse$b(version2, null, true);
23997
23826
  const comparison = v1.compare(v2);
23998
23827
 
23999
23828
  if (comparison === 0) {
@@ -24060,9 +23889,9 @@ const SemVer$m = semver$3;
24060
23889
  const patch$3 = (a, loose) => new SemVer$m(a, loose).patch;
24061
23890
  var patch_1$1 = patch$3;
24062
23891
 
24063
- const parse$c = parse_1$1;
23892
+ const parse$a = parse_1$1;
24064
23893
  const prerelease$3 = (version, options) => {
24065
- const parsed = parse$c(version, options);
23894
+ const parsed = parse$a(version, options);
24066
23895
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
24067
23896
  };
24068
23897
  var prerelease_1$1 = prerelease$3;
@@ -24175,7 +24004,7 @@ const cmp$3 = (a, op, b, loose) => {
24175
24004
  var cmp_1$1 = cmp$3;
24176
24005
 
24177
24006
  const SemVer$j = semver$3;
24178
- const parse$b = parse_1$1;
24007
+ const parse$9 = parse_1$1;
24179
24008
  const { safeRe: re$3, t: t$2 } = reExports$1;
24180
24009
 
24181
24010
  const coerce$3 = (version, options) => {
@@ -24231,50 +24060,59 @@ const coerce$3 = (version, options) => {
24231
24060
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
24232
24061
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
24233
24062
 
24234
- return parse$b(`${major}.${minor}.${patch}${prerelease}${build}`, options)
24063
+ return parse$9(`${major}.${minor}.${patch}${prerelease}${build}`, options)
24235
24064
  };
24236
24065
  var coerce_1$1 = coerce$3;
24237
24066
 
24238
- let LRUCache$1 = class LRUCache {
24239
- constructor () {
24240
- this.max = 1000;
24241
- this.map = new Map();
24242
- }
24067
+ var lrucache$1;
24068
+ var hasRequiredLrucache;
24243
24069
 
24244
- get (key) {
24245
- const value = this.map.get(key);
24246
- if (value === undefined) {
24247
- return undefined
24248
- } else {
24249
- // Remove the key from the map and add it to the end
24250
- this.map.delete(key);
24251
- this.map.set(key, value);
24252
- return value
24253
- }
24254
- }
24070
+ function requireLrucache () {
24071
+ if (hasRequiredLrucache) return lrucache$1;
24072
+ hasRequiredLrucache = 1;
24255
24073
 
24256
- delete (key) {
24257
- return this.map.delete(key)
24258
- }
24074
+ class LRUCache {
24075
+ constructor () {
24076
+ this.max = 1000;
24077
+ this.map = new Map();
24078
+ }
24259
24079
 
24260
- set (key, value) {
24261
- const deleted = this.delete(key);
24080
+ get (key) {
24081
+ const value = this.map.get(key);
24082
+ if (value === undefined) {
24083
+ return undefined
24084
+ } else {
24085
+ // Remove the key from the map and add it to the end
24086
+ this.map.delete(key);
24087
+ this.map.set(key, value);
24088
+ return value
24089
+ }
24090
+ }
24262
24091
 
24263
- if (!deleted && value !== undefined) {
24264
- // If cache is full, delete the least recently used item
24265
- if (this.map.size >= this.max) {
24266
- const firstKey = this.map.keys().next().value;
24267
- this.delete(firstKey);
24268
- }
24092
+ delete (key) {
24093
+ return this.map.delete(key)
24094
+ }
24269
24095
 
24270
- this.map.set(key, value);
24271
- }
24096
+ set (key, value) {
24097
+ const deleted = this.delete(key);
24272
24098
 
24273
- return this
24274
- }
24275
- };
24099
+ if (!deleted && value !== undefined) {
24100
+ // If cache is full, delete the least recently used item
24101
+ if (this.map.size >= this.max) {
24102
+ const firstKey = this.map.keys().next().value;
24103
+ this.delete(firstKey);
24104
+ }
24105
+
24106
+ this.map.set(key, value);
24107
+ }
24276
24108
 
24277
- var lrucache$1 = LRUCache$1;
24109
+ return this
24110
+ }
24111
+ }
24112
+
24113
+ lrucache$1 = LRUCache;
24114
+ return lrucache$1;
24115
+ }
24278
24116
 
24279
24117
  var range$1;
24280
24118
  var hasRequiredRange$1;
@@ -24497,7 +24335,7 @@ function requireRange$1 () {
24497
24335
 
24498
24336
  range$1 = Range;
24499
24337
 
24500
- const LRU = lrucache$1;
24338
+ const LRU = requireLrucache();
24501
24339
  const cache = new LRU();
24502
24340
 
24503
24341
  const parseOptions = parseOptions_1$1;
@@ -25536,7 +25374,7 @@ const internalRe$1 = reExports$1;
25536
25374
  const constants$2 = constants$3;
25537
25375
  const SemVer$e = semver$3;
25538
25376
  const identifiers$2 = identifiers$3;
25539
- const parse$a = parse_1$1;
25377
+ const parse$8 = parse_1$1;
25540
25378
  const valid$3 = valid_1$1;
25541
25379
  const clean$2 = clean_1$1;
25542
25380
  const inc$2 = inc_1$1;
@@ -25574,7 +25412,7 @@ const intersects$2 = intersects_1$1;
25574
25412
  const simplifyRange$1 = simplify$1;
25575
25413
  const subset$2 = subset_1$1;
25576
25414
  var semver$2 = {
25577
- parse: parse$a,
25415
+ parse: parse$8,
25578
25416
  valid: valid$3,
25579
25417
  clean: clean$2,
25580
25418
  inc: inc$2,
@@ -25988,7 +25826,7 @@ var RequireInTheMiddleSingleton$1 = /** @class */ (function () {
25988
25826
  }
25989
25827
  RequireInTheMiddleSingleton.prototype._initialize = function () {
25990
25828
  var _this = this;
25991
- new Hook_1$4(
25829
+ new Hook_1$1(
25992
25830
  // Intercept all `require` calls; we will filter the matching ones below
25993
25831
  null, { internals: true }, function (exports, name, basedir) {
25994
25832
  var e_1, _a;
@@ -26052,248 +25890,11 @@ var RequireInTheMiddleSingleton$1 = /** @class */ (function () {
26052
25890
  * @returns {string} Normalized module name or path
26053
25891
  */
26054
25892
  function normalizePathSeparators$1(moduleNameOrPath) {
26055
- return path$7.sep !== ModuleNameSeparator$1
26056
- ? moduleNameOrPath.split(path$7.sep).join(ModuleNameSeparator$1)
25893
+ return path$4.sep !== ModuleNameSeparator$1
25894
+ ? moduleNameOrPath.split(path$4.sep).join(ModuleNameSeparator$1)
26057
25895
  : moduleNameOrPath;
26058
25896
  }
26059
25897
 
26060
- var importInTheMiddle$1 = {exports: {}};
26061
-
26062
- var register$3 = {};
26063
-
26064
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
26065
- //
26066
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
26067
-
26068
- const importHooks$3 = []; // TODO should this be a Set?
26069
- const setters$1 = new WeakMap();
26070
- const getters$1 = new WeakMap();
26071
- const specifiers$3 = new Map();
26072
- const toHook$3 = [];
26073
-
26074
- const proxyHandler$1 = {
26075
- set (target, name, value) {
26076
- return setters$1.get(target)[name](value)
26077
- },
26078
-
26079
- get (target, name) {
26080
- if (name === Symbol.toStringTag) {
26081
- return 'Module'
26082
- }
26083
-
26084
- const getter = getters$1.get(target)[name];
26085
-
26086
- if (typeof getter === 'function') {
26087
- return getter()
26088
- }
26089
- },
26090
-
26091
- defineProperty (target, property, descriptor) {
26092
- if ((!('value' in descriptor))) {
26093
- throw new Error('Getters/setters are not supported for exports property descriptors.')
26094
- }
26095
-
26096
- return setters$1.get(target)[property](descriptor.value)
26097
- }
26098
- };
26099
-
26100
- function register$2 (name, namespace, set, get, specifier) {
26101
- specifiers$3.set(name, specifier);
26102
- setters$1.set(namespace, set);
26103
- getters$1.set(namespace, get);
26104
- const proxy = new Proxy(namespace, proxyHandler$1);
26105
- importHooks$3.forEach(hook => hook(name, proxy));
26106
- toHook$3.push([name, proxy]);
26107
- }
26108
-
26109
- let experimentalPatchInternals$1 = false;
26110
-
26111
- function getExperimentalPatchInternals$3 () {
26112
- return experimentalPatchInternals$1
26113
- }
26114
-
26115
- function setExperimentalPatchInternals$1 (value) {
26116
- experimentalPatchInternals$1 = value;
26117
- }
26118
-
26119
- register$3.register = register$2;
26120
- register$3.importHooks = importHooks$3;
26121
- register$3.specifiers = specifiers$3;
26122
- register$3.toHook = toHook$3;
26123
- register$3.getExperimentalPatchInternals = getExperimentalPatchInternals$3;
26124
- register$3.setExperimentalPatchInternals = setExperimentalPatchInternals$1;
26125
-
26126
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
26127
- //
26128
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
26129
-
26130
- const path$1 = path__default;
26131
- const parse$9 = moduleDetailsFromPath$1;
26132
- const { fileURLToPath: fileURLToPath$1 } = require$$2__default;
26133
- const { MessageChannel: MessageChannel$1 } = require$$3;
26134
-
26135
- const {
26136
- importHooks: importHooks$2,
26137
- specifiers: specifiers$2,
26138
- toHook: toHook$2,
26139
- getExperimentalPatchInternals: getExperimentalPatchInternals$2
26140
- } = register$3;
26141
-
26142
- function addHook$1 (hook) {
26143
- importHooks$2.push(hook);
26144
- toHook$2.forEach(([name, namespace]) => hook(name, namespace));
26145
- }
26146
-
26147
- function removeHook$1 (hook) {
26148
- const index = importHooks$2.indexOf(hook);
26149
- if (index > -1) {
26150
- importHooks$2.splice(index, 1);
26151
- }
26152
- }
26153
-
26154
- function callHookFn$1 (hookFn, namespace, name, baseDir) {
26155
- const newDefault = hookFn(namespace, name, baseDir);
26156
- if (newDefault && newDefault !== namespace) {
26157
- namespace.default = newDefault;
26158
- }
26159
- }
26160
-
26161
- let sendModulesToLoader$1;
26162
-
26163
- /**
26164
- * EXPERIMENTAL
26165
- * This feature is experimental and may change in minor versions.
26166
- * **NOTE** This feature is incompatible with the {internals: true} Hook option.
26167
- *
26168
- * Creates a message channel with a port that can be used to add hooks to the
26169
- * list of exclusively included modules.
26170
- *
26171
- * This can be used to only wrap modules that are Hook'ed, however modules need
26172
- * to be hooked before they are imported.
26173
- *
26174
- * ```ts
26175
- * import { register } from 'module'
26176
- * import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
26177
- *
26178
- * const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
26179
- *
26180
- * register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
26181
- *
26182
- * Hook(['fs'], (exported, name, baseDir) => {
26183
- * // Instrument the fs module
26184
- * })
26185
- *
26186
- * // Ensure that the loader has acknowledged all the modules
26187
- * // before we allow execution to continue
26188
- * await waitForAllMessagesAcknowledged()
26189
- * ```
26190
- */
26191
- function createAddHookMessageChannel$1 () {
26192
- const { port1, port2 } = new MessageChannel$1();
26193
- let pendingAckCount = 0;
26194
- let resolveFn;
26195
-
26196
- sendModulesToLoader$1 = (modules) => {
26197
- pendingAckCount++;
26198
- port1.postMessage(modules);
26199
- };
26200
-
26201
- port1.on('message', () => {
26202
- pendingAckCount--;
26203
-
26204
- if (resolveFn && pendingAckCount <= 0) {
26205
- resolveFn();
26206
- }
26207
- }).unref();
26208
-
26209
- function waitForAllMessagesAcknowledged () {
26210
- // This timer is to prevent the process from exiting with code 13:
26211
- // 13: Unsettled Top-Level Await.
26212
- const timer = setInterval(() => { }, 1000);
26213
- const promise = new Promise((resolve) => {
26214
- resolveFn = resolve;
26215
- }).then(() => { clearInterval(timer); });
26216
-
26217
- if (pendingAckCount === 0) {
26218
- resolveFn();
26219
- }
26220
-
26221
- return promise
26222
- }
26223
-
26224
- const addHookMessagePort = port2;
26225
- const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
26226
-
26227
- return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
26228
- }
26229
-
26230
- function Hook$1 (modules, options, hookFn) {
26231
- if ((this instanceof Hook$1) === false) return new Hook$1(modules, options, hookFn)
26232
- if (typeof modules === 'function') {
26233
- hookFn = modules;
26234
- modules = null;
26235
- options = null;
26236
- } else if (typeof options === 'function') {
26237
- hookFn = options;
26238
- options = null;
26239
- }
26240
- const internals = options ? options.internals === true : false;
26241
-
26242
- if (sendModulesToLoader$1 && Array.isArray(modules)) {
26243
- sendModulesToLoader$1(modules);
26244
- }
26245
-
26246
- this._iitmHook = (name, namespace) => {
26247
- const filename = name;
26248
- const isBuiltin = name.startsWith('node:');
26249
- let baseDir;
26250
-
26251
- if (isBuiltin) {
26252
- name = name.replace(/^node:/, '');
26253
- } else {
26254
- if (name.startsWith('file://')) {
26255
- try {
26256
- name = fileURLToPath$1(name);
26257
- } catch (e) {}
26258
- }
26259
- const details = parse$9(name);
26260
- if (details) {
26261
- name = details.name;
26262
- baseDir = details.basedir;
26263
- }
26264
- }
26265
-
26266
- if (modules) {
26267
- for (const moduleName of modules) {
26268
- if (moduleName === name) {
26269
- if (baseDir) {
26270
- if (internals) {
26271
- name = name + path$1.sep + path$1.relative(baseDir, fileURLToPath$1(filename));
26272
- } else {
26273
- if (!getExperimentalPatchInternals$2() && !baseDir.endsWith(specifiers$2.get(filename))) continue
26274
- }
26275
- }
26276
- callHookFn$1(hookFn, namespace, name, baseDir);
26277
- }
26278
- }
26279
- } else {
26280
- callHookFn$1(hookFn, namespace, name, baseDir);
26281
- }
26282
- };
26283
-
26284
- addHook$1(this._iitmHook);
26285
- }
26286
-
26287
- Hook$1.prototype.unhook = function () {
26288
- removeHook$1(this._iitmHook);
26289
- };
26290
-
26291
- importInTheMiddle$1.exports = Hook$1;
26292
- var Hook_1$1 = importInTheMiddle$1.exports.Hook = Hook$1;
26293
- importInTheMiddle$1.exports.addHook = addHook$1;
26294
- importInTheMiddle$1.exports.removeHook = removeHook$1;
26295
- importInTheMiddle$1.exports.createAddHookMessageChannel = createAddHookMessageChannel$1;
26296
-
26297
25898
  /*
26298
25899
  * Copyright The OpenTelemetry Authors
26299
25900
  *
@@ -26500,7 +26101,7 @@ var InstrumentationBase$1 = /** @class */ (function (_super) {
26500
26101
  };
26501
26102
  InstrumentationBase.prototype._extractPackageVersion = function (baseDir) {
26502
26103
  try {
26503
- var json = readFileSync(path$7.join(baseDir, 'package.json'), {
26104
+ var json = readFileSync(path$4.join(baseDir, 'package.json'), {
26504
26105
  encoding: 'utf8',
26505
26106
  });
26506
26107
  var version = JSON.parse(json).version;
@@ -26547,7 +26148,7 @@ var InstrumentationBase$1 = /** @class */ (function (_super) {
26547
26148
  }
26548
26149
  // internal file
26549
26150
  var files = (_a = module.files) !== null && _a !== void 0 ? _a : [];
26550
- var normalizedName = path$7.normalize(name);
26151
+ var normalizedName = path$4.normalize(name);
26551
26152
  var supportedFileInstrumentations = files
26552
26153
  .filter(function (f) { return f.name === normalizedName; })
26553
26154
  .filter(function (f) {
@@ -26629,11 +26230,11 @@ var InstrumentationBase$1 = /** @class */ (function (_super) {
26629
26230
  // `RequireInTheMiddleSingleton` does not support absolute paths.
26630
26231
  // For an absolute paths, we must create a separate instance of the
26631
26232
  // require-in-the-middle `Hook`.
26632
- var hook = path$7.isAbsolute(module_2.name)
26633
- ? new Hook_1$4([module_2.name], { internals: true }, onRequire)
26233
+ var hook = path$4.isAbsolute(module_2.name)
26234
+ ? new Hook_1$1([module_2.name], { internals: true }, onRequire)
26634
26235
  : this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
26635
26236
  this_1._hooks.push(hook);
26636
- var esmHook = new Hook_1$1([module_2.name], { internals: false }, hookFn);
26237
+ var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
26637
26238
  this_1._hooks.push(esmHook);
26638
26239
  };
26639
26240
  var this_1 = this;
@@ -26727,32 +26328,7 @@ function isSupported$1(supportedVersions, version, includePrerelease) {
26727
26328
  * See the License for the specific language governing permissions and
26728
26329
  * limitations under the License.
26729
26330
  */
26730
- var AttributeNames$1;
26731
- (function (AttributeNames) {
26732
- AttributeNames["EVENT_TYPE"] = "event_type";
26733
- AttributeNames["TARGET_ELEMENT"] = "target_element";
26734
- AttributeNames["TARGET_XPATH"] = "target_xpath";
26735
- AttributeNames["HTTP_URL"] = "http.url";
26736
- })(AttributeNames$1 || (AttributeNames$1 = {}));
26737
-
26738
- /*
26739
- * Copyright The OpenTelemetry Authors
26740
- *
26741
- * Licensed under the Apache License, Version 2.0 (the "License");
26742
- * you may not use this file except in compliance with the License.
26743
- * You may obtain a copy of the License at
26744
- *
26745
- * https://www.apache.org/licenses/LICENSE-2.0
26746
- *
26747
- * Unless required by applicable law or agreed to in writing, software
26748
- * distributed under the License is distributed on an "AS IS" BASIS,
26749
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26750
- * See the License for the specific language governing permissions and
26751
- * limitations under the License.
26752
- */
26753
- // this is autogenerated file, see scripts/version-update.js
26754
- var PACKAGE_VERSION = '0.39.0';
26755
- var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
26331
+ var otperformance$1 = performance$1;
26756
26332
 
26757
26333
  /*
26758
26334
  * Copyright The OpenTelemetry Authors
@@ -26769,7 +26345,110 @@ var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
26769
26345
  * See the License for the specific language governing permissions and
26770
26346
  * limitations under the License.
26771
26347
  */
26772
- var __extends$2 = (undefined && undefined.__extends) || (function () {
26348
+ var NANOSECOND_DIGITS$1 = 9;
26349
+ var NANOSECOND_DIGITS_IN_MILLIS$1 = 6;
26350
+ var MILLISECONDS_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS_IN_MILLIS$1);
26351
+ var SECOND_TO_NANOSECONDS$1 = Math.pow(10, NANOSECOND_DIGITS$1);
26352
+ /**
26353
+ * Converts a number of milliseconds from epoch to HrTime([seconds, remainder in nanoseconds]).
26354
+ * @param epochMillis
26355
+ */
26356
+ function millisToHrTime$1(epochMillis) {
26357
+ var epochSeconds = epochMillis / 1000;
26358
+ // Decimals only.
26359
+ var seconds = Math.trunc(epochSeconds);
26360
+ // Round sub-nanosecond accuracy to nanosecond.
26361
+ var nanos = Math.round((epochMillis % 1000) * MILLISECONDS_TO_NANOSECONDS$1);
26362
+ return [seconds, nanos];
26363
+ }
26364
+ function getTimeOrigin$1() {
26365
+ var timeOrigin = otperformance$1.timeOrigin;
26366
+ if (typeof timeOrigin !== 'number') {
26367
+ var perf = otperformance$1;
26368
+ timeOrigin = perf.timing && perf.timing.fetchStart;
26369
+ }
26370
+ return timeOrigin;
26371
+ }
26372
+ /**
26373
+ * Returns an hrtime calculated via performance component.
26374
+ * @param performanceNow
26375
+ */
26376
+ function hrTime$1(performanceNow) {
26377
+ var timeOrigin = millisToHrTime$1(getTimeOrigin$1());
26378
+ var now = millisToHrTime$1(otperformance$1.now());
26379
+ return addHrTimes$1(timeOrigin, now);
26380
+ }
26381
+ /**
26382
+ * Given 2 HrTime formatted times, return their sum as an HrTime.
26383
+ */
26384
+ function addHrTimes$1(time1, time2) {
26385
+ var out = [time1[0] + time2[0], time1[1] + time2[1]];
26386
+ // Nanoseconds
26387
+ if (out[1] >= SECOND_TO_NANOSECONDS$1) {
26388
+ out[1] -= SECOND_TO_NANOSECONDS$1;
26389
+ out[0] += 1;
26390
+ }
26391
+ return out;
26392
+ }
26393
+
26394
+ /*
26395
+ * Copyright The OpenTelemetry Authors
26396
+ *
26397
+ * Licensed under the Apache License, Version 2.0 (the "License");
26398
+ * you may not use this file except in compliance with the License.
26399
+ * You may obtain a copy of the License at
26400
+ *
26401
+ * https://www.apache.org/licenses/LICENSE-2.0
26402
+ *
26403
+ * Unless required by applicable law or agreed to in writing, software
26404
+ * distributed under the License is distributed on an "AS IS" BASIS,
26405
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26406
+ * See the License for the specific language governing permissions and
26407
+ * limitations under the License.
26408
+ */
26409
+ var AttributeNames$1;
26410
+ (function (AttributeNames) {
26411
+ AttributeNames["EVENT_TYPE"] = "event_type";
26412
+ AttributeNames["TARGET_ELEMENT"] = "target_element";
26413
+ AttributeNames["TARGET_XPATH"] = "target_xpath";
26414
+ AttributeNames["HTTP_URL"] = "http.url";
26415
+ })(AttributeNames$1 || (AttributeNames$1 = {}));
26416
+
26417
+ /*
26418
+ * Copyright The OpenTelemetry Authors
26419
+ *
26420
+ * Licensed under the Apache License, Version 2.0 (the "License");
26421
+ * you may not use this file except in compliance with the License.
26422
+ * You may obtain a copy of the License at
26423
+ *
26424
+ * https://www.apache.org/licenses/LICENSE-2.0
26425
+ *
26426
+ * Unless required by applicable law or agreed to in writing, software
26427
+ * distributed under the License is distributed on an "AS IS" BASIS,
26428
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26429
+ * See the License for the specific language governing permissions and
26430
+ * limitations under the License.
26431
+ */
26432
+ // this is autogenerated file, see scripts/version-update.js
26433
+ var PACKAGE_VERSION = '0.39.0';
26434
+ var PACKAGE_NAME = '@opentelemetry/instrumentation-user-interaction';
26435
+
26436
+ /*
26437
+ * Copyright The OpenTelemetry Authors
26438
+ *
26439
+ * Licensed under the Apache License, Version 2.0 (the "License");
26440
+ * you may not use this file except in compliance with the License.
26441
+ * You may obtain a copy of the License at
26442
+ *
26443
+ * https://www.apache.org/licenses/LICENSE-2.0
26444
+ *
26445
+ * Unless required by applicable law or agreed to in writing, software
26446
+ * distributed under the License is distributed on an "AS IS" BASIS,
26447
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
26448
+ * See the License for the specific language governing permissions and
26449
+ * limitations under the License.
26450
+ */
26451
+ var __extends$2 = (undefined && undefined.__extends) || (function () {
26773
26452
  var extendStatics = function (d, b) {
26774
26453
  extendStatics = Object.setPrototypeOf ||
26775
26454
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
@@ -26828,7 +26507,7 @@ var UserInteractionInstrumentation = /** @class */ (function (_super) {
26828
26507
  var spanData = this._spansData.get(span);
26829
26508
  if (spanData) {
26830
26509
  if (task.source === 'setTimeout') {
26831
- spanData.hrTimeLastTimeout = hrTime$2();
26510
+ spanData.hrTimeLastTimeout = hrTime$1();
26832
26511
  }
26833
26512
  else if (task.source !== 'Promise.then' &&
26834
26513
  task.source !== 'setTimeout') {
@@ -28138,7 +27817,7 @@ let SemVer$d = class SemVer {
28138
27817
  var semver$1 = SemVer$d;
28139
27818
 
28140
27819
  const SemVer$c = semver$1;
28141
- const parse$8 = (version, options, throwErrors = false) => {
27820
+ const parse$7 = (version, options, throwErrors = false) => {
28142
27821
  if (version instanceof SemVer$c) {
28143
27822
  return version
28144
27823
  }
@@ -28152,18 +27831,18 @@ const parse$8 = (version, options, throwErrors = false) => {
28152
27831
  }
28153
27832
  };
28154
27833
 
28155
- var parse_1 = parse$8;
27834
+ var parse_1 = parse$7;
28156
27835
 
28157
- const parse$7 = parse_1;
27836
+ const parse$6 = parse_1;
28158
27837
  const valid$2 = (version, options) => {
28159
- const v = parse$7(version, options);
27838
+ const v = parse$6(version, options);
28160
27839
  return v ? v.version : null
28161
27840
  };
28162
27841
  var valid_1 = valid$2;
28163
27842
 
28164
- const parse$6 = parse_1;
27843
+ const parse$5 = parse_1;
28165
27844
  const clean$1 = (version, options) => {
28166
- const s = parse$6(version.trim().replace(/^[=v]+/, ''), options);
27845
+ const s = parse$5(version.trim().replace(/^[=v]+/, ''), options);
28167
27846
  return s ? s.version : null
28168
27847
  };
28169
27848
  var clean_1 = clean$1;
@@ -28188,11 +27867,11 @@ const inc$1 = (version, release, options, identifier, identifierBase) => {
28188
27867
  };
28189
27868
  var inc_1 = inc$1;
28190
27869
 
28191
- const parse$5 = parse_1;
27870
+ const parse$4 = parse_1;
28192
27871
 
28193
27872
  const diff$1 = (version1, version2) => {
28194
- const v1 = parse$5(version1, null, true);
28195
- const v2 = parse$5(version2, null, true);
27873
+ const v1 = parse$4(version1, null, true);
27874
+ const v2 = parse$4(version2, null, true);
28196
27875
  const comparison = v1.compare(v2);
28197
27876
 
28198
27877
  if (comparison === 0) {
@@ -28259,9 +27938,9 @@ const SemVer$8 = semver$1;
28259
27938
  const patch$1 = (a, loose) => new SemVer$8(a, loose).patch;
28260
27939
  var patch_1 = patch$1;
28261
27940
 
28262
- const parse$4 = parse_1;
27941
+ const parse$3 = parse_1;
28263
27942
  const prerelease$1 = (version, options) => {
28264
- const parsed = parse$4(version, options);
27943
+ const parsed = parse$3(version, options);
28265
27944
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
28266
27945
  };
28267
27946
  var prerelease_1 = prerelease$1;
@@ -28374,7 +28053,7 @@ const cmp$1 = (a, op, b, loose) => {
28374
28053
  var cmp_1 = cmp$1;
28375
28054
 
28376
28055
  const SemVer$5 = semver$1;
28377
- const parse$3 = parse_1;
28056
+ const parse$2 = parse_1;
28378
28057
  const { safeRe: re, t } = reExports;
28379
28058
 
28380
28059
  const coerce$1 = (version, options) => {
@@ -28430,7 +28109,7 @@ const coerce$1 = (version, options) => {
28430
28109
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : '';
28431
28110
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : '';
28432
28111
 
28433
- return parse$3(`${major}.${minor}.${patch}${prerelease}${build}`, options)
28112
+ return parse$2(`${major}.${minor}.${patch}${prerelease}${build}`, options)
28434
28113
  };
28435
28114
  var coerce_1 = coerce$1;
28436
28115
 
@@ -29735,7 +29414,7 @@ const internalRe = reExports;
29735
29414
  const constants = constants$1;
29736
29415
  const SemVer = semver$1;
29737
29416
  const identifiers = identifiers$1;
29738
- const parse$2 = parse_1;
29417
+ const parse$1 = parse_1;
29739
29418
  const valid = valid_1;
29740
29419
  const clean = clean_1;
29741
29420
  const inc = inc_1;
@@ -29773,7 +29452,7 @@ const intersects = intersects_1;
29773
29452
  const simplifyRange = simplify;
29774
29453
  const subset = subset_1;
29775
29454
  var semver = {
29776
- parse: parse$2,
29455
+ parse: parse$1,
29777
29456
  valid,
29778
29457
  clean,
29779
29458
  inc,
@@ -30187,7 +29866,7 @@ var RequireInTheMiddleSingleton = /** @class */ (function () {
30187
29866
  }
30188
29867
  RequireInTheMiddleSingleton.prototype._initialize = function () {
30189
29868
  var _this = this;
30190
- new Hook_1$4(
29869
+ new Hook_1$1(
30191
29870
  // Intercept all `require` calls; we will filter the matching ones below
30192
29871
  null, { internals: true }, function (exports, name, basedir) {
30193
29872
  var e_1, _a;
@@ -30251,248 +29930,11 @@ var RequireInTheMiddleSingleton = /** @class */ (function () {
30251
29930
  * @returns {string} Normalized module name or path
30252
29931
  */
30253
29932
  function normalizePathSeparators(moduleNameOrPath) {
30254
- return path$7.sep !== ModuleNameSeparator
30255
- ? moduleNameOrPath.split(path$7.sep).join(ModuleNameSeparator)
29933
+ return path$4.sep !== ModuleNameSeparator
29934
+ ? moduleNameOrPath.split(path$4.sep).join(ModuleNameSeparator)
30256
29935
  : moduleNameOrPath;
30257
29936
  }
30258
29937
 
30259
- var importInTheMiddle = {exports: {}};
30260
-
30261
- var register$1 = {};
30262
-
30263
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
30264
- //
30265
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
30266
-
30267
- const importHooks$1 = []; // TODO should this be a Set?
30268
- const setters = new WeakMap();
30269
- const getters = new WeakMap();
30270
- const specifiers$1 = new Map();
30271
- const toHook$1 = [];
30272
-
30273
- const proxyHandler = {
30274
- set (target, name, value) {
30275
- return setters.get(target)[name](value)
30276
- },
30277
-
30278
- get (target, name) {
30279
- if (name === Symbol.toStringTag) {
30280
- return 'Module'
30281
- }
30282
-
30283
- const getter = getters.get(target)[name];
30284
-
30285
- if (typeof getter === 'function') {
30286
- return getter()
30287
- }
30288
- },
30289
-
30290
- defineProperty (target, property, descriptor) {
30291
- if ((!('value' in descriptor))) {
30292
- throw new Error('Getters/setters are not supported for exports property descriptors.')
30293
- }
30294
-
30295
- return setters.get(target)[property](descriptor.value)
30296
- }
30297
- };
30298
-
30299
- function register (name, namespace, set, get, specifier) {
30300
- specifiers$1.set(name, specifier);
30301
- setters.set(namespace, set);
30302
- getters.set(namespace, get);
30303
- const proxy = new Proxy(namespace, proxyHandler);
30304
- importHooks$1.forEach(hook => hook(name, proxy));
30305
- toHook$1.push([name, proxy]);
30306
- }
30307
-
30308
- let experimentalPatchInternals = false;
30309
-
30310
- function getExperimentalPatchInternals$1 () {
30311
- return experimentalPatchInternals
30312
- }
30313
-
30314
- function setExperimentalPatchInternals (value) {
30315
- experimentalPatchInternals = value;
30316
- }
30317
-
30318
- register$1.register = register;
30319
- register$1.importHooks = importHooks$1;
30320
- register$1.specifiers = specifiers$1;
30321
- register$1.toHook = toHook$1;
30322
- register$1.getExperimentalPatchInternals = getExperimentalPatchInternals$1;
30323
- register$1.setExperimentalPatchInternals = setExperimentalPatchInternals;
30324
-
30325
- // Unless explicitly stated otherwise all files in this repository are licensed under the Apache 2.0 License.
30326
- //
30327
- // This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2021 Datadog, Inc.
30328
-
30329
- const path = path__default;
30330
- const parse$1 = moduleDetailsFromPath$1;
30331
- const { fileURLToPath } = require$$2__default;
30332
- const { MessageChannel } = require$$3;
30333
-
30334
- const {
30335
- importHooks,
30336
- specifiers,
30337
- toHook,
30338
- getExperimentalPatchInternals
30339
- } = register$1;
30340
-
30341
- function addHook (hook) {
30342
- importHooks.push(hook);
30343
- toHook.forEach(([name, namespace]) => hook(name, namespace));
30344
- }
30345
-
30346
- function removeHook (hook) {
30347
- const index = importHooks.indexOf(hook);
30348
- if (index > -1) {
30349
- importHooks.splice(index, 1);
30350
- }
30351
- }
30352
-
30353
- function callHookFn (hookFn, namespace, name, baseDir) {
30354
- const newDefault = hookFn(namespace, name, baseDir);
30355
- if (newDefault && newDefault !== namespace) {
30356
- namespace.default = newDefault;
30357
- }
30358
- }
30359
-
30360
- let sendModulesToLoader;
30361
-
30362
- /**
30363
- * EXPERIMENTAL
30364
- * This feature is experimental and may change in minor versions.
30365
- * **NOTE** This feature is incompatible with the {internals: true} Hook option.
30366
- *
30367
- * Creates a message channel with a port that can be used to add hooks to the
30368
- * list of exclusively included modules.
30369
- *
30370
- * This can be used to only wrap modules that are Hook'ed, however modules need
30371
- * to be hooked before they are imported.
30372
- *
30373
- * ```ts
30374
- * import { register } from 'module'
30375
- * import { Hook, createAddHookMessageChannel } from 'import-in-the-middle'
30376
- *
30377
- * const { registerOptions, waitForAllMessagesAcknowledged } = createAddHookMessageChannel()
30378
- *
30379
- * register('import-in-the-middle/hook.mjs', import.meta.url, registerOptions)
30380
- *
30381
- * Hook(['fs'], (exported, name, baseDir) => {
30382
- * // Instrument the fs module
30383
- * })
30384
- *
30385
- * // Ensure that the loader has acknowledged all the modules
30386
- * // before we allow execution to continue
30387
- * await waitForAllMessagesAcknowledged()
30388
- * ```
30389
- */
30390
- function createAddHookMessageChannel () {
30391
- const { port1, port2 } = new MessageChannel();
30392
- let pendingAckCount = 0;
30393
- let resolveFn;
30394
-
30395
- sendModulesToLoader = (modules) => {
30396
- pendingAckCount++;
30397
- port1.postMessage(modules);
30398
- };
30399
-
30400
- port1.on('message', () => {
30401
- pendingAckCount--;
30402
-
30403
- if (resolveFn && pendingAckCount <= 0) {
30404
- resolveFn();
30405
- }
30406
- }).unref();
30407
-
30408
- function waitForAllMessagesAcknowledged () {
30409
- // This timer is to prevent the process from exiting with code 13:
30410
- // 13: Unsettled Top-Level Await.
30411
- const timer = setInterval(() => { }, 1000);
30412
- const promise = new Promise((resolve) => {
30413
- resolveFn = resolve;
30414
- }).then(() => { clearInterval(timer); });
30415
-
30416
- if (pendingAckCount === 0) {
30417
- resolveFn();
30418
- }
30419
-
30420
- return promise
30421
- }
30422
-
30423
- const addHookMessagePort = port2;
30424
- const registerOptions = { data: { addHookMessagePort, include: [] }, transferList: [addHookMessagePort] };
30425
-
30426
- return { registerOptions, addHookMessagePort, waitForAllMessagesAcknowledged }
30427
- }
30428
-
30429
- function Hook (modules, options, hookFn) {
30430
- if ((this instanceof Hook) === false) return new Hook(modules, options, hookFn)
30431
- if (typeof modules === 'function') {
30432
- hookFn = modules;
30433
- modules = null;
30434
- options = null;
30435
- } else if (typeof options === 'function') {
30436
- hookFn = options;
30437
- options = null;
30438
- }
30439
- const internals = options ? options.internals === true : false;
30440
-
30441
- if (sendModulesToLoader && Array.isArray(modules)) {
30442
- sendModulesToLoader(modules);
30443
- }
30444
-
30445
- this._iitmHook = (name, namespace) => {
30446
- const filename = name;
30447
- const isBuiltin = name.startsWith('node:');
30448
- let baseDir;
30449
-
30450
- if (isBuiltin) {
30451
- name = name.replace(/^node:/, '');
30452
- } else {
30453
- if (name.startsWith('file://')) {
30454
- try {
30455
- name = fileURLToPath(name);
30456
- } catch (e) {}
30457
- }
30458
- const details = parse$1(name);
30459
- if (details) {
30460
- name = details.name;
30461
- baseDir = details.basedir;
30462
- }
30463
- }
30464
-
30465
- if (modules) {
30466
- for (const moduleName of modules) {
30467
- if (moduleName === name) {
30468
- if (baseDir) {
30469
- if (internals) {
30470
- name = name + path.sep + path.relative(baseDir, fileURLToPath(filename));
30471
- } else {
30472
- if (!getExperimentalPatchInternals() && !baseDir.endsWith(specifiers.get(filename))) continue
30473
- }
30474
- }
30475
- callHookFn(hookFn, namespace, name, baseDir);
30476
- }
30477
- }
30478
- } else {
30479
- callHookFn(hookFn, namespace, name, baseDir);
30480
- }
30481
- };
30482
-
30483
- addHook(this._iitmHook);
30484
- }
30485
-
30486
- Hook.prototype.unhook = function () {
30487
- removeHook(this._iitmHook);
30488
- };
30489
-
30490
- importInTheMiddle.exports = Hook;
30491
- var Hook_1 = importInTheMiddle.exports.Hook = Hook;
30492
- importInTheMiddle.exports.addHook = addHook;
30493
- importInTheMiddle.exports.removeHook = removeHook;
30494
- importInTheMiddle.exports.createAddHookMessageChannel = createAddHookMessageChannel;
30495
-
30496
29938
  /*
30497
29939
  * Copyright The OpenTelemetry Authors
30498
29940
  *
@@ -30719,7 +30161,7 @@ var InstrumentationBase = /** @class */ (function (_super) {
30719
30161
  };
30720
30162
  InstrumentationBase.prototype._extractPackageVersion = function (baseDir) {
30721
30163
  try {
30722
- var json = readFileSync(path$7.join(baseDir, 'package.json'), {
30164
+ var json = readFileSync(path$4.join(baseDir, 'package.json'), {
30723
30165
  encoding: 'utf8',
30724
30166
  });
30725
30167
  var version = JSON.parse(json).version;
@@ -30766,7 +30208,7 @@ var InstrumentationBase = /** @class */ (function (_super) {
30766
30208
  }
30767
30209
  // internal file
30768
30210
  var files = (_a = module.files) !== null && _a !== void 0 ? _a : [];
30769
- var normalizedName = path$7.normalize(name);
30211
+ var normalizedName = path$4.normalize(name);
30770
30212
  var supportedFileInstrumentations = files
30771
30213
  .filter(function (f) { return f.name === normalizedName; })
30772
30214
  .filter(function (f) {
@@ -30848,8 +30290,8 @@ var InstrumentationBase = /** @class */ (function (_super) {
30848
30290
  // `RequireInTheMiddleSingleton` does not support absolute paths.
30849
30291
  // For an absolute paths, we must create a separate instance of the
30850
30292
  // require-in-the-middle `Hook`.
30851
- var hook = path$7.isAbsolute(module_2.name)
30852
- ? new Hook_1$4([module_2.name], { internals: true }, onRequire)
30293
+ var hook = path$4.isAbsolute(module_2.name)
30294
+ ? new Hook_1$1([module_2.name], { internals: true }, onRequire)
30853
30295
  : this_1._requireInTheMiddleSingleton.register(module_2.name, onRequire);
30854
30296
  this_1._hooks.push(hook);
30855
30297
  var esmHook = new Hook_1([module_2.name], { internals: false }, hookFn);
@@ -30948,66 +30390,6 @@ function isSupported(supportedVersions, version, includePrerelease) {
30948
30390
  */
30949
30391
  var otperformance = performance$1;
30950
30392
 
30951
- /*
30952
- * Copyright The OpenTelemetry Authors
30953
- *
30954
- * Licensed under the Apache License, Version 2.0 (the "License");
30955
- * you may not use this file except in compliance with the License.
30956
- * You may obtain a copy of the License at
30957
- *
30958
- * https://www.apache.org/licenses/LICENSE-2.0
30959
- *
30960
- * Unless required by applicable law or agreed to in writing, software
30961
- * distributed under the License is distributed on an "AS IS" BASIS,
30962
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30963
- * See the License for the specific language governing permissions and
30964
- * limitations under the License.
30965
- */
30966
- var TMP_HTTP_METHOD = 'http.method';
30967
- var TMP_HTTP_URL = 'http.url';
30968
- var TMP_HTTP_HOST = 'http.host';
30969
- var TMP_HTTP_SCHEME = 'http.scheme';
30970
- var TMP_HTTP_STATUS_CODE = 'http.status_code';
30971
- var TMP_HTTP_USER_AGENT = 'http.user_agent';
30972
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH = 'http.response_content_length';
30973
- var TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = 'http.response_content_length_uncompressed';
30974
- /**
30975
- * HTTP request method.
30976
- */
30977
- var SEMATTRS_HTTP_METHOD = TMP_HTTP_METHOD;
30978
- /**
30979
- * Full HTTP request URL in the form `scheme://host[:port]/path?query[#fragment]`. Usually the fragment is not transmitted over HTTP, but if it is known, it should be included nevertheless.
30980
- *
30981
- * Note: `http.url` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case the attribute&#39;s value should be `https://www.example.com/`.
30982
- */
30983
- var SEMATTRS_HTTP_URL = TMP_HTTP_URL;
30984
- /**
30985
- * The value of the [HTTP host header](https://tools.ietf.org/html/rfc7230#section-5.4). An empty Host header should also be reported, see note.
30986
- *
30987
- * Note: When the header is present but empty the attribute SHOULD be set to the empty string. Note that this is a valid situation that is expected in certain cases, according the aforementioned [section of RFC 7230](https://tools.ietf.org/html/rfc7230#section-5.4). When the header is not set the attribute MUST NOT be set.
30988
- */
30989
- var SEMATTRS_HTTP_HOST = TMP_HTTP_HOST;
30990
- /**
30991
- * The URI scheme identifying the used protocol.
30992
- */
30993
- var SEMATTRS_HTTP_SCHEME = TMP_HTTP_SCHEME;
30994
- /**
30995
- * [HTTP response status code](https://tools.ietf.org/html/rfc7231#section-6).
30996
- */
30997
- var SEMATTRS_HTTP_STATUS_CODE = TMP_HTTP_STATUS_CODE;
30998
- /**
30999
- * Value of the [HTTP User-Agent](https://tools.ietf.org/html/rfc7231#section-5.5.3) header sent by the client.
31000
- */
31001
- var SEMATTRS_HTTP_USER_AGENT = TMP_HTTP_USER_AGENT;
31002
- /**
31003
- * The size of the response payload body in bytes. This is the number of bytes transferred excluding headers and is often, but not always, present as the [Content-Length](https://tools.ietf.org/html/rfc7230#section-3.3.2) header. For requests using transport encoding, this should be the compressed size.
31004
- */
31005
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH = TMP_HTTP_RESPONSE_CONTENT_LENGTH;
31006
- /**
31007
- * The size of the uncompressed response payload body after transport decoding. Not set if transport encoding not used.
31008
- */
31009
- var SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED = TMP_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED;
31010
-
31011
30393
  /*
31012
30394
  * Copyright The OpenTelemetry Authors
31013
30395
  *