@nsshunt/stsobservability 1.0.2 → 1.0.3

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.
@@ -1259,18 +1259,44 @@ convertMS_fn = function(ms) {
1259
1259
  return (d + "." + pad(h) + ":" + pad(m) + ":" + pad(s)).padStart(12);
1260
1260
  };
1261
1261
  var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
1262
- function getDefaultExportFromCjs(x) {
1262
+ function getDefaultExportFromCjs$1(x) {
1263
1263
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
1264
1264
  }
1265
+ function getAugmentedNamespace(n) {
1266
+ if (n.__esModule)
1267
+ return n;
1268
+ var f = n.default;
1269
+ if (typeof f == "function") {
1270
+ var a = function a2() {
1271
+ if (this instanceof a2) {
1272
+ return Reflect.construct(f, arguments, this.constructor);
1273
+ }
1274
+ return f.apply(this, arguments);
1275
+ };
1276
+ a.prototype = f.prototype;
1277
+ } else
1278
+ a = {};
1279
+ Object.defineProperty(a, "__esModule", { value: true });
1280
+ Object.keys(n).forEach(function(k) {
1281
+ var d = Object.getOwnPropertyDescriptor(n, k);
1282
+ Object.defineProperty(a, k, d.get ? d : {
1283
+ enumerable: true,
1284
+ get: function() {
1285
+ return n[k];
1286
+ }
1287
+ });
1288
+ });
1289
+ return a;
1290
+ }
1265
1291
  var timsort$1 = {};
1266
- (function(exports) {
1292
+ (function(exports2) {
1267
1293
  (function(global2, factory) {
1268
1294
  {
1269
- factory(exports);
1295
+ factory(exports2);
1270
1296
  }
1271
- })(commonjsGlobal, function(exports2) {
1272
- exports2.__esModule = true;
1273
- exports2.sort = sort;
1297
+ })(commonjsGlobal, function(exports3) {
1298
+ exports3.__esModule = true;
1299
+ exports3.sort = sort;
1274
1300
  function _classCallCheck(instance, Constructor) {
1275
1301
  if (!(instance instanceof Constructor)) {
1276
1302
  throw new TypeError("Cannot call a class as a function");
@@ -1929,7 +1955,7 @@ function percentile(pOrPs, list, fn) {
1929
1955
  });
1930
1956
  }
1931
1957
  var lib = percentile;
1932
- const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs(lib);
1958
+ const percentile$1 = /* @__PURE__ */ getDefaultExportFromCjs$1(lib);
1933
1959
  class InstrumentGaugeOptions extends InstrumentBaseOptions {
1934
1960
  constructor() {
1935
1961
  super(...arguments);
@@ -2553,14 +2579,14 @@ class RequestLoggerMiddleware extends STSOptionsBase {
2553
2579
  }
2554
2580
  _tinyEmitter = new WeakMap();
2555
2581
  _RequestCompleted = new WeakMap();
2556
- var ansiStyles$1 = { exports: {} };
2557
- var colorName;
2558
- var hasRequiredColorName;
2559
- function requireColorName() {
2560
- if (hasRequiredColorName)
2561
- return colorName;
2562
- hasRequiredColorName = 1;
2563
- colorName = {
2582
+ var ansiStyles$3 = { exports: {} };
2583
+ var colorName$1;
2584
+ var hasRequiredColorName$1;
2585
+ function requireColorName$1() {
2586
+ if (hasRequiredColorName$1)
2587
+ return colorName$1;
2588
+ hasRequiredColorName$1 = 1;
2589
+ colorName$1 = {
2564
2590
  "aliceblue": [240, 248, 255],
2565
2591
  "antiquewhite": [250, 235, 215],
2566
2592
  "aqua": [0, 255, 255],
@@ -2710,15 +2736,15 @@ function requireColorName() {
2710
2736
  "yellow": [255, 255, 0],
2711
2737
  "yellowgreen": [154, 205, 50]
2712
2738
  };
2713
- return colorName;
2739
+ return colorName$1;
2714
2740
  }
2715
- var conversions;
2716
- var hasRequiredConversions;
2717
- function requireConversions() {
2718
- if (hasRequiredConversions)
2719
- return conversions;
2720
- hasRequiredConversions = 1;
2721
- const cssKeywords = requireColorName();
2741
+ var conversions$1;
2742
+ var hasRequiredConversions$1;
2743
+ function requireConversions$1() {
2744
+ if (hasRequiredConversions$1)
2745
+ return conversions$1;
2746
+ hasRequiredConversions$1 = 1;
2747
+ const cssKeywords = requireColorName$1();
2722
2748
  const reverseKeywords = {};
2723
2749
  for (const key of Object.keys(cssKeywords)) {
2724
2750
  reverseKeywords[cssKeywords[key]] = key;
@@ -2740,7 +2766,7 @@ function requireConversions() {
2740
2766
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
2741
2767
  gray: { channels: 1, labels: ["gray"] }
2742
2768
  };
2743
- conversions = convert;
2769
+ conversions$1 = convert;
2744
2770
  for (const model of Object.keys(convert)) {
2745
2771
  if (!("channels" in convert[model])) {
2746
2772
  throw new Error("missing channels property: " + model);
@@ -3383,15 +3409,15 @@ function requireConversions() {
3383
3409
  const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
3384
3410
  return [val / 255 * 100];
3385
3411
  };
3386
- return conversions;
3412
+ return conversions$1;
3387
3413
  }
3388
- var route;
3389
- var hasRequiredRoute;
3390
- function requireRoute() {
3391
- if (hasRequiredRoute)
3392
- return route;
3393
- hasRequiredRoute = 1;
3394
- const conversions2 = requireConversions();
3414
+ var route$1;
3415
+ var hasRequiredRoute$1;
3416
+ function requireRoute$1() {
3417
+ if (hasRequiredRoute$1)
3418
+ return route$1;
3419
+ hasRequiredRoute$1 = 1;
3420
+ const conversions2 = requireConversions$1();
3395
3421
  function buildGraph() {
3396
3422
  const graph = {};
3397
3423
  const models = Object.keys(conversions2);
@@ -3430,18 +3456,18 @@ function requireRoute() {
3430
3456
  };
3431
3457
  }
3432
3458
  function wrapConversion(toModel, graph) {
3433
- const path = [graph[toModel].parent, toModel];
3459
+ const path2 = [graph[toModel].parent, toModel];
3434
3460
  let fn = conversions2[graph[toModel].parent][toModel];
3435
3461
  let cur = graph[toModel].parent;
3436
3462
  while (graph[cur].parent) {
3437
- path.unshift(graph[cur].parent);
3463
+ path2.unshift(graph[cur].parent);
3438
3464
  fn = link(conversions2[graph[cur].parent][cur], fn);
3439
3465
  cur = graph[cur].parent;
3440
3466
  }
3441
- fn.conversion = path;
3467
+ fn.conversion = path2;
3442
3468
  return fn;
3443
3469
  }
3444
- route = function(fromModel) {
3470
+ route$1 = function(fromModel) {
3445
3471
  const graph = deriveBFS(fromModel);
3446
3472
  const conversion = {};
3447
3473
  const models = Object.keys(graph);
@@ -3455,16 +3481,16 @@ function requireRoute() {
3455
3481
  }
3456
3482
  return conversion;
3457
3483
  };
3458
- return route;
3484
+ return route$1;
3459
3485
  }
3460
- var colorConvert;
3461
- var hasRequiredColorConvert;
3462
- function requireColorConvert() {
3463
- if (hasRequiredColorConvert)
3464
- return colorConvert;
3465
- hasRequiredColorConvert = 1;
3466
- const conversions2 = requireConversions();
3467
- const route2 = requireRoute();
3486
+ var colorConvert$1;
3487
+ var hasRequiredColorConvert$1;
3488
+ function requireColorConvert$1() {
3489
+ if (hasRequiredColorConvert$1)
3490
+ return colorConvert$1;
3491
+ hasRequiredColorConvert$1 = 1;
3492
+ const conversions2 = requireConversions$1();
3493
+ const route2 = requireRoute$1();
3468
3494
  const convert = {};
3469
3495
  const models = Object.keys(conversions2);
3470
3496
  function wrapRaw(fn) {
@@ -3517,10 +3543,10 @@ function requireColorConvert() {
3517
3543
  convert[fromModel][toModel].raw = wrapRaw(fn);
3518
3544
  });
3519
3545
  });
3520
- colorConvert = convert;
3521
- return colorConvert;
3546
+ colorConvert$1 = convert;
3547
+ return colorConvert$1;
3522
3548
  }
3523
- ansiStyles$1.exports;
3549
+ ansiStyles$3.exports;
3524
3550
  (function(module) {
3525
3551
  const wrapAnsi16 = (fn, offset) => (...args) => {
3526
3552
  const code = fn(...args);
@@ -3554,16 +3580,16 @@ ansiStyles$1.exports;
3554
3580
  let colorConvert2;
3555
3581
  const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3556
3582
  if (colorConvert2 === void 0) {
3557
- colorConvert2 = requireColorConvert();
3583
+ colorConvert2 = requireColorConvert$1();
3558
3584
  }
3559
3585
  const offset = isBackground ? 10 : 0;
3560
3586
  const styles2 = {};
3561
3587
  for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3562
- const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3588
+ const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3563
3589
  if (sourceSpace === targetSpace) {
3564
- styles2[name] = wrap(identity, offset);
3590
+ styles2[name2] = wrap(identity, offset);
3565
3591
  } else if (typeof suite === "object") {
3566
- styles2[name] = wrap(suite[targetSpace], offset);
3592
+ styles2[name2] = wrap(suite[targetSpace], offset);
3567
3593
  }
3568
3594
  }
3569
3595
  return styles2;
@@ -3657,13 +3683,13 @@ ansiStyles$1.exports;
3657
3683
  enumerable: true,
3658
3684
  get: assembleStyles
3659
3685
  });
3660
- })(ansiStyles$1);
3661
- var ansiStylesExports = ansiStyles$1.exports;
3662
- var browser = {
3686
+ })(ansiStyles$3);
3687
+ var ansiStylesExports$1 = ansiStyles$3.exports;
3688
+ var browser$2 = {
3663
3689
  stdout: false,
3664
3690
  stderr: false
3665
3691
  };
3666
- const stringReplaceAll$1 = (string, substring, replacer) => {
3692
+ const stringReplaceAll$3 = (string, substring, replacer) => {
3667
3693
  let index = string.indexOf(substring);
3668
3694
  if (index === -1) {
3669
3695
  return string;
@@ -3679,7 +3705,7 @@ const stringReplaceAll$1 = (string, substring, replacer) => {
3679
3705
  returnValue += string.substr(endIndex);
3680
3706
  return returnValue;
3681
3707
  };
3682
- const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
3708
+ const stringEncaseCRLFWithFirstIndex$3 = (string, prefix, postfix, index) => {
3683
3709
  let endIndex = 0;
3684
3710
  let returnValue = "";
3685
3711
  do {
@@ -3691,16 +3717,16 @@ const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
3691
3717
  returnValue += string.substr(endIndex);
3692
3718
  return returnValue;
3693
3719
  };
3694
- var util = {
3695
- stringReplaceAll: stringReplaceAll$1,
3696
- stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
3720
+ var util$1 = {
3721
+ stringReplaceAll: stringReplaceAll$3,
3722
+ stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$3
3697
3723
  };
3698
- var templates;
3699
- var hasRequiredTemplates;
3700
- function requireTemplates() {
3701
- if (hasRequiredTemplates)
3702
- return templates;
3703
- hasRequiredTemplates = 1;
3724
+ var templates$1;
3725
+ var hasRequiredTemplates$1;
3726
+ function requireTemplates$1() {
3727
+ if (hasRequiredTemplates$1)
3728
+ return templates$1;
3729
+ hasRequiredTemplates$1 = 1;
3704
3730
  const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
3705
3731
  const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
3706
3732
  const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
@@ -3728,7 +3754,7 @@ function requireTemplates() {
3728
3754
  }
3729
3755
  return ESCAPES.get(c) || c;
3730
3756
  }
3731
- function parseArguments(name, arguments_) {
3757
+ function parseArguments(name2, arguments_) {
3732
3758
  const results = [];
3733
3759
  const chunks = arguments_.trim().split(/\s*,\s*/g);
3734
3760
  let matches;
@@ -3739,7 +3765,7 @@ function requireTemplates() {
3739
3765
  } else if (matches = chunk.match(STRING_REGEX)) {
3740
3766
  results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
3741
3767
  } else {
3742
- throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
3768
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
3743
3769
  }
3744
3770
  }
3745
3771
  return results;
@@ -3749,12 +3775,12 @@ function requireTemplates() {
3749
3775
  const results = [];
3750
3776
  let matches;
3751
3777
  while ((matches = STYLE_REGEX.exec(style)) !== null) {
3752
- const name = matches[1];
3778
+ const name2 = matches[1];
3753
3779
  if (matches[2]) {
3754
- const args = parseArguments(name, matches[2]);
3755
- results.push([name].concat(args));
3780
+ const args = parseArguments(name2, matches[2]);
3781
+ results.push([name2].concat(args));
3756
3782
  } else {
3757
- results.push([name]);
3783
+ results.push([name2]);
3758
3784
  }
3759
3785
  }
3760
3786
  return results;
@@ -3778,7 +3804,7 @@ function requireTemplates() {
3778
3804
  }
3779
3805
  return current;
3780
3806
  }
3781
- templates = (chalk2, temporary) => {
3807
+ templates$1 = (chalk2, temporary) => {
3782
3808
  const styles2 = [];
3783
3809
  const chunks = [];
3784
3810
  let chunk = [];
@@ -3808,92 +3834,92 @@ function requireTemplates() {
3808
3834
  }
3809
3835
  return chunks.join("");
3810
3836
  };
3811
- return templates;
3837
+ return templates$1;
3812
3838
  }
3813
- const ansiStyles = ansiStylesExports;
3814
- const { stdout: stdoutColor, stderr: stderrColor } = browser;
3839
+ const ansiStyles$2 = ansiStylesExports$1;
3840
+ const { stdout: stdoutColor$1, stderr: stderrColor$1 } = browser$2;
3815
3841
  const {
3816
- stringReplaceAll,
3817
- stringEncaseCRLFWithFirstIndex
3818
- } = util;
3819
- const { isArray } = Array;
3820
- const levelMapping = [
3842
+ stringReplaceAll: stringReplaceAll$2,
3843
+ stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$2
3844
+ } = util$1;
3845
+ const { isArray: isArray$1 } = Array;
3846
+ const levelMapping$1 = [
3821
3847
  "ansi",
3822
3848
  "ansi",
3823
3849
  "ansi256",
3824
3850
  "ansi16m"
3825
3851
  ];
3826
- const styles = /* @__PURE__ */ Object.create(null);
3827
- const applyOptions = (object, options = {}) => {
3852
+ const styles$1 = /* @__PURE__ */ Object.create(null);
3853
+ const applyOptions$1 = (object, options = {}) => {
3828
3854
  if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3829
3855
  throw new Error("The `level` option should be an integer from 0 to 3");
3830
3856
  }
3831
- const colorLevel = stdoutColor ? stdoutColor.level : 0;
3857
+ const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
3832
3858
  object.level = options.level === void 0 ? colorLevel : options.level;
3833
3859
  };
3834
- class ChalkClass {
3860
+ let ChalkClass$1 = class ChalkClass {
3835
3861
  constructor(options) {
3836
- return chalkFactory(options);
3862
+ return chalkFactory$1(options);
3837
3863
  }
3838
- }
3839
- const chalkFactory = (options) => {
3864
+ };
3865
+ const chalkFactory$1 = (options) => {
3840
3866
  const chalk2 = {};
3841
- applyOptions(chalk2, options);
3842
- chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
3843
- Object.setPrototypeOf(chalk2, Chalk.prototype);
3867
+ applyOptions$1(chalk2, options);
3868
+ chalk2.template = (...arguments_) => chalkTag$1(chalk2.template, ...arguments_);
3869
+ Object.setPrototypeOf(chalk2, Chalk$1.prototype);
3844
3870
  Object.setPrototypeOf(chalk2.template, chalk2);
3845
3871
  chalk2.template.constructor = () => {
3846
3872
  throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3847
3873
  };
3848
- chalk2.template.Instance = ChalkClass;
3874
+ chalk2.template.Instance = ChalkClass$1;
3849
3875
  return chalk2.template;
3850
3876
  };
3851
- function Chalk(options) {
3852
- return chalkFactory(options);
3877
+ function Chalk$1(options) {
3878
+ return chalkFactory$1(options);
3853
3879
  }
3854
- for (const [styleName, style] of Object.entries(ansiStyles)) {
3855
- styles[styleName] = {
3880
+ for (const [styleName, style] of Object.entries(ansiStyles$2)) {
3881
+ styles$1[styleName] = {
3856
3882
  get() {
3857
- const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3883
+ const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this._styler), this._isEmpty);
3858
3884
  Object.defineProperty(this, styleName, { value: builder });
3859
3885
  return builder;
3860
3886
  }
3861
3887
  };
3862
3888
  }
3863
- styles.visible = {
3889
+ styles$1.visible = {
3864
3890
  get() {
3865
- const builder = createBuilder(this, this._styler, true);
3891
+ const builder = createBuilder$1(this, this._styler, true);
3866
3892
  Object.defineProperty(this, "visible", { value: builder });
3867
3893
  return builder;
3868
3894
  }
3869
3895
  };
3870
- const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3871
- for (const model of usedModels) {
3872
- styles[model] = {
3896
+ const usedModels$1 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3897
+ for (const model of usedModels$1) {
3898
+ styles$1[model] = {
3873
3899
  get() {
3874
3900
  const { level } = this;
3875
3901
  return function(...arguments_) {
3876
- const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
3877
- return createBuilder(this, styler, this._isEmpty);
3902
+ const styler = createStyler$1(ansiStyles$2.color[levelMapping$1[level]][model](...arguments_), ansiStyles$2.color.close, this._styler);
3903
+ return createBuilder$1(this, styler, this._isEmpty);
3878
3904
  };
3879
3905
  }
3880
3906
  };
3881
3907
  }
3882
- for (const model of usedModels) {
3908
+ for (const model of usedModels$1) {
3883
3909
  const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3884
- styles[bgModel] = {
3910
+ styles$1[bgModel] = {
3885
3911
  get() {
3886
3912
  const { level } = this;
3887
3913
  return function(...arguments_) {
3888
- const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
3889
- return createBuilder(this, styler, this._isEmpty);
3914
+ const styler = createStyler$1(ansiStyles$2.bgColor[levelMapping$1[level]][model](...arguments_), ansiStyles$2.bgColor.close, this._styler);
3915
+ return createBuilder$1(this, styler, this._isEmpty);
3890
3916
  };
3891
3917
  }
3892
3918
  };
3893
3919
  }
3894
- const proto = Object.defineProperties(() => {
3920
+ const proto$1 = Object.defineProperties(() => {
3895
3921
  }, {
3896
- ...styles,
3922
+ ...styles$1,
3897
3923
  level: {
3898
3924
  enumerable: true,
3899
3925
  get() {
@@ -3904,7 +3930,7 @@ const proto = Object.defineProperties(() => {
3904
3930
  }
3905
3931
  }
3906
3932
  });
3907
- const createStyler = (open, close, parent) => {
3933
+ const createStyler$1 = (open, close, parent) => {
3908
3934
  let openAll;
3909
3935
  let closeAll;
3910
3936
  if (parent === void 0) {
@@ -3922,20 +3948,20 @@ const createStyler = (open, close, parent) => {
3922
3948
  parent
3923
3949
  };
3924
3950
  };
3925
- const createBuilder = (self2, _styler, _isEmpty) => {
3951
+ const createBuilder$1 = (self2, _styler, _isEmpty) => {
3926
3952
  const builder = (...arguments_) => {
3927
- if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3928
- return applyStyle(builder, chalkTag(builder, ...arguments_));
3953
+ if (isArray$1(arguments_[0]) && isArray$1(arguments_[0].raw)) {
3954
+ return applyStyle$1(builder, chalkTag$1(builder, ...arguments_));
3929
3955
  }
3930
- return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3956
+ return applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3931
3957
  };
3932
- Object.setPrototypeOf(builder, proto);
3958
+ Object.setPrototypeOf(builder, proto$1);
3933
3959
  builder._generator = self2;
3934
3960
  builder._styler = _styler;
3935
3961
  builder._isEmpty = _isEmpty;
3936
3962
  return builder;
3937
3963
  };
3938
- const applyStyle = (self2, string) => {
3964
+ const applyStyle$1 = (self2, string) => {
3939
3965
  if (self2.level <= 0 || !string) {
3940
3966
  return self2._isEmpty ? "" : string;
3941
3967
  }
@@ -3946,20 +3972,20 @@ const applyStyle = (self2, string) => {
3946
3972
  const { openAll, closeAll } = styler;
3947
3973
  if (string.indexOf("\x1B") !== -1) {
3948
3974
  while (styler !== void 0) {
3949
- string = stringReplaceAll(string, styler.close, styler.open);
3975
+ string = stringReplaceAll$2(string, styler.close, styler.open);
3950
3976
  styler = styler.parent;
3951
3977
  }
3952
3978
  }
3953
3979
  const lfIndex = string.indexOf("\n");
3954
3980
  if (lfIndex !== -1) {
3955
- string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3981
+ string = stringEncaseCRLFWithFirstIndex$2(string, closeAll, openAll, lfIndex);
3956
3982
  }
3957
3983
  return openAll + string + closeAll;
3958
3984
  };
3959
- let template;
3960
- const chalkTag = (chalk2, ...strings) => {
3985
+ let template$1;
3986
+ const chalkTag$1 = (chalk2, ...strings) => {
3961
3987
  const [firstString] = strings;
3962
- if (!isArray(firstString) || !isArray(firstString.raw)) {
3988
+ if (!isArray$1(firstString) || !isArray$1(firstString.raw)) {
3963
3989
  return strings.join(" ");
3964
3990
  }
3965
3991
  const arguments_ = strings.slice(1);
@@ -3970,18 +3996,18 @@ const chalkTag = (chalk2, ...strings) => {
3970
3996
  String(firstString.raw[i])
3971
3997
  );
3972
3998
  }
3973
- if (template === void 0) {
3974
- template = requireTemplates();
3999
+ if (template$1 === void 0) {
4000
+ template$1 = requireTemplates$1();
3975
4001
  }
3976
- return template(chalk2, parts.join(""));
4002
+ return template$1(chalk2, parts.join(""));
3977
4003
  };
3978
- Object.defineProperties(Chalk.prototype, styles);
3979
- const chalk = Chalk();
3980
- chalk.supportsColor = stdoutColor;
3981
- chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3982
- chalk.stderr.supportsColor = stderrColor;
3983
- var source = chalk;
3984
- const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
4004
+ Object.defineProperties(Chalk$1.prototype, styles$1);
4005
+ const chalk$2 = Chalk$1();
4006
+ chalk$2.supportsColor = stdoutColor$1;
4007
+ chalk$2.stderr = Chalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
4008
+ chalk$2.stderr.supportsColor = stderrColor$1;
4009
+ var source$1 = chalk$2;
4010
+ const chalk$3 = /* @__PURE__ */ getDefaultExportFromCjs$1(source$1);
3985
4011
  var ePublishState = /* @__PURE__ */ ((ePublishState2) => {
3986
4012
  ePublishState2[ePublishState2["init"] = 0] = "init";
3987
4013
  ePublishState2[ePublishState2["started"] = 1] = "started";
@@ -4033,7 +4059,7 @@ class PublishInstrumentController extends STSOptionsBase {
4033
4059
  }
4034
4060
  async StartPublish() {
4035
4061
  if (__privateGet(this, _publishState) !== 0) {
4036
- this.options.logger.debug(chalk$1.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state.`));
4062
+ this.options.logger.debug(chalk$3.yellow(`StartPublish:${this.options.processContext.nid}: StartPublish called when not currently in the init state.`));
4037
4063
  return false;
4038
4064
  }
4039
4065
  __privateSet(this, _publishState, 1);
@@ -4042,7 +4068,7 @@ class PublishInstrumentController extends STSOptionsBase {
4042
4068
  }
4043
4069
  async EndPublish() {
4044
4070
  if (__privateGet(this, _publishState) !== 1) {
4045
- this.options.logger.debug(chalk$1.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state.`));
4071
+ this.options.logger.debug(chalk$3.yellow(`EndPublish:${this.options.processContext.nid}: EndPublish called when not within the started state.`));
4046
4072
  return false;
4047
4073
  }
4048
4074
  __privateSet(this, _publishState, 2);
@@ -4057,11 +4083,11 @@ class PublishInstrumentController extends STSOptionsBase {
4057
4083
  }
4058
4084
  SetupInstrumentation() {
4059
4085
  if (!this.options.instrumentDefinitions) {
4060
- this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4086
+ this.options.logger.debug(chalk$3.yellow(`SetupInstrumentation:${this.options.processContext.nid}: No instrument(s) defined within supplied options.`));
4061
4087
  return;
4062
4088
  }
4063
4089
  if (!this.options.processContext) {
4064
- this.options.logger.debug(chalk$1.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4090
+ this.options.logger.debug(chalk$3.yellow(`SetupInstrumentation: No context defined within supplied options.`));
4065
4091
  return;
4066
4092
  }
4067
4093
  __privateMethod(this, _CreateInstruments, CreateInstruments_fn).call(this, this.options.instrumentDefinitions);
@@ -4086,7 +4112,7 @@ class PublishInstrumentController extends STSOptionsBase {
4086
4112
  if (__privateGet(this, _instruments)[instrumentName]) {
4087
4113
  __privateMethod(this, _ProcessTelemetryCommand, ProcessTelemetryCommand_fn).call(this, instrumentName, telemetry);
4088
4114
  } else {
4089
- this.options.logger.debug(chalk$1.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4115
+ this.options.logger.debug(chalk$3.red(`UpdateInstrument:${this.options.processContext.nid}: Attempted to UpdateInstrument before initialised.`));
4090
4116
  }
4091
4117
  }
4092
4118
  /*
@@ -4315,21 +4341,21 @@ const GetSTSInstrumentController = (app) => {
4315
4341
  const STSInstrumentControllerPlugin = {
4316
4342
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
4317
4343
  install: (app, options) => {
4318
- options.logger.debug(chalk$1.yellow(`STSInstrumentControllerPlugin:install:Start`));
4344
+ options.logger.debug(chalk$3.yellow(`STSInstrumentControllerPlugin:install:Start`));
4319
4345
  const aic = new AgentInstrumentController(options);
4320
4346
  if (!app.config.globalProperties.$sts) {
4321
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4347
+ options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] does not exist.`));
4322
4348
  app.config.globalProperties.$sts = {};
4323
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4349
+ options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: created empty [app.config.globalProperties.$sts].`));
4324
4350
  } else {
4325
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4351
+ options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: [app.config.globalProperties.$sts] already exists.`));
4326
4352
  }
4327
4353
  app.config.globalProperties.$sts.aic = aic;
4328
4354
  app.config.globalProperties.$sts[STSInstrumentControllerPluginKey] = aic;
4329
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4355
+ options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into [app.config.globalProperties.$sts] using: [${String(STSInstrumentControllerPluginKey)}].`));
4330
4356
  app.provide(STSInstrumentControllerPluginKey, aic);
4331
- options.logger.debug(chalk$1.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4332
- options.logger.debug(chalk$1.green(`STSInstrumentControllerPlugin:install:End`));
4357
+ options.logger.debug(chalk$3.cyan(`STSInstrumentControllerPlugin:install: AgentInstrumentController installed into 'provide' using: [${String(STSInstrumentControllerPluginKey)}].`));
4358
+ options.logger.debug(chalk$3.green(`STSInstrumentControllerPlugin:install:End`));
4333
4359
  }
4334
4360
  };
4335
4361
  function utf8Count(str) {
@@ -5015,14 +5041,14 @@ class PublishTransportRESTServer extends STSOptionsBase {
5015
5041
  }
5016
5042
  }
5017
5043
  if (retVal.status !== 200) {
5018
- this.options.logger.debug(chalk$1.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
5044
+ this.options.logger.debug(chalk$3.red(`Error (_PerformPublishRESTAPI:_PerformPublish:#publishmessage): Invalid response from server: [${retVal.status}]`));
5019
5045
  return false;
5020
5046
  } else {
5021
- this.options.logger.debug(chalk$1.green(`_PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
5047
+ this.options.logger.debug(chalk$3.green(`_PerformPublishRESTAPI:_PerformPublish:#publishmessage: [${this.options.url}] - Valid response from server: [${retVal.status}]`));
5022
5048
  }
5023
5049
  return true;
5024
5050
  } catch (error) {
5025
- this.options.logger.error(chalk$1.red(`Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
5051
+ this.options.logger.error(chalk$3.red(`Error (PublishRESTServer:_PerformPublishRESTAPI:Error: [${error}]`));
5026
5052
  return false;
5027
5053
  }
5028
5054
  });
@@ -5381,7 +5407,7 @@ class ObservabilityRESTAPISubscriber {
5381
5407
  subscription.cb(payload);
5382
5408
  }
5383
5409
  } catch (error) {
5384
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5410
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5385
5411
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
5386
5412
  }
5387
5413
  });
@@ -5393,11 +5419,11 @@ class ObservabilityRESTAPISubscriber {
5393
5419
  async Subscribe(subscriptions) {
5394
5420
  subscriptions.map(async (subId) => {
5395
5421
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5396
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5422
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`ObservabilityRESTAPISubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5397
5423
  try {
5398
5424
  __privateMethod(this, _AddKeepAlive, AddKeepAlive_fn).call(this, subId);
5399
5425
  } catch (error) {
5400
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5426
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5401
5427
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5402
5428
  }
5403
5429
  });
@@ -5408,7 +5434,7 @@ class ObservabilityRESTAPISubscriber {
5408
5434
  UnSubscribe(subscriptions) {
5409
5435
  subscriptions.map(async (subId) => {
5410
5436
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subId);
5411
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5437
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`ObservabilityRESTAPISubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5412
5438
  });
5413
5439
  }
5414
5440
  }
@@ -5545,13 +5571,13 @@ SetupTimeout_fn = function(socketSubscribeKeepAlive, subscription, timeout) {
5545
5571
  if (timeoutDuration < 500) {
5546
5572
  timeoutDuration = 500;
5547
5573
  }
5548
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
5574
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`Total duration for subscription: [${diff}], waiting: [${timeoutDuration}]`));
5549
5575
  socketSubscribeKeepAlive.timeout = __privateMethod(this, _SetupTimeout, SetupTimeout_fn).call(this, socketSubscribeKeepAlive, subscription, timeoutDuration);
5550
5576
  } else {
5551
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5577
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.yellow(`Subscription removed: [${socketSubscribeKeepAlive.id}]. Processing terminate.`));
5552
5578
  }
5553
5579
  } catch (error) {
5554
- __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$1.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5580
+ __privateMethod(this, _LogErrorMessage, LogErrorMessage_fn).call(this, chalk$3.red(`ObservabilityRESTAPISubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5555
5581
  __privateMethod(this, _RemoveKeepAlive, RemoveKeepAlive_fn).call(this, subscription);
5556
5582
  }
5557
5583
  }, timeout);
@@ -5569,7 +5595,7 @@ AddKeepAlive_fn = function(subscription) {
5569
5595
  _RemoveKeepAlive = new WeakSet();
5570
5596
  RemoveKeepAlive_fn = function(subscription) {
5571
5597
  if (__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id]) {
5572
- __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$1.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5598
+ __privateMethod(this, _LogDebugMessage, LogDebugMessage_fn).call(this, chalk$3.gray(`ObservabilityRESTAPISubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5573
5599
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout);
5574
5600
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id].timeout;
5575
5601
  delete __privateGet(this, _socketSubscribeKeepAlive)[subscription.subscriptionKey.id];
@@ -5647,7 +5673,7 @@ class SocketIoMessageSender {
5647
5673
  return __privateGet(this, _socket);
5648
5674
  }
5649
5675
  set socket(socket) {
5650
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5676
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.cyan(`SocketIoMessageSender:set socket(): new socket assigned`));
5651
5677
  __privateSet(this, _socket, socket);
5652
5678
  }
5653
5679
  AckListener(message, payload) {
@@ -5660,25 +5686,25 @@ class SocketIoMessageSender {
5660
5686
  message.status = "SUCCESS";
5661
5687
  message.subscriptionKeyResponse = payload;
5662
5688
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5663
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5689
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.grey(`SocketIoMessageSender:AckListener(): ack received, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5664
5690
  message.resolve(message);
5665
5691
  }
5666
5692
  }
5667
5693
  ResponseTimout(message) {
5668
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5694
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached: [${__privateGet(this, _timeoutValue)}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5669
5695
  delete message.timeoutId;
5670
5696
  __privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5671
5697
  message.endTime = performance.now();
5672
5698
  if (message.retryCount >= __privateGet(this, _maxReties)) {
5673
5699
  message.status = "FAIL";
5674
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5700
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.red(`SocketIoMessageSender:ResponseTimout(): timeout reached after ${__privateGet(this, _maxReties)} retries, event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5675
5701
  delete __privateGet(this, _messageWithAckPayloadRecords)[message.id];
5676
5702
  message.reject(message);
5677
5703
  return;
5678
5704
  }
5679
5705
  message.status = "INRETRY";
5680
5706
  message.retryCount++;
5681
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5707
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.magenta(`SocketIoMessageSender:ResponseTimout(): timeout reached, retrying. Retries: [${message.retryCount}], event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5682
5708
  this.SendMessage(message);
5683
5709
  }
5684
5710
  SendMessage(message) {
@@ -5691,7 +5717,7 @@ class SocketIoMessageSender {
5691
5717
  };
5692
5718
  message.BoundAckListenerCallback = AckListenerCallback.bind(this);
5693
5719
  __privateGet(this, _socket).on(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
5694
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5720
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.gray(`SocketIoMessageSender:SendMessage(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5695
5721
  __privateGet(this, _socket).emit(message.eventName, message.subscriptionKey);
5696
5722
  }
5697
5723
  SendMessageWithAck(eventName, subscriptionKey) {
@@ -5715,7 +5741,7 @@ class SocketIoMessageSender {
5715
5741
  const killIds = [];
5716
5742
  for (const [, message] of Object.entries(__privateGet(this, _messageWithAckPayloadRecords))) {
5717
5743
  if (message.subscriptionKey.id.localeCompare(subscriptionKey.id) === 0) {
5718
- __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$1.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5744
+ __privateMethod(this, _LogDebugMessage2, LogDebugMessage_fn2).call(this, chalk$3.blue(`SocketIoMessageSender:KillMessageInFlight(): event: [${message.eventName}], subscriptionKey: [${message.subscriptionKey.id}]`));
5719
5745
  clearTimeout(message.timeoutId);
5720
5746
  delete message.timeoutId;
5721
5747
  __privateGet(this, _socket).off(__privateMethod(this, _GetSubscribeKeepAliveAckEventName, GetSubscribeKeepAliveAckEventName_fn).call(this, message.eventName, message.subscriptionKey), message.BoundAckListenerCallback);
@@ -5765,7 +5791,7 @@ class ObservabilitySocketIOSubscriber {
5765
5791
  return __privateGet(this, _socket2);
5766
5792
  }
5767
5793
  set socket(socket) {
5768
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5794
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.cyan(`ObservabilitySocketIOSubscriber:set socket(): new socket assigned`));
5769
5795
  __privateSet(this, _socket2, socket);
5770
5796
  __privateGet(this, _socketIoMessageSender).socket = socket;
5771
5797
  }
@@ -5776,14 +5802,14 @@ class ObservabilitySocketIOSubscriber {
5776
5802
  const socket = __privateGet(this, _socket2);
5777
5803
  subscriptions.map(async (subId) => {
5778
5804
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5779
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5805
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:Subscribe(): Sending subscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5780
5806
  try {
5781
5807
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribe", subId.subscriptionKey);
5782
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5808
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:Subscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5783
5809
  __privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subId);
5784
5810
  socket.on(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5785
5811
  } catch (error) {
5786
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5812
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:Subscribe(): Error: response: [${JSON.stringify(error)}]`));
5787
5813
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5788
5814
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5789
5815
  }
@@ -5798,12 +5824,12 @@ class ObservabilitySocketIOSubscriber {
5798
5824
  socket.off(GetSocketIOSubscriptionKey(subId.subscriptionKey), subId.cb);
5799
5825
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subId);
5800
5826
  __privateGet(this, _socketIoMessageSender).KillMessageInFlight(subId.subscriptionKey);
5801
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5827
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:UnSubscribe(): Sending unsubscribe: subscriptionKey: [${subId.subscriptionKey.id}]`));
5802
5828
  try {
5803
5829
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("unsubscribe", subId.subscriptionKey);
5804
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5830
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:UnSubscribe(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5805
5831
  } catch (error) {
5806
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5832
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:UnSubscribe(): Error response: [${JSON.stringify(error)}]`));
5807
5833
  }
5808
5834
  });
5809
5835
  }
@@ -5839,13 +5865,13 @@ AddKeepAlive_fn2 = function(socket, subscription) {
5839
5865
  __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id] = {
5840
5866
  id: subscription.subscriptionKey.id,
5841
5867
  timeout: setTimeout(async () => {
5842
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5868
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.yellow(`ObservabilitySocketIOSubscriber:#AddKeepAlive:timeoutCheck(): Sending keepAlive: subscriptionKey: [${subscription.subscriptionKey.id}]`));
5843
5869
  try {
5844
5870
  const retVal = await __privateGet(this, _socketIoMessageSender).SendMessageWithAck("subscribeKeepAlive", subscription.subscriptionKey);
5845
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5871
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.green(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): SendMessageWithAck response: [${JSON.stringify(retVal)}]`));
5846
5872
  __privateMethod(this, _AddKeepAlive2, AddKeepAlive_fn2).call(this, socket, subscription);
5847
5873
  } catch (error) {
5848
- __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$1.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5874
+ __privateMethod(this, _LogErrorMessage2, LogErrorMessage_fn2).call(this, chalk$3.red(`ObservabilitySocketIOSubscriber:#AddKeepAlive(): Error response: [${JSON.stringify(error)}]`));
5849
5875
  socket.off(GetSocketIOSubscriptionKey(subscription.subscriptionKey), subscription.cb);
5850
5876
  __privateMethod(this, _RemoveKeepAlive2, RemoveKeepAlive_fn2).call(this, subscription);
5851
5877
  }
@@ -5855,7 +5881,7 @@ AddKeepAlive_fn2 = function(socket, subscription) {
5855
5881
  _RemoveKeepAlive2 = new WeakSet();
5856
5882
  RemoveKeepAlive_fn2 = function(subscription) {
5857
5883
  if (__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id]) {
5858
- __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$1.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5884
+ __privateMethod(this, _LogDebugMessage3, LogDebugMessage_fn3).call(this, chalk$3.gray(`ObservabilitySocketIOSubscriber:#RemoveKeepAlive(): subscriptionKey: [${subscription.subscriptionKey.id}]`));
5859
5885
  clearTimeout(__privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id].timeout);
5860
5886
  delete __privateGet(this, _socketSubscribeKeepAlive2)[subscription.subscriptionKey.id];
5861
5887
  }
@@ -5903,7 +5929,7 @@ class ObservabilitySubscriptionManager {
5903
5929
  subscriptions.map((subscription) => {
5904
5930
  const retVal = this.subscriptions.find((v) => v.subscriptionKey.id.localeCompare(subscription.subscriptionKey.id) === 0);
5905
5931
  if (retVal) {
5906
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
5932
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.magenta(`AddSubscription(): Subscription: [${retVal.subscriptionKey.id}] already exists - ignoring.`));
5907
5933
  } else {
5908
5934
  subscriptionsToAdd.push(subscription);
5909
5935
  }
@@ -5912,7 +5938,7 @@ class ObservabilitySubscriptionManager {
5912
5938
  subscriptionsToAdd.map((s) => this.subscriptions.push(s));
5913
5939
  (_a2 = __privateGet(this, _observabilitySocketIOSubscriber)) == null ? void 0 : _a2.Subscribe(subscriptionsToAdd);
5914
5940
  } else {
5915
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
5941
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.magenta(`AddSubscription(): No valid subscriptions to subscribe.`));
5916
5942
  }
5917
5943
  }
5918
5944
  RemoveSubscriptionsByKey(keyToFind) {
@@ -6007,7 +6033,7 @@ class ObservabilitySubscriptionManager {
6007
6033
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllServicesCombined.toString()) === 0) {
6008
6034
  __privateGet(this, _serviceModel)["STS-Service"] = ObservabilityModelUtils.GetModelForService("STS-Service", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6009
6035
  if (__privateGet(this, _serviceModel)["STS-Service"] === null) {
6010
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6036
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllServicesCombined():Error: GetModelForService() returned null`));
6011
6037
  }
6012
6038
  }
6013
6039
  } catch (error) {
@@ -6022,7 +6048,7 @@ class ObservabilitySubscriptionManager {
6022
6048
  for (const [serviceId, serviceTelemetry] of Object.entries(subscriptionPayload.data)) {
6023
6049
  __privateGet(this, _serviceModel)[serviceId] = ObservabilityModelUtils.GetModelForService(serviceId, serviceTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6024
6050
  if (__privateGet(this, _serviceModel)[serviceId] === null) {
6025
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServices():Error: GetModelForService() returned null`));
6051
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServices():Error: GetModelForService() returned null`));
6026
6052
  }
6027
6053
  }
6028
6054
  } catch (error) {
@@ -6056,7 +6082,7 @@ class ObservabilitySubscriptionManager {
6056
6082
  }
6057
6083
  }
6058
6084
  } else {
6059
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6085
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServiceInstances():Error: GetModelForService() returned null`));
6060
6086
  }
6061
6087
  } else {
6062
6088
  if (subscribeToKafka) {
@@ -6099,7 +6125,7 @@ class ObservabilitySubscriptionManager {
6099
6125
  }
6100
6126
  }
6101
6127
  } else {
6102
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6128
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelServiceInstance():Error: GetModelForService() returned null`));
6103
6129
  }
6104
6130
  } else {
6105
6131
  if (subscribeToKafka) {
@@ -6124,7 +6150,7 @@ class ObservabilitySubscriptionManager {
6124
6150
  if (Object.keys(subscriptionPayload.data).length !== 0) {
6125
6151
  __privateGet(this, _agentModel)["STS-Agent"] = ObservabilityModelUtils.GetModelForAgent("STS-Agent", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6126
6152
  if (__privateGet(this, _agentModel)["STS-Agent"] === null) {
6127
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6153
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllAgentsCombined():Error: GetModelForAgent() returned null`));
6128
6154
  }
6129
6155
  }
6130
6156
  }
@@ -6158,7 +6184,7 @@ class ObservabilitySubscriptionManager {
6158
6184
  }
6159
6185
  }
6160
6186
  } else {
6161
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6187
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgents():Error: GetModelForAgent() returned null`));
6162
6188
  }
6163
6189
  } else {
6164
6190
  if (subscribeToKafka) {
@@ -6169,7 +6195,7 @@ class ObservabilitySubscriptionManager {
6169
6195
  }
6170
6196
  }
6171
6197
  } catch (error) {
6172
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6198
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgent:CreateModel(): Error: [${error}]`));
6173
6199
  }
6174
6200
  }
6175
6201
  // /agentId/agentWorkerId
@@ -6202,7 +6228,7 @@ class ObservabilitySubscriptionManager {
6202
6228
  }
6203
6229
  }
6204
6230
  } else {
6205
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6231
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgentWorkers():Error: GetModelForAgent() returned null`));
6206
6232
  }
6207
6233
  } else {
6208
6234
  if (subscribeToKafka) {
@@ -6214,7 +6240,7 @@ class ObservabilitySubscriptionManager {
6214
6240
  }
6215
6241
  }
6216
6242
  } catch (error) {
6217
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6243
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgentThreads:CreateModel(): Error: [${error}]`));
6218
6244
  }
6219
6245
  }
6220
6246
  // /agentId/agentWorkerId/asyncRunnerId
@@ -6244,7 +6270,7 @@ class ObservabilitySubscriptionManager {
6244
6270
  }
6245
6271
  }
6246
6272
  } else {
6247
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6273
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAgentWorker():Error: GetModelForAgent() returned null`));
6248
6274
  }
6249
6275
  } else {
6250
6276
  if (subscribeToKafka) {
@@ -6257,7 +6283,7 @@ class ObservabilitySubscriptionManager {
6257
6283
  }
6258
6284
  }
6259
6285
  } catch (error) {
6260
- __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$1.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6286
+ __privateMethod(this, _LogErrorMessage3, LogErrorMessage_fn3).call(this, chalk$3.red(`UIControllerAgentThread:CreateModel(): Error: [${error}]`));
6261
6287
  }
6262
6288
  }
6263
6289
  // --- [ Lambdas ] ------------------------------------------------------------------------------------------------------------------------------------------------
@@ -6268,7 +6294,7 @@ class ObservabilitySubscriptionManager {
6268
6294
  if (subscriptionPayload.subscriptionKey.topic.localeCompare(SubscriptionTopic.AllLambdasCombined.toString()) === 0) {
6269
6295
  __privateGet(this, _lambdaModel)["STS-Lambda"] = ObservabilityModelUtils.GetModelForLambda("STS-Lambda", subscriptionPayload.data, subscribeToKafka, __privateGet(this, _options5).logger);
6270
6296
  if (__privateGet(this, _lambdaModel)["STS-Lambda"] === null) {
6271
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6297
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelAllLambdasCombined():Error: GetModelForLambda() returned null`));
6272
6298
  }
6273
6299
  }
6274
6300
  } catch (error) {
@@ -6283,7 +6309,7 @@ class ObservabilitySubscriptionManager {
6283
6309
  for (const [technologyId, technologyTelemetry] of Object.entries(subscriptionPayload.data)) {
6284
6310
  __privateGet(this, _lambdaModel)[technologyId] = ObservabilityModelUtils.GetModelForLambda(technologyId, technologyTelemetry, subscribeToKafka, __privateGet(this, _options5).logger);
6285
6311
  if (__privateGet(this, _lambdaModel)[technologyId] === null) {
6286
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6312
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaTechnologies():Error: GetModelForLambda() returned null`));
6287
6313
  }
6288
6314
  }
6289
6315
  } catch (error) {
@@ -6317,7 +6343,7 @@ class ObservabilitySubscriptionManager {
6317
6343
  }
6318
6344
  }
6319
6345
  } else {
6320
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6346
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaSubTechnologies():Error: GetModelForLambda() returned null`));
6321
6347
  }
6322
6348
  } else {
6323
6349
  if (subscribeToKafka) {
@@ -6360,7 +6386,7 @@ class ObservabilitySubscriptionManager {
6360
6386
  }
6361
6387
  }
6362
6388
  } else {
6363
- __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$1.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6389
+ __privateMethod(this, _LogDebugMessage4, LogDebugMessage_fn4).call(this, chalk$3.red(`CreateModelLambdaSubTechnologiesInstance():Error: GetModelForLambda() returned null`));
6364
6390
  }
6365
6391
  } else {
6366
6392
  if (subscribeToKafka) {
@@ -6419,21 +6445,21 @@ class SocketIoClientHelper {
6419
6445
  get sockets() {
6420
6446
  return __privateGet(this, _sockets);
6421
6447
  }
6422
- SetupClientSideSocket(name, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
6423
- this.sockets[name] = {
6424
- name,
6448
+ SetupClientSideSocket(name2, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
6449
+ this.sockets[name2] = {
6450
+ name: name2,
6425
6451
  address,
6426
6452
  socket: null,
6427
6453
  errorCallBack
6428
6454
  };
6429
- __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack);
6430
- return this.sockets[name].socket;
6455
+ __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack);
6456
+ return this.sockets[name2].socket;
6431
6457
  }
6432
- GetSocket(name) {
6433
- return this.sockets[name].socket;
6458
+ GetSocket(name2) {
6459
+ return this.sockets[name2].socket;
6434
6460
  }
6435
- GetSocketDetail(name) {
6436
- return this.sockets[name];
6461
+ GetSocketDetail(name2) {
6462
+ return this.sockets[name2];
6437
6463
  }
6438
6464
  }
6439
6465
  _options6 = new WeakMap();
@@ -6450,17 +6476,17 @@ LogErrorMessage_fn4 = function(message) {
6450
6476
  __privateGet(this, _options6).logger.error(message);
6451
6477
  };
6452
6478
  _EstablishSocketConnect = new WeakSet();
6453
- EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBack) {
6454
- const socketDetail = this.sockets[name];
6479
+ EstablishSocketConnect_fn = function(name2, onConnectCallBack, socketEventsCallBack) {
6480
+ const socketDetail = this.sockets[name2];
6455
6481
  if (socketDetail.socket !== null) {
6456
6482
  if (socketDetail.socket.connected === true) {
6457
6483
  socketDetail.socket.disconnect();
6458
6484
  }
6459
6485
  socketDetail.socket = null;
6460
6486
  if (isNode) {
6461
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6487
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6462
6488
  } else {
6463
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6489
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6464
6490
  }
6465
6491
  return;
6466
6492
  }
@@ -6502,12 +6528,12 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
6502
6528
  {
6503
6529
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
6504
6530
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6505
- const socketDetail2 = this.sockets[name];
6531
+ const socketDetail2 = this.sockets[name2];
6506
6532
  socketDetail2.socket = null;
6507
6533
  if (isNode) {
6508
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6534
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6509
6535
  } else {
6510
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6536
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6511
6537
  }
6512
6538
  }
6513
6539
  break;
@@ -6521,244 +6547,2261 @@ EstablishSocketConnect_fn = function(name, onConnectCallBack, socketEventsCallBa
6521
6547
  {
6522
6548
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
6523
6549
  __privateMethod(this, _LogDebugMessage5, LogDebugMessage_fn5).call(this, "The connection will be re-established when the server becomes available.");
6524
- const socketDetail2 = this.sockets[name];
6550
+ const socketDetail2 = this.sockets[name2];
6525
6551
  if (socketDetail2.socket) {
6526
6552
  socketDetail2.socket.disconnect();
6527
6553
  }
6528
6554
  socketDetail2.socket = null;
6529
6555
  if (isNode) {
6530
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100).unref();
6556
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
6531
6557
  } else {
6532
- setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name, onConnectCallBack, socketEventsCallBack), 100);
6558
+ setTimeout(() => __privateMethod(this, _EstablishSocketConnect, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
6533
6559
  }
6534
6560
  }
6535
6561
  break;
6536
6562
  }
6537
6563
  });
6538
6564
  };
6539
- var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
6540
- influxDBDataType2["intField"] = "intField";
6541
- influxDBDataType2["floatField"] = "floatField";
6542
- influxDBDataType2["stringField"] = "stringField";
6543
- return influxDBDataType2;
6544
- })(influxDBDataType || {});
6545
- const globalServiceDefinitions = {
6546
- coreFieldList: [
6547
- {
6548
- fieldName: "requestCount",
6549
- gauge: Gauge.REQUEST_COUNT_GAUGE,
6550
- instrumentProperty: "val",
6551
- dataType: "number",
6552
- influxdbDataType: "intField"
6553
- /* intField */
6554
- },
6555
- {
6556
- fieldName: "errorCount",
6557
- gauge: Gauge.ERROR_COUNT_GAUGE,
6558
- instrumentProperty: "val",
6559
- dataType: "number",
6560
- influxdbDataType: "intField"
6561
- /* intField */
6562
- },
6563
- {
6564
- fieldName: "retryCount",
6565
- gauge: Gauge.RETRY_COUNT_GAUGE,
6566
- instrumentProperty: "val",
6567
- dataType: "number",
6568
- influxdbDataType: "intField"
6569
- /* intField */
6570
- },
6571
- {
6572
- fieldName: "authenticationCount",
6573
- gauge: Gauge.AUTHENTICATION_COUNT_GAUGE,
6574
- instrumentProperty: "val",
6575
- dataType: "number",
6576
- influxdbDataType: "intField"
6577
- /* intField */
6578
- },
6579
- {
6580
- fieldName: "authenticationErrorCount",
6581
- gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE,
6582
- instrumentProperty: "val",
6583
- dataType: "number",
6584
- influxdbDataType: "intField"
6585
- /* intField */
6586
- },
6587
- {
6588
- fieldName: "authenticationRetryCount",
6589
- gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE,
6590
- instrumentProperty: "val",
6591
- dataType: "number",
6592
- influxdbDataType: "intField"
6593
- /* intField */
6594
- },
6595
- {
6596
- fieldName: "velocity",
6597
- gauge: Gauge.VELOCITY_GAUGE,
6598
- instrumentProperty: "va",
6599
- dataType: "number",
6600
- influxdbDataType: "floatField"
6601
- /* floatField */
6602
- },
6603
- {
6604
- fieldName: "activeRequestCount",
6605
- gauge: Gauge.ACTIVE_REQUEST_GAUGE,
6606
- instrumentProperty: "val",
6607
- dataType: "number",
6608
- timeSeriesIndex: true,
6609
- quantile: true,
6610
- influxdbDataType: "intField"
6611
- /* intField */
6612
- },
6613
- {
6614
- fieldName: "coreCount",
6615
- gauge: Gauge.CORE_COUNT_GAUGE,
6616
- instrumentProperty: "val",
6617
- dataType: "number",
6618
- influxdbDataType: "intField"
6619
- /* intField */
6620
- },
6621
- {
6622
- fieldName: "rx",
6623
- gauge: Gauge.NETWORK_RX_GAUGE,
6624
- instrumentProperty: "va",
6625
- dataType: "number",
6626
- influxdbDataType: "floatField"
6627
- /* floatField */
6628
- },
6629
- {
6630
- fieldName: "tx",
6631
- gauge: Gauge.NETWORK_TX_GAUGE,
6632
- instrumentProperty: "va",
6633
- dataType: "number",
6634
- influxdbDataType: "floatField"
6635
- /* floatField */
6636
- },
6637
- {
6638
- fieldName: "timer",
6639
- gauge: Gauge.TIMER_GAUGE,
6640
- instrumentProperty: "val",
6641
- dataType: "number",
6642
- influxdbDataType: "floatField"
6643
- /* floatField */
6644
- },
6645
- {
6646
- fieldName: "duration",
6647
- gauge: Gauge.DURATION_GAUGE,
6648
- instrumentProperty: "val",
6649
- dataType: "number",
6650
- timeSeriesIndex: true,
6651
- quantile: true,
6652
- influxdbDataType: "floatField",
6653
- histo: [
6654
- { label: "B10", bucketLimit: 10 },
6655
- { label: "B20", bucketLimit: 20 },
6656
- { label: "B50", bucketLimit: 50 },
6657
- { label: "B100", bucketLimit: 100 },
6658
- { label: "B1000", bucketLimit: 1e3 },
6659
- { label: "B50000", bucketLimit: 5e4 },
6660
- { label: "BInfinity", bucketLimit: -1 }
6661
- ]
6662
- },
6663
- {
6664
- fieldName: "latency",
6665
- gauge: Gauge.LATENCY_GAUGE,
6666
- instrumentProperty: "val",
6667
- dataType: "number",
6668
- timeSeriesIndex: true,
6669
- quantile: true,
6670
- influxdbDataType: "floatField",
6671
- histo: [
6672
- { label: "B10", bucketLimit: 10 },
6673
- { label: "B20", bucketLimit: 20 },
6674
- { label: "B50", bucketLimit: 50 },
6675
- { label: "B100", bucketLimit: 100 },
6676
- { label: "B1000", bucketLimit: 1e3 },
6677
- { label: "B50000", bucketLimit: 5e4 },
6678
- { label: "BInfinity", bucketLimit: -1 }
6679
- ]
6565
+ var main$1 = { exports: {} };
6566
+ const __viteBrowserExternal$1 = {};
6567
+ const __viteBrowserExternal$2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6568
+ __proto__: null,
6569
+ default: __viteBrowserExternal$1
6570
+ }, Symbol.toStringTag, { value: "Module" }));
6571
+ const require$$3 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$2);
6572
+ const name = "dotenv";
6573
+ const version$1 = "16.4.5";
6574
+ const description = "Loads environment variables from .env file";
6575
+ const main = "lib/main.js";
6576
+ const types = "lib/main.d.ts";
6577
+ const exports = {
6578
+ ".": {
6579
+ types: "./lib/main.d.ts",
6580
+ require: "./lib/main.js",
6581
+ "default": "./lib/main.js"
6582
+ },
6583
+ "./config": "./config.js",
6584
+ "./config.js": "./config.js",
6585
+ "./lib/env-options": "./lib/env-options.js",
6586
+ "./lib/env-options.js": "./lib/env-options.js",
6587
+ "./lib/cli-options": "./lib/cli-options.js",
6588
+ "./lib/cli-options.js": "./lib/cli-options.js",
6589
+ "./package.json": "./package.json"
6590
+ };
6591
+ const scripts = {
6592
+ "dts-check": "tsc --project tests/types/tsconfig.json",
6593
+ lint: "standard",
6594
+ "lint-readme": "standard-markdown",
6595
+ pretest: "npm run lint && npm run dts-check",
6596
+ test: "tap tests/*.js --100 -Rspec",
6597
+ "test:coverage": "tap --coverage-report=lcov",
6598
+ prerelease: "npm test",
6599
+ release: "standard-version"
6600
+ };
6601
+ const repository = {
6602
+ type: "git",
6603
+ url: "git://github.com/motdotla/dotenv.git"
6604
+ };
6605
+ const funding = "https://dotenvx.com";
6606
+ const keywords = [
6607
+ "dotenv",
6608
+ "env",
6609
+ ".env",
6610
+ "environment",
6611
+ "variables",
6612
+ "config",
6613
+ "settings"
6614
+ ];
6615
+ const readmeFilename = "README.md";
6616
+ const license = "BSD-2-Clause";
6617
+ const devDependencies = {
6618
+ "@definitelytyped/dtslint": "^0.0.133",
6619
+ "@types/node": "^18.11.3",
6620
+ decache: "^4.6.1",
6621
+ sinon: "^14.0.1",
6622
+ standard: "^17.0.0",
6623
+ "standard-markdown": "^7.1.0",
6624
+ "standard-version": "^9.5.0",
6625
+ tap: "^16.3.0",
6626
+ tar: "^6.1.11",
6627
+ typescript: "^4.8.4"
6628
+ };
6629
+ const engines = {
6630
+ node: ">=12"
6631
+ };
6632
+ const browser$1 = {
6633
+ fs: false
6634
+ };
6635
+ const require$$4 = {
6636
+ name,
6637
+ version: version$1,
6638
+ description,
6639
+ main,
6640
+ types,
6641
+ exports,
6642
+ scripts,
6643
+ repository,
6644
+ funding,
6645
+ keywords,
6646
+ readmeFilename,
6647
+ license,
6648
+ devDependencies,
6649
+ engines,
6650
+ browser: browser$1
6651
+ };
6652
+ const fs$1 = require$$3;
6653
+ const path = require$$3;
6654
+ const os = require$$3;
6655
+ const crypto$1 = require$$3;
6656
+ const packageJson = require$$4;
6657
+ const version = packageJson.version;
6658
+ const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
6659
+ function parse(src) {
6660
+ const obj = {};
6661
+ let lines = src.toString();
6662
+ lines = lines.replace(/\r\n?/mg, "\n");
6663
+ let match;
6664
+ while ((match = LINE.exec(lines)) != null) {
6665
+ const key = match[1];
6666
+ let value = match[2] || "";
6667
+ value = value.trim();
6668
+ const maybeQuote = value[0];
6669
+ value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
6670
+ if (maybeQuote === '"') {
6671
+ value = value.replace(/\\n/g, "\n");
6672
+ value = value.replace(/\\r/g, "\r");
6673
+ }
6674
+ obj[key] = value;
6675
+ }
6676
+ return obj;
6677
+ }
6678
+ function _parseVault(options) {
6679
+ const vaultPath = _vaultPath(options);
6680
+ const result = DotenvModule.configDotenv({ path: vaultPath });
6681
+ if (!result.parsed) {
6682
+ const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
6683
+ err.code = "MISSING_DATA";
6684
+ throw err;
6685
+ }
6686
+ const keys = _dotenvKey(options).split(",");
6687
+ const length = keys.length;
6688
+ let decrypted;
6689
+ for (let i = 0; i < length; i++) {
6690
+ try {
6691
+ const key = keys[i].trim();
6692
+ const attrs = _instructions(result, key);
6693
+ decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
6694
+ break;
6695
+ } catch (error) {
6696
+ if (i + 1 >= length) {
6697
+ throw error;
6698
+ }
6680
6699
  }
6681
- ],
6682
- services: {
6683
- ["service"]: {
6684
- influxDBContextTags: [
6685
- "serviceId",
6686
- "serviceName",
6687
- "serviceVersion",
6688
- "serviceInstanceId",
6689
- "serviceInstanceProcessId",
6690
- "hostName",
6691
- "pid",
6692
- "ppid"
6693
- ],
6694
- redisIndexPrefixDefinitions: {
6695
- timeSeriesIndex: "idx:serviceIndexTimeSeries",
6696
- timeSeriesPrefix: "/serviceTimeSeries:",
6697
- instantIndex: "idx:serviceIndexInstant",
6698
- instantPrefix: "/serviceInstant:"
6699
- },
6700
- fieldList: [
6701
- {
6702
- fieldName: "cpu",
6703
- gauge: Gauge.CPU_LOAD_GAUGE,
6704
- instrumentProperty: "val",
6705
- dataType: "number",
6706
- timeSeriesIndex: true,
6707
- quantile: true,
6708
- influxdbDataType: "floatField"
6709
- /* floatField */
6710
- },
6711
- {
6712
- fieldName: "connectionCount",
6713
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
6700
+ }
6701
+ return DotenvModule.parse(decrypted);
6702
+ }
6703
+ function _log(message) {
6704
+ console.log(`[dotenv@${version}][INFO] ${message}`);
6705
+ }
6706
+ function _warn(message) {
6707
+ console.log(`[dotenv@${version}][WARN] ${message}`);
6708
+ }
6709
+ function _debug(message) {
6710
+ console.log(`[dotenv@${version}][DEBUG] ${message}`);
6711
+ }
6712
+ function _dotenvKey(options) {
6713
+ if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
6714
+ return options.DOTENV_KEY;
6715
+ }
6716
+ if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
6717
+ return process.env.DOTENV_KEY;
6718
+ }
6719
+ return "";
6720
+ }
6721
+ function _instructions(result, dotenvKey) {
6722
+ let uri;
6723
+ try {
6724
+ uri = new URL(dotenvKey);
6725
+ } catch (error) {
6726
+ if (error.code === "ERR_INVALID_URL") {
6727
+ const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
6728
+ err.code = "INVALID_DOTENV_KEY";
6729
+ throw err;
6730
+ }
6731
+ throw error;
6732
+ }
6733
+ const key = uri.password;
6734
+ if (!key) {
6735
+ const err = new Error("INVALID_DOTENV_KEY: Missing key part");
6736
+ err.code = "INVALID_DOTENV_KEY";
6737
+ throw err;
6738
+ }
6739
+ const environment = uri.searchParams.get("environment");
6740
+ if (!environment) {
6741
+ const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
6742
+ err.code = "INVALID_DOTENV_KEY";
6743
+ throw err;
6744
+ }
6745
+ const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
6746
+ const ciphertext = result.parsed[environmentKey];
6747
+ if (!ciphertext) {
6748
+ const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
6749
+ err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
6750
+ throw err;
6751
+ }
6752
+ return { ciphertext, key };
6753
+ }
6754
+ function _vaultPath(options) {
6755
+ let possibleVaultPath = null;
6756
+ if (options && options.path && options.path.length > 0) {
6757
+ if (Array.isArray(options.path)) {
6758
+ for (const filepath of options.path) {
6759
+ if (fs$1.existsSync(filepath)) {
6760
+ possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
6761
+ }
6762
+ }
6763
+ } else {
6764
+ possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
6765
+ }
6766
+ } else {
6767
+ possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
6768
+ }
6769
+ if (fs$1.existsSync(possibleVaultPath)) {
6770
+ return possibleVaultPath;
6771
+ }
6772
+ return null;
6773
+ }
6774
+ function _resolveHome(envPath) {
6775
+ return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
6776
+ }
6777
+ function _configVault(options) {
6778
+ _log("Loading env from encrypted .env.vault");
6779
+ const parsed = DotenvModule._parseVault(options);
6780
+ let processEnv = process.env;
6781
+ if (options && options.processEnv != null) {
6782
+ processEnv = options.processEnv;
6783
+ }
6784
+ DotenvModule.populate(processEnv, parsed, options);
6785
+ return { parsed };
6786
+ }
6787
+ function configDotenv(options) {
6788
+ const dotenvPath = path.resolve(process.cwd(), ".env");
6789
+ let encoding = "utf8";
6790
+ const debug = Boolean(options && options.debug);
6791
+ if (options && options.encoding) {
6792
+ encoding = options.encoding;
6793
+ } else {
6794
+ if (debug) {
6795
+ _debug("No encoding is specified. UTF-8 is used by default");
6796
+ }
6797
+ }
6798
+ let optionPaths = [dotenvPath];
6799
+ if (options && options.path) {
6800
+ if (!Array.isArray(options.path)) {
6801
+ optionPaths = [_resolveHome(options.path)];
6802
+ } else {
6803
+ optionPaths = [];
6804
+ for (const filepath of options.path) {
6805
+ optionPaths.push(_resolveHome(filepath));
6806
+ }
6807
+ }
6808
+ }
6809
+ let lastError;
6810
+ const parsedAll = {};
6811
+ for (const path2 of optionPaths) {
6812
+ try {
6813
+ const parsed = DotenvModule.parse(fs$1.readFileSync(path2, { encoding }));
6814
+ DotenvModule.populate(parsedAll, parsed, options);
6815
+ } catch (e) {
6816
+ if (debug) {
6817
+ _debug(`Failed to load ${path2} ${e.message}`);
6818
+ }
6819
+ lastError = e;
6820
+ }
6821
+ }
6822
+ let processEnv = process.env;
6823
+ if (options && options.processEnv != null) {
6824
+ processEnv = options.processEnv;
6825
+ }
6826
+ DotenvModule.populate(processEnv, parsedAll, options);
6827
+ if (lastError) {
6828
+ return { parsed: parsedAll, error: lastError };
6829
+ } else {
6830
+ return { parsed: parsedAll };
6831
+ }
6832
+ }
6833
+ function config(options) {
6834
+ if (_dotenvKey(options).length === 0) {
6835
+ return DotenvModule.configDotenv(options);
6836
+ }
6837
+ const vaultPath = _vaultPath(options);
6838
+ if (!vaultPath) {
6839
+ _warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
6840
+ return DotenvModule.configDotenv(options);
6841
+ }
6842
+ return DotenvModule._configVault(options);
6843
+ }
6844
+ function decrypt(encrypted, keyStr) {
6845
+ const key = Buffer.from(keyStr.slice(-64), "hex");
6846
+ let ciphertext = Buffer.from(encrypted, "base64");
6847
+ const nonce = ciphertext.subarray(0, 12);
6848
+ const authTag = ciphertext.subarray(-16);
6849
+ ciphertext = ciphertext.subarray(12, -16);
6850
+ try {
6851
+ const aesgcm = crypto$1.createDecipheriv("aes-256-gcm", key, nonce);
6852
+ aesgcm.setAuthTag(authTag);
6853
+ return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
6854
+ } catch (error) {
6855
+ const isRange = error instanceof RangeError;
6856
+ const invalidKeyLength = error.message === "Invalid key length";
6857
+ const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
6858
+ if (isRange || invalidKeyLength) {
6859
+ const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
6860
+ err.code = "INVALID_DOTENV_KEY";
6861
+ throw err;
6862
+ } else if (decryptionFailed) {
6863
+ const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
6864
+ err.code = "DECRYPTION_FAILED";
6865
+ throw err;
6866
+ } else {
6867
+ throw error;
6868
+ }
6869
+ }
6870
+ }
6871
+ function populate(processEnv, parsed, options = {}) {
6872
+ const debug = Boolean(options && options.debug);
6873
+ const override = Boolean(options && options.override);
6874
+ if (typeof parsed !== "object") {
6875
+ const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
6876
+ err.code = "OBJECT_REQUIRED";
6877
+ throw err;
6878
+ }
6879
+ for (const key of Object.keys(parsed)) {
6880
+ if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
6881
+ if (override === true) {
6882
+ processEnv[key] = parsed[key];
6883
+ }
6884
+ if (debug) {
6885
+ if (override === true) {
6886
+ _debug(`"${key}" is already defined and WAS overwritten`);
6887
+ } else {
6888
+ _debug(`"${key}" is already defined and was NOT overwritten`);
6889
+ }
6890
+ }
6891
+ } else {
6892
+ processEnv[key] = parsed[key];
6893
+ }
6894
+ }
6895
+ }
6896
+ const DotenvModule = {
6897
+ configDotenv,
6898
+ _configVault,
6899
+ _parseVault,
6900
+ config,
6901
+ decrypt,
6902
+ parse,
6903
+ populate
6904
+ };
6905
+ main$1.exports.configDotenv = DotenvModule.configDotenv;
6906
+ main$1.exports._configVault = DotenvModule._configVault;
6907
+ main$1.exports._parseVault = DotenvModule._parseVault;
6908
+ var config_1 = main$1.exports.config = DotenvModule.config;
6909
+ main$1.exports.decrypt = DotenvModule.decrypt;
6910
+ main$1.exports.parse = DotenvModule.parse;
6911
+ main$1.exports.populate = DotenvModule.populate;
6912
+ main$1.exports = DotenvModule;
6913
+ const __viteBrowserExternal = {};
6914
+ const fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
6915
+ __proto__: null,
6916
+ default: __viteBrowserExternal
6917
+ }, Symbol.toStringTag, { value: "Module" }));
6918
+ function getDefaultExportFromCjs(x) {
6919
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
6920
+ }
6921
+ var ansiStyles$1 = { exports: {} };
6922
+ var colorName;
6923
+ var hasRequiredColorName;
6924
+ function requireColorName() {
6925
+ if (hasRequiredColorName)
6926
+ return colorName;
6927
+ hasRequiredColorName = 1;
6928
+ colorName = {
6929
+ "aliceblue": [240, 248, 255],
6930
+ "antiquewhite": [250, 235, 215],
6931
+ "aqua": [0, 255, 255],
6932
+ "aquamarine": [127, 255, 212],
6933
+ "azure": [240, 255, 255],
6934
+ "beige": [245, 245, 220],
6935
+ "bisque": [255, 228, 196],
6936
+ "black": [0, 0, 0],
6937
+ "blanchedalmond": [255, 235, 205],
6938
+ "blue": [0, 0, 255],
6939
+ "blueviolet": [138, 43, 226],
6940
+ "brown": [165, 42, 42],
6941
+ "burlywood": [222, 184, 135],
6942
+ "cadetblue": [95, 158, 160],
6943
+ "chartreuse": [127, 255, 0],
6944
+ "chocolate": [210, 105, 30],
6945
+ "coral": [255, 127, 80],
6946
+ "cornflowerblue": [100, 149, 237],
6947
+ "cornsilk": [255, 248, 220],
6948
+ "crimson": [220, 20, 60],
6949
+ "cyan": [0, 255, 255],
6950
+ "darkblue": [0, 0, 139],
6951
+ "darkcyan": [0, 139, 139],
6952
+ "darkgoldenrod": [184, 134, 11],
6953
+ "darkgray": [169, 169, 169],
6954
+ "darkgreen": [0, 100, 0],
6955
+ "darkgrey": [169, 169, 169],
6956
+ "darkkhaki": [189, 183, 107],
6957
+ "darkmagenta": [139, 0, 139],
6958
+ "darkolivegreen": [85, 107, 47],
6959
+ "darkorange": [255, 140, 0],
6960
+ "darkorchid": [153, 50, 204],
6961
+ "darkred": [139, 0, 0],
6962
+ "darksalmon": [233, 150, 122],
6963
+ "darkseagreen": [143, 188, 143],
6964
+ "darkslateblue": [72, 61, 139],
6965
+ "darkslategray": [47, 79, 79],
6966
+ "darkslategrey": [47, 79, 79],
6967
+ "darkturquoise": [0, 206, 209],
6968
+ "darkviolet": [148, 0, 211],
6969
+ "deeppink": [255, 20, 147],
6970
+ "deepskyblue": [0, 191, 255],
6971
+ "dimgray": [105, 105, 105],
6972
+ "dimgrey": [105, 105, 105],
6973
+ "dodgerblue": [30, 144, 255],
6974
+ "firebrick": [178, 34, 34],
6975
+ "floralwhite": [255, 250, 240],
6976
+ "forestgreen": [34, 139, 34],
6977
+ "fuchsia": [255, 0, 255],
6978
+ "gainsboro": [220, 220, 220],
6979
+ "ghostwhite": [248, 248, 255],
6980
+ "gold": [255, 215, 0],
6981
+ "goldenrod": [218, 165, 32],
6982
+ "gray": [128, 128, 128],
6983
+ "green": [0, 128, 0],
6984
+ "greenyellow": [173, 255, 47],
6985
+ "grey": [128, 128, 128],
6986
+ "honeydew": [240, 255, 240],
6987
+ "hotpink": [255, 105, 180],
6988
+ "indianred": [205, 92, 92],
6989
+ "indigo": [75, 0, 130],
6990
+ "ivory": [255, 255, 240],
6991
+ "khaki": [240, 230, 140],
6992
+ "lavender": [230, 230, 250],
6993
+ "lavenderblush": [255, 240, 245],
6994
+ "lawngreen": [124, 252, 0],
6995
+ "lemonchiffon": [255, 250, 205],
6996
+ "lightblue": [173, 216, 230],
6997
+ "lightcoral": [240, 128, 128],
6998
+ "lightcyan": [224, 255, 255],
6999
+ "lightgoldenrodyellow": [250, 250, 210],
7000
+ "lightgray": [211, 211, 211],
7001
+ "lightgreen": [144, 238, 144],
7002
+ "lightgrey": [211, 211, 211],
7003
+ "lightpink": [255, 182, 193],
7004
+ "lightsalmon": [255, 160, 122],
7005
+ "lightseagreen": [32, 178, 170],
7006
+ "lightskyblue": [135, 206, 250],
7007
+ "lightslategray": [119, 136, 153],
7008
+ "lightslategrey": [119, 136, 153],
7009
+ "lightsteelblue": [176, 196, 222],
7010
+ "lightyellow": [255, 255, 224],
7011
+ "lime": [0, 255, 0],
7012
+ "limegreen": [50, 205, 50],
7013
+ "linen": [250, 240, 230],
7014
+ "magenta": [255, 0, 255],
7015
+ "maroon": [128, 0, 0],
7016
+ "mediumaquamarine": [102, 205, 170],
7017
+ "mediumblue": [0, 0, 205],
7018
+ "mediumorchid": [186, 85, 211],
7019
+ "mediumpurple": [147, 112, 219],
7020
+ "mediumseagreen": [60, 179, 113],
7021
+ "mediumslateblue": [123, 104, 238],
7022
+ "mediumspringgreen": [0, 250, 154],
7023
+ "mediumturquoise": [72, 209, 204],
7024
+ "mediumvioletred": [199, 21, 133],
7025
+ "midnightblue": [25, 25, 112],
7026
+ "mintcream": [245, 255, 250],
7027
+ "mistyrose": [255, 228, 225],
7028
+ "moccasin": [255, 228, 181],
7029
+ "navajowhite": [255, 222, 173],
7030
+ "navy": [0, 0, 128],
7031
+ "oldlace": [253, 245, 230],
7032
+ "olive": [128, 128, 0],
7033
+ "olivedrab": [107, 142, 35],
7034
+ "orange": [255, 165, 0],
7035
+ "orangered": [255, 69, 0],
7036
+ "orchid": [218, 112, 214],
7037
+ "palegoldenrod": [238, 232, 170],
7038
+ "palegreen": [152, 251, 152],
7039
+ "paleturquoise": [175, 238, 238],
7040
+ "palevioletred": [219, 112, 147],
7041
+ "papayawhip": [255, 239, 213],
7042
+ "peachpuff": [255, 218, 185],
7043
+ "peru": [205, 133, 63],
7044
+ "pink": [255, 192, 203],
7045
+ "plum": [221, 160, 221],
7046
+ "powderblue": [176, 224, 230],
7047
+ "purple": [128, 0, 128],
7048
+ "rebeccapurple": [102, 51, 153],
7049
+ "red": [255, 0, 0],
7050
+ "rosybrown": [188, 143, 143],
7051
+ "royalblue": [65, 105, 225],
7052
+ "saddlebrown": [139, 69, 19],
7053
+ "salmon": [250, 128, 114],
7054
+ "sandybrown": [244, 164, 96],
7055
+ "seagreen": [46, 139, 87],
7056
+ "seashell": [255, 245, 238],
7057
+ "sienna": [160, 82, 45],
7058
+ "silver": [192, 192, 192],
7059
+ "skyblue": [135, 206, 235],
7060
+ "slateblue": [106, 90, 205],
7061
+ "slategray": [112, 128, 144],
7062
+ "slategrey": [112, 128, 144],
7063
+ "snow": [255, 250, 250],
7064
+ "springgreen": [0, 255, 127],
7065
+ "steelblue": [70, 130, 180],
7066
+ "tan": [210, 180, 140],
7067
+ "teal": [0, 128, 128],
7068
+ "thistle": [216, 191, 216],
7069
+ "tomato": [255, 99, 71],
7070
+ "turquoise": [64, 224, 208],
7071
+ "violet": [238, 130, 238],
7072
+ "wheat": [245, 222, 179],
7073
+ "white": [255, 255, 255],
7074
+ "whitesmoke": [245, 245, 245],
7075
+ "yellow": [255, 255, 0],
7076
+ "yellowgreen": [154, 205, 50]
7077
+ };
7078
+ return colorName;
7079
+ }
7080
+ var conversions;
7081
+ var hasRequiredConversions;
7082
+ function requireConversions() {
7083
+ if (hasRequiredConversions)
7084
+ return conversions;
7085
+ hasRequiredConversions = 1;
7086
+ const cssKeywords = requireColorName();
7087
+ const reverseKeywords = {};
7088
+ for (const key of Object.keys(cssKeywords)) {
7089
+ reverseKeywords[cssKeywords[key]] = key;
7090
+ }
7091
+ const convert = {
7092
+ rgb: { channels: 3, labels: "rgb" },
7093
+ hsl: { channels: 3, labels: "hsl" },
7094
+ hsv: { channels: 3, labels: "hsv" },
7095
+ hwb: { channels: 3, labels: "hwb" },
7096
+ cmyk: { channels: 4, labels: "cmyk" },
7097
+ xyz: { channels: 3, labels: "xyz" },
7098
+ lab: { channels: 3, labels: "lab" },
7099
+ lch: { channels: 3, labels: "lch" },
7100
+ hex: { channels: 1, labels: ["hex"] },
7101
+ keyword: { channels: 1, labels: ["keyword"] },
7102
+ ansi16: { channels: 1, labels: ["ansi16"] },
7103
+ ansi256: { channels: 1, labels: ["ansi256"] },
7104
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
7105
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
7106
+ gray: { channels: 1, labels: ["gray"] }
7107
+ };
7108
+ conversions = convert;
7109
+ for (const model of Object.keys(convert)) {
7110
+ if (!("channels" in convert[model])) {
7111
+ throw new Error("missing channels property: " + model);
7112
+ }
7113
+ if (!("labels" in convert[model])) {
7114
+ throw new Error("missing channel labels property: " + model);
7115
+ }
7116
+ if (convert[model].labels.length !== convert[model].channels) {
7117
+ throw new Error("channel and label counts mismatch: " + model);
7118
+ }
7119
+ const { channels, labels } = convert[model];
7120
+ delete convert[model].channels;
7121
+ delete convert[model].labels;
7122
+ Object.defineProperty(convert[model], "channels", { value: channels });
7123
+ Object.defineProperty(convert[model], "labels", { value: labels });
7124
+ }
7125
+ convert.rgb.hsl = function(rgb) {
7126
+ const r = rgb[0] / 255;
7127
+ const g = rgb[1] / 255;
7128
+ const b = rgb[2] / 255;
7129
+ const min = Math.min(r, g, b);
7130
+ const max = Math.max(r, g, b);
7131
+ const delta = max - min;
7132
+ let h;
7133
+ let s;
7134
+ if (max === min) {
7135
+ h = 0;
7136
+ } else if (r === max) {
7137
+ h = (g - b) / delta;
7138
+ } else if (g === max) {
7139
+ h = 2 + (b - r) / delta;
7140
+ } else if (b === max) {
7141
+ h = 4 + (r - g) / delta;
7142
+ }
7143
+ h = Math.min(h * 60, 360);
7144
+ if (h < 0) {
7145
+ h += 360;
7146
+ }
7147
+ const l = (min + max) / 2;
7148
+ if (max === min) {
7149
+ s = 0;
7150
+ } else if (l <= 0.5) {
7151
+ s = delta / (max + min);
7152
+ } else {
7153
+ s = delta / (2 - max - min);
7154
+ }
7155
+ return [h, s * 100, l * 100];
7156
+ };
7157
+ convert.rgb.hsv = function(rgb) {
7158
+ let rdif;
7159
+ let gdif;
7160
+ let bdif;
7161
+ let h;
7162
+ let s;
7163
+ const r = rgb[0] / 255;
7164
+ const g = rgb[1] / 255;
7165
+ const b = rgb[2] / 255;
7166
+ const v = Math.max(r, g, b);
7167
+ const diff = v - Math.min(r, g, b);
7168
+ const diffc = function(c) {
7169
+ return (v - c) / 6 / diff + 1 / 2;
7170
+ };
7171
+ if (diff === 0) {
7172
+ h = 0;
7173
+ s = 0;
7174
+ } else {
7175
+ s = diff / v;
7176
+ rdif = diffc(r);
7177
+ gdif = diffc(g);
7178
+ bdif = diffc(b);
7179
+ if (r === v) {
7180
+ h = bdif - gdif;
7181
+ } else if (g === v) {
7182
+ h = 1 / 3 + rdif - bdif;
7183
+ } else if (b === v) {
7184
+ h = 2 / 3 + gdif - rdif;
7185
+ }
7186
+ if (h < 0) {
7187
+ h += 1;
7188
+ } else if (h > 1) {
7189
+ h -= 1;
7190
+ }
7191
+ }
7192
+ return [
7193
+ h * 360,
7194
+ s * 100,
7195
+ v * 100
7196
+ ];
7197
+ };
7198
+ convert.rgb.hwb = function(rgb) {
7199
+ const r = rgb[0];
7200
+ const g = rgb[1];
7201
+ let b = rgb[2];
7202
+ const h = convert.rgb.hsl(rgb)[0];
7203
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
7204
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
7205
+ return [h, w * 100, b * 100];
7206
+ };
7207
+ convert.rgb.cmyk = function(rgb) {
7208
+ const r = rgb[0] / 255;
7209
+ const g = rgb[1] / 255;
7210
+ const b = rgb[2] / 255;
7211
+ const k = Math.min(1 - r, 1 - g, 1 - b);
7212
+ const c = (1 - r - k) / (1 - k) || 0;
7213
+ const m = (1 - g - k) / (1 - k) || 0;
7214
+ const y = (1 - b - k) / (1 - k) || 0;
7215
+ return [c * 100, m * 100, y * 100, k * 100];
7216
+ };
7217
+ function comparativeDistance(x, y) {
7218
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
7219
+ }
7220
+ convert.rgb.keyword = function(rgb) {
7221
+ const reversed = reverseKeywords[rgb];
7222
+ if (reversed) {
7223
+ return reversed;
7224
+ }
7225
+ let currentClosestDistance = Infinity;
7226
+ let currentClosestKeyword;
7227
+ for (const keyword of Object.keys(cssKeywords)) {
7228
+ const value = cssKeywords[keyword];
7229
+ const distance = comparativeDistance(rgb, value);
7230
+ if (distance < currentClosestDistance) {
7231
+ currentClosestDistance = distance;
7232
+ currentClosestKeyword = keyword;
7233
+ }
7234
+ }
7235
+ return currentClosestKeyword;
7236
+ };
7237
+ convert.keyword.rgb = function(keyword) {
7238
+ return cssKeywords[keyword];
7239
+ };
7240
+ convert.rgb.xyz = function(rgb) {
7241
+ let r = rgb[0] / 255;
7242
+ let g = rgb[1] / 255;
7243
+ let b = rgb[2] / 255;
7244
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
7245
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
7246
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
7247
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
7248
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
7249
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
7250
+ return [x * 100, y * 100, z * 100];
7251
+ };
7252
+ convert.rgb.lab = function(rgb) {
7253
+ const xyz = convert.rgb.xyz(rgb);
7254
+ let x = xyz[0];
7255
+ let y = xyz[1];
7256
+ let z = xyz[2];
7257
+ x /= 95.047;
7258
+ y /= 100;
7259
+ z /= 108.883;
7260
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
7261
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
7262
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
7263
+ const l = 116 * y - 16;
7264
+ const a = 500 * (x - y);
7265
+ const b = 200 * (y - z);
7266
+ return [l, a, b];
7267
+ };
7268
+ convert.hsl.rgb = function(hsl) {
7269
+ const h = hsl[0] / 360;
7270
+ const s = hsl[1] / 100;
7271
+ const l = hsl[2] / 100;
7272
+ let t2;
7273
+ let t3;
7274
+ let val;
7275
+ if (s === 0) {
7276
+ val = l * 255;
7277
+ return [val, val, val];
7278
+ }
7279
+ if (l < 0.5) {
7280
+ t2 = l * (1 + s);
7281
+ } else {
7282
+ t2 = l + s - l * s;
7283
+ }
7284
+ const t1 = 2 * l - t2;
7285
+ const rgb = [0, 0, 0];
7286
+ for (let i = 0; i < 3; i++) {
7287
+ t3 = h + 1 / 3 * -(i - 1);
7288
+ if (t3 < 0) {
7289
+ t3++;
7290
+ }
7291
+ if (t3 > 1) {
7292
+ t3--;
7293
+ }
7294
+ if (6 * t3 < 1) {
7295
+ val = t1 + (t2 - t1) * 6 * t3;
7296
+ } else if (2 * t3 < 1) {
7297
+ val = t2;
7298
+ } else if (3 * t3 < 2) {
7299
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
7300
+ } else {
7301
+ val = t1;
7302
+ }
7303
+ rgb[i] = val * 255;
7304
+ }
7305
+ return rgb;
7306
+ };
7307
+ convert.hsl.hsv = function(hsl) {
7308
+ const h = hsl[0];
7309
+ let s = hsl[1] / 100;
7310
+ let l = hsl[2] / 100;
7311
+ let smin = s;
7312
+ const lmin = Math.max(l, 0.01);
7313
+ l *= 2;
7314
+ s *= l <= 1 ? l : 2 - l;
7315
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
7316
+ const v = (l + s) / 2;
7317
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
7318
+ return [h, sv * 100, v * 100];
7319
+ };
7320
+ convert.hsv.rgb = function(hsv) {
7321
+ const h = hsv[0] / 60;
7322
+ const s = hsv[1] / 100;
7323
+ let v = hsv[2] / 100;
7324
+ const hi = Math.floor(h) % 6;
7325
+ const f = h - Math.floor(h);
7326
+ const p = 255 * v * (1 - s);
7327
+ const q = 255 * v * (1 - s * f);
7328
+ const t = 255 * v * (1 - s * (1 - f));
7329
+ v *= 255;
7330
+ switch (hi) {
7331
+ case 0:
7332
+ return [v, t, p];
7333
+ case 1:
7334
+ return [q, v, p];
7335
+ case 2:
7336
+ return [p, v, t];
7337
+ case 3:
7338
+ return [p, q, v];
7339
+ case 4:
7340
+ return [t, p, v];
7341
+ case 5:
7342
+ return [v, p, q];
7343
+ }
7344
+ };
7345
+ convert.hsv.hsl = function(hsv) {
7346
+ const h = hsv[0];
7347
+ const s = hsv[1] / 100;
7348
+ const v = hsv[2] / 100;
7349
+ const vmin = Math.max(v, 0.01);
7350
+ let sl;
7351
+ let l;
7352
+ l = (2 - s) * v;
7353
+ const lmin = (2 - s) * vmin;
7354
+ sl = s * vmin;
7355
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
7356
+ sl = sl || 0;
7357
+ l /= 2;
7358
+ return [h, sl * 100, l * 100];
7359
+ };
7360
+ convert.hwb.rgb = function(hwb) {
7361
+ const h = hwb[0] / 360;
7362
+ let wh = hwb[1] / 100;
7363
+ let bl = hwb[2] / 100;
7364
+ const ratio = wh + bl;
7365
+ let f;
7366
+ if (ratio > 1) {
7367
+ wh /= ratio;
7368
+ bl /= ratio;
7369
+ }
7370
+ const i = Math.floor(6 * h);
7371
+ const v = 1 - bl;
7372
+ f = 6 * h - i;
7373
+ if ((i & 1) !== 0) {
7374
+ f = 1 - f;
7375
+ }
7376
+ const n = wh + f * (v - wh);
7377
+ let r;
7378
+ let g;
7379
+ let b;
7380
+ switch (i) {
7381
+ default:
7382
+ case 6:
7383
+ case 0:
7384
+ r = v;
7385
+ g = n;
7386
+ b = wh;
7387
+ break;
7388
+ case 1:
7389
+ r = n;
7390
+ g = v;
7391
+ b = wh;
7392
+ break;
7393
+ case 2:
7394
+ r = wh;
7395
+ g = v;
7396
+ b = n;
7397
+ break;
7398
+ case 3:
7399
+ r = wh;
7400
+ g = n;
7401
+ b = v;
7402
+ break;
7403
+ case 4:
7404
+ r = n;
7405
+ g = wh;
7406
+ b = v;
7407
+ break;
7408
+ case 5:
7409
+ r = v;
7410
+ g = wh;
7411
+ b = n;
7412
+ break;
7413
+ }
7414
+ return [r * 255, g * 255, b * 255];
7415
+ };
7416
+ convert.cmyk.rgb = function(cmyk) {
7417
+ const c = cmyk[0] / 100;
7418
+ const m = cmyk[1] / 100;
7419
+ const y = cmyk[2] / 100;
7420
+ const k = cmyk[3] / 100;
7421
+ const r = 1 - Math.min(1, c * (1 - k) + k);
7422
+ const g = 1 - Math.min(1, m * (1 - k) + k);
7423
+ const b = 1 - Math.min(1, y * (1 - k) + k);
7424
+ return [r * 255, g * 255, b * 255];
7425
+ };
7426
+ convert.xyz.rgb = function(xyz) {
7427
+ const x = xyz[0] / 100;
7428
+ const y = xyz[1] / 100;
7429
+ const z = xyz[2] / 100;
7430
+ let r;
7431
+ let g;
7432
+ let b;
7433
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
7434
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
7435
+ b = x * 0.0557 + y * -0.204 + z * 1.057;
7436
+ r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
7437
+ g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
7438
+ b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
7439
+ r = Math.min(Math.max(0, r), 1);
7440
+ g = Math.min(Math.max(0, g), 1);
7441
+ b = Math.min(Math.max(0, b), 1);
7442
+ return [r * 255, g * 255, b * 255];
7443
+ };
7444
+ convert.xyz.lab = function(xyz) {
7445
+ let x = xyz[0];
7446
+ let y = xyz[1];
7447
+ let z = xyz[2];
7448
+ x /= 95.047;
7449
+ y /= 100;
7450
+ z /= 108.883;
7451
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
7452
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
7453
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
7454
+ const l = 116 * y - 16;
7455
+ const a = 500 * (x - y);
7456
+ const b = 200 * (y - z);
7457
+ return [l, a, b];
7458
+ };
7459
+ convert.lab.xyz = function(lab) {
7460
+ const l = lab[0];
7461
+ const a = lab[1];
7462
+ const b = lab[2];
7463
+ let x;
7464
+ let y;
7465
+ let z;
7466
+ y = (l + 16) / 116;
7467
+ x = a / 500 + y;
7468
+ z = y - b / 200;
7469
+ const y2 = y ** 3;
7470
+ const x2 = x ** 3;
7471
+ const z2 = z ** 3;
7472
+ y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
7473
+ x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
7474
+ z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
7475
+ x *= 95.047;
7476
+ y *= 100;
7477
+ z *= 108.883;
7478
+ return [x, y, z];
7479
+ };
7480
+ convert.lab.lch = function(lab) {
7481
+ const l = lab[0];
7482
+ const a = lab[1];
7483
+ const b = lab[2];
7484
+ let h;
7485
+ const hr = Math.atan2(b, a);
7486
+ h = hr * 360 / 2 / Math.PI;
7487
+ if (h < 0) {
7488
+ h += 360;
7489
+ }
7490
+ const c = Math.sqrt(a * a + b * b);
7491
+ return [l, c, h];
7492
+ };
7493
+ convert.lch.lab = function(lch) {
7494
+ const l = lch[0];
7495
+ const c = lch[1];
7496
+ const h = lch[2];
7497
+ const hr = h / 360 * 2 * Math.PI;
7498
+ const a = c * Math.cos(hr);
7499
+ const b = c * Math.sin(hr);
7500
+ return [l, a, b];
7501
+ };
7502
+ convert.rgb.ansi16 = function(args, saturation = null) {
7503
+ const [r, g, b] = args;
7504
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
7505
+ value = Math.round(value / 50);
7506
+ if (value === 0) {
7507
+ return 30;
7508
+ }
7509
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
7510
+ if (value === 2) {
7511
+ ansi += 60;
7512
+ }
7513
+ return ansi;
7514
+ };
7515
+ convert.hsv.ansi16 = function(args) {
7516
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
7517
+ };
7518
+ convert.rgb.ansi256 = function(args) {
7519
+ const r = args[0];
7520
+ const g = args[1];
7521
+ const b = args[2];
7522
+ if (r === g && g === b) {
7523
+ if (r < 8) {
7524
+ return 16;
7525
+ }
7526
+ if (r > 248) {
7527
+ return 231;
7528
+ }
7529
+ return Math.round((r - 8) / 247 * 24) + 232;
7530
+ }
7531
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
7532
+ return ansi;
7533
+ };
7534
+ convert.ansi16.rgb = function(args) {
7535
+ let color = args % 10;
7536
+ if (color === 0 || color === 7) {
7537
+ if (args > 50) {
7538
+ color += 3.5;
7539
+ }
7540
+ color = color / 10.5 * 255;
7541
+ return [color, color, color];
7542
+ }
7543
+ const mult = (~~(args > 50) + 1) * 0.5;
7544
+ const r = (color & 1) * mult * 255;
7545
+ const g = (color >> 1 & 1) * mult * 255;
7546
+ const b = (color >> 2 & 1) * mult * 255;
7547
+ return [r, g, b];
7548
+ };
7549
+ convert.ansi256.rgb = function(args) {
7550
+ if (args >= 232) {
7551
+ const c = (args - 232) * 10 + 8;
7552
+ return [c, c, c];
7553
+ }
7554
+ args -= 16;
7555
+ let rem;
7556
+ const r = Math.floor(args / 36) / 5 * 255;
7557
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
7558
+ const b = rem % 6 / 5 * 255;
7559
+ return [r, g, b];
7560
+ };
7561
+ convert.rgb.hex = function(args) {
7562
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
7563
+ const string = integer.toString(16).toUpperCase();
7564
+ return "000000".substring(string.length) + string;
7565
+ };
7566
+ convert.hex.rgb = function(args) {
7567
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
7568
+ if (!match) {
7569
+ return [0, 0, 0];
7570
+ }
7571
+ let colorString = match[0];
7572
+ if (match[0].length === 3) {
7573
+ colorString = colorString.split("").map((char) => {
7574
+ return char + char;
7575
+ }).join("");
7576
+ }
7577
+ const integer = parseInt(colorString, 16);
7578
+ const r = integer >> 16 & 255;
7579
+ const g = integer >> 8 & 255;
7580
+ const b = integer & 255;
7581
+ return [r, g, b];
7582
+ };
7583
+ convert.rgb.hcg = function(rgb) {
7584
+ const r = rgb[0] / 255;
7585
+ const g = rgb[1] / 255;
7586
+ const b = rgb[2] / 255;
7587
+ const max = Math.max(Math.max(r, g), b);
7588
+ const min = Math.min(Math.min(r, g), b);
7589
+ const chroma = max - min;
7590
+ let grayscale;
7591
+ let hue;
7592
+ if (chroma < 1) {
7593
+ grayscale = min / (1 - chroma);
7594
+ } else {
7595
+ grayscale = 0;
7596
+ }
7597
+ if (chroma <= 0) {
7598
+ hue = 0;
7599
+ } else if (max === r) {
7600
+ hue = (g - b) / chroma % 6;
7601
+ } else if (max === g) {
7602
+ hue = 2 + (b - r) / chroma;
7603
+ } else {
7604
+ hue = 4 + (r - g) / chroma;
7605
+ }
7606
+ hue /= 6;
7607
+ hue %= 1;
7608
+ return [hue * 360, chroma * 100, grayscale * 100];
7609
+ };
7610
+ convert.hsl.hcg = function(hsl) {
7611
+ const s = hsl[1] / 100;
7612
+ const l = hsl[2] / 100;
7613
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
7614
+ let f = 0;
7615
+ if (c < 1) {
7616
+ f = (l - 0.5 * c) / (1 - c);
7617
+ }
7618
+ return [hsl[0], c * 100, f * 100];
7619
+ };
7620
+ convert.hsv.hcg = function(hsv) {
7621
+ const s = hsv[1] / 100;
7622
+ const v = hsv[2] / 100;
7623
+ const c = s * v;
7624
+ let f = 0;
7625
+ if (c < 1) {
7626
+ f = (v - c) / (1 - c);
7627
+ }
7628
+ return [hsv[0], c * 100, f * 100];
7629
+ };
7630
+ convert.hcg.rgb = function(hcg) {
7631
+ const h = hcg[0] / 360;
7632
+ const c = hcg[1] / 100;
7633
+ const g = hcg[2] / 100;
7634
+ if (c === 0) {
7635
+ return [g * 255, g * 255, g * 255];
7636
+ }
7637
+ const pure = [0, 0, 0];
7638
+ const hi = h % 1 * 6;
7639
+ const v = hi % 1;
7640
+ const w = 1 - v;
7641
+ let mg = 0;
7642
+ switch (Math.floor(hi)) {
7643
+ case 0:
7644
+ pure[0] = 1;
7645
+ pure[1] = v;
7646
+ pure[2] = 0;
7647
+ break;
7648
+ case 1:
7649
+ pure[0] = w;
7650
+ pure[1] = 1;
7651
+ pure[2] = 0;
7652
+ break;
7653
+ case 2:
7654
+ pure[0] = 0;
7655
+ pure[1] = 1;
7656
+ pure[2] = v;
7657
+ break;
7658
+ case 3:
7659
+ pure[0] = 0;
7660
+ pure[1] = w;
7661
+ pure[2] = 1;
7662
+ break;
7663
+ case 4:
7664
+ pure[0] = v;
7665
+ pure[1] = 0;
7666
+ pure[2] = 1;
7667
+ break;
7668
+ default:
7669
+ pure[0] = 1;
7670
+ pure[1] = 0;
7671
+ pure[2] = w;
7672
+ }
7673
+ mg = (1 - c) * g;
7674
+ return [
7675
+ (c * pure[0] + mg) * 255,
7676
+ (c * pure[1] + mg) * 255,
7677
+ (c * pure[2] + mg) * 255
7678
+ ];
7679
+ };
7680
+ convert.hcg.hsv = function(hcg) {
7681
+ const c = hcg[1] / 100;
7682
+ const g = hcg[2] / 100;
7683
+ const v = c + g * (1 - c);
7684
+ let f = 0;
7685
+ if (v > 0) {
7686
+ f = c / v;
7687
+ }
7688
+ return [hcg[0], f * 100, v * 100];
7689
+ };
7690
+ convert.hcg.hsl = function(hcg) {
7691
+ const c = hcg[1] / 100;
7692
+ const g = hcg[2] / 100;
7693
+ const l = g * (1 - c) + 0.5 * c;
7694
+ let s = 0;
7695
+ if (l > 0 && l < 0.5) {
7696
+ s = c / (2 * l);
7697
+ } else if (l >= 0.5 && l < 1) {
7698
+ s = c / (2 * (1 - l));
7699
+ }
7700
+ return [hcg[0], s * 100, l * 100];
7701
+ };
7702
+ convert.hcg.hwb = function(hcg) {
7703
+ const c = hcg[1] / 100;
7704
+ const g = hcg[2] / 100;
7705
+ const v = c + g * (1 - c);
7706
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
7707
+ };
7708
+ convert.hwb.hcg = function(hwb) {
7709
+ const w = hwb[1] / 100;
7710
+ const b = hwb[2] / 100;
7711
+ const v = 1 - b;
7712
+ const c = v - w;
7713
+ let g = 0;
7714
+ if (c < 1) {
7715
+ g = (v - c) / (1 - c);
7716
+ }
7717
+ return [hwb[0], c * 100, g * 100];
7718
+ };
7719
+ convert.apple.rgb = function(apple) {
7720
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
7721
+ };
7722
+ convert.rgb.apple = function(rgb) {
7723
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
7724
+ };
7725
+ convert.gray.rgb = function(args) {
7726
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
7727
+ };
7728
+ convert.gray.hsl = function(args) {
7729
+ return [0, 0, args[0]];
7730
+ };
7731
+ convert.gray.hsv = convert.gray.hsl;
7732
+ convert.gray.hwb = function(gray) {
7733
+ return [0, 100, gray[0]];
7734
+ };
7735
+ convert.gray.cmyk = function(gray) {
7736
+ return [0, 0, 0, gray[0]];
7737
+ };
7738
+ convert.gray.lab = function(gray) {
7739
+ return [gray[0], 0, 0];
7740
+ };
7741
+ convert.gray.hex = function(gray) {
7742
+ const val = Math.round(gray[0] / 100 * 255) & 255;
7743
+ const integer = (val << 16) + (val << 8) + val;
7744
+ const string = integer.toString(16).toUpperCase();
7745
+ return "000000".substring(string.length) + string;
7746
+ };
7747
+ convert.rgb.gray = function(rgb) {
7748
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
7749
+ return [val / 255 * 100];
7750
+ };
7751
+ return conversions;
7752
+ }
7753
+ var route;
7754
+ var hasRequiredRoute;
7755
+ function requireRoute() {
7756
+ if (hasRequiredRoute)
7757
+ return route;
7758
+ hasRequiredRoute = 1;
7759
+ const conversions2 = requireConversions();
7760
+ function buildGraph() {
7761
+ const graph = {};
7762
+ const models = Object.keys(conversions2);
7763
+ for (let len = models.length, i = 0; i < len; i++) {
7764
+ graph[models[i]] = {
7765
+ // http://jsperf.com/1-vs-infinity
7766
+ // micro-opt, but this is simple.
7767
+ distance: -1,
7768
+ parent: null
7769
+ };
7770
+ }
7771
+ return graph;
7772
+ }
7773
+ function deriveBFS(fromModel) {
7774
+ const graph = buildGraph();
7775
+ const queue = [fromModel];
7776
+ graph[fromModel].distance = 0;
7777
+ while (queue.length) {
7778
+ const current = queue.pop();
7779
+ const adjacents = Object.keys(conversions2[current]);
7780
+ for (let len = adjacents.length, i = 0; i < len; i++) {
7781
+ const adjacent = adjacents[i];
7782
+ const node = graph[adjacent];
7783
+ if (node.distance === -1) {
7784
+ node.distance = graph[current].distance + 1;
7785
+ node.parent = current;
7786
+ queue.unshift(adjacent);
7787
+ }
7788
+ }
7789
+ }
7790
+ return graph;
7791
+ }
7792
+ function link(from, to) {
7793
+ return function(args) {
7794
+ return to(from(args));
7795
+ };
7796
+ }
7797
+ function wrapConversion(toModel, graph) {
7798
+ const path2 = [graph[toModel].parent, toModel];
7799
+ let fn = conversions2[graph[toModel].parent][toModel];
7800
+ let cur = graph[toModel].parent;
7801
+ while (graph[cur].parent) {
7802
+ path2.unshift(graph[cur].parent);
7803
+ fn = link(conversions2[graph[cur].parent][cur], fn);
7804
+ cur = graph[cur].parent;
7805
+ }
7806
+ fn.conversion = path2;
7807
+ return fn;
7808
+ }
7809
+ route = function(fromModel) {
7810
+ const graph = deriveBFS(fromModel);
7811
+ const conversion = {};
7812
+ const models = Object.keys(graph);
7813
+ for (let len = models.length, i = 0; i < len; i++) {
7814
+ const toModel = models[i];
7815
+ const node = graph[toModel];
7816
+ if (node.parent === null) {
7817
+ continue;
7818
+ }
7819
+ conversion[toModel] = wrapConversion(toModel, graph);
7820
+ }
7821
+ return conversion;
7822
+ };
7823
+ return route;
7824
+ }
7825
+ var colorConvert;
7826
+ var hasRequiredColorConvert;
7827
+ function requireColorConvert() {
7828
+ if (hasRequiredColorConvert)
7829
+ return colorConvert;
7830
+ hasRequiredColorConvert = 1;
7831
+ const conversions2 = requireConversions();
7832
+ const route2 = requireRoute();
7833
+ const convert = {};
7834
+ const models = Object.keys(conversions2);
7835
+ function wrapRaw(fn) {
7836
+ const wrappedFn = function(...args) {
7837
+ const arg0 = args[0];
7838
+ if (arg0 === void 0 || arg0 === null) {
7839
+ return arg0;
7840
+ }
7841
+ if (arg0.length > 1) {
7842
+ args = arg0;
7843
+ }
7844
+ return fn(args);
7845
+ };
7846
+ if ("conversion" in fn) {
7847
+ wrappedFn.conversion = fn.conversion;
7848
+ }
7849
+ return wrappedFn;
7850
+ }
7851
+ function wrapRounded(fn) {
7852
+ const wrappedFn = function(...args) {
7853
+ const arg0 = args[0];
7854
+ if (arg0 === void 0 || arg0 === null) {
7855
+ return arg0;
7856
+ }
7857
+ if (arg0.length > 1) {
7858
+ args = arg0;
7859
+ }
7860
+ const result = fn(args);
7861
+ if (typeof result === "object") {
7862
+ for (let len = result.length, i = 0; i < len; i++) {
7863
+ result[i] = Math.round(result[i]);
7864
+ }
7865
+ }
7866
+ return result;
7867
+ };
7868
+ if ("conversion" in fn) {
7869
+ wrappedFn.conversion = fn.conversion;
7870
+ }
7871
+ return wrappedFn;
7872
+ }
7873
+ models.forEach((fromModel) => {
7874
+ convert[fromModel] = {};
7875
+ Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
7876
+ Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
7877
+ const routes = route2(fromModel);
7878
+ const routeModels = Object.keys(routes);
7879
+ routeModels.forEach((toModel) => {
7880
+ const fn = routes[toModel];
7881
+ convert[fromModel][toModel] = wrapRounded(fn);
7882
+ convert[fromModel][toModel].raw = wrapRaw(fn);
7883
+ });
7884
+ });
7885
+ colorConvert = convert;
7886
+ return colorConvert;
7887
+ }
7888
+ ansiStyles$1.exports;
7889
+ (function(module) {
7890
+ const wrapAnsi16 = (fn, offset) => (...args) => {
7891
+ const code = fn(...args);
7892
+ return `\x1B[${code + offset}m`;
7893
+ };
7894
+ const wrapAnsi256 = (fn, offset) => (...args) => {
7895
+ const code = fn(...args);
7896
+ return `\x1B[${38 + offset};5;${code}m`;
7897
+ };
7898
+ const wrapAnsi16m = (fn, offset) => (...args) => {
7899
+ const rgb = fn(...args);
7900
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
7901
+ };
7902
+ const ansi2ansi = (n) => n;
7903
+ const rgb2rgb = (r, g, b) => [r, g, b];
7904
+ const setLazyProperty = (object, property, get) => {
7905
+ Object.defineProperty(object, property, {
7906
+ get: () => {
7907
+ const value = get();
7908
+ Object.defineProperty(object, property, {
7909
+ value,
7910
+ enumerable: true,
7911
+ configurable: true
7912
+ });
7913
+ return value;
7914
+ },
7915
+ enumerable: true,
7916
+ configurable: true
7917
+ });
7918
+ };
7919
+ let colorConvert2;
7920
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
7921
+ if (colorConvert2 === void 0) {
7922
+ colorConvert2 = requireColorConvert();
7923
+ }
7924
+ const offset = isBackground ? 10 : 0;
7925
+ const styles2 = {};
7926
+ for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
7927
+ const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
7928
+ if (sourceSpace === targetSpace) {
7929
+ styles2[name2] = wrap(identity, offset);
7930
+ } else if (typeof suite === "object") {
7931
+ styles2[name2] = wrap(suite[targetSpace], offset);
7932
+ }
7933
+ }
7934
+ return styles2;
7935
+ };
7936
+ function assembleStyles() {
7937
+ const codes = /* @__PURE__ */ new Map();
7938
+ const styles2 = {
7939
+ modifier: {
7940
+ reset: [0, 0],
7941
+ // 21 isn't widely supported and 22 does the same thing
7942
+ bold: [1, 22],
7943
+ dim: [2, 22],
7944
+ italic: [3, 23],
7945
+ underline: [4, 24],
7946
+ inverse: [7, 27],
7947
+ hidden: [8, 28],
7948
+ strikethrough: [9, 29]
7949
+ },
7950
+ color: {
7951
+ black: [30, 39],
7952
+ red: [31, 39],
7953
+ green: [32, 39],
7954
+ yellow: [33, 39],
7955
+ blue: [34, 39],
7956
+ magenta: [35, 39],
7957
+ cyan: [36, 39],
7958
+ white: [37, 39],
7959
+ // Bright color
7960
+ blackBright: [90, 39],
7961
+ redBright: [91, 39],
7962
+ greenBright: [92, 39],
7963
+ yellowBright: [93, 39],
7964
+ blueBright: [94, 39],
7965
+ magentaBright: [95, 39],
7966
+ cyanBright: [96, 39],
7967
+ whiteBright: [97, 39]
7968
+ },
7969
+ bgColor: {
7970
+ bgBlack: [40, 49],
7971
+ bgRed: [41, 49],
7972
+ bgGreen: [42, 49],
7973
+ bgYellow: [43, 49],
7974
+ bgBlue: [44, 49],
7975
+ bgMagenta: [45, 49],
7976
+ bgCyan: [46, 49],
7977
+ bgWhite: [47, 49],
7978
+ // Bright color
7979
+ bgBlackBright: [100, 49],
7980
+ bgRedBright: [101, 49],
7981
+ bgGreenBright: [102, 49],
7982
+ bgYellowBright: [103, 49],
7983
+ bgBlueBright: [104, 49],
7984
+ bgMagentaBright: [105, 49],
7985
+ bgCyanBright: [106, 49],
7986
+ bgWhiteBright: [107, 49]
7987
+ }
7988
+ };
7989
+ styles2.color.gray = styles2.color.blackBright;
7990
+ styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
7991
+ styles2.color.grey = styles2.color.blackBright;
7992
+ styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
7993
+ for (const [groupName, group] of Object.entries(styles2)) {
7994
+ for (const [styleName, style] of Object.entries(group)) {
7995
+ styles2[styleName] = {
7996
+ open: `\x1B[${style[0]}m`,
7997
+ close: `\x1B[${style[1]}m`
7998
+ };
7999
+ group[styleName] = styles2[styleName];
8000
+ codes.set(style[0], style[1]);
8001
+ }
8002
+ Object.defineProperty(styles2, groupName, {
8003
+ value: group,
8004
+ enumerable: false
8005
+ });
8006
+ }
8007
+ Object.defineProperty(styles2, "codes", {
8008
+ value: codes,
8009
+ enumerable: false
8010
+ });
8011
+ styles2.color.close = "\x1B[39m";
8012
+ styles2.bgColor.close = "\x1B[49m";
8013
+ setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
8014
+ setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
8015
+ setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
8016
+ setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
8017
+ setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
8018
+ setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
8019
+ return styles2;
8020
+ }
8021
+ Object.defineProperty(module, "exports", {
8022
+ enumerable: true,
8023
+ get: assembleStyles
8024
+ });
8025
+ })(ansiStyles$1);
8026
+ var ansiStylesExports = ansiStyles$1.exports;
8027
+ var browser = {
8028
+ stdout: false,
8029
+ stderr: false
8030
+ };
8031
+ const stringReplaceAll$1 = (string, substring, replacer) => {
8032
+ let index = string.indexOf(substring);
8033
+ if (index === -1) {
8034
+ return string;
8035
+ }
8036
+ const substringLength = substring.length;
8037
+ let endIndex = 0;
8038
+ let returnValue = "";
8039
+ do {
8040
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
8041
+ endIndex = index + substringLength;
8042
+ index = string.indexOf(substring, endIndex);
8043
+ } while (index !== -1);
8044
+ returnValue += string.substr(endIndex);
8045
+ return returnValue;
8046
+ };
8047
+ const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
8048
+ let endIndex = 0;
8049
+ let returnValue = "";
8050
+ do {
8051
+ const gotCR = string[index - 1] === "\r";
8052
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
8053
+ endIndex = index + 1;
8054
+ index = string.indexOf("\n", endIndex);
8055
+ } while (index !== -1);
8056
+ returnValue += string.substr(endIndex);
8057
+ return returnValue;
8058
+ };
8059
+ var util = {
8060
+ stringReplaceAll: stringReplaceAll$1,
8061
+ stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
8062
+ };
8063
+ var templates;
8064
+ var hasRequiredTemplates;
8065
+ function requireTemplates() {
8066
+ if (hasRequiredTemplates)
8067
+ return templates;
8068
+ hasRequiredTemplates = 1;
8069
+ const TEMPLATE_REGEX = /(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
8070
+ const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
8071
+ const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
8072
+ const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
8073
+ const ESCAPES = /* @__PURE__ */ new Map([
8074
+ ["n", "\n"],
8075
+ ["r", "\r"],
8076
+ ["t", " "],
8077
+ ["b", "\b"],
8078
+ ["f", "\f"],
8079
+ ["v", "\v"],
8080
+ ["0", "\0"],
8081
+ ["\\", "\\"],
8082
+ ["e", "\x1B"],
8083
+ ["a", "\x07"]
8084
+ ]);
8085
+ function unescape(c) {
8086
+ const u = c[0] === "u";
8087
+ const bracket = c[1] === "{";
8088
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
8089
+ return String.fromCharCode(parseInt(c.slice(1), 16));
8090
+ }
8091
+ if (u && bracket) {
8092
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
8093
+ }
8094
+ return ESCAPES.get(c) || c;
8095
+ }
8096
+ function parseArguments(name2, arguments_) {
8097
+ const results = [];
8098
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
8099
+ let matches;
8100
+ for (const chunk of chunks) {
8101
+ const number = Number(chunk);
8102
+ if (!Number.isNaN(number)) {
8103
+ results.push(number);
8104
+ } else if (matches = chunk.match(STRING_REGEX)) {
8105
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape, character) => escape ? unescape(escape) : character));
8106
+ } else {
8107
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
8108
+ }
8109
+ }
8110
+ return results;
8111
+ }
8112
+ function parseStyle(style) {
8113
+ STYLE_REGEX.lastIndex = 0;
8114
+ const results = [];
8115
+ let matches;
8116
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
8117
+ const name2 = matches[1];
8118
+ if (matches[2]) {
8119
+ const args = parseArguments(name2, matches[2]);
8120
+ results.push([name2].concat(args));
8121
+ } else {
8122
+ results.push([name2]);
8123
+ }
8124
+ }
8125
+ return results;
8126
+ }
8127
+ function buildStyle(chalk2, styles2) {
8128
+ const enabled = {};
8129
+ for (const layer of styles2) {
8130
+ for (const style of layer.styles) {
8131
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
8132
+ }
8133
+ }
8134
+ let current = chalk2;
8135
+ for (const [styleName, styles3] of Object.entries(enabled)) {
8136
+ if (!Array.isArray(styles3)) {
8137
+ continue;
8138
+ }
8139
+ if (!(styleName in current)) {
8140
+ throw new Error(`Unknown Chalk style: ${styleName}`);
8141
+ }
8142
+ current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
8143
+ }
8144
+ return current;
8145
+ }
8146
+ templates = (chalk2, temporary) => {
8147
+ const styles2 = [];
8148
+ const chunks = [];
8149
+ let chunk = [];
8150
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
8151
+ if (escapeCharacter) {
8152
+ chunk.push(unescape(escapeCharacter));
8153
+ } else if (style) {
8154
+ const string = chunk.join("");
8155
+ chunk = [];
8156
+ chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
8157
+ styles2.push({ inverse, styles: parseStyle(style) });
8158
+ } else if (close) {
8159
+ if (styles2.length === 0) {
8160
+ throw new Error("Found extraneous } in Chalk template literal");
8161
+ }
8162
+ chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
8163
+ chunk = [];
8164
+ styles2.pop();
8165
+ } else {
8166
+ chunk.push(character);
8167
+ }
8168
+ });
8169
+ chunks.push(chunk.join(""));
8170
+ if (styles2.length > 0) {
8171
+ const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
8172
+ throw new Error(errMessage);
8173
+ }
8174
+ return chunks.join("");
8175
+ };
8176
+ return templates;
8177
+ }
8178
+ const ansiStyles = ansiStylesExports;
8179
+ const { stdout: stdoutColor, stderr: stderrColor } = browser;
8180
+ const {
8181
+ stringReplaceAll,
8182
+ stringEncaseCRLFWithFirstIndex
8183
+ } = util;
8184
+ const { isArray } = Array;
8185
+ const levelMapping = [
8186
+ "ansi",
8187
+ "ansi",
8188
+ "ansi256",
8189
+ "ansi16m"
8190
+ ];
8191
+ const styles = /* @__PURE__ */ Object.create(null);
8192
+ const applyOptions = (object, options = {}) => {
8193
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
8194
+ throw new Error("The `level` option should be an integer from 0 to 3");
8195
+ }
8196
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
8197
+ object.level = options.level === void 0 ? colorLevel : options.level;
8198
+ };
8199
+ class ChalkClass2 {
8200
+ constructor(options) {
8201
+ return chalkFactory(options);
8202
+ }
8203
+ }
8204
+ const chalkFactory = (options) => {
8205
+ const chalk2 = {};
8206
+ applyOptions(chalk2, options);
8207
+ chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
8208
+ Object.setPrototypeOf(chalk2, Chalk.prototype);
8209
+ Object.setPrototypeOf(chalk2.template, chalk2);
8210
+ chalk2.template.constructor = () => {
8211
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
8212
+ };
8213
+ chalk2.template.Instance = ChalkClass2;
8214
+ return chalk2.template;
8215
+ };
8216
+ function Chalk(options) {
8217
+ return chalkFactory(options);
8218
+ }
8219
+ for (const [styleName, style] of Object.entries(ansiStyles)) {
8220
+ styles[styleName] = {
8221
+ get() {
8222
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
8223
+ Object.defineProperty(this, styleName, { value: builder });
8224
+ return builder;
8225
+ }
8226
+ };
8227
+ }
8228
+ styles.visible = {
8229
+ get() {
8230
+ const builder = createBuilder(this, this._styler, true);
8231
+ Object.defineProperty(this, "visible", { value: builder });
8232
+ return builder;
8233
+ }
8234
+ };
8235
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
8236
+ for (const model of usedModels) {
8237
+ styles[model] = {
8238
+ get() {
8239
+ const { level } = this;
8240
+ return function(...arguments_) {
8241
+ const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
8242
+ return createBuilder(this, styler, this._isEmpty);
8243
+ };
8244
+ }
8245
+ };
8246
+ }
8247
+ for (const model of usedModels) {
8248
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
8249
+ styles[bgModel] = {
8250
+ get() {
8251
+ const { level } = this;
8252
+ return function(...arguments_) {
8253
+ const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
8254
+ return createBuilder(this, styler, this._isEmpty);
8255
+ };
8256
+ }
8257
+ };
8258
+ }
8259
+ const proto = Object.defineProperties(() => {
8260
+ }, {
8261
+ ...styles,
8262
+ level: {
8263
+ enumerable: true,
8264
+ get() {
8265
+ return this._generator.level;
8266
+ },
8267
+ set(level) {
8268
+ this._generator.level = level;
8269
+ }
8270
+ }
8271
+ });
8272
+ const createStyler = (open, close, parent) => {
8273
+ let openAll;
8274
+ let closeAll;
8275
+ if (parent === void 0) {
8276
+ openAll = open;
8277
+ closeAll = close;
8278
+ } else {
8279
+ openAll = parent.openAll + open;
8280
+ closeAll = close + parent.closeAll;
8281
+ }
8282
+ return {
8283
+ open,
8284
+ close,
8285
+ openAll,
8286
+ closeAll,
8287
+ parent
8288
+ };
8289
+ };
8290
+ const createBuilder = (self2, _styler, _isEmpty) => {
8291
+ const builder = (...arguments_) => {
8292
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
8293
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
8294
+ }
8295
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
8296
+ };
8297
+ Object.setPrototypeOf(builder, proto);
8298
+ builder._generator = self2;
8299
+ builder._styler = _styler;
8300
+ builder._isEmpty = _isEmpty;
8301
+ return builder;
8302
+ };
8303
+ const applyStyle = (self2, string) => {
8304
+ if (self2.level <= 0 || !string) {
8305
+ return self2._isEmpty ? "" : string;
8306
+ }
8307
+ let styler = self2._styler;
8308
+ if (styler === void 0) {
8309
+ return string;
8310
+ }
8311
+ const { openAll, closeAll } = styler;
8312
+ if (string.indexOf("\x1B") !== -1) {
8313
+ while (styler !== void 0) {
8314
+ string = stringReplaceAll(string, styler.close, styler.open);
8315
+ styler = styler.parent;
8316
+ }
8317
+ }
8318
+ const lfIndex = string.indexOf("\n");
8319
+ if (lfIndex !== -1) {
8320
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
8321
+ }
8322
+ return openAll + string + closeAll;
8323
+ };
8324
+ let template;
8325
+ const chalkTag = (chalk2, ...strings) => {
8326
+ const [firstString] = strings;
8327
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
8328
+ return strings.join(" ");
8329
+ }
8330
+ const arguments_ = strings.slice(1);
8331
+ const parts = [firstString.raw[0]];
8332
+ for (let i = 1; i < firstString.length; i++) {
8333
+ parts.push(
8334
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
8335
+ String(firstString.raw[i])
8336
+ );
8337
+ }
8338
+ if (template === void 0) {
8339
+ template = requireTemplates();
8340
+ }
8341
+ return template(chalk2, parts.join(""));
8342
+ };
8343
+ Object.defineProperties(Chalk.prototype, styles);
8344
+ const chalk = Chalk();
8345
+ chalk.supportsColor = stdoutColor;
8346
+ chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
8347
+ chalk.stderr.supportsColor = stderrColor;
8348
+ var source = chalk;
8349
+ const chalk$1 = /* @__PURE__ */ getDefaultExportFromCjs(source);
8350
+ const { accessSync, constants, readFileSync } = fs;
8351
+ let envOptions = null;
8352
+ function SetupConfig(envOptions2, logger) {
8353
+ const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
8354
+ config_1({ path: envfile });
8355
+ const defconfig = {
8356
+ // Node runtime environment
8357
+ isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
8358
+ isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
8359
+ consoleLogErrors: process.env.CONSOLE_LOG_ERRORS === void 0 ? false : process.env.CONSOLE_LOG_ERRORS === "true" ? true : false,
8360
+ dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
8361
+ dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
8362
+ dbpasswordfile: process.env.DB_PASSWORD_FILE,
8363
+ dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
8364
+ database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
8365
+ databaseUrl: process.env.DATABASE_URL,
8366
+ databasescriptfolder: process.env.DB_SCRIPT_FOLDER === void 0 ? "/var/lib/sts/stsglobalresources/db-scripts" : process.env.DB_SCRIPT_FOLDER,
8367
+ connectionString: "",
8368
+ defaultDatabaseConnectionString: "",
8369
+ logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
8370
+ logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
8371
+ logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
8372
+ poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
8373
+ useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
8374
+ respawnOnFail: process.env.RESPAWN === void 0 ? false : process.env.RESPAWN === "true" ? true : false,
8375
+ defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
8376
+ useRedis: process.env.USE_REDIS === void 0 ? false : process.env.USE_REDIS === "true" ? true : false,
8377
+ useL1Redis: process.env.USE_L1_REDIS === void 0 ? false : process.env.USE_L1_REDIS === "true" ? true : false,
8378
+ useRedisAdaptor: process.env.USE_REDIS_ADAPTOR === void 0 ? false : process.env.USE_REDIS_ADAPTOR === "true" ? true : false,
8379
+ redisAdaptorUrl: process.env.REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_ADAPTOR_URL,
8380
+ useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
8381
+ redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
8382
+ endFlush: process.env.REDIS_END_FLUSH === void 0 ? false : process.env.REDIS_END_FLUSH === "true" ? true : false,
8383
+ redisPort: process.env.REDIS_PORT === void 0 ? "6379" : process.env.REDIS_PORT,
8384
+ redisServer: process.env.REDIS_SERVER === void 0 ? "localhost" : process.env.REDIS_SERVER,
8385
+ k6ScriptPath: process.env.K6SCRIPTPATH === void 0 ? "." : process.env.K6SCRIPTPATH,
8386
+ defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
8387
+ defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
8388
+ rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
8389
+ rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
8390
+ rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
8391
+ rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
8392
+ rest01apiidentifier: process.env.REST01_API_IDENTIFIER,
8393
+ rest01apiidentifierfile: process.env.REST01_API_IDENTIFIER_FILE,
8394
+ rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
8395
+ rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
8396
+ rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
8397
+ rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
8398
+ rest01clientid: process.env.REST01_CLIENT_ID,
8399
+ rest01clientidfile: process.env.REST01_CLIENT_ID_FILE,
8400
+ rest01clientsecret: process.env.REST01_CLIENT_SECRET,
8401
+ rest01clientsecretfile: process.env.REST01_CLIENT_SECRET_FILE,
8402
+ imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
8403
+ imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
8404
+ import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
8405
+ imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
8406
+ imapiidentifier: process.env.IM_API_IDENTIFIER,
8407
+ imapiidentifierfile: process.env.IM_API_IDENTIFIER_FILE,
8408
+ imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
8409
+ imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
8410
+ imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
8411
+ imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
8412
+ imclientid: process.env.IM_CLIENT_ID,
8413
+ imclientidfile: process.env.IM_CLIENT_ID_FILE,
8414
+ imclientsecret: process.env.IM_CLIENT_SECRET,
8415
+ imclientsecretfile: process.env.IM_CLIENT_SECRET_FILE,
8416
+ toendpoint: process.env.TO_ENDPOINT === void 0 ? "https://localhost" : process.env.TO_ENDPOINT,
8417
+ tohostport: process.env.TO_HOST_PORT === void 0 ? "3004" : process.env.TO_HOST_PORT,
8418
+ toport: process.env.TO_PORT === void 0 ? "3004" : process.env.TO_PORT,
8419
+ toapiroot: process.env.TO_APIROOT === void 0 ? "/ststestorchestrator/v1" : process.env.TO_APIROOT,
8420
+ toapiidentifier: process.env.TO_API_IDENTIFIER,
8421
+ toapiidentifierfile: process.env.TO_API_IDENTIFIER_FILE,
8422
+ toprometheussupport: process.env.TO_PROM_SUPPORT === void 0 ? true : process.env.TO_PROM_SUPPORT === "true" ? true : false,
8423
+ toprometheusclusterport: process.env.TO_PROM_CLUSTER_PORT === void 0 ? "3014" : process.env.TO_PROM_CLUSTER_PORT,
8424
+ toservicename: process.env.TO_SERVICE_NAME === void 0 ? "STSTestOrchestrator" : process.env.TO_SERVICE_NAME,
8425
+ toserviceversion: process.env.TO_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TO_SERVICE_VERSION,
8426
+ toclientid: process.env.TO_CLIENT_ID,
8427
+ toclientidfile: process.env.TO_CLIENT_ID_FILE,
8428
+ toclientsecret: process.env.TO_CLIENT_SECRET,
8429
+ toclientsecretfile: process.env.TO_CLIENT_SECRET_FILE,
8430
+ asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
8431
+ ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
8432
+ asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
8433
+ asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
8434
+ asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
8435
+ asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
8436
+ asapiidentifier: process.env.AS_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthapi/v1.0/" : process.env.AS_API_IDENTIFIER,
8437
+ asapiidentifierfile: process.env.AS_API_IDENTIFIER_FILE,
8438
+ asoauthapiidentifier: process.env.AS_OAUTH_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthoauthapi/v2.0/" : process.env.AS_OAUTH_API_IDENTIFIER,
8439
+ asoauthapiidentifierfile: process.env.AS_OAUTH_API_IDENTIFIER_FILE,
8440
+ asadminapiidentifier: process.env.AS_ADMIN_API_IDENTIFIER === void 0 ? "https://stsmda.com.au/stsauthadminapi/v1.0/" : process.env.AS_ADMIN_API_IDENTIFIER,
8441
+ asadminapiidentifierfile: process.env.AS_ADMIN_API_IDENTIFIER_FILE,
8442
+ asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
8443
+ asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
8444
+ asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
8445
+ asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
8446
+ asclientid: process.env.AS_CLIENT_ID,
8447
+ asclientidfile: process.env.AS_CLIENT_ID_FILE,
8448
+ asclientsecret: process.env.AS_CLIENT_SECRET,
8449
+ asclientsecretfile: process.env.AS_CLIENT_SECRET_FILE,
8450
+ asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
8451
+ asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
8452
+ asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
8453
+ asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
8454
+ asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
8455
+ authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
8456
+ authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
8457
+ authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
8458
+ authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
8459
+ brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
8460
+ brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
8461
+ brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
8462
+ brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
8463
+ brokerapiidentifier: process.env.BROKER_API_IDENTIFIER,
8464
+ brokerapiidentifierfile: process.env.BROKER_API_IDENTIFIER_FILE,
8465
+ brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
8466
+ brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
8467
+ brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
8468
+ brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
8469
+ brokerclientid: process.env.BROKER_CLIENT_ID,
8470
+ brokerclientidfile: process.env.BROKER_CLIENT_ID_FILE,
8471
+ brokerclientsecret: process.env.BROKER_CLIENT_SECRET,
8472
+ brokerclientsecretfile: process.env.BROKER_CLIENT_SECRET_FILE,
8473
+ trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
8474
+ trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
8475
+ trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
8476
+ trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
8477
+ trnapiidentifier: process.env.TRN_API_IDENTIFIER,
8478
+ trnapiidentifierfile: process.env.TRN_API_IDENTIFIER_FILE,
8479
+ trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
8480
+ trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
8481
+ trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
8482
+ trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
8483
+ trnclientid: process.env.TRN_CLIENT_ID,
8484
+ trnclientidfile: process.env.TRN_CLIENT_ID_FILE,
8485
+ trnclientsecret: process.env.TRN_CLIENT_SECRET,
8486
+ trnclientsecretfile: process.env.TRN_CLIENT_SECRET_FILE,
8487
+ trncallbackuri: process.env.TRN_CALLBACK_URI === void 0 ? "https://localhost:3007/ststrn/v1.0/" : process.env.TRN_CALLBACK_URI,
8488
+ trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
8489
+ trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
8490
+ trprometheussupport: process.env.TR_PROM_SUPPORT === void 0 ? true : process.env.TR_PROM_SUPPORT === "true" ? true : false,
8491
+ trprometheusclusterport: process.env.TR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.TR_PROM_CLUSTER_PORT,
8492
+ trservicename: process.env.TR_SERVICE_NAME === void 0 ? "STSRestRunner" : process.env.TR_SERVICE_NAME,
8493
+ trserviceversion: process.env.TR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TR_SERVICE_VERSION,
8494
+ trclientid: process.env.TR_CLIENT_ID,
8495
+ trclientidfile: process.env.TR_CLIENT_ID_FILE,
8496
+ trclientsecret: process.env.TR_CLIENT_SECRET,
8497
+ trclientsecretfile: process.env.TR_CLIENT_SECRET_FILE,
8498
+ lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
8499
+ lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
8500
+ lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
8501
+ lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
8502
+ lambdaapiidentifier: process.env.LAMBDA_API_IDENTIFIER,
8503
+ lambdaapiidentifierfile: process.env.LAMBDA_API_IDENTIFIER_FILE,
8504
+ lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
8505
+ lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
8506
+ lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
8507
+ lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
8508
+ lambdaclientid: process.env.LAMBDA_CLIENT_ID,
8509
+ lambdaclientidfile: process.env.LAMBDA_CLIENT_ID_FILE,
8510
+ lambdaclientsecret: process.env.LAMBDA_CLIENT_SECRET,
8511
+ lambdaclientsecretfile: process.env.LAMBDA_CLIENT_SECRET_FILE,
8512
+ publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
8513
+ publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
8514
+ publishdebug: process.env.PUBLISH_DEBUG === void 0 ? false : process.env.PUBLISH_DEBUG === "true" ? true : false,
8515
+ transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
8516
+ useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
8517
+ keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
8518
+ maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
8519
+ maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
8520
+ maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
8521
+ timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
8522
+ maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
8523
+ instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
8524
+ instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
8525
+ authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
8526
+ authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
8527
+ authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
8528
+ masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
8529
+ childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
8530
+ systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
8531
+ ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
8532
+ httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
8533
+ httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
8534
+ tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
8535
+ tsjwksstorepath: process.env.TS_JWKS_STORE_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.stsauthprivate/jwks-private.json" : process.env.TS_JWKS_STORE_PATH,
8536
+ tsjwksstorepathfile: process.env.TS_JWKS_STORE_PATH_FILE,
8537
+ tsjwksstorepublicpath: process.env.TS_JWKS_STORE_PUBLIC_PATH === void 0 ? "/var/lib/sts/stsglobalresources/.well-known/jwks.json" : process.env.TS_JWKS_STORE_PUBLIC_PATH,
8538
+ jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
8539
+ jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
8540
+ jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
8541
+ jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
8542
+ jwksAuthConfigRateLimitRequestsPerMinute: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE === void 0 ? 10 : parseInt(process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE),
8543
+ jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
8544
+ influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
8545
+ influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
8546
+ influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
8547
+ influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
8548
+ influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
8549
+ influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
8550
+ influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
8551
+ influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
8552
+ influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
8553
+ influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
8554
+ influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
8555
+ influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
8556
+ kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
8557
+ kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
8558
+ kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
8559
+ kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
8560
+ kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
8561
+ kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
8562
+ kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
8563
+ kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
8564
+ kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
8565
+ kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
8566
+ kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
8567
+ kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
8568
+ kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
8569
+ observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
8570
+ stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
8571
+ };
8572
+ const ReadFile = (passwordFile) => {
8573
+ try {
8574
+ accessSync(passwordFile, constants.R_OK);
8575
+ const data = readFileSync(passwordFile, "utf8");
8576
+ if (logger)
8577
+ logger.debug(chalk$1.green(`Successfully loaded password file: [${passwordFile}]`));
8578
+ return data;
8579
+ } catch (err) {
8580
+ if (logger)
8581
+ logger.debug(chalk$1.red(`Problem loading password file: [${passwordFile}], Error: [${err}]`));
8582
+ return "";
8583
+ }
8584
+ };
8585
+ const fileconfig = [
8586
+ { fileprop: "dbpasswordfile", prop: "dbpassword" },
8587
+ // API identifier file processing
8588
+ { fileprop: "asapiidentifierfile", prop: "asapiidentifier" },
8589
+ { fileprop: "asoauthapiidentifierfile", prop: "asoauthapiidentifier" },
8590
+ { fileprop: "asadminapiidentifierfile", prop: "asadminapiidentifier" },
8591
+ { fileprop: "rest01apiidentifierfile", prop: "rest01apiidentifier" },
8592
+ { fileprop: "brokerapiidentifierfile", prop: "brokerapiidentifier" },
8593
+ { fileprop: "toapiidentifierfile", prop: "toapiidentifier" },
8594
+ { fileprop: "imapiidentifierfile", prop: "imapiidentifier" },
8595
+ { fileprop: "trnapiidentifierfile", prop: "trnapiidentifier" },
8596
+ { fileprop: "lambdaapiidentifierfile", prop: "lambdaapiidentifier" },
8597
+ // Client ID file processing
8598
+ { fileprop: "asclientidfile", prop: "asclientid" },
8599
+ { fileprop: "rest01clientidfile", prop: "rest01clientid" },
8600
+ { fileprop: "brokerclientidfile", prop: "brokerclientid" },
8601
+ { fileprop: "toclientidfile", prop: "toclientid" },
8602
+ { fileprop: "imclientidfile", prop: "imclientid" },
8603
+ { fileprop: "trclientidfile", prop: "trclientid" },
8604
+ { fileprop: "trnclientidfile", prop: "trnclientid" },
8605
+ { fileprop: "lambdaclientidfile", prop: "lambdaclientid" },
8606
+ // Client secret file processing
8607
+ { fileprop: "asclientsecretfile", prop: "asclientsecret" },
8608
+ { fileprop: "rest01clientsecretfile", prop: "rest01clientsecret" },
8609
+ { fileprop: "brokerclientsecretfile", prop: "brokerclientsecret" },
8610
+ { fileprop: "toclientsecretfile", prop: "toclientsecret" },
8611
+ { fileprop: "imclientsecretfile", prop: "imclientsecret" },
8612
+ { fileprop: "trclientsecretfile", prop: "trclientsecret" },
8613
+ { fileprop: "trnclientsecretfile", prop: "trnclientsecret" },
8614
+ { fileprop: "lambdaclientsecretfile", prop: "lambdaclientsecret" },
8615
+ // JWKS secret file processing
8616
+ { fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
8617
+ // InfluxDB file processing
8618
+ { fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
8619
+ ];
8620
+ fileconfig.forEach((v) => {
8621
+ if (defconfig[v.fileprop] !== void 0) {
8622
+ defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
8623
+ }
8624
+ });
8625
+ for (const [key, val] of Object.entries(defconfig)) {
8626
+ envOptions2[key] = val;
8627
+ }
8628
+ }
8629
+ function $SetupOptions(envOptions2) {
8630
+ SetupConfig(envOptions2);
8631
+ const options = envOptions2;
8632
+ const hosts = options.dbhost.split(",");
8633
+ envOptions2.connectionString = hosts.map((host) => {
8634
+ return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
8635
+ }).join(",");
8636
+ envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
8637
+ return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
8638
+ }).join(",");
8639
+ }
8640
+ function $Options() {
8641
+ if (envOptions === null) {
8642
+ envOptions = {};
8643
+ $SetupOptions(envOptions);
8644
+ }
8645
+ return envOptions;
8646
+ }
8647
+ const goptions = $Options();
8648
+ var influxDBDataType = /* @__PURE__ */ ((influxDBDataType2) => {
8649
+ influxDBDataType2["intField"] = "intField";
8650
+ influxDBDataType2["floatField"] = "floatField";
8651
+ influxDBDataType2["stringField"] = "stringField";
8652
+ return influxDBDataType2;
8653
+ })(influxDBDataType || {});
8654
+ const globalServiceDefinitions = {
8655
+ coreFieldList: [
8656
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8657
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8658
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8659
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8660
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8661
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8662
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8663
+ {
8664
+ fieldName: "activeRequestCount",
8665
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
8666
+ instrumentProperty: "val",
8667
+ dataType: "number",
8668
+ timeSeriesIndex: true,
8669
+ quantile: true,
8670
+ influxdbDataType: "intField",
8671
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8672
+ instrumentOptions: {
8673
+ interval: goptions.instrumentationObservationInterval,
8674
+ sampleSize: goptions.instrumentationTimeWindow
8675
+ }
8676
+ },
8677
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8678
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8679
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
8680
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
8681
+ {
8682
+ fieldName: "duration",
8683
+ gauge: Gauge.DURATION_GAUGE,
8684
+ instrumentProperty: "val",
8685
+ dataType: "number",
8686
+ timeSeriesIndex: true,
8687
+ quantile: true,
8688
+ influxdbDataType: "floatField",
8689
+ gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
8690
+ instrumentOptions: {
8691
+ interval: goptions.instrumentationObservationInterval,
8692
+ sampleSize: goptions.instrumentationTimeWindow
8693
+ },
8694
+ histo: [
8695
+ { label: "B10", bucketLimit: 10 },
8696
+ { label: "B20", bucketLimit: 20 },
8697
+ { label: "B50", bucketLimit: 50 },
8698
+ { label: "B100", bucketLimit: 100 },
8699
+ { label: "B1000", bucketLimit: 1e3 },
8700
+ { label: "B50000", bucketLimit: 5e4 },
8701
+ { label: "BInfinity", bucketLimit: -1 }
8702
+ ]
8703
+ },
8704
+ {
8705
+ fieldName: "latency",
8706
+ gauge: Gauge.LATENCY_GAUGE,
8707
+ instrumentProperty: "val",
8708
+ dataType: "number",
8709
+ timeSeriesIndex: true,
8710
+ quantile: true,
8711
+ influxdbDataType: "floatField",
8712
+ gaugeType: GaugeTypes.INSTRUMENT_HISTOGRAM,
8713
+ instrumentOptions: {
8714
+ interval: goptions.instrumentationObservationInterval,
8715
+ sampleSize: goptions.instrumentationTimeWindow
8716
+ },
8717
+ histo: [
8718
+ { label: "B10", bucketLimit: 10 },
8719
+ { label: "B20", bucketLimit: 20 },
8720
+ { label: "B50", bucketLimit: 50 },
8721
+ { label: "B100", bucketLimit: 100 },
8722
+ { label: "B1000", bucketLimit: 1e3 },
8723
+ { label: "B50000", bucketLimit: 5e4 },
8724
+ { label: "BInfinity", bucketLimit: -1 }
8725
+ ]
8726
+ }
8727
+ ],
8728
+ logFieldList: [
8729
+ {
8730
+ fieldName: "log",
8731
+ gauge: Gauge.LOGGER,
8732
+ instrumentProperty: "val",
8733
+ dataType: "string",
8734
+ timeSeriesIndex: false,
8735
+ quantile: false,
8736
+ influxdbDataType: "stringField",
8737
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
8738
+ instrumentOptions: {
8739
+ consoleLogging: goptions.consoleLogging,
8740
+ instrumentLogging: goptions.instrumentLogging
8741
+ }
8742
+ }
8743
+ ],
8744
+ services: {
8745
+ ["service"]: {
8746
+ influxDBContextTags: [
8747
+ "serviceId",
8748
+ "serviceName",
8749
+ "serviceVersion",
8750
+ "serviceInstanceId",
8751
+ "serviceInstanceProcessId",
8752
+ "hostName",
8753
+ "pid",
8754
+ "ppid"
8755
+ ],
8756
+ redisIndexPrefixDefinitions: {
8757
+ timeSeriesIndex: "idx:serviceIndexTimeSeries",
8758
+ timeSeriesPrefix: "/serviceTimeSeries:",
8759
+ instantIndex: "idx:serviceIndexInstant",
8760
+ instantPrefix: "/serviceInstant:"
8761
+ },
8762
+ fieldList: [
8763
+ {
8764
+ fieldName: "cpu",
8765
+ gauge: Gauge.CPU_LOAD_GAUGE,
6714
8766
  instrumentProperty: "val",
6715
8767
  dataType: "number",
6716
8768
  timeSeriesIndex: true,
6717
8769
  quantile: true,
6718
- influxdbDataType: "intField"
6719
- /* intField */
6720
- },
6721
- {
6722
- fieldName: "connectionPoolCount",
6723
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
6724
- instrumentProperty: "val",
6725
- dataType: "number",
6726
- influxdbDataType: "intField"
6727
- /* intField */
6728
- },
6729
- {
6730
- fieldName: "connectionIdleCount",
6731
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
6732
- instrumentProperty: "val",
6733
- dataType: "number",
6734
- influxdbDataType: "intField"
6735
- /* intField */
6736
- },
6737
- {
6738
- fieldName: "connectionWaitingCount",
6739
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
6740
- instrumentProperty: "val",
6741
- dataType: "number",
6742
- influxdbDataType: "intField"
6743
- /* intField */
8770
+ influxdbDataType: "floatField",
8771
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8772
+ instrumentOptions: {
8773
+ interval: goptions.instrumentationObservationInterval,
8774
+ sampleSize: goptions.instrumentationTimeWindow
8775
+ }
6744
8776
  },
6745
8777
  {
6746
- fieldName: "systemcpu",
6747
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
8778
+ fieldName: "connectionCount",
8779
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
6748
8780
  instrumentProperty: "val",
6749
8781
  dataType: "number",
6750
8782
  timeSeriesIndex: true,
6751
8783
  quantile: true,
6752
- influxdbDataType: "floatField"
6753
- /* floatField */
8784
+ influxdbDataType: "intField",
8785
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
8786
+ instrumentOptions: {
8787
+ interval: goptions.instrumentationObservationInterval,
8788
+ sampleSize: goptions.instrumentationTimeWindow
8789
+ }
6754
8790
  },
8791
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8792
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8793
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8794
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
6755
8795
  {
6756
8796
  fieldName: "memory",
6757
8797
  gauge: Gauge.OBJECT_GAUGE,
6758
8798
  instrumentProperty: "val",
6759
8799
  dataType: "JSON",
6760
- influxdbDataType: "stringField"
6761
- /* stringField */
8800
+ influxdbDataType: "stringField",
8801
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
8802
+ instrumentOptions: {
8803
+ label: "InstrumentObjectMaster"
8804
+ }
6762
8805
  }
6763
8806
  ],
6764
8807
  GetPathFromContext(context) {
@@ -6804,14 +8847,7 @@ const globalServiceDefinitions = {
6804
8847
  instantPrefix: "/agentInstant:"
6805
8848
  },
6806
8849
  fieldList: [
6807
- {
6808
- fieldName: "childCount",
6809
- gauge: Gauge.CHILD_COUNT,
6810
- instrumentProperty: "val",
6811
- dataType: "number",
6812
- influxdbDataType: "intField"
6813
- /* intField */
6814
- }
8850
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
6815
8851
  ],
6816
8852
  //@@ need type declare in appframework ?? agent does not use appframework ... perhaps stspublisher
6817
8853
  GetPathFromContext(context) {
@@ -6863,68 +8899,13 @@ const globalServiceDefinitions = {
6863
8899
  instantPrefix: "/lambdaInstant:"
6864
8900
  },
6865
8901
  fieldList: [
6866
- {
6867
- fieldName: "cpu",
6868
- gauge: Gauge.CPU_LOAD_GAUGE,
6869
- instrumentProperty: "val",
6870
- dataType: "number",
6871
- timeSeriesIndex: true,
6872
- quantile: true,
6873
- influxdbDataType: "floatField"
6874
- /* floatField */
6875
- },
6876
- {
6877
- fieldName: "connectionCount",
6878
- gauge: Gauge.CONNECTION_COUNT_GAUGE,
6879
- instrumentProperty: "val",
6880
- dataType: "number",
6881
- timeSeriesIndex: true,
6882
- quantile: true,
6883
- influxdbDataType: "intField"
6884
- /* intField */
6885
- },
6886
- {
6887
- fieldName: "connectionPoolCount",
6888
- gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE,
6889
- instrumentProperty: "val",
6890
- dataType: "number",
6891
- influxdbDataType: "intField"
6892
- /* intField */
6893
- },
6894
- {
6895
- fieldName: "connectionIdleCount",
6896
- gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE,
6897
- instrumentProperty: "val",
6898
- dataType: "number",
6899
- influxdbDataType: "intField"
6900
- /* intField */
6901
- },
6902
- {
6903
- fieldName: "connectionWaitingCount",
6904
- gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE,
6905
- instrumentProperty: "val",
6906
- dataType: "number",
6907
- influxdbDataType: "intField"
6908
- /* intField */
6909
- },
6910
- {
6911
- fieldName: "systemcpu",
6912
- gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE,
6913
- instrumentProperty: "val",
6914
- dataType: "number",
6915
- timeSeriesIndex: true,
6916
- quantile: true,
6917
- influxdbDataType: "floatField"
6918
- /* floatField */
6919
- },
6920
- {
6921
- fieldName: "memory",
6922
- gauge: Gauge.OBJECT_GAUGE,
6923
- instrumentProperty: "val",
6924
- dataType: "JSON",
6925
- influxdbDataType: "stringField"
6926
- /* stringField */
6927
- }
8902
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8903
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8904
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8905
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8906
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8907
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
8908
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
6928
8909
  ],
6929
8910
  //@@ need type declare in appframework
6930
8911
  GetPathFromContext(context) {
@@ -6961,6 +8942,22 @@ const globalServiceDefinitions = {
6961
8942
  }
6962
8943
  }
6963
8944
  };
8945
+ const GetInstruments = (service) => {
8946
+ const fieldList = [
8947
+ ...globalServiceDefinitions.coreFieldList,
8948
+ ...globalServiceDefinitions.logFieldList,
8949
+ ...globalServiceDefinitions.services[service].fieldList
8950
+ ];
8951
+ const retVal = [];
8952
+ fieldList.forEach((v) => {
8953
+ if (v.instrumentOptions) {
8954
+ retVal.push([v.gauge, v.gaugeType, v.instrumentOptions]);
8955
+ } else {
8956
+ retVal.push([v.gauge, v.gaugeType]);
8957
+ }
8958
+ });
8959
+ return retVal;
8960
+ };
6964
8961
  export {
6965
8962
  AgentInstrumentController,
6966
8963
  CompareSTSInstrumentControllerPluginKey,
@@ -6968,6 +8965,7 @@ export {
6968
8965
  Gauge,
6969
8966
  GaugeTypes,
6970
8967
  GetInstrumentName,
8968
+ GetInstruments,
6971
8969
  GetSTSInstrumentController,
6972
8970
  GetSTSInstrumentControllerPluginKey,
6973
8971
  GetSocketIOSubscriptionKey,