@nsshunt/stsoauth2plugin 1.0.154 → 1.0.156

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.
@@ -3,8 +3,8 @@ import * as wt from "node:worker_threads";
3
3
  import { OAuth2ParameterType, Sleep, AgentManager, STSAxiosConfig } from "@nsshunt/stsutils";
4
4
  import { ClientStorageFactory, ClientStorageType } from "@nsshunt/stsvueutils";
5
5
  import { defineStore } from "pinia";
6
- import { STSInstrumentControllerPluginKey, Gauge } from "@nsshunt/stsobservability";
7
6
  import axios from "axios";
7
+ import { Gauge as Gauge$1 } from "@nsshunt/stsobservability";
8
8
  import http from "node:http";
9
9
  import https from "node:https";
10
10
  const STSOAuth2ManagerPluginKey = /* @__PURE__ */ Symbol();
@@ -12,13 +12,13 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
12
12
  function getDefaultExportFromCjs(x) {
13
13
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
14
14
  }
15
- var ansiStyles = { exports: {} };
16
- var colorName;
17
- var hasRequiredColorName;
18
- function requireColorName() {
19
- if (hasRequiredColorName) return colorName;
20
- hasRequiredColorName = 1;
21
- colorName = {
15
+ var ansiStyles$1 = { exports: {} };
16
+ var colorName$1;
17
+ var hasRequiredColorName$1;
18
+ function requireColorName$1() {
19
+ if (hasRequiredColorName$1) return colorName$1;
20
+ hasRequiredColorName$1 = 1;
21
+ colorName$1 = {
22
22
  "aliceblue": [240, 248, 255],
23
23
  "antiquewhite": [250, 235, 215],
24
24
  "aqua": [0, 255, 255],
@@ -168,14 +168,14 @@ function requireColorName() {
168
168
  "yellow": [255, 255, 0],
169
169
  "yellowgreen": [154, 205, 50]
170
170
  };
171
- return colorName;
171
+ return colorName$1;
172
172
  }
173
- var conversions;
174
- var hasRequiredConversions;
175
- function requireConversions() {
176
- if (hasRequiredConversions) return conversions;
177
- hasRequiredConversions = 1;
178
- const cssKeywords = requireColorName();
173
+ var conversions$1;
174
+ var hasRequiredConversions$1;
175
+ function requireConversions$1() {
176
+ if (hasRequiredConversions$1) return conversions$1;
177
+ hasRequiredConversions$1 = 1;
178
+ const cssKeywords = requireColorName$1();
179
179
  const reverseKeywords = {};
180
180
  for (const key of Object.keys(cssKeywords)) {
181
181
  reverseKeywords[cssKeywords[key]] = key;
@@ -197,7 +197,7 @@ function requireConversions() {
197
197
  apple: { channels: 3, labels: ["r16", "g16", "b16"] },
198
198
  gray: { channels: 1, labels: ["gray"] }
199
199
  };
200
- conversions = convert;
200
+ conversions$1 = convert;
201
201
  for (const model of Object.keys(convert)) {
202
202
  if (!("channels" in convert[model])) {
203
203
  throw new Error("missing channels property: " + model);
@@ -840,14 +840,14 @@ function requireConversions() {
840
840
  const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
841
841
  return [val / 255 * 100];
842
842
  };
843
- return conversions;
843
+ return conversions$1;
844
844
  }
845
- var route;
846
- var hasRequiredRoute;
847
- function requireRoute() {
848
- if (hasRequiredRoute) return route;
849
- hasRequiredRoute = 1;
850
- const conversions2 = requireConversions();
845
+ var route$1;
846
+ var hasRequiredRoute$1;
847
+ function requireRoute$1() {
848
+ if (hasRequiredRoute$1) return route$1;
849
+ hasRequiredRoute$1 = 1;
850
+ const conversions2 = requireConversions$1();
851
851
  function buildGraph() {
852
852
  const graph = {};
853
853
  const models = Object.keys(conversions2);
@@ -897,7 +897,7 @@ function requireRoute() {
897
897
  fn.conversion = path;
898
898
  return fn;
899
899
  }
900
- route = function(fromModel) {
900
+ route$1 = function(fromModel) {
901
901
  const graph = deriveBFS(fromModel);
902
902
  const conversion = {};
903
903
  const models = Object.keys(graph);
@@ -911,15 +911,15 @@ function requireRoute() {
911
911
  }
912
912
  return conversion;
913
913
  };
914
- return route;
914
+ return route$1;
915
915
  }
916
- var colorConvert;
917
- var hasRequiredColorConvert;
918
- function requireColorConvert() {
919
- if (hasRequiredColorConvert) return colorConvert;
920
- hasRequiredColorConvert = 1;
921
- const conversions2 = requireConversions();
922
- const route2 = requireRoute();
916
+ var colorConvert$1;
917
+ var hasRequiredColorConvert$1;
918
+ function requireColorConvert$1() {
919
+ if (hasRequiredColorConvert$1) return colorConvert$1;
920
+ hasRequiredColorConvert$1 = 1;
921
+ const conversions2 = requireConversions$1();
922
+ const route2 = requireRoute$1();
923
923
  const convert = {};
924
924
  const models = Object.keys(conversions2);
925
925
  function wrapRaw(fn) {
@@ -972,14 +972,14 @@ function requireColorConvert() {
972
972
  convert[fromModel][toModel].raw = wrapRaw(fn);
973
973
  });
974
974
  });
975
- colorConvert = convert;
976
- return colorConvert;
975
+ colorConvert$1 = convert;
976
+ return colorConvert$1;
977
977
  }
978
- ansiStyles.exports;
979
- var hasRequiredAnsiStyles;
980
- function requireAnsiStyles() {
981
- if (hasRequiredAnsiStyles) return ansiStyles.exports;
982
- hasRequiredAnsiStyles = 1;
978
+ ansiStyles$1.exports;
979
+ var hasRequiredAnsiStyles$1;
980
+ function requireAnsiStyles$1() {
981
+ if (hasRequiredAnsiStyles$1) return ansiStyles$1.exports;
982
+ hasRequiredAnsiStyles$1 = 1;
983
983
  (function(module) {
984
984
  const wrapAnsi16 = (fn, offset) => (...args) => {
985
985
  const code = fn(...args);
@@ -1013,7 +1013,7 @@ function requireAnsiStyles() {
1013
1013
  let colorConvert2;
1014
1014
  const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
1015
1015
  if (colorConvert2 === void 0) {
1016
- colorConvert2 = requireColorConvert();
1016
+ colorConvert2 = requireColorConvert$1();
1017
1017
  }
1018
1018
  const offset = isBackground ? 10 : 0;
1019
1019
  const styles = {};
@@ -1116,25 +1116,25 @@ function requireAnsiStyles() {
1116
1116
  enumerable: true,
1117
1117
  get: assembleStyles
1118
1118
  });
1119
- })(ansiStyles);
1120
- return ansiStyles.exports;
1119
+ })(ansiStyles$1);
1120
+ return ansiStyles$1.exports;
1121
1121
  }
1122
- var browser;
1123
- var hasRequiredBrowser;
1124
- function requireBrowser() {
1125
- if (hasRequiredBrowser) return browser;
1126
- hasRequiredBrowser = 1;
1127
- browser = {
1122
+ var browser$1;
1123
+ var hasRequiredBrowser$1;
1124
+ function requireBrowser$1() {
1125
+ if (hasRequiredBrowser$1) return browser$1;
1126
+ hasRequiredBrowser$1 = 1;
1127
+ browser$1 = {
1128
1128
  stdout: false,
1129
1129
  stderr: false
1130
1130
  };
1131
- return browser;
1131
+ return browser$1;
1132
1132
  }
1133
- var util;
1134
- var hasRequiredUtil;
1135
- function requireUtil() {
1136
- if (hasRequiredUtil) return util;
1137
- hasRequiredUtil = 1;
1133
+ var util$1;
1134
+ var hasRequiredUtil$1;
1135
+ function requireUtil$1() {
1136
+ if (hasRequiredUtil$1) return util$1;
1137
+ hasRequiredUtil$1 = 1;
1138
1138
  const stringReplaceAll = (string, substring, replacer) => {
1139
1139
  let index = string.indexOf(substring);
1140
1140
  if (index === -1) {
@@ -1163,17 +1163,17 @@ function requireUtil() {
1163
1163
  returnValue += string.substr(endIndex);
1164
1164
  return returnValue;
1165
1165
  };
1166
- util = {
1166
+ util$1 = {
1167
1167
  stringReplaceAll,
1168
1168
  stringEncaseCRLFWithFirstIndex
1169
1169
  };
1170
- return util;
1170
+ return util$1;
1171
1171
  }
1172
- var templates;
1173
- var hasRequiredTemplates;
1174
- function requireTemplates() {
1175
- if (hasRequiredTemplates) return templates;
1176
- hasRequiredTemplates = 1;
1172
+ var templates$1;
1173
+ var hasRequiredTemplates$1;
1174
+ function requireTemplates$1() {
1175
+ if (hasRequiredTemplates$1) return templates$1;
1176
+ hasRequiredTemplates$1 = 1;
1177
1177
  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;
1178
1178
  const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
1179
1179
  const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
@@ -1251,7 +1251,7 @@ function requireTemplates() {
1251
1251
  }
1252
1252
  return current;
1253
1253
  }
1254
- templates = (chalk2, temporary) => {
1254
+ templates$1 = (chalk2, temporary) => {
1255
1255
  const styles = [];
1256
1256
  const chunks = [];
1257
1257
  let chunk = [];
@@ -1281,19 +1281,19 @@ function requireTemplates() {
1281
1281
  }
1282
1282
  return chunks.join("");
1283
1283
  };
1284
- return templates;
1284
+ return templates$1;
1285
1285
  }
1286
- var source;
1287
- var hasRequiredSource;
1288
- function requireSource() {
1289
- if (hasRequiredSource) return source;
1290
- hasRequiredSource = 1;
1291
- const ansiStyles2 = requireAnsiStyles();
1292
- const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
1286
+ var source$1;
1287
+ var hasRequiredSource$1;
1288
+ function requireSource$1() {
1289
+ if (hasRequiredSource$1) return source$1;
1290
+ hasRequiredSource$1 = 1;
1291
+ const ansiStyles2 = requireAnsiStyles$1();
1292
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser$1();
1293
1293
  const {
1294
1294
  stringReplaceAll,
1295
1295
  stringEncaseCRLFWithFirstIndex
1296
- } = requireUtil();
1296
+ } = requireUtil$1();
1297
1297
  const { isArray } = Array;
1298
1298
  const levelMapping = [
1299
1299
  "ansi",
@@ -1449,7 +1449,7 @@ function requireSource() {
1449
1449
  );
1450
1450
  }
1451
1451
  if (template === void 0) {
1452
- template = requireTemplates();
1452
+ template = requireTemplates$1();
1453
1453
  }
1454
1454
  return template(chalk3, parts.join(""));
1455
1455
  };
@@ -1458,10 +1458,10 @@ function requireSource() {
1458
1458
  chalk2.supportsColor = stdoutColor;
1459
1459
  chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
1460
1460
  chalk2.stderr.supportsColor = stderrColor;
1461
- source = chalk2;
1462
- return source;
1461
+ source$1 = chalk2;
1462
+ return source$1;
1463
1463
  }
1464
- var sourceExports = requireSource();
1464
+ var sourceExports = requireSource$1();
1465
1465
  const chalk = /* @__PURE__ */ getDefaultExportFromCjs(sourceExports);
1466
1466
  const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
1467
1467
  var AuthorizeOptionsResponseType = /* @__PURE__ */ ((AuthorizeOptionsResponseType2) => {
@@ -1598,6 +1598,3258 @@ const STSOauth2Store = defineStore("__sts__STSOauth2Store", {
1598
1598
  }
1599
1599
  */
1600
1600
  });
1601
+ var tinyEmitter = { exports: {} };
1602
+ var hasRequiredTinyEmitter;
1603
+ function requireTinyEmitter() {
1604
+ if (hasRequiredTinyEmitter) return tinyEmitter.exports;
1605
+ hasRequiredTinyEmitter = 1;
1606
+ function E() {
1607
+ }
1608
+ E.prototype = {
1609
+ on: function(name, callback, ctx) {
1610
+ var e = this.e || (this.e = {});
1611
+ (e[name] || (e[name] = [])).push({
1612
+ fn: callback,
1613
+ ctx
1614
+ });
1615
+ return this;
1616
+ },
1617
+ once: function(name, callback, ctx) {
1618
+ var self2 = this;
1619
+ function listener() {
1620
+ self2.off(name, listener);
1621
+ callback.apply(ctx, arguments);
1622
+ }
1623
+ listener._ = callback;
1624
+ return this.on(name, listener, ctx);
1625
+ },
1626
+ emit: function(name) {
1627
+ var data = [].slice.call(arguments, 1);
1628
+ var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
1629
+ var i = 0;
1630
+ var len = evtArr.length;
1631
+ for (i; i < len; i++) {
1632
+ evtArr[i].fn.apply(evtArr[i].ctx, data);
1633
+ }
1634
+ return this;
1635
+ },
1636
+ off: function(name, callback) {
1637
+ var e = this.e || (this.e = {});
1638
+ var evts = e[name];
1639
+ var liveEvents = [];
1640
+ if (evts && callback) {
1641
+ for (var i = 0, len = evts.length; i < len; i++) {
1642
+ if (evts[i].fn !== callback && evts[i].fn._ !== callback)
1643
+ liveEvents.push(evts[i]);
1644
+ }
1645
+ }
1646
+ liveEvents.length ? e[name] = liveEvents : delete e[name];
1647
+ return this;
1648
+ }
1649
+ };
1650
+ tinyEmitter.exports = E;
1651
+ tinyEmitter.exports.TinyEmitter = E;
1652
+ return tinyEmitter.exports;
1653
+ }
1654
+ requireTinyEmitter();
1655
+ var lodash_clonedeep = { exports: {} };
1656
+ lodash_clonedeep.exports;
1657
+ var hasRequiredLodash_clonedeep;
1658
+ function requireLodash_clonedeep() {
1659
+ if (hasRequiredLodash_clonedeep) return lodash_clonedeep.exports;
1660
+ hasRequiredLodash_clonedeep = 1;
1661
+ (function(module, exports$1) {
1662
+ var LARGE_ARRAY_SIZE = 200;
1663
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
1664
+ var MAX_SAFE_INTEGER = 9007199254740991;
1665
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", promiseTag = "[object Promise]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", weakMapTag = "[object WeakMap]";
1666
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
1667
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
1668
+ var reFlags = /\w*$/;
1669
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
1670
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
1671
+ var cloneableTags = {};
1672
+ cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true;
1673
+ cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false;
1674
+ var freeGlobal = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
1675
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
1676
+ var root = freeGlobal || freeSelf || Function("return this")();
1677
+ var freeExports = exports$1 && !exports$1.nodeType && exports$1;
1678
+ var freeModule = freeExports && true && module && !module.nodeType && module;
1679
+ var moduleExports = freeModule && freeModule.exports === freeExports;
1680
+ function addMapEntry(map, pair) {
1681
+ map.set(pair[0], pair[1]);
1682
+ return map;
1683
+ }
1684
+ function addSetEntry(set, value) {
1685
+ set.add(value);
1686
+ return set;
1687
+ }
1688
+ function arrayEach(array, iteratee) {
1689
+ var index = -1, length = array ? array.length : 0;
1690
+ while (++index < length) {
1691
+ if (iteratee(array[index], index, array) === false) {
1692
+ break;
1693
+ }
1694
+ }
1695
+ return array;
1696
+ }
1697
+ function arrayPush(array, values) {
1698
+ var index = -1, length = values.length, offset = array.length;
1699
+ while (++index < length) {
1700
+ array[offset + index] = values[index];
1701
+ }
1702
+ return array;
1703
+ }
1704
+ function arrayReduce(array, iteratee, accumulator, initAccum) {
1705
+ var index = -1, length = array ? array.length : 0;
1706
+ while (++index < length) {
1707
+ accumulator = iteratee(accumulator, array[index], index, array);
1708
+ }
1709
+ return accumulator;
1710
+ }
1711
+ function baseTimes(n, iteratee) {
1712
+ var index = -1, result = Array(n);
1713
+ while (++index < n) {
1714
+ result[index] = iteratee(index);
1715
+ }
1716
+ return result;
1717
+ }
1718
+ function getValue(object, key) {
1719
+ return object == null ? void 0 : object[key];
1720
+ }
1721
+ function isHostObject(value) {
1722
+ var result = false;
1723
+ if (value != null && typeof value.toString != "function") {
1724
+ try {
1725
+ result = !!(value + "");
1726
+ } catch (e) {
1727
+ }
1728
+ }
1729
+ return result;
1730
+ }
1731
+ function mapToArray(map) {
1732
+ var index = -1, result = Array(map.size);
1733
+ map.forEach(function(value, key) {
1734
+ result[++index] = [key, value];
1735
+ });
1736
+ return result;
1737
+ }
1738
+ function overArg(func, transform) {
1739
+ return function(arg) {
1740
+ return func(transform(arg));
1741
+ };
1742
+ }
1743
+ function setToArray(set) {
1744
+ var index = -1, result = Array(set.size);
1745
+ set.forEach(function(value) {
1746
+ result[++index] = value;
1747
+ });
1748
+ return result;
1749
+ }
1750
+ var arrayProto = Array.prototype, funcProto = Function.prototype, objectProto = Object.prototype;
1751
+ var coreJsData = root["__core-js_shared__"];
1752
+ var maskSrcKey = (function() {
1753
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
1754
+ return uid ? "Symbol(src)_1." + uid : "";
1755
+ })();
1756
+ var funcToString = funcProto.toString;
1757
+ var hasOwnProperty = objectProto.hasOwnProperty;
1758
+ var objectToString = objectProto.toString;
1759
+ var reIsNative = RegExp(
1760
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1761
+ );
1762
+ var Buffer = moduleExports ? root.Buffer : void 0, Symbol2 = root.Symbol, Uint8Array2 = root.Uint8Array, getPrototype = overArg(Object.getPrototypeOf, Object), objectCreate = Object.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice;
1763
+ var nativeGetSymbols = Object.getOwnPropertySymbols, nativeIsBuffer = Buffer ? Buffer.isBuffer : void 0, nativeKeys = overArg(Object.keys, Object);
1764
+ var DataView2 = getNative(root, "DataView"), Map2 = getNative(root, "Map"), Promise2 = getNative(root, "Promise"), Set = getNative(root, "Set"), WeakMap = getNative(root, "WeakMap"), nativeCreate = getNative(Object, "create");
1765
+ var dataViewCtorString = toSource(DataView2), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set), weakMapCtorString = toSource(WeakMap);
1766
+ var symbolProto = Symbol2 ? Symbol2.prototype : void 0, symbolValueOf = symbolProto ? symbolProto.valueOf : void 0;
1767
+ function Hash(entries) {
1768
+ var index = -1, length = entries ? entries.length : 0;
1769
+ this.clear();
1770
+ while (++index < length) {
1771
+ var entry = entries[index];
1772
+ this.set(entry[0], entry[1]);
1773
+ }
1774
+ }
1775
+ function hashClear() {
1776
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
1777
+ }
1778
+ function hashDelete(key) {
1779
+ return this.has(key) && delete this.__data__[key];
1780
+ }
1781
+ function hashGet(key) {
1782
+ var data = this.__data__;
1783
+ if (nativeCreate) {
1784
+ var result = data[key];
1785
+ return result === HASH_UNDEFINED ? void 0 : result;
1786
+ }
1787
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
1788
+ }
1789
+ function hashHas(key) {
1790
+ var data = this.__data__;
1791
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
1792
+ }
1793
+ function hashSet(key, value) {
1794
+ var data = this.__data__;
1795
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
1796
+ return this;
1797
+ }
1798
+ Hash.prototype.clear = hashClear;
1799
+ Hash.prototype["delete"] = hashDelete;
1800
+ Hash.prototype.get = hashGet;
1801
+ Hash.prototype.has = hashHas;
1802
+ Hash.prototype.set = hashSet;
1803
+ function ListCache(entries) {
1804
+ var index = -1, length = entries ? entries.length : 0;
1805
+ this.clear();
1806
+ while (++index < length) {
1807
+ var entry = entries[index];
1808
+ this.set(entry[0], entry[1]);
1809
+ }
1810
+ }
1811
+ function listCacheClear() {
1812
+ this.__data__ = [];
1813
+ }
1814
+ function listCacheDelete(key) {
1815
+ var data = this.__data__, index = assocIndexOf(data, key);
1816
+ if (index < 0) {
1817
+ return false;
1818
+ }
1819
+ var lastIndex = data.length - 1;
1820
+ if (index == lastIndex) {
1821
+ data.pop();
1822
+ } else {
1823
+ splice.call(data, index, 1);
1824
+ }
1825
+ return true;
1826
+ }
1827
+ function listCacheGet(key) {
1828
+ var data = this.__data__, index = assocIndexOf(data, key);
1829
+ return index < 0 ? void 0 : data[index][1];
1830
+ }
1831
+ function listCacheHas(key) {
1832
+ return assocIndexOf(this.__data__, key) > -1;
1833
+ }
1834
+ function listCacheSet(key, value) {
1835
+ var data = this.__data__, index = assocIndexOf(data, key);
1836
+ if (index < 0) {
1837
+ data.push([key, value]);
1838
+ } else {
1839
+ data[index][1] = value;
1840
+ }
1841
+ return this;
1842
+ }
1843
+ ListCache.prototype.clear = listCacheClear;
1844
+ ListCache.prototype["delete"] = listCacheDelete;
1845
+ ListCache.prototype.get = listCacheGet;
1846
+ ListCache.prototype.has = listCacheHas;
1847
+ ListCache.prototype.set = listCacheSet;
1848
+ function MapCache(entries) {
1849
+ var index = -1, length = entries ? entries.length : 0;
1850
+ this.clear();
1851
+ while (++index < length) {
1852
+ var entry = entries[index];
1853
+ this.set(entry[0], entry[1]);
1854
+ }
1855
+ }
1856
+ function mapCacheClear() {
1857
+ this.__data__ = {
1858
+ "hash": new Hash(),
1859
+ "map": new (Map2 || ListCache)(),
1860
+ "string": new Hash()
1861
+ };
1862
+ }
1863
+ function mapCacheDelete(key) {
1864
+ return getMapData(this, key)["delete"](key);
1865
+ }
1866
+ function mapCacheGet(key) {
1867
+ return getMapData(this, key).get(key);
1868
+ }
1869
+ function mapCacheHas(key) {
1870
+ return getMapData(this, key).has(key);
1871
+ }
1872
+ function mapCacheSet(key, value) {
1873
+ getMapData(this, key).set(key, value);
1874
+ return this;
1875
+ }
1876
+ MapCache.prototype.clear = mapCacheClear;
1877
+ MapCache.prototype["delete"] = mapCacheDelete;
1878
+ MapCache.prototype.get = mapCacheGet;
1879
+ MapCache.prototype.has = mapCacheHas;
1880
+ MapCache.prototype.set = mapCacheSet;
1881
+ function Stack(entries) {
1882
+ this.__data__ = new ListCache(entries);
1883
+ }
1884
+ function stackClear() {
1885
+ this.__data__ = new ListCache();
1886
+ }
1887
+ function stackDelete(key) {
1888
+ return this.__data__["delete"](key);
1889
+ }
1890
+ function stackGet(key) {
1891
+ return this.__data__.get(key);
1892
+ }
1893
+ function stackHas(key) {
1894
+ return this.__data__.has(key);
1895
+ }
1896
+ function stackSet(key, value) {
1897
+ var cache = this.__data__;
1898
+ if (cache instanceof ListCache) {
1899
+ var pairs = cache.__data__;
1900
+ if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) {
1901
+ pairs.push([key, value]);
1902
+ return this;
1903
+ }
1904
+ cache = this.__data__ = new MapCache(pairs);
1905
+ }
1906
+ cache.set(key, value);
1907
+ return this;
1908
+ }
1909
+ Stack.prototype.clear = stackClear;
1910
+ Stack.prototype["delete"] = stackDelete;
1911
+ Stack.prototype.get = stackGet;
1912
+ Stack.prototype.has = stackHas;
1913
+ Stack.prototype.set = stackSet;
1914
+ function arrayLikeKeys(value, inherited) {
1915
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
1916
+ var length = result.length, skipIndexes = !!length;
1917
+ for (var key in value) {
1918
+ if (hasOwnProperty.call(value, key) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
1919
+ result.push(key);
1920
+ }
1921
+ }
1922
+ return result;
1923
+ }
1924
+ function assignValue(object, key, value) {
1925
+ var objValue = object[key];
1926
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
1927
+ object[key] = value;
1928
+ }
1929
+ }
1930
+ function assocIndexOf(array, key) {
1931
+ var length = array.length;
1932
+ while (length--) {
1933
+ if (eq(array[length][0], key)) {
1934
+ return length;
1935
+ }
1936
+ }
1937
+ return -1;
1938
+ }
1939
+ function baseAssign(object, source2) {
1940
+ return object && copyObject(source2, keys(source2), object);
1941
+ }
1942
+ function baseClone(value, isDeep, isFull, customizer, key, object, stack) {
1943
+ var result;
1944
+ if (customizer) {
1945
+ result = object ? customizer(value, key, object, stack) : customizer(value);
1946
+ }
1947
+ if (result !== void 0) {
1948
+ return result;
1949
+ }
1950
+ if (!isObject(value)) {
1951
+ return value;
1952
+ }
1953
+ var isArr = isArray(value);
1954
+ if (isArr) {
1955
+ result = initCloneArray(value);
1956
+ if (!isDeep) {
1957
+ return copyArray(value, result);
1958
+ }
1959
+ } else {
1960
+ var tag = getTag(value), isFunc = tag == funcTag || tag == genTag;
1961
+ if (isBuffer(value)) {
1962
+ return cloneBuffer(value, isDeep);
1963
+ }
1964
+ if (tag == objectTag || tag == argsTag || isFunc && !object) {
1965
+ if (isHostObject(value)) {
1966
+ return object ? value : {};
1967
+ }
1968
+ result = initCloneObject(isFunc ? {} : value);
1969
+ if (!isDeep) {
1970
+ return copySymbols(value, baseAssign(result, value));
1971
+ }
1972
+ } else {
1973
+ if (!cloneableTags[tag]) {
1974
+ return object ? value : {};
1975
+ }
1976
+ result = initCloneByTag(value, tag, baseClone, isDeep);
1977
+ }
1978
+ }
1979
+ stack || (stack = new Stack());
1980
+ var stacked = stack.get(value);
1981
+ if (stacked) {
1982
+ return stacked;
1983
+ }
1984
+ stack.set(value, result);
1985
+ if (!isArr) {
1986
+ var props = isFull ? getAllKeys(value) : keys(value);
1987
+ }
1988
+ arrayEach(props || value, function(subValue, key2) {
1989
+ if (props) {
1990
+ key2 = subValue;
1991
+ subValue = value[key2];
1992
+ }
1993
+ assignValue(result, key2, baseClone(subValue, isDeep, isFull, customizer, key2, value, stack));
1994
+ });
1995
+ return result;
1996
+ }
1997
+ function baseCreate(proto) {
1998
+ return isObject(proto) ? objectCreate(proto) : {};
1999
+ }
2000
+ function baseGetAllKeys(object, keysFunc, symbolsFunc) {
2001
+ var result = keysFunc(object);
2002
+ return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
2003
+ }
2004
+ function baseGetTag(value) {
2005
+ return objectToString.call(value);
2006
+ }
2007
+ function baseIsNative(value) {
2008
+ if (!isObject(value) || isMasked(value)) {
2009
+ return false;
2010
+ }
2011
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
2012
+ return pattern.test(toSource(value));
2013
+ }
2014
+ function baseKeys(object) {
2015
+ if (!isPrototype(object)) {
2016
+ return nativeKeys(object);
2017
+ }
2018
+ var result = [];
2019
+ for (var key in Object(object)) {
2020
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
2021
+ result.push(key);
2022
+ }
2023
+ }
2024
+ return result;
2025
+ }
2026
+ function cloneBuffer(buffer, isDeep) {
2027
+ if (isDeep) {
2028
+ return buffer.slice();
2029
+ }
2030
+ var result = new buffer.constructor(buffer.length);
2031
+ buffer.copy(result);
2032
+ return result;
2033
+ }
2034
+ function cloneArrayBuffer(arrayBuffer) {
2035
+ var result = new arrayBuffer.constructor(arrayBuffer.byteLength);
2036
+ new Uint8Array2(result).set(new Uint8Array2(arrayBuffer));
2037
+ return result;
2038
+ }
2039
+ function cloneDataView(dataView, isDeep) {
2040
+ var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer;
2041
+ return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength);
2042
+ }
2043
+ function cloneMap(map, isDeep, cloneFunc) {
2044
+ var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map);
2045
+ return arrayReduce(array, addMapEntry, new map.constructor());
2046
+ }
2047
+ function cloneRegExp(regexp) {
2048
+ var result = new regexp.constructor(regexp.source, reFlags.exec(regexp));
2049
+ result.lastIndex = regexp.lastIndex;
2050
+ return result;
2051
+ }
2052
+ function cloneSet(set, isDeep, cloneFunc) {
2053
+ var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set);
2054
+ return arrayReduce(array, addSetEntry, new set.constructor());
2055
+ }
2056
+ function cloneSymbol(symbol) {
2057
+ return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {};
2058
+ }
2059
+ function cloneTypedArray(typedArray, isDeep) {
2060
+ var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;
2061
+ return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);
2062
+ }
2063
+ function copyArray(source2, array) {
2064
+ var index = -1, length = source2.length;
2065
+ array || (array = Array(length));
2066
+ while (++index < length) {
2067
+ array[index] = source2[index];
2068
+ }
2069
+ return array;
2070
+ }
2071
+ function copyObject(source2, props, object, customizer) {
2072
+ object || (object = {});
2073
+ var index = -1, length = props.length;
2074
+ while (++index < length) {
2075
+ var key = props[index];
2076
+ var newValue = void 0;
2077
+ assignValue(object, key, newValue === void 0 ? source2[key] : newValue);
2078
+ }
2079
+ return object;
2080
+ }
2081
+ function copySymbols(source2, object) {
2082
+ return copyObject(source2, getSymbols(source2), object);
2083
+ }
2084
+ function getAllKeys(object) {
2085
+ return baseGetAllKeys(object, keys, getSymbols);
2086
+ }
2087
+ function getMapData(map, key) {
2088
+ var data = map.__data__;
2089
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
2090
+ }
2091
+ function getNative(object, key) {
2092
+ var value = getValue(object, key);
2093
+ return baseIsNative(value) ? value : void 0;
2094
+ }
2095
+ var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray;
2096
+ var getTag = baseGetTag;
2097
+ if (DataView2 && getTag(new DataView2(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set && getTag(new Set()) != setTag || WeakMap && getTag(new WeakMap()) != weakMapTag) {
2098
+ getTag = function(value) {
2099
+ var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0;
2100
+ if (ctorString) {
2101
+ switch (ctorString) {
2102
+ case dataViewCtorString:
2103
+ return dataViewTag;
2104
+ case mapCtorString:
2105
+ return mapTag;
2106
+ case promiseCtorString:
2107
+ return promiseTag;
2108
+ case setCtorString:
2109
+ return setTag;
2110
+ case weakMapCtorString:
2111
+ return weakMapTag;
2112
+ }
2113
+ }
2114
+ return result;
2115
+ };
2116
+ }
2117
+ function initCloneArray(array) {
2118
+ var length = array.length, result = array.constructor(length);
2119
+ if (length && typeof array[0] == "string" && hasOwnProperty.call(array, "index")) {
2120
+ result.index = array.index;
2121
+ result.input = array.input;
2122
+ }
2123
+ return result;
2124
+ }
2125
+ function initCloneObject(object) {
2126
+ return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {};
2127
+ }
2128
+ function initCloneByTag(object, tag, cloneFunc, isDeep) {
2129
+ var Ctor = object.constructor;
2130
+ switch (tag) {
2131
+ case arrayBufferTag:
2132
+ return cloneArrayBuffer(object);
2133
+ case boolTag:
2134
+ case dateTag:
2135
+ return new Ctor(+object);
2136
+ case dataViewTag:
2137
+ return cloneDataView(object, isDeep);
2138
+ case float32Tag:
2139
+ case float64Tag:
2140
+ case int8Tag:
2141
+ case int16Tag:
2142
+ case int32Tag:
2143
+ case uint8Tag:
2144
+ case uint8ClampedTag:
2145
+ case uint16Tag:
2146
+ case uint32Tag:
2147
+ return cloneTypedArray(object, isDeep);
2148
+ case mapTag:
2149
+ return cloneMap(object, isDeep, cloneFunc);
2150
+ case numberTag:
2151
+ case stringTag:
2152
+ return new Ctor(object);
2153
+ case regexpTag:
2154
+ return cloneRegExp(object);
2155
+ case setTag:
2156
+ return cloneSet(object, isDeep, cloneFunc);
2157
+ case symbolTag:
2158
+ return cloneSymbol(object);
2159
+ }
2160
+ }
2161
+ function isIndex(value, length) {
2162
+ length = length == null ? MAX_SAFE_INTEGER : length;
2163
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
2164
+ }
2165
+ function isKeyable(value) {
2166
+ var type = typeof value;
2167
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
2168
+ }
2169
+ function isMasked(func) {
2170
+ return !!maskSrcKey && maskSrcKey in func;
2171
+ }
2172
+ function isPrototype(value) {
2173
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
2174
+ return value === proto;
2175
+ }
2176
+ function toSource(func) {
2177
+ if (func != null) {
2178
+ try {
2179
+ return funcToString.call(func);
2180
+ } catch (e) {
2181
+ }
2182
+ try {
2183
+ return func + "";
2184
+ } catch (e) {
2185
+ }
2186
+ }
2187
+ return "";
2188
+ }
2189
+ function cloneDeep(value) {
2190
+ return baseClone(value, true, true);
2191
+ }
2192
+ function eq(value, other) {
2193
+ return value === other || value !== value && other !== other;
2194
+ }
2195
+ function isArguments(value) {
2196
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
2197
+ }
2198
+ var isArray = Array.isArray;
2199
+ function isArrayLike(value) {
2200
+ return value != null && isLength(value.length) && !isFunction(value);
2201
+ }
2202
+ function isArrayLikeObject(value) {
2203
+ return isObjectLike(value) && isArrayLike(value);
2204
+ }
2205
+ var isBuffer = nativeIsBuffer || stubFalse;
2206
+ function isFunction(value) {
2207
+ var tag = isObject(value) ? objectToString.call(value) : "";
2208
+ return tag == funcTag || tag == genTag;
2209
+ }
2210
+ function isLength(value) {
2211
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
2212
+ }
2213
+ function isObject(value) {
2214
+ var type = typeof value;
2215
+ return !!value && (type == "object" || type == "function");
2216
+ }
2217
+ function isObjectLike(value) {
2218
+ return !!value && typeof value == "object";
2219
+ }
2220
+ function keys(object) {
2221
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
2222
+ }
2223
+ function stubArray() {
2224
+ return [];
2225
+ }
2226
+ function stubFalse() {
2227
+ return false;
2228
+ }
2229
+ module.exports = cloneDeep;
2230
+ })(lodash_clonedeep, lodash_clonedeep.exports);
2231
+ return lodash_clonedeep.exports;
2232
+ }
2233
+ requireLodash_clonedeep();
2234
+ var SubscriptionTopic = /* @__PURE__ */ ((SubscriptionTopic2) => {
2235
+ SubscriptionTopic2["AllServicesCombined"] = "AllServicesCombined";
2236
+ SubscriptionTopic2["Services"] = "Services";
2237
+ SubscriptionTopic2["ServiceInstances"] = "ServiceInstances";
2238
+ SubscriptionTopic2["ServiceInstance"] = "ServiceInstance";
2239
+ SubscriptionTopic2["AllAgentsCombined"] = "AllAgentsCombined";
2240
+ SubscriptionTopic2["Agents"] = "Agents";
2241
+ SubscriptionTopic2["AgentWorkers"] = "AgentWorkers";
2242
+ SubscriptionTopic2["AgentWorker"] = "AgentWorker";
2243
+ SubscriptionTopic2["AllLambdasCombined"] = "AllLambdasCombined";
2244
+ SubscriptionTopic2["LambdaTechnologies"] = "LambdaTechnologies";
2245
+ SubscriptionTopic2["LambdaSubTechnologies"] = "LambdaSubTechnologies";
2246
+ SubscriptionTopic2["LambdaSubTechnologiesInstance"] = "LambdaSubTechnologiesInstance";
2247
+ SubscriptionTopic2["LogProcessing"] = "LogProcessing";
2248
+ return SubscriptionTopic2;
2249
+ })(SubscriptionTopic || {});
2250
+ var ansiStyles = { exports: {} };
2251
+ var colorName;
2252
+ var hasRequiredColorName;
2253
+ function requireColorName() {
2254
+ if (hasRequiredColorName) return colorName;
2255
+ hasRequiredColorName = 1;
2256
+ colorName = {
2257
+ "aliceblue": [240, 248, 255],
2258
+ "antiquewhite": [250, 235, 215],
2259
+ "aqua": [0, 255, 255],
2260
+ "aquamarine": [127, 255, 212],
2261
+ "azure": [240, 255, 255],
2262
+ "beige": [245, 245, 220],
2263
+ "bisque": [255, 228, 196],
2264
+ "black": [0, 0, 0],
2265
+ "blanchedalmond": [255, 235, 205],
2266
+ "blue": [0, 0, 255],
2267
+ "blueviolet": [138, 43, 226],
2268
+ "brown": [165, 42, 42],
2269
+ "burlywood": [222, 184, 135],
2270
+ "cadetblue": [95, 158, 160],
2271
+ "chartreuse": [127, 255, 0],
2272
+ "chocolate": [210, 105, 30],
2273
+ "coral": [255, 127, 80],
2274
+ "cornflowerblue": [100, 149, 237],
2275
+ "cornsilk": [255, 248, 220],
2276
+ "crimson": [220, 20, 60],
2277
+ "cyan": [0, 255, 255],
2278
+ "darkblue": [0, 0, 139],
2279
+ "darkcyan": [0, 139, 139],
2280
+ "darkgoldenrod": [184, 134, 11],
2281
+ "darkgray": [169, 169, 169],
2282
+ "darkgreen": [0, 100, 0],
2283
+ "darkgrey": [169, 169, 169],
2284
+ "darkkhaki": [189, 183, 107],
2285
+ "darkmagenta": [139, 0, 139],
2286
+ "darkolivegreen": [85, 107, 47],
2287
+ "darkorange": [255, 140, 0],
2288
+ "darkorchid": [153, 50, 204],
2289
+ "darkred": [139, 0, 0],
2290
+ "darksalmon": [233, 150, 122],
2291
+ "darkseagreen": [143, 188, 143],
2292
+ "darkslateblue": [72, 61, 139],
2293
+ "darkslategray": [47, 79, 79],
2294
+ "darkslategrey": [47, 79, 79],
2295
+ "darkturquoise": [0, 206, 209],
2296
+ "darkviolet": [148, 0, 211],
2297
+ "deeppink": [255, 20, 147],
2298
+ "deepskyblue": [0, 191, 255],
2299
+ "dimgray": [105, 105, 105],
2300
+ "dimgrey": [105, 105, 105],
2301
+ "dodgerblue": [30, 144, 255],
2302
+ "firebrick": [178, 34, 34],
2303
+ "floralwhite": [255, 250, 240],
2304
+ "forestgreen": [34, 139, 34],
2305
+ "fuchsia": [255, 0, 255],
2306
+ "gainsboro": [220, 220, 220],
2307
+ "ghostwhite": [248, 248, 255],
2308
+ "gold": [255, 215, 0],
2309
+ "goldenrod": [218, 165, 32],
2310
+ "gray": [128, 128, 128],
2311
+ "green": [0, 128, 0],
2312
+ "greenyellow": [173, 255, 47],
2313
+ "grey": [128, 128, 128],
2314
+ "honeydew": [240, 255, 240],
2315
+ "hotpink": [255, 105, 180],
2316
+ "indianred": [205, 92, 92],
2317
+ "indigo": [75, 0, 130],
2318
+ "ivory": [255, 255, 240],
2319
+ "khaki": [240, 230, 140],
2320
+ "lavender": [230, 230, 250],
2321
+ "lavenderblush": [255, 240, 245],
2322
+ "lawngreen": [124, 252, 0],
2323
+ "lemonchiffon": [255, 250, 205],
2324
+ "lightblue": [173, 216, 230],
2325
+ "lightcoral": [240, 128, 128],
2326
+ "lightcyan": [224, 255, 255],
2327
+ "lightgoldenrodyellow": [250, 250, 210],
2328
+ "lightgray": [211, 211, 211],
2329
+ "lightgreen": [144, 238, 144],
2330
+ "lightgrey": [211, 211, 211],
2331
+ "lightpink": [255, 182, 193],
2332
+ "lightsalmon": [255, 160, 122],
2333
+ "lightseagreen": [32, 178, 170],
2334
+ "lightskyblue": [135, 206, 250],
2335
+ "lightslategray": [119, 136, 153],
2336
+ "lightslategrey": [119, 136, 153],
2337
+ "lightsteelblue": [176, 196, 222],
2338
+ "lightyellow": [255, 255, 224],
2339
+ "lime": [0, 255, 0],
2340
+ "limegreen": [50, 205, 50],
2341
+ "linen": [250, 240, 230],
2342
+ "magenta": [255, 0, 255],
2343
+ "maroon": [128, 0, 0],
2344
+ "mediumaquamarine": [102, 205, 170],
2345
+ "mediumblue": [0, 0, 205],
2346
+ "mediumorchid": [186, 85, 211],
2347
+ "mediumpurple": [147, 112, 219],
2348
+ "mediumseagreen": [60, 179, 113],
2349
+ "mediumslateblue": [123, 104, 238],
2350
+ "mediumspringgreen": [0, 250, 154],
2351
+ "mediumturquoise": [72, 209, 204],
2352
+ "mediumvioletred": [199, 21, 133],
2353
+ "midnightblue": [25, 25, 112],
2354
+ "mintcream": [245, 255, 250],
2355
+ "mistyrose": [255, 228, 225],
2356
+ "moccasin": [255, 228, 181],
2357
+ "navajowhite": [255, 222, 173],
2358
+ "navy": [0, 0, 128],
2359
+ "oldlace": [253, 245, 230],
2360
+ "olive": [128, 128, 0],
2361
+ "olivedrab": [107, 142, 35],
2362
+ "orange": [255, 165, 0],
2363
+ "orangered": [255, 69, 0],
2364
+ "orchid": [218, 112, 214],
2365
+ "palegoldenrod": [238, 232, 170],
2366
+ "palegreen": [152, 251, 152],
2367
+ "paleturquoise": [175, 238, 238],
2368
+ "palevioletred": [219, 112, 147],
2369
+ "papayawhip": [255, 239, 213],
2370
+ "peachpuff": [255, 218, 185],
2371
+ "peru": [205, 133, 63],
2372
+ "pink": [255, 192, 203],
2373
+ "plum": [221, 160, 221],
2374
+ "powderblue": [176, 224, 230],
2375
+ "purple": [128, 0, 128],
2376
+ "rebeccapurple": [102, 51, 153],
2377
+ "red": [255, 0, 0],
2378
+ "rosybrown": [188, 143, 143],
2379
+ "royalblue": [65, 105, 225],
2380
+ "saddlebrown": [139, 69, 19],
2381
+ "salmon": [250, 128, 114],
2382
+ "sandybrown": [244, 164, 96],
2383
+ "seagreen": [46, 139, 87],
2384
+ "seashell": [255, 245, 238],
2385
+ "sienna": [160, 82, 45],
2386
+ "silver": [192, 192, 192],
2387
+ "skyblue": [135, 206, 235],
2388
+ "slateblue": [106, 90, 205],
2389
+ "slategray": [112, 128, 144],
2390
+ "slategrey": [112, 128, 144],
2391
+ "snow": [255, 250, 250],
2392
+ "springgreen": [0, 255, 127],
2393
+ "steelblue": [70, 130, 180],
2394
+ "tan": [210, 180, 140],
2395
+ "teal": [0, 128, 128],
2396
+ "thistle": [216, 191, 216],
2397
+ "tomato": [255, 99, 71],
2398
+ "turquoise": [64, 224, 208],
2399
+ "violet": [238, 130, 238],
2400
+ "wheat": [245, 222, 179],
2401
+ "white": [255, 255, 255],
2402
+ "whitesmoke": [245, 245, 245],
2403
+ "yellow": [255, 255, 0],
2404
+ "yellowgreen": [154, 205, 50]
2405
+ };
2406
+ return colorName;
2407
+ }
2408
+ var conversions;
2409
+ var hasRequiredConversions;
2410
+ function requireConversions() {
2411
+ if (hasRequiredConversions) return conversions;
2412
+ hasRequiredConversions = 1;
2413
+ const cssKeywords = requireColorName();
2414
+ const reverseKeywords = {};
2415
+ for (const key of Object.keys(cssKeywords)) {
2416
+ reverseKeywords[cssKeywords[key]] = key;
2417
+ }
2418
+ const convert = {
2419
+ rgb: { channels: 3, labels: "rgb" },
2420
+ hsl: { channels: 3, labels: "hsl" },
2421
+ hsv: { channels: 3, labels: "hsv" },
2422
+ hwb: { channels: 3, labels: "hwb" },
2423
+ cmyk: { channels: 4, labels: "cmyk" },
2424
+ xyz: { channels: 3, labels: "xyz" },
2425
+ lab: { channels: 3, labels: "lab" },
2426
+ lch: { channels: 3, labels: "lch" },
2427
+ hex: { channels: 1, labels: ["hex"] },
2428
+ keyword: { channels: 1, labels: ["keyword"] },
2429
+ ansi16: { channels: 1, labels: ["ansi16"] },
2430
+ ansi256: { channels: 1, labels: ["ansi256"] },
2431
+ hcg: { channels: 3, labels: ["h", "c", "g"] },
2432
+ apple: { channels: 3, labels: ["r16", "g16", "b16"] },
2433
+ gray: { channels: 1, labels: ["gray"] }
2434
+ };
2435
+ conversions = convert;
2436
+ for (const model of Object.keys(convert)) {
2437
+ if (!("channels" in convert[model])) {
2438
+ throw new Error("missing channels property: " + model);
2439
+ }
2440
+ if (!("labels" in convert[model])) {
2441
+ throw new Error("missing channel labels property: " + model);
2442
+ }
2443
+ if (convert[model].labels.length !== convert[model].channels) {
2444
+ throw new Error("channel and label counts mismatch: " + model);
2445
+ }
2446
+ const { channels, labels } = convert[model];
2447
+ delete convert[model].channels;
2448
+ delete convert[model].labels;
2449
+ Object.defineProperty(convert[model], "channels", { value: channels });
2450
+ Object.defineProperty(convert[model], "labels", { value: labels });
2451
+ }
2452
+ convert.rgb.hsl = function(rgb) {
2453
+ const r = rgb[0] / 255;
2454
+ const g = rgb[1] / 255;
2455
+ const b = rgb[2] / 255;
2456
+ const min = Math.min(r, g, b);
2457
+ const max = Math.max(r, g, b);
2458
+ const delta = max - min;
2459
+ let h;
2460
+ let s;
2461
+ if (max === min) {
2462
+ h = 0;
2463
+ } else if (r === max) {
2464
+ h = (g - b) / delta;
2465
+ } else if (g === max) {
2466
+ h = 2 + (b - r) / delta;
2467
+ } else if (b === max) {
2468
+ h = 4 + (r - g) / delta;
2469
+ }
2470
+ h = Math.min(h * 60, 360);
2471
+ if (h < 0) {
2472
+ h += 360;
2473
+ }
2474
+ const l = (min + max) / 2;
2475
+ if (max === min) {
2476
+ s = 0;
2477
+ } else if (l <= 0.5) {
2478
+ s = delta / (max + min);
2479
+ } else {
2480
+ s = delta / (2 - max - min);
2481
+ }
2482
+ return [h, s * 100, l * 100];
2483
+ };
2484
+ convert.rgb.hsv = function(rgb) {
2485
+ let rdif;
2486
+ let gdif;
2487
+ let bdif;
2488
+ let h;
2489
+ let s;
2490
+ const r = rgb[0] / 255;
2491
+ const g = rgb[1] / 255;
2492
+ const b = rgb[2] / 255;
2493
+ const v = Math.max(r, g, b);
2494
+ const diff = v - Math.min(r, g, b);
2495
+ const diffc = function(c) {
2496
+ return (v - c) / 6 / diff + 1 / 2;
2497
+ };
2498
+ if (diff === 0) {
2499
+ h = 0;
2500
+ s = 0;
2501
+ } else {
2502
+ s = diff / v;
2503
+ rdif = diffc(r);
2504
+ gdif = diffc(g);
2505
+ bdif = diffc(b);
2506
+ if (r === v) {
2507
+ h = bdif - gdif;
2508
+ } else if (g === v) {
2509
+ h = 1 / 3 + rdif - bdif;
2510
+ } else if (b === v) {
2511
+ h = 2 / 3 + gdif - rdif;
2512
+ }
2513
+ if (h < 0) {
2514
+ h += 1;
2515
+ } else if (h > 1) {
2516
+ h -= 1;
2517
+ }
2518
+ }
2519
+ return [
2520
+ h * 360,
2521
+ s * 100,
2522
+ v * 100
2523
+ ];
2524
+ };
2525
+ convert.rgb.hwb = function(rgb) {
2526
+ const r = rgb[0];
2527
+ const g = rgb[1];
2528
+ let b = rgb[2];
2529
+ const h = convert.rgb.hsl(rgb)[0];
2530
+ const w = 1 / 255 * Math.min(r, Math.min(g, b));
2531
+ b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
2532
+ return [h, w * 100, b * 100];
2533
+ };
2534
+ convert.rgb.cmyk = function(rgb) {
2535
+ const r = rgb[0] / 255;
2536
+ const g = rgb[1] / 255;
2537
+ const b = rgb[2] / 255;
2538
+ const k = Math.min(1 - r, 1 - g, 1 - b);
2539
+ const c = (1 - r - k) / (1 - k) || 0;
2540
+ const m = (1 - g - k) / (1 - k) || 0;
2541
+ const y = (1 - b - k) / (1 - k) || 0;
2542
+ return [c * 100, m * 100, y * 100, k * 100];
2543
+ };
2544
+ function comparativeDistance(x, y) {
2545
+ return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
2546
+ }
2547
+ convert.rgb.keyword = function(rgb) {
2548
+ const reversed = reverseKeywords[rgb];
2549
+ if (reversed) {
2550
+ return reversed;
2551
+ }
2552
+ let currentClosestDistance = Infinity;
2553
+ let currentClosestKeyword;
2554
+ for (const keyword of Object.keys(cssKeywords)) {
2555
+ const value = cssKeywords[keyword];
2556
+ const distance = comparativeDistance(rgb, value);
2557
+ if (distance < currentClosestDistance) {
2558
+ currentClosestDistance = distance;
2559
+ currentClosestKeyword = keyword;
2560
+ }
2561
+ }
2562
+ return currentClosestKeyword;
2563
+ };
2564
+ convert.keyword.rgb = function(keyword) {
2565
+ return cssKeywords[keyword];
2566
+ };
2567
+ convert.rgb.xyz = function(rgb) {
2568
+ let r = rgb[0] / 255;
2569
+ let g = rgb[1] / 255;
2570
+ let b = rgb[2] / 255;
2571
+ r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
2572
+ g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
2573
+ b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
2574
+ const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
2575
+ const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
2576
+ const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
2577
+ return [x * 100, y * 100, z * 100];
2578
+ };
2579
+ convert.rgb.lab = function(rgb) {
2580
+ const xyz = convert.rgb.xyz(rgb);
2581
+ let x = xyz[0];
2582
+ let y = xyz[1];
2583
+ let z = xyz[2];
2584
+ x /= 95.047;
2585
+ y /= 100;
2586
+ z /= 108.883;
2587
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2588
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2589
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2590
+ const l = 116 * y - 16;
2591
+ const a = 500 * (x - y);
2592
+ const b = 200 * (y - z);
2593
+ return [l, a, b];
2594
+ };
2595
+ convert.hsl.rgb = function(hsl) {
2596
+ const h = hsl[0] / 360;
2597
+ const s = hsl[1] / 100;
2598
+ const l = hsl[2] / 100;
2599
+ let t2;
2600
+ let t3;
2601
+ let val;
2602
+ if (s === 0) {
2603
+ val = l * 255;
2604
+ return [val, val, val];
2605
+ }
2606
+ if (l < 0.5) {
2607
+ t2 = l * (1 + s);
2608
+ } else {
2609
+ t2 = l + s - l * s;
2610
+ }
2611
+ const t1 = 2 * l - t2;
2612
+ const rgb = [0, 0, 0];
2613
+ for (let i = 0; i < 3; i++) {
2614
+ t3 = h + 1 / 3 * -(i - 1);
2615
+ if (t3 < 0) {
2616
+ t3++;
2617
+ }
2618
+ if (t3 > 1) {
2619
+ t3--;
2620
+ }
2621
+ if (6 * t3 < 1) {
2622
+ val = t1 + (t2 - t1) * 6 * t3;
2623
+ } else if (2 * t3 < 1) {
2624
+ val = t2;
2625
+ } else if (3 * t3 < 2) {
2626
+ val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
2627
+ } else {
2628
+ val = t1;
2629
+ }
2630
+ rgb[i] = val * 255;
2631
+ }
2632
+ return rgb;
2633
+ };
2634
+ convert.hsl.hsv = function(hsl) {
2635
+ const h = hsl[0];
2636
+ let s = hsl[1] / 100;
2637
+ let l = hsl[2] / 100;
2638
+ let smin = s;
2639
+ const lmin = Math.max(l, 0.01);
2640
+ l *= 2;
2641
+ s *= l <= 1 ? l : 2 - l;
2642
+ smin *= lmin <= 1 ? lmin : 2 - lmin;
2643
+ const v = (l + s) / 2;
2644
+ const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
2645
+ return [h, sv * 100, v * 100];
2646
+ };
2647
+ convert.hsv.rgb = function(hsv) {
2648
+ const h = hsv[0] / 60;
2649
+ const s = hsv[1] / 100;
2650
+ let v = hsv[2] / 100;
2651
+ const hi = Math.floor(h) % 6;
2652
+ const f = h - Math.floor(h);
2653
+ const p = 255 * v * (1 - s);
2654
+ const q = 255 * v * (1 - s * f);
2655
+ const t = 255 * v * (1 - s * (1 - f));
2656
+ v *= 255;
2657
+ switch (hi) {
2658
+ case 0:
2659
+ return [v, t, p];
2660
+ case 1:
2661
+ return [q, v, p];
2662
+ case 2:
2663
+ return [p, v, t];
2664
+ case 3:
2665
+ return [p, q, v];
2666
+ case 4:
2667
+ return [t, p, v];
2668
+ case 5:
2669
+ return [v, p, q];
2670
+ }
2671
+ };
2672
+ convert.hsv.hsl = function(hsv) {
2673
+ const h = hsv[0];
2674
+ const s = hsv[1] / 100;
2675
+ const v = hsv[2] / 100;
2676
+ const vmin = Math.max(v, 0.01);
2677
+ let sl;
2678
+ let l;
2679
+ l = (2 - s) * v;
2680
+ const lmin = (2 - s) * vmin;
2681
+ sl = s * vmin;
2682
+ sl /= lmin <= 1 ? lmin : 2 - lmin;
2683
+ sl = sl || 0;
2684
+ l /= 2;
2685
+ return [h, sl * 100, l * 100];
2686
+ };
2687
+ convert.hwb.rgb = function(hwb) {
2688
+ const h = hwb[0] / 360;
2689
+ let wh = hwb[1] / 100;
2690
+ let bl = hwb[2] / 100;
2691
+ const ratio = wh + bl;
2692
+ let f;
2693
+ if (ratio > 1) {
2694
+ wh /= ratio;
2695
+ bl /= ratio;
2696
+ }
2697
+ const i = Math.floor(6 * h);
2698
+ const v = 1 - bl;
2699
+ f = 6 * h - i;
2700
+ if ((i & 1) !== 0) {
2701
+ f = 1 - f;
2702
+ }
2703
+ const n = wh + f * (v - wh);
2704
+ let r;
2705
+ let g;
2706
+ let b;
2707
+ switch (i) {
2708
+ default:
2709
+ case 6:
2710
+ case 0:
2711
+ r = v;
2712
+ g = n;
2713
+ b = wh;
2714
+ break;
2715
+ case 1:
2716
+ r = n;
2717
+ g = v;
2718
+ b = wh;
2719
+ break;
2720
+ case 2:
2721
+ r = wh;
2722
+ g = v;
2723
+ b = n;
2724
+ break;
2725
+ case 3:
2726
+ r = wh;
2727
+ g = n;
2728
+ b = v;
2729
+ break;
2730
+ case 4:
2731
+ r = n;
2732
+ g = wh;
2733
+ b = v;
2734
+ break;
2735
+ case 5:
2736
+ r = v;
2737
+ g = wh;
2738
+ b = n;
2739
+ break;
2740
+ }
2741
+ return [r * 255, g * 255, b * 255];
2742
+ };
2743
+ convert.cmyk.rgb = function(cmyk) {
2744
+ const c = cmyk[0] / 100;
2745
+ const m = cmyk[1] / 100;
2746
+ const y = cmyk[2] / 100;
2747
+ const k = cmyk[3] / 100;
2748
+ const r = 1 - Math.min(1, c * (1 - k) + k);
2749
+ const g = 1 - Math.min(1, m * (1 - k) + k);
2750
+ const b = 1 - Math.min(1, y * (1 - k) + k);
2751
+ return [r * 255, g * 255, b * 255];
2752
+ };
2753
+ convert.xyz.rgb = function(xyz) {
2754
+ const x = xyz[0] / 100;
2755
+ const y = xyz[1] / 100;
2756
+ const z = xyz[2] / 100;
2757
+ let r;
2758
+ let g;
2759
+ let b;
2760
+ r = x * 3.2406 + y * -1.5372 + z * -0.4986;
2761
+ g = x * -0.9689 + y * 1.8758 + z * 0.0415;
2762
+ b = x * 0.0557 + y * -0.204 + z * 1.057;
2763
+ r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
2764
+ g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
2765
+ b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
2766
+ r = Math.min(Math.max(0, r), 1);
2767
+ g = Math.min(Math.max(0, g), 1);
2768
+ b = Math.min(Math.max(0, b), 1);
2769
+ return [r * 255, g * 255, b * 255];
2770
+ };
2771
+ convert.xyz.lab = function(xyz) {
2772
+ let x = xyz[0];
2773
+ let y = xyz[1];
2774
+ let z = xyz[2];
2775
+ x /= 95.047;
2776
+ y /= 100;
2777
+ z /= 108.883;
2778
+ x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
2779
+ y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
2780
+ z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
2781
+ const l = 116 * y - 16;
2782
+ const a = 500 * (x - y);
2783
+ const b = 200 * (y - z);
2784
+ return [l, a, b];
2785
+ };
2786
+ convert.lab.xyz = function(lab) {
2787
+ const l = lab[0];
2788
+ const a = lab[1];
2789
+ const b = lab[2];
2790
+ let x;
2791
+ let y;
2792
+ let z;
2793
+ y = (l + 16) / 116;
2794
+ x = a / 500 + y;
2795
+ z = y - b / 200;
2796
+ const y2 = y ** 3;
2797
+ const x2 = x ** 3;
2798
+ const z2 = z ** 3;
2799
+ y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
2800
+ x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
2801
+ z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
2802
+ x *= 95.047;
2803
+ y *= 100;
2804
+ z *= 108.883;
2805
+ return [x, y, z];
2806
+ };
2807
+ convert.lab.lch = function(lab) {
2808
+ const l = lab[0];
2809
+ const a = lab[1];
2810
+ const b = lab[2];
2811
+ let h;
2812
+ const hr = Math.atan2(b, a);
2813
+ h = hr * 360 / 2 / Math.PI;
2814
+ if (h < 0) {
2815
+ h += 360;
2816
+ }
2817
+ const c = Math.sqrt(a * a + b * b);
2818
+ return [l, c, h];
2819
+ };
2820
+ convert.lch.lab = function(lch) {
2821
+ const l = lch[0];
2822
+ const c = lch[1];
2823
+ const h = lch[2];
2824
+ const hr = h / 360 * 2 * Math.PI;
2825
+ const a = c * Math.cos(hr);
2826
+ const b = c * Math.sin(hr);
2827
+ return [l, a, b];
2828
+ };
2829
+ convert.rgb.ansi16 = function(args, saturation = null) {
2830
+ const [r, g, b] = args;
2831
+ let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
2832
+ value = Math.round(value / 50);
2833
+ if (value === 0) {
2834
+ return 30;
2835
+ }
2836
+ let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
2837
+ if (value === 2) {
2838
+ ansi += 60;
2839
+ }
2840
+ return ansi;
2841
+ };
2842
+ convert.hsv.ansi16 = function(args) {
2843
+ return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
2844
+ };
2845
+ convert.rgb.ansi256 = function(args) {
2846
+ const r = args[0];
2847
+ const g = args[1];
2848
+ const b = args[2];
2849
+ if (r === g && g === b) {
2850
+ if (r < 8) {
2851
+ return 16;
2852
+ }
2853
+ if (r > 248) {
2854
+ return 231;
2855
+ }
2856
+ return Math.round((r - 8) / 247 * 24) + 232;
2857
+ }
2858
+ const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
2859
+ return ansi;
2860
+ };
2861
+ convert.ansi16.rgb = function(args) {
2862
+ let color = args % 10;
2863
+ if (color === 0 || color === 7) {
2864
+ if (args > 50) {
2865
+ color += 3.5;
2866
+ }
2867
+ color = color / 10.5 * 255;
2868
+ return [color, color, color];
2869
+ }
2870
+ const mult = (~~(args > 50) + 1) * 0.5;
2871
+ const r = (color & 1) * mult * 255;
2872
+ const g = (color >> 1 & 1) * mult * 255;
2873
+ const b = (color >> 2 & 1) * mult * 255;
2874
+ return [r, g, b];
2875
+ };
2876
+ convert.ansi256.rgb = function(args) {
2877
+ if (args >= 232) {
2878
+ const c = (args - 232) * 10 + 8;
2879
+ return [c, c, c];
2880
+ }
2881
+ args -= 16;
2882
+ let rem;
2883
+ const r = Math.floor(args / 36) / 5 * 255;
2884
+ const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
2885
+ const b = rem % 6 / 5 * 255;
2886
+ return [r, g, b];
2887
+ };
2888
+ convert.rgb.hex = function(args) {
2889
+ const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
2890
+ const string = integer.toString(16).toUpperCase();
2891
+ return "000000".substring(string.length) + string;
2892
+ };
2893
+ convert.hex.rgb = function(args) {
2894
+ const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
2895
+ if (!match) {
2896
+ return [0, 0, 0];
2897
+ }
2898
+ let colorString = match[0];
2899
+ if (match[0].length === 3) {
2900
+ colorString = colorString.split("").map((char) => {
2901
+ return char + char;
2902
+ }).join("");
2903
+ }
2904
+ const integer = parseInt(colorString, 16);
2905
+ const r = integer >> 16 & 255;
2906
+ const g = integer >> 8 & 255;
2907
+ const b = integer & 255;
2908
+ return [r, g, b];
2909
+ };
2910
+ convert.rgb.hcg = function(rgb) {
2911
+ const r = rgb[0] / 255;
2912
+ const g = rgb[1] / 255;
2913
+ const b = rgb[2] / 255;
2914
+ const max = Math.max(Math.max(r, g), b);
2915
+ const min = Math.min(Math.min(r, g), b);
2916
+ const chroma = max - min;
2917
+ let grayscale;
2918
+ let hue;
2919
+ if (chroma < 1) {
2920
+ grayscale = min / (1 - chroma);
2921
+ } else {
2922
+ grayscale = 0;
2923
+ }
2924
+ if (chroma <= 0) {
2925
+ hue = 0;
2926
+ } else if (max === r) {
2927
+ hue = (g - b) / chroma % 6;
2928
+ } else if (max === g) {
2929
+ hue = 2 + (b - r) / chroma;
2930
+ } else {
2931
+ hue = 4 + (r - g) / chroma;
2932
+ }
2933
+ hue /= 6;
2934
+ hue %= 1;
2935
+ return [hue * 360, chroma * 100, grayscale * 100];
2936
+ };
2937
+ convert.hsl.hcg = function(hsl) {
2938
+ const s = hsl[1] / 100;
2939
+ const l = hsl[2] / 100;
2940
+ const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
2941
+ let f = 0;
2942
+ if (c < 1) {
2943
+ f = (l - 0.5 * c) / (1 - c);
2944
+ }
2945
+ return [hsl[0], c * 100, f * 100];
2946
+ };
2947
+ convert.hsv.hcg = function(hsv) {
2948
+ const s = hsv[1] / 100;
2949
+ const v = hsv[2] / 100;
2950
+ const c = s * v;
2951
+ let f = 0;
2952
+ if (c < 1) {
2953
+ f = (v - c) / (1 - c);
2954
+ }
2955
+ return [hsv[0], c * 100, f * 100];
2956
+ };
2957
+ convert.hcg.rgb = function(hcg) {
2958
+ const h = hcg[0] / 360;
2959
+ const c = hcg[1] / 100;
2960
+ const g = hcg[2] / 100;
2961
+ if (c === 0) {
2962
+ return [g * 255, g * 255, g * 255];
2963
+ }
2964
+ const pure = [0, 0, 0];
2965
+ const hi = h % 1 * 6;
2966
+ const v = hi % 1;
2967
+ const w = 1 - v;
2968
+ let mg = 0;
2969
+ switch (Math.floor(hi)) {
2970
+ case 0:
2971
+ pure[0] = 1;
2972
+ pure[1] = v;
2973
+ pure[2] = 0;
2974
+ break;
2975
+ case 1:
2976
+ pure[0] = w;
2977
+ pure[1] = 1;
2978
+ pure[2] = 0;
2979
+ break;
2980
+ case 2:
2981
+ pure[0] = 0;
2982
+ pure[1] = 1;
2983
+ pure[2] = v;
2984
+ break;
2985
+ case 3:
2986
+ pure[0] = 0;
2987
+ pure[1] = w;
2988
+ pure[2] = 1;
2989
+ break;
2990
+ case 4:
2991
+ pure[0] = v;
2992
+ pure[1] = 0;
2993
+ pure[2] = 1;
2994
+ break;
2995
+ default:
2996
+ pure[0] = 1;
2997
+ pure[1] = 0;
2998
+ pure[2] = w;
2999
+ }
3000
+ mg = (1 - c) * g;
3001
+ return [
3002
+ (c * pure[0] + mg) * 255,
3003
+ (c * pure[1] + mg) * 255,
3004
+ (c * pure[2] + mg) * 255
3005
+ ];
3006
+ };
3007
+ convert.hcg.hsv = function(hcg) {
3008
+ const c = hcg[1] / 100;
3009
+ const g = hcg[2] / 100;
3010
+ const v = c + g * (1 - c);
3011
+ let f = 0;
3012
+ if (v > 0) {
3013
+ f = c / v;
3014
+ }
3015
+ return [hcg[0], f * 100, v * 100];
3016
+ };
3017
+ convert.hcg.hsl = function(hcg) {
3018
+ const c = hcg[1] / 100;
3019
+ const g = hcg[2] / 100;
3020
+ const l = g * (1 - c) + 0.5 * c;
3021
+ let s = 0;
3022
+ if (l > 0 && l < 0.5) {
3023
+ s = c / (2 * l);
3024
+ } else if (l >= 0.5 && l < 1) {
3025
+ s = c / (2 * (1 - l));
3026
+ }
3027
+ return [hcg[0], s * 100, l * 100];
3028
+ };
3029
+ convert.hcg.hwb = function(hcg) {
3030
+ const c = hcg[1] / 100;
3031
+ const g = hcg[2] / 100;
3032
+ const v = c + g * (1 - c);
3033
+ return [hcg[0], (v - c) * 100, (1 - v) * 100];
3034
+ };
3035
+ convert.hwb.hcg = function(hwb) {
3036
+ const w = hwb[1] / 100;
3037
+ const b = hwb[2] / 100;
3038
+ const v = 1 - b;
3039
+ const c = v - w;
3040
+ let g = 0;
3041
+ if (c < 1) {
3042
+ g = (v - c) / (1 - c);
3043
+ }
3044
+ return [hwb[0], c * 100, g * 100];
3045
+ };
3046
+ convert.apple.rgb = function(apple) {
3047
+ return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
3048
+ };
3049
+ convert.rgb.apple = function(rgb) {
3050
+ return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
3051
+ };
3052
+ convert.gray.rgb = function(args) {
3053
+ return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
3054
+ };
3055
+ convert.gray.hsl = function(args) {
3056
+ return [0, 0, args[0]];
3057
+ };
3058
+ convert.gray.hsv = convert.gray.hsl;
3059
+ convert.gray.hwb = function(gray) {
3060
+ return [0, 100, gray[0]];
3061
+ };
3062
+ convert.gray.cmyk = function(gray) {
3063
+ return [0, 0, 0, gray[0]];
3064
+ };
3065
+ convert.gray.lab = function(gray) {
3066
+ return [gray[0], 0, 0];
3067
+ };
3068
+ convert.gray.hex = function(gray) {
3069
+ const val = Math.round(gray[0] / 100 * 255) & 255;
3070
+ const integer = (val << 16) + (val << 8) + val;
3071
+ const string = integer.toString(16).toUpperCase();
3072
+ return "000000".substring(string.length) + string;
3073
+ };
3074
+ convert.rgb.gray = function(rgb) {
3075
+ const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
3076
+ return [val / 255 * 100];
3077
+ };
3078
+ return conversions;
3079
+ }
3080
+ var route;
3081
+ var hasRequiredRoute;
3082
+ function requireRoute() {
3083
+ if (hasRequiredRoute) return route;
3084
+ hasRequiredRoute = 1;
3085
+ const conversions2 = requireConversions();
3086
+ function buildGraph() {
3087
+ const graph = {};
3088
+ const models = Object.keys(conversions2);
3089
+ for (let len = models.length, i = 0; i < len; i++) {
3090
+ graph[models[i]] = {
3091
+ // http://jsperf.com/1-vs-infinity
3092
+ // micro-opt, but this is simple.
3093
+ distance: -1,
3094
+ parent: null
3095
+ };
3096
+ }
3097
+ return graph;
3098
+ }
3099
+ function deriveBFS(fromModel) {
3100
+ const graph = buildGraph();
3101
+ const queue = [fromModel];
3102
+ graph[fromModel].distance = 0;
3103
+ while (queue.length) {
3104
+ const current = queue.pop();
3105
+ const adjacents = Object.keys(conversions2[current]);
3106
+ for (let len = adjacents.length, i = 0; i < len; i++) {
3107
+ const adjacent = adjacents[i];
3108
+ const node = graph[adjacent];
3109
+ if (node.distance === -1) {
3110
+ node.distance = graph[current].distance + 1;
3111
+ node.parent = current;
3112
+ queue.unshift(adjacent);
3113
+ }
3114
+ }
3115
+ }
3116
+ return graph;
3117
+ }
3118
+ function link(from, to) {
3119
+ return function(args) {
3120
+ return to(from(args));
3121
+ };
3122
+ }
3123
+ function wrapConversion(toModel, graph) {
3124
+ const path = [graph[toModel].parent, toModel];
3125
+ let fn = conversions2[graph[toModel].parent][toModel];
3126
+ let cur = graph[toModel].parent;
3127
+ while (graph[cur].parent) {
3128
+ path.unshift(graph[cur].parent);
3129
+ fn = link(conversions2[graph[cur].parent][cur], fn);
3130
+ cur = graph[cur].parent;
3131
+ }
3132
+ fn.conversion = path;
3133
+ return fn;
3134
+ }
3135
+ route = function(fromModel) {
3136
+ const graph = deriveBFS(fromModel);
3137
+ const conversion = {};
3138
+ const models = Object.keys(graph);
3139
+ for (let len = models.length, i = 0; i < len; i++) {
3140
+ const toModel = models[i];
3141
+ const node = graph[toModel];
3142
+ if (node.parent === null) {
3143
+ continue;
3144
+ }
3145
+ conversion[toModel] = wrapConversion(toModel, graph);
3146
+ }
3147
+ return conversion;
3148
+ };
3149
+ return route;
3150
+ }
3151
+ var colorConvert;
3152
+ var hasRequiredColorConvert;
3153
+ function requireColorConvert() {
3154
+ if (hasRequiredColorConvert) return colorConvert;
3155
+ hasRequiredColorConvert = 1;
3156
+ const conversions2 = requireConversions();
3157
+ const route2 = requireRoute();
3158
+ const convert = {};
3159
+ const models = Object.keys(conversions2);
3160
+ function wrapRaw(fn) {
3161
+ const wrappedFn = function(...args) {
3162
+ const arg0 = args[0];
3163
+ if (arg0 === void 0 || arg0 === null) {
3164
+ return arg0;
3165
+ }
3166
+ if (arg0.length > 1) {
3167
+ args = arg0;
3168
+ }
3169
+ return fn(args);
3170
+ };
3171
+ if ("conversion" in fn) {
3172
+ wrappedFn.conversion = fn.conversion;
3173
+ }
3174
+ return wrappedFn;
3175
+ }
3176
+ function wrapRounded(fn) {
3177
+ const wrappedFn = function(...args) {
3178
+ const arg0 = args[0];
3179
+ if (arg0 === void 0 || arg0 === null) {
3180
+ return arg0;
3181
+ }
3182
+ if (arg0.length > 1) {
3183
+ args = arg0;
3184
+ }
3185
+ const result = fn(args);
3186
+ if (typeof result === "object") {
3187
+ for (let len = result.length, i = 0; i < len; i++) {
3188
+ result[i] = Math.round(result[i]);
3189
+ }
3190
+ }
3191
+ return result;
3192
+ };
3193
+ if ("conversion" in fn) {
3194
+ wrappedFn.conversion = fn.conversion;
3195
+ }
3196
+ return wrappedFn;
3197
+ }
3198
+ models.forEach((fromModel) => {
3199
+ convert[fromModel] = {};
3200
+ Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
3201
+ Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
3202
+ const routes = route2(fromModel);
3203
+ const routeModels = Object.keys(routes);
3204
+ routeModels.forEach((toModel) => {
3205
+ const fn = routes[toModel];
3206
+ convert[fromModel][toModel] = wrapRounded(fn);
3207
+ convert[fromModel][toModel].raw = wrapRaw(fn);
3208
+ });
3209
+ });
3210
+ colorConvert = convert;
3211
+ return colorConvert;
3212
+ }
3213
+ ansiStyles.exports;
3214
+ var hasRequiredAnsiStyles;
3215
+ function requireAnsiStyles() {
3216
+ if (hasRequiredAnsiStyles) return ansiStyles.exports;
3217
+ hasRequiredAnsiStyles = 1;
3218
+ (function(module) {
3219
+ const wrapAnsi16 = (fn, offset) => (...args) => {
3220
+ const code = fn(...args);
3221
+ return `\x1B[${code + offset}m`;
3222
+ };
3223
+ const wrapAnsi256 = (fn, offset) => (...args) => {
3224
+ const code = fn(...args);
3225
+ return `\x1B[${38 + offset};5;${code}m`;
3226
+ };
3227
+ const wrapAnsi16m = (fn, offset) => (...args) => {
3228
+ const rgb = fn(...args);
3229
+ return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
3230
+ };
3231
+ const ansi2ansi = (n) => n;
3232
+ const rgb2rgb = (r, g, b) => [r, g, b];
3233
+ const setLazyProperty = (object, property, get) => {
3234
+ Object.defineProperty(object, property, {
3235
+ get: () => {
3236
+ const value = get();
3237
+ Object.defineProperty(object, property, {
3238
+ value,
3239
+ enumerable: true,
3240
+ configurable: true
3241
+ });
3242
+ return value;
3243
+ },
3244
+ enumerable: true,
3245
+ configurable: true
3246
+ });
3247
+ };
3248
+ let colorConvert2;
3249
+ const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
3250
+ if (colorConvert2 === void 0) {
3251
+ colorConvert2 = requireColorConvert();
3252
+ }
3253
+ const offset = isBackground ? 10 : 0;
3254
+ const styles = {};
3255
+ for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
3256
+ const name = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
3257
+ if (sourceSpace === targetSpace) {
3258
+ styles[name] = wrap(identity, offset);
3259
+ } else if (typeof suite === "object") {
3260
+ styles[name] = wrap(suite[targetSpace], offset);
3261
+ }
3262
+ }
3263
+ return styles;
3264
+ };
3265
+ function assembleStyles() {
3266
+ const codes = /* @__PURE__ */ new Map();
3267
+ const styles = {
3268
+ modifier: {
3269
+ reset: [0, 0],
3270
+ // 21 isn't widely supported and 22 does the same thing
3271
+ bold: [1, 22],
3272
+ dim: [2, 22],
3273
+ italic: [3, 23],
3274
+ underline: [4, 24],
3275
+ inverse: [7, 27],
3276
+ hidden: [8, 28],
3277
+ strikethrough: [9, 29]
3278
+ },
3279
+ color: {
3280
+ black: [30, 39],
3281
+ red: [31, 39],
3282
+ green: [32, 39],
3283
+ yellow: [33, 39],
3284
+ blue: [34, 39],
3285
+ magenta: [35, 39],
3286
+ cyan: [36, 39],
3287
+ white: [37, 39],
3288
+ // Bright color
3289
+ blackBright: [90, 39],
3290
+ redBright: [91, 39],
3291
+ greenBright: [92, 39],
3292
+ yellowBright: [93, 39],
3293
+ blueBright: [94, 39],
3294
+ magentaBright: [95, 39],
3295
+ cyanBright: [96, 39],
3296
+ whiteBright: [97, 39]
3297
+ },
3298
+ bgColor: {
3299
+ bgBlack: [40, 49],
3300
+ bgRed: [41, 49],
3301
+ bgGreen: [42, 49],
3302
+ bgYellow: [43, 49],
3303
+ bgBlue: [44, 49],
3304
+ bgMagenta: [45, 49],
3305
+ bgCyan: [46, 49],
3306
+ bgWhite: [47, 49],
3307
+ // Bright color
3308
+ bgBlackBright: [100, 49],
3309
+ bgRedBright: [101, 49],
3310
+ bgGreenBright: [102, 49],
3311
+ bgYellowBright: [103, 49],
3312
+ bgBlueBright: [104, 49],
3313
+ bgMagentaBright: [105, 49],
3314
+ bgCyanBright: [106, 49],
3315
+ bgWhiteBright: [107, 49]
3316
+ }
3317
+ };
3318
+ styles.color.gray = styles.color.blackBright;
3319
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
3320
+ styles.color.grey = styles.color.blackBright;
3321
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
3322
+ for (const [groupName, group] of Object.entries(styles)) {
3323
+ for (const [styleName, style] of Object.entries(group)) {
3324
+ styles[styleName] = {
3325
+ open: `\x1B[${style[0]}m`,
3326
+ close: `\x1B[${style[1]}m`
3327
+ };
3328
+ group[styleName] = styles[styleName];
3329
+ codes.set(style[0], style[1]);
3330
+ }
3331
+ Object.defineProperty(styles, groupName, {
3332
+ value: group,
3333
+ enumerable: false
3334
+ });
3335
+ }
3336
+ Object.defineProperty(styles, "codes", {
3337
+ value: codes,
3338
+ enumerable: false
3339
+ });
3340
+ styles.color.close = "\x1B[39m";
3341
+ styles.bgColor.close = "\x1B[49m";
3342
+ setLazyProperty(styles.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
3343
+ setLazyProperty(styles.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
3344
+ setLazyProperty(styles.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
3345
+ setLazyProperty(styles.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
3346
+ setLazyProperty(styles.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
3347
+ setLazyProperty(styles.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
3348
+ return styles;
3349
+ }
3350
+ Object.defineProperty(module, "exports", {
3351
+ enumerable: true,
3352
+ get: assembleStyles
3353
+ });
3354
+ })(ansiStyles);
3355
+ return ansiStyles.exports;
3356
+ }
3357
+ var browser;
3358
+ var hasRequiredBrowser;
3359
+ function requireBrowser() {
3360
+ if (hasRequiredBrowser) return browser;
3361
+ hasRequiredBrowser = 1;
3362
+ browser = {
3363
+ stdout: false,
3364
+ stderr: false
3365
+ };
3366
+ return browser;
3367
+ }
3368
+ var util;
3369
+ var hasRequiredUtil;
3370
+ function requireUtil() {
3371
+ if (hasRequiredUtil) return util;
3372
+ hasRequiredUtil = 1;
3373
+ const stringReplaceAll = (string, substring, replacer) => {
3374
+ let index = string.indexOf(substring);
3375
+ if (index === -1) {
3376
+ return string;
3377
+ }
3378
+ const substringLength = substring.length;
3379
+ let endIndex = 0;
3380
+ let returnValue = "";
3381
+ do {
3382
+ returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
3383
+ endIndex = index + substringLength;
3384
+ index = string.indexOf(substring, endIndex);
3385
+ } while (index !== -1);
3386
+ returnValue += string.substr(endIndex);
3387
+ return returnValue;
3388
+ };
3389
+ const stringEncaseCRLFWithFirstIndex = (string, prefix, postfix, index) => {
3390
+ let endIndex = 0;
3391
+ let returnValue = "";
3392
+ do {
3393
+ const gotCR = string[index - 1] === "\r";
3394
+ returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
3395
+ endIndex = index + 1;
3396
+ index = string.indexOf("\n", endIndex);
3397
+ } while (index !== -1);
3398
+ returnValue += string.substr(endIndex);
3399
+ return returnValue;
3400
+ };
3401
+ util = {
3402
+ stringReplaceAll,
3403
+ stringEncaseCRLFWithFirstIndex
3404
+ };
3405
+ return util;
3406
+ }
3407
+ var templates;
3408
+ var hasRequiredTemplates;
3409
+ function requireTemplates() {
3410
+ if (hasRequiredTemplates) return templates;
3411
+ hasRequiredTemplates = 1;
3412
+ 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;
3413
+ const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
3414
+ const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
3415
+ const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
3416
+ const ESCAPES = /* @__PURE__ */ new Map([
3417
+ ["n", "\n"],
3418
+ ["r", "\r"],
3419
+ ["t", " "],
3420
+ ["b", "\b"],
3421
+ ["f", "\f"],
3422
+ ["v", "\v"],
3423
+ ["0", "\0"],
3424
+ ["\\", "\\"],
3425
+ ["e", "\x1B"],
3426
+ ["a", "\x07"]
3427
+ ]);
3428
+ function unescape2(c) {
3429
+ const u = c[0] === "u";
3430
+ const bracket = c[1] === "{";
3431
+ if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
3432
+ return String.fromCharCode(parseInt(c.slice(1), 16));
3433
+ }
3434
+ if (u && bracket) {
3435
+ return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
3436
+ }
3437
+ return ESCAPES.get(c) || c;
3438
+ }
3439
+ function parseArguments(name, arguments_) {
3440
+ const results = [];
3441
+ const chunks = arguments_.trim().split(/\s*,\s*/g);
3442
+ let matches;
3443
+ for (const chunk of chunks) {
3444
+ const number = Number(chunk);
3445
+ if (!Number.isNaN(number)) {
3446
+ results.push(number);
3447
+ } else if (matches = chunk.match(STRING_REGEX)) {
3448
+ results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape2(escape2) : character));
3449
+ } else {
3450
+ throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name}')`);
3451
+ }
3452
+ }
3453
+ return results;
3454
+ }
3455
+ function parseStyle(style) {
3456
+ STYLE_REGEX.lastIndex = 0;
3457
+ const results = [];
3458
+ let matches;
3459
+ while ((matches = STYLE_REGEX.exec(style)) !== null) {
3460
+ const name = matches[1];
3461
+ if (matches[2]) {
3462
+ const args = parseArguments(name, matches[2]);
3463
+ results.push([name].concat(args));
3464
+ } else {
3465
+ results.push([name]);
3466
+ }
3467
+ }
3468
+ return results;
3469
+ }
3470
+ function buildStyle(chalk2, styles) {
3471
+ const enabled = {};
3472
+ for (const layer of styles) {
3473
+ for (const style of layer.styles) {
3474
+ enabled[style[0]] = layer.inverse ? null : style.slice(1);
3475
+ }
3476
+ }
3477
+ let current = chalk2;
3478
+ for (const [styleName, styles2] of Object.entries(enabled)) {
3479
+ if (!Array.isArray(styles2)) {
3480
+ continue;
3481
+ }
3482
+ if (!(styleName in current)) {
3483
+ throw new Error(`Unknown Chalk style: ${styleName}`);
3484
+ }
3485
+ current = styles2.length > 0 ? current[styleName](...styles2) : current[styleName];
3486
+ }
3487
+ return current;
3488
+ }
3489
+ templates = (chalk2, temporary) => {
3490
+ const styles = [];
3491
+ const chunks = [];
3492
+ let chunk = [];
3493
+ temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
3494
+ if (escapeCharacter) {
3495
+ chunk.push(unescape2(escapeCharacter));
3496
+ } else if (style) {
3497
+ const string = chunk.join("");
3498
+ chunk = [];
3499
+ chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
3500
+ styles.push({ inverse, styles: parseStyle(style) });
3501
+ } else if (close) {
3502
+ if (styles.length === 0) {
3503
+ throw new Error("Found extraneous } in Chalk template literal");
3504
+ }
3505
+ chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
3506
+ chunk = [];
3507
+ styles.pop();
3508
+ } else {
3509
+ chunk.push(character);
3510
+ }
3511
+ });
3512
+ chunks.push(chunk.join(""));
3513
+ if (styles.length > 0) {
3514
+ const errMessage = `Chalk template literal is missing ${styles.length} closing bracket${styles.length === 1 ? "" : "s"} (\`}\`)`;
3515
+ throw new Error(errMessage);
3516
+ }
3517
+ return chunks.join("");
3518
+ };
3519
+ return templates;
3520
+ }
3521
+ var source;
3522
+ var hasRequiredSource;
3523
+ function requireSource() {
3524
+ if (hasRequiredSource) return source;
3525
+ hasRequiredSource = 1;
3526
+ const ansiStyles2 = requireAnsiStyles();
3527
+ const { stdout: stdoutColor, stderr: stderrColor } = requireBrowser();
3528
+ const {
3529
+ stringReplaceAll,
3530
+ stringEncaseCRLFWithFirstIndex
3531
+ } = requireUtil();
3532
+ const { isArray } = Array;
3533
+ const levelMapping = [
3534
+ "ansi",
3535
+ "ansi",
3536
+ "ansi256",
3537
+ "ansi16m"
3538
+ ];
3539
+ const styles = /* @__PURE__ */ Object.create(null);
3540
+ const applyOptions = (object, options = {}) => {
3541
+ if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
3542
+ throw new Error("The `level` option should be an integer from 0 to 3");
3543
+ }
3544
+ const colorLevel = stdoutColor ? stdoutColor.level : 0;
3545
+ object.level = options.level === void 0 ? colorLevel : options.level;
3546
+ };
3547
+ class ChalkClass {
3548
+ constructor(options) {
3549
+ return chalkFactory(options);
3550
+ }
3551
+ }
3552
+ const chalkFactory = (options) => {
3553
+ const chalk3 = {};
3554
+ applyOptions(chalk3, options);
3555
+ chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
3556
+ Object.setPrototypeOf(chalk3, Chalk.prototype);
3557
+ Object.setPrototypeOf(chalk3.template, chalk3);
3558
+ chalk3.template.constructor = () => {
3559
+ throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
3560
+ };
3561
+ chalk3.template.Instance = ChalkClass;
3562
+ return chalk3.template;
3563
+ };
3564
+ function Chalk(options) {
3565
+ return chalkFactory(options);
3566
+ }
3567
+ for (const [styleName, style] of Object.entries(ansiStyles2)) {
3568
+ styles[styleName] = {
3569
+ get() {
3570
+ const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
3571
+ Object.defineProperty(this, styleName, { value: builder });
3572
+ return builder;
3573
+ }
3574
+ };
3575
+ }
3576
+ styles.visible = {
3577
+ get() {
3578
+ const builder = createBuilder(this, this._styler, true);
3579
+ Object.defineProperty(this, "visible", { value: builder });
3580
+ return builder;
3581
+ }
3582
+ };
3583
+ const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
3584
+ for (const model of usedModels) {
3585
+ styles[model] = {
3586
+ get() {
3587
+ const { level } = this;
3588
+ return function(...arguments_) {
3589
+ const styler = createStyler(ansiStyles2.color[levelMapping[level]][model](...arguments_), ansiStyles2.color.close, this._styler);
3590
+ return createBuilder(this, styler, this._isEmpty);
3591
+ };
3592
+ }
3593
+ };
3594
+ }
3595
+ for (const model of usedModels) {
3596
+ const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
3597
+ styles[bgModel] = {
3598
+ get() {
3599
+ const { level } = this;
3600
+ return function(...arguments_) {
3601
+ const styler = createStyler(ansiStyles2.bgColor[levelMapping[level]][model](...arguments_), ansiStyles2.bgColor.close, this._styler);
3602
+ return createBuilder(this, styler, this._isEmpty);
3603
+ };
3604
+ }
3605
+ };
3606
+ }
3607
+ const proto = Object.defineProperties(() => {
3608
+ }, {
3609
+ ...styles,
3610
+ level: {
3611
+ enumerable: true,
3612
+ get() {
3613
+ return this._generator.level;
3614
+ },
3615
+ set(level) {
3616
+ this._generator.level = level;
3617
+ }
3618
+ }
3619
+ });
3620
+ const createStyler = (open, close, parent) => {
3621
+ let openAll;
3622
+ let closeAll;
3623
+ if (parent === void 0) {
3624
+ openAll = open;
3625
+ closeAll = close;
3626
+ } else {
3627
+ openAll = parent.openAll + open;
3628
+ closeAll = close + parent.closeAll;
3629
+ }
3630
+ return {
3631
+ open,
3632
+ close,
3633
+ openAll,
3634
+ closeAll,
3635
+ parent
3636
+ };
3637
+ };
3638
+ const createBuilder = (self2, _styler, _isEmpty) => {
3639
+ const builder = (...arguments_) => {
3640
+ if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
3641
+ return applyStyle(builder, chalkTag(builder, ...arguments_));
3642
+ }
3643
+ return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
3644
+ };
3645
+ Object.setPrototypeOf(builder, proto);
3646
+ builder._generator = self2;
3647
+ builder._styler = _styler;
3648
+ builder._isEmpty = _isEmpty;
3649
+ return builder;
3650
+ };
3651
+ const applyStyle = (self2, string) => {
3652
+ if (self2.level <= 0 || !string) {
3653
+ return self2._isEmpty ? "" : string;
3654
+ }
3655
+ let styler = self2._styler;
3656
+ if (styler === void 0) {
3657
+ return string;
3658
+ }
3659
+ const { openAll, closeAll } = styler;
3660
+ if (string.indexOf("\x1B") !== -1) {
3661
+ while (styler !== void 0) {
3662
+ string = stringReplaceAll(string, styler.close, styler.open);
3663
+ styler = styler.parent;
3664
+ }
3665
+ }
3666
+ const lfIndex = string.indexOf("\n");
3667
+ if (lfIndex !== -1) {
3668
+ string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
3669
+ }
3670
+ return openAll + string + closeAll;
3671
+ };
3672
+ let template;
3673
+ const chalkTag = (chalk3, ...strings) => {
3674
+ const [firstString] = strings;
3675
+ if (!isArray(firstString) || !isArray(firstString.raw)) {
3676
+ return strings.join(" ");
3677
+ }
3678
+ const arguments_ = strings.slice(1);
3679
+ const parts = [firstString.raw[0]];
3680
+ for (let i = 1; i < firstString.length; i++) {
3681
+ parts.push(
3682
+ String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
3683
+ String(firstString.raw[i])
3684
+ );
3685
+ }
3686
+ if (template === void 0) {
3687
+ template = requireTemplates();
3688
+ }
3689
+ return template(chalk3, parts.join(""));
3690
+ };
3691
+ Object.defineProperties(Chalk.prototype, styles);
3692
+ const chalk2 = Chalk();
3693
+ chalk2.supportsColor = stdoutColor;
3694
+ chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
3695
+ chalk2.stderr.supportsColor = stderrColor;
3696
+ source = chalk2;
3697
+ return source;
3698
+ }
3699
+ requireSource();
3700
+ var Gauge = /* @__PURE__ */ ((Gauge2) => {
3701
+ Gauge2["ACTIVE_REQUEST_GAUGE"] = "a";
3702
+ Gauge2["AUTHENTICATION_COUNT_GAUGE"] = "b";
3703
+ Gauge2["AUTHENTICATION_ERROR_COUNT_GAUGE"] = "aa";
3704
+ Gauge2["AUTHENTICATION_RETRY_COUNT_GAUGE"] = "ab";
3705
+ Gauge2["CONNECTION_POOL_IDLE_GAUGE"] = "c";
3706
+ Gauge2["CONNECTION_POOL_TOTAL_GAUGE"] = "d";
3707
+ Gauge2["CONNECTION_POOL_WAITING_GAUGE"] = "e";
3708
+ Gauge2["CPU_LOAD_GAUGE"] = "f";
3709
+ Gauge2["CPU_SYSTEM_LOAD_GAUGE"] = "g";
3710
+ Gauge2["DURATION_GAUGE"] = "h";
3711
+ Gauge2["DURATION_HISTOGRAM_GAUGE"] = "i";
3712
+ Gauge2["ERROR_COUNT_GAUGE"] = "j";
3713
+ Gauge2["LATENCY_GAUGE"] = "k";
3714
+ Gauge2["LATENCY_HISTOGRAM_GAUGE"] = "l";
3715
+ Gauge2["LOGGER"] = "m";
3716
+ Gauge2["LOGGER_COPY"] = "n";
3717
+ Gauge2["NETWORK_RX_GAUGE"] = "o";
3718
+ Gauge2["NETWORK_TX_GAUGE"] = "p";
3719
+ Gauge2["REQUEST_COUNT_GAUGE"] = "q";
3720
+ Gauge2["RETRY_COUNT_GAUGE"] = "r";
3721
+ Gauge2["TIMER_GAUGE"] = "s";
3722
+ Gauge2["VELOCITY_GAUGE"] = "t";
3723
+ Gauge2["CONNECTION_COUNT_GAUGE"] = "u";
3724
+ Gauge2["OBJECT_GAUGE"] = "v";
3725
+ Gauge2["PAYLOAD_SIZE"] = "w";
3726
+ Gauge2["CORE_COUNT_GAUGE"] = "x";
3727
+ Gauge2["CHILD_COUNT"] = "y";
3728
+ Gauge2["UNKNOWN"] = "z";
3729
+ return Gauge2;
3730
+ })(Gauge || {});
3731
+ var GaugeTypes = /* @__PURE__ */ ((GaugeTypes2) => {
3732
+ GaugeTypes2["GAUGE_TYPE"] = "_";
3733
+ GaugeTypes2["INSTRUMENT_GAUGE"] = "a";
3734
+ GaugeTypes2["INSTRUMENT_VELOCITY"] = "b";
3735
+ GaugeTypes2["INSTRUMENT_HISTOGRAM"] = "c";
3736
+ GaugeTypes2["INSTRUMENT_LOG"] = "d";
3737
+ GaugeTypes2["INSTRUMENT_TIMER"] = "e";
3738
+ GaugeTypes2["INSTRUMENT_OBJECT"] = "f";
3739
+ return GaugeTypes2;
3740
+ })(GaugeTypes || {});
3741
+ class InstrumentBase {
3742
+ #label = "";
3743
+ #options = null;
3744
+ #data = {};
3745
+ // Use for copy objects only.
3746
+ //protected _data: Record<string, any> = { };
3747
+ constructor(options = {}) {
3748
+ if (typeof options === "string" || options instanceof String) {
3749
+ throw new Error("Instrument parameter must be an options object.");
3750
+ }
3751
+ this.#options = options;
3752
+ if (options.label) {
3753
+ this.#label = options.label;
3754
+ } else {
3755
+ this.#label = "InstrumentGauge";
3756
+ }
3757
+ }
3758
+ [GaugeTypes.GAUGE_TYPE] = GaugeTypes.INSTRUMENT_OBJECT;
3759
+ // Default Gauge type
3760
+ val;
3761
+ WithLabel(label) {
3762
+ this.label = label;
3763
+ return this;
3764
+ }
3765
+ DefineCopyProperties(propertyNames) {
3766
+ propertyNames.forEach((propertyName) => {
3767
+ Object.defineProperty(this, propertyName, {
3768
+ enumerable: true,
3769
+ get: () => this.#data[propertyName],
3770
+ set: (value) => {
3771
+ if (value === void 0) {
3772
+ return;
3773
+ }
3774
+ this.#data[propertyName] = value;
3775
+ }
3776
+ });
3777
+ });
3778
+ }
3779
+ GetNumber(val) {
3780
+ if (Number.isInteger(val)) {
3781
+ return val;
3782
+ } else {
3783
+ return Math.round((val + Number.EPSILON) * 100) / 100;
3784
+ }
3785
+ }
3786
+ get options() {
3787
+ return this.#options;
3788
+ }
3789
+ set options(optionsValue) {
3790
+ this.#options = optionsValue;
3791
+ }
3792
+ get label() {
3793
+ return this.#label;
3794
+ }
3795
+ set label(labelValue) {
3796
+ this.#label = labelValue;
3797
+ }
3798
+ StopTimer() {
3799
+ }
3800
+ ProcessTelemetry(telemetry) {
3801
+ throw new Error(`Must override in extended class: [ProcessTelemetry]: [${telemetry}].`);
3802
+ }
3803
+ /*
3804
+ toJSON()
3805
+ {
3806
+ return this._serialValue;
3807
+ }
3808
+ */
3809
+ /*
3810
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols
3811
+ [Symbol.iterator]() {
3812
+ // Use a new index for each iterator. This makes multiple
3813
+ // iterations over the iterable safe for non-trivial cases,
3814
+ // such as use of break or nested looping over the same iterable.
3815
+ let index = 0;
3816
+
3817
+ return {
3818
+ next: () => {
3819
+ if (index < 1) {
3820
+ return {value: this.GetFormatted(), done: false}
3821
+ } else {
3822
+ return {done: true}
3823
+ }
3824
+ }
3825
+ }
3826
+ }
3827
+ */
3828
+ }
3829
+ var timsort$1 = {};
3830
+ var hasRequiredTimsort$1;
3831
+ function requireTimsort$1() {
3832
+ if (hasRequiredTimsort$1) return timsort$1;
3833
+ hasRequiredTimsort$1 = 1;
3834
+ (function(exports$1) {
3835
+ (function(global2, factory) {
3836
+ {
3837
+ factory(exports$1);
3838
+ }
3839
+ })(timsort$1, function(exports2) {
3840
+ exports2.__esModule = true;
3841
+ exports2.sort = sort;
3842
+ function _classCallCheck(instance, Constructor) {
3843
+ if (!(instance instanceof Constructor)) {
3844
+ throw new TypeError("Cannot call a class as a function");
3845
+ }
3846
+ }
3847
+ var DEFAULT_MIN_MERGE = 32;
3848
+ var DEFAULT_MIN_GALLOPING = 7;
3849
+ var DEFAULT_TMP_STORAGE_LENGTH = 256;
3850
+ var POWERS_OF_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9];
3851
+ function log10(x) {
3852
+ if (x < 1e5) {
3853
+ if (x < 100) {
3854
+ return x < 10 ? 0 : 1;
3855
+ }
3856
+ if (x < 1e4) {
3857
+ return x < 1e3 ? 2 : 3;
3858
+ }
3859
+ return 4;
3860
+ }
3861
+ if (x < 1e7) {
3862
+ return x < 1e6 ? 5 : 6;
3863
+ }
3864
+ if (x < 1e9) {
3865
+ return x < 1e8 ? 7 : 8;
3866
+ }
3867
+ return 9;
3868
+ }
3869
+ function alphabeticalCompare(a, b) {
3870
+ if (a === b) {
3871
+ return 0;
3872
+ }
3873
+ if (~~a === a && ~~b === b) {
3874
+ if (a === 0 || b === 0) {
3875
+ return a < b ? -1 : 1;
3876
+ }
3877
+ if (a < 0 || b < 0) {
3878
+ if (b >= 0) {
3879
+ return -1;
3880
+ }
3881
+ if (a >= 0) {
3882
+ return 1;
3883
+ }
3884
+ a = -a;
3885
+ b = -b;
3886
+ }
3887
+ var al = log10(a);
3888
+ var bl = log10(b);
3889
+ var t = 0;
3890
+ if (al < bl) {
3891
+ a *= POWERS_OF_TEN[bl - al - 1];
3892
+ b /= 10;
3893
+ t = -1;
3894
+ } else if (al > bl) {
3895
+ b *= POWERS_OF_TEN[al - bl - 1];
3896
+ a /= 10;
3897
+ t = 1;
3898
+ }
3899
+ if (a === b) {
3900
+ return t;
3901
+ }
3902
+ return a < b ? -1 : 1;
3903
+ }
3904
+ var aStr = String(a);
3905
+ var bStr = String(b);
3906
+ if (aStr === bStr) {
3907
+ return 0;
3908
+ }
3909
+ return aStr < bStr ? -1 : 1;
3910
+ }
3911
+ function minRunLength(n) {
3912
+ var r = 0;
3913
+ while (n >= DEFAULT_MIN_MERGE) {
3914
+ r |= n & 1;
3915
+ n >>= 1;
3916
+ }
3917
+ return n + r;
3918
+ }
3919
+ function makeAscendingRun(array, lo, hi, compare) {
3920
+ var runHi = lo + 1;
3921
+ if (runHi === hi) {
3922
+ return 1;
3923
+ }
3924
+ if (compare(array[runHi++], array[lo]) < 0) {
3925
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) < 0) {
3926
+ runHi++;
3927
+ }
3928
+ reverseRun(array, lo, runHi);
3929
+ } else {
3930
+ while (runHi < hi && compare(array[runHi], array[runHi - 1]) >= 0) {
3931
+ runHi++;
3932
+ }
3933
+ }
3934
+ return runHi - lo;
3935
+ }
3936
+ function reverseRun(array, lo, hi) {
3937
+ hi--;
3938
+ while (lo < hi) {
3939
+ var t = array[lo];
3940
+ array[lo++] = array[hi];
3941
+ array[hi--] = t;
3942
+ }
3943
+ }
3944
+ function binaryInsertionSort(array, lo, hi, start, compare) {
3945
+ if (start === lo) {
3946
+ start++;
3947
+ }
3948
+ for (; start < hi; start++) {
3949
+ var pivot = array[start];
3950
+ var left = lo;
3951
+ var right = start;
3952
+ while (left < right) {
3953
+ var mid = left + right >>> 1;
3954
+ if (compare(pivot, array[mid]) < 0) {
3955
+ right = mid;
3956
+ } else {
3957
+ left = mid + 1;
3958
+ }
3959
+ }
3960
+ var n = start - left;
3961
+ switch (n) {
3962
+ case 3:
3963
+ array[left + 3] = array[left + 2];
3964
+ case 2:
3965
+ array[left + 2] = array[left + 1];
3966
+ case 1:
3967
+ array[left + 1] = array[left];
3968
+ break;
3969
+ default:
3970
+ while (n > 0) {
3971
+ array[left + n] = array[left + n - 1];
3972
+ n--;
3973
+ }
3974
+ }
3975
+ array[left] = pivot;
3976
+ }
3977
+ }
3978
+ function gallopLeft(value, array, start, length, hint, compare) {
3979
+ var lastOffset = 0;
3980
+ var maxOffset = 0;
3981
+ var offset = 1;
3982
+ if (compare(value, array[start + hint]) > 0) {
3983
+ maxOffset = length - hint;
3984
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) > 0) {
3985
+ lastOffset = offset;
3986
+ offset = (offset << 1) + 1;
3987
+ if (offset <= 0) {
3988
+ offset = maxOffset;
3989
+ }
3990
+ }
3991
+ if (offset > maxOffset) {
3992
+ offset = maxOffset;
3993
+ }
3994
+ lastOffset += hint;
3995
+ offset += hint;
3996
+ } else {
3997
+ maxOffset = hint + 1;
3998
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) <= 0) {
3999
+ lastOffset = offset;
4000
+ offset = (offset << 1) + 1;
4001
+ if (offset <= 0) {
4002
+ offset = maxOffset;
4003
+ }
4004
+ }
4005
+ if (offset > maxOffset) {
4006
+ offset = maxOffset;
4007
+ }
4008
+ var tmp = lastOffset;
4009
+ lastOffset = hint - offset;
4010
+ offset = hint - tmp;
4011
+ }
4012
+ lastOffset++;
4013
+ while (lastOffset < offset) {
4014
+ var m = lastOffset + (offset - lastOffset >>> 1);
4015
+ if (compare(value, array[start + m]) > 0) {
4016
+ lastOffset = m + 1;
4017
+ } else {
4018
+ offset = m;
4019
+ }
4020
+ }
4021
+ return offset;
4022
+ }
4023
+ function gallopRight(value, array, start, length, hint, compare) {
4024
+ var lastOffset = 0;
4025
+ var maxOffset = 0;
4026
+ var offset = 1;
4027
+ if (compare(value, array[start + hint]) < 0) {
4028
+ maxOffset = hint + 1;
4029
+ while (offset < maxOffset && compare(value, array[start + hint - offset]) < 0) {
4030
+ lastOffset = offset;
4031
+ offset = (offset << 1) + 1;
4032
+ if (offset <= 0) {
4033
+ offset = maxOffset;
4034
+ }
4035
+ }
4036
+ if (offset > maxOffset) {
4037
+ offset = maxOffset;
4038
+ }
4039
+ var tmp = lastOffset;
4040
+ lastOffset = hint - offset;
4041
+ offset = hint - tmp;
4042
+ } else {
4043
+ maxOffset = length - hint;
4044
+ while (offset < maxOffset && compare(value, array[start + hint + offset]) >= 0) {
4045
+ lastOffset = offset;
4046
+ offset = (offset << 1) + 1;
4047
+ if (offset <= 0) {
4048
+ offset = maxOffset;
4049
+ }
4050
+ }
4051
+ if (offset > maxOffset) {
4052
+ offset = maxOffset;
4053
+ }
4054
+ lastOffset += hint;
4055
+ offset += hint;
4056
+ }
4057
+ lastOffset++;
4058
+ while (lastOffset < offset) {
4059
+ var m = lastOffset + (offset - lastOffset >>> 1);
4060
+ if (compare(value, array[start + m]) < 0) {
4061
+ offset = m;
4062
+ } else {
4063
+ lastOffset = m + 1;
4064
+ }
4065
+ }
4066
+ return offset;
4067
+ }
4068
+ var TimSort = (function() {
4069
+ function TimSort2(array, compare) {
4070
+ _classCallCheck(this, TimSort2);
4071
+ this.array = null;
4072
+ this.compare = null;
4073
+ this.minGallop = DEFAULT_MIN_GALLOPING;
4074
+ this.length = 0;
4075
+ this.tmpStorageLength = DEFAULT_TMP_STORAGE_LENGTH;
4076
+ this.stackLength = 0;
4077
+ this.runStart = null;
4078
+ this.runLength = null;
4079
+ this.stackSize = 0;
4080
+ this.array = array;
4081
+ this.compare = compare;
4082
+ this.length = array.length;
4083
+ if (this.length < 2 * DEFAULT_TMP_STORAGE_LENGTH) {
4084
+ this.tmpStorageLength = this.length >>> 1;
4085
+ }
4086
+ this.tmp = new Array(this.tmpStorageLength);
4087
+ this.stackLength = this.length < 120 ? 5 : this.length < 1542 ? 10 : this.length < 119151 ? 19 : 40;
4088
+ this.runStart = new Array(this.stackLength);
4089
+ this.runLength = new Array(this.stackLength);
4090
+ }
4091
+ TimSort2.prototype.pushRun = function pushRun(runStart, runLength) {
4092
+ this.runStart[this.stackSize] = runStart;
4093
+ this.runLength[this.stackSize] = runLength;
4094
+ this.stackSize += 1;
4095
+ };
4096
+ TimSort2.prototype.mergeRuns = function mergeRuns() {
4097
+ while (this.stackSize > 1) {
4098
+ var n = this.stackSize - 2;
4099
+ if (n >= 1 && this.runLength[n - 1] <= this.runLength[n] + this.runLength[n + 1] || n >= 2 && this.runLength[n - 2] <= this.runLength[n] + this.runLength[n - 1]) {
4100
+ if (this.runLength[n - 1] < this.runLength[n + 1]) {
4101
+ n--;
4102
+ }
4103
+ } else if (this.runLength[n] > this.runLength[n + 1]) {
4104
+ break;
4105
+ }
4106
+ this.mergeAt(n);
4107
+ }
4108
+ };
4109
+ TimSort2.prototype.forceMergeRuns = function forceMergeRuns() {
4110
+ while (this.stackSize > 1) {
4111
+ var n = this.stackSize - 2;
4112
+ if (n > 0 && this.runLength[n - 1] < this.runLength[n + 1]) {
4113
+ n--;
4114
+ }
4115
+ this.mergeAt(n);
4116
+ }
4117
+ };
4118
+ TimSort2.prototype.mergeAt = function mergeAt(i) {
4119
+ var compare = this.compare;
4120
+ var array = this.array;
4121
+ var start1 = this.runStart[i];
4122
+ var length1 = this.runLength[i];
4123
+ var start2 = this.runStart[i + 1];
4124
+ var length2 = this.runLength[i + 1];
4125
+ this.runLength[i] = length1 + length2;
4126
+ if (i === this.stackSize - 3) {
4127
+ this.runStart[i + 1] = this.runStart[i + 2];
4128
+ this.runLength[i + 1] = this.runLength[i + 2];
4129
+ }
4130
+ this.stackSize--;
4131
+ var k = gallopRight(array[start2], array, start1, length1, 0, compare);
4132
+ start1 += k;
4133
+ length1 -= k;
4134
+ if (length1 === 0) {
4135
+ return;
4136
+ }
4137
+ length2 = gallopLeft(array[start1 + length1 - 1], array, start2, length2, length2 - 1, compare);
4138
+ if (length2 === 0) {
4139
+ return;
4140
+ }
4141
+ if (length1 <= length2) {
4142
+ this.mergeLow(start1, length1, start2, length2);
4143
+ } else {
4144
+ this.mergeHigh(start1, length1, start2, length2);
4145
+ }
4146
+ };
4147
+ TimSort2.prototype.mergeLow = function mergeLow(start1, length1, start2, length2) {
4148
+ var compare = this.compare;
4149
+ var array = this.array;
4150
+ var tmp = this.tmp;
4151
+ var i = 0;
4152
+ for (i = 0; i < length1; i++) {
4153
+ tmp[i] = array[start1 + i];
4154
+ }
4155
+ var cursor1 = 0;
4156
+ var cursor2 = start2;
4157
+ var dest = start1;
4158
+ array[dest++] = array[cursor2++];
4159
+ if (--length2 === 0) {
4160
+ for (i = 0; i < length1; i++) {
4161
+ array[dest + i] = tmp[cursor1 + i];
4162
+ }
4163
+ return;
4164
+ }
4165
+ if (length1 === 1) {
4166
+ for (i = 0; i < length2; i++) {
4167
+ array[dest + i] = array[cursor2 + i];
4168
+ }
4169
+ array[dest + length2] = tmp[cursor1];
4170
+ return;
4171
+ }
4172
+ var minGallop = this.minGallop;
4173
+ while (true) {
4174
+ var count1 = 0;
4175
+ var count2 = 0;
4176
+ var exit = false;
4177
+ do {
4178
+ if (compare(array[cursor2], tmp[cursor1]) < 0) {
4179
+ array[dest++] = array[cursor2++];
4180
+ count2++;
4181
+ count1 = 0;
4182
+ if (--length2 === 0) {
4183
+ exit = true;
4184
+ break;
4185
+ }
4186
+ } else {
4187
+ array[dest++] = tmp[cursor1++];
4188
+ count1++;
4189
+ count2 = 0;
4190
+ if (--length1 === 1) {
4191
+ exit = true;
4192
+ break;
4193
+ }
4194
+ }
4195
+ } while ((count1 | count2) < minGallop);
4196
+ if (exit) {
4197
+ break;
4198
+ }
4199
+ do {
4200
+ count1 = gallopRight(array[cursor2], tmp, cursor1, length1, 0, compare);
4201
+ if (count1 !== 0) {
4202
+ for (i = 0; i < count1; i++) {
4203
+ array[dest + i] = tmp[cursor1 + i];
4204
+ }
4205
+ dest += count1;
4206
+ cursor1 += count1;
4207
+ length1 -= count1;
4208
+ if (length1 <= 1) {
4209
+ exit = true;
4210
+ break;
4211
+ }
4212
+ }
4213
+ array[dest++] = array[cursor2++];
4214
+ if (--length2 === 0) {
4215
+ exit = true;
4216
+ break;
4217
+ }
4218
+ count2 = gallopLeft(tmp[cursor1], array, cursor2, length2, 0, compare);
4219
+ if (count2 !== 0) {
4220
+ for (i = 0; i < count2; i++) {
4221
+ array[dest + i] = array[cursor2 + i];
4222
+ }
4223
+ dest += count2;
4224
+ cursor2 += count2;
4225
+ length2 -= count2;
4226
+ if (length2 === 0) {
4227
+ exit = true;
4228
+ break;
4229
+ }
4230
+ }
4231
+ array[dest++] = tmp[cursor1++];
4232
+ if (--length1 === 1) {
4233
+ exit = true;
4234
+ break;
4235
+ }
4236
+ minGallop--;
4237
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
4238
+ if (exit) {
4239
+ break;
4240
+ }
4241
+ if (minGallop < 0) {
4242
+ minGallop = 0;
4243
+ }
4244
+ minGallop += 2;
4245
+ }
4246
+ this.minGallop = minGallop;
4247
+ if (minGallop < 1) {
4248
+ this.minGallop = 1;
4249
+ }
4250
+ if (length1 === 1) {
4251
+ for (i = 0; i < length2; i++) {
4252
+ array[dest + i] = array[cursor2 + i];
4253
+ }
4254
+ array[dest + length2] = tmp[cursor1];
4255
+ } else if (length1 === 0) {
4256
+ throw new Error("mergeLow preconditions were not respected");
4257
+ } else {
4258
+ for (i = 0; i < length1; i++) {
4259
+ array[dest + i] = tmp[cursor1 + i];
4260
+ }
4261
+ }
4262
+ };
4263
+ TimSort2.prototype.mergeHigh = function mergeHigh(start1, length1, start2, length2) {
4264
+ var compare = this.compare;
4265
+ var array = this.array;
4266
+ var tmp = this.tmp;
4267
+ var i = 0;
4268
+ for (i = 0; i < length2; i++) {
4269
+ tmp[i] = array[start2 + i];
4270
+ }
4271
+ var cursor1 = start1 + length1 - 1;
4272
+ var cursor2 = length2 - 1;
4273
+ var dest = start2 + length2 - 1;
4274
+ var customCursor = 0;
4275
+ var customDest = 0;
4276
+ array[dest--] = array[cursor1--];
4277
+ if (--length1 === 0) {
4278
+ customCursor = dest - (length2 - 1);
4279
+ for (i = 0; i < length2; i++) {
4280
+ array[customCursor + i] = tmp[i];
4281
+ }
4282
+ return;
4283
+ }
4284
+ if (length2 === 1) {
4285
+ dest -= length1;
4286
+ cursor1 -= length1;
4287
+ customDest = dest + 1;
4288
+ customCursor = cursor1 + 1;
4289
+ for (i = length1 - 1; i >= 0; i--) {
4290
+ array[customDest + i] = array[customCursor + i];
4291
+ }
4292
+ array[dest] = tmp[cursor2];
4293
+ return;
4294
+ }
4295
+ var minGallop = this.minGallop;
4296
+ while (true) {
4297
+ var count1 = 0;
4298
+ var count2 = 0;
4299
+ var exit = false;
4300
+ do {
4301
+ if (compare(tmp[cursor2], array[cursor1]) < 0) {
4302
+ array[dest--] = array[cursor1--];
4303
+ count1++;
4304
+ count2 = 0;
4305
+ if (--length1 === 0) {
4306
+ exit = true;
4307
+ break;
4308
+ }
4309
+ } else {
4310
+ array[dest--] = tmp[cursor2--];
4311
+ count2++;
4312
+ count1 = 0;
4313
+ if (--length2 === 1) {
4314
+ exit = true;
4315
+ break;
4316
+ }
4317
+ }
4318
+ } while ((count1 | count2) < minGallop);
4319
+ if (exit) {
4320
+ break;
4321
+ }
4322
+ do {
4323
+ count1 = length1 - gallopRight(tmp[cursor2], array, start1, length1, length1 - 1, compare);
4324
+ if (count1 !== 0) {
4325
+ dest -= count1;
4326
+ cursor1 -= count1;
4327
+ length1 -= count1;
4328
+ customDest = dest + 1;
4329
+ customCursor = cursor1 + 1;
4330
+ for (i = count1 - 1; i >= 0; i--) {
4331
+ array[customDest + i] = array[customCursor + i];
4332
+ }
4333
+ if (length1 === 0) {
4334
+ exit = true;
4335
+ break;
4336
+ }
4337
+ }
4338
+ array[dest--] = tmp[cursor2--];
4339
+ if (--length2 === 1) {
4340
+ exit = true;
4341
+ break;
4342
+ }
4343
+ count2 = length2 - gallopLeft(array[cursor1], tmp, 0, length2, length2 - 1, compare);
4344
+ if (count2 !== 0) {
4345
+ dest -= count2;
4346
+ cursor2 -= count2;
4347
+ length2 -= count2;
4348
+ customDest = dest + 1;
4349
+ customCursor = cursor2 + 1;
4350
+ for (i = 0; i < count2; i++) {
4351
+ array[customDest + i] = tmp[customCursor + i];
4352
+ }
4353
+ if (length2 <= 1) {
4354
+ exit = true;
4355
+ break;
4356
+ }
4357
+ }
4358
+ array[dest--] = array[cursor1--];
4359
+ if (--length1 === 0) {
4360
+ exit = true;
4361
+ break;
4362
+ }
4363
+ minGallop--;
4364
+ } while (count1 >= DEFAULT_MIN_GALLOPING || count2 >= DEFAULT_MIN_GALLOPING);
4365
+ if (exit) {
4366
+ break;
4367
+ }
4368
+ if (minGallop < 0) {
4369
+ minGallop = 0;
4370
+ }
4371
+ minGallop += 2;
4372
+ }
4373
+ this.minGallop = minGallop;
4374
+ if (minGallop < 1) {
4375
+ this.minGallop = 1;
4376
+ }
4377
+ if (length2 === 1) {
4378
+ dest -= length1;
4379
+ cursor1 -= length1;
4380
+ customDest = dest + 1;
4381
+ customCursor = cursor1 + 1;
4382
+ for (i = length1 - 1; i >= 0; i--) {
4383
+ array[customDest + i] = array[customCursor + i];
4384
+ }
4385
+ array[dest] = tmp[cursor2];
4386
+ } else if (length2 === 0) {
4387
+ throw new Error("mergeHigh preconditions were not respected");
4388
+ } else {
4389
+ customCursor = dest - (length2 - 1);
4390
+ for (i = 0; i < length2; i++) {
4391
+ array[customCursor + i] = tmp[i];
4392
+ }
4393
+ }
4394
+ };
4395
+ return TimSort2;
4396
+ })();
4397
+ function sort(array, compare, lo, hi) {
4398
+ if (!Array.isArray(array)) {
4399
+ throw new TypeError("Can only sort arrays");
4400
+ }
4401
+ if (!compare) {
4402
+ compare = alphabeticalCompare;
4403
+ } else if (typeof compare !== "function") {
4404
+ hi = lo;
4405
+ lo = compare;
4406
+ compare = alphabeticalCompare;
4407
+ }
4408
+ if (!lo) {
4409
+ lo = 0;
4410
+ }
4411
+ if (!hi) {
4412
+ hi = array.length;
4413
+ }
4414
+ var remaining = hi - lo;
4415
+ if (remaining < 2) {
4416
+ return;
4417
+ }
4418
+ var runLength = 0;
4419
+ if (remaining < DEFAULT_MIN_MERGE) {
4420
+ runLength = makeAscendingRun(array, lo, hi, compare);
4421
+ binaryInsertionSort(array, lo, hi, lo + runLength, compare);
4422
+ return;
4423
+ }
4424
+ var ts = new TimSort(array, compare);
4425
+ var minRun = minRunLength(remaining);
4426
+ do {
4427
+ runLength = makeAscendingRun(array, lo, hi, compare);
4428
+ if (runLength < minRun) {
4429
+ var force = remaining;
4430
+ if (force > minRun) {
4431
+ force = minRun;
4432
+ }
4433
+ binaryInsertionSort(array, lo, lo + force, lo + runLength, compare);
4434
+ runLength = force;
4435
+ }
4436
+ ts.pushRun(lo, runLength);
4437
+ ts.mergeRuns();
4438
+ remaining -= runLength;
4439
+ lo += runLength;
4440
+ } while (remaining !== 0);
4441
+ ts.forceMergeRuns();
4442
+ }
4443
+ });
4444
+ })(timsort$1);
4445
+ return timsort$1;
4446
+ }
4447
+ var timsort;
4448
+ var hasRequiredTimsort;
4449
+ function requireTimsort() {
4450
+ if (hasRequiredTimsort) return timsort;
4451
+ hasRequiredTimsort = 1;
4452
+ timsort = requireTimsort$1();
4453
+ return timsort;
4454
+ }
4455
+ requireTimsort();
4456
+ new TextEncoder();
4457
+ new TextDecoder();
4458
+ class ExtData {
4459
+ type;
4460
+ data;
4461
+ constructor(type, data) {
4462
+ this.type = type;
4463
+ this.data = data;
4464
+ }
4465
+ }
4466
+ class DecodeError extends Error {
4467
+ constructor(message) {
4468
+ super(message);
4469
+ const proto = Object.create(DecodeError.prototype);
4470
+ Object.setPrototypeOf(this, proto);
4471
+ Object.defineProperty(this, "name", {
4472
+ configurable: true,
4473
+ enumerable: false,
4474
+ value: DecodeError.name
4475
+ });
4476
+ }
4477
+ }
4478
+ function setInt64(view, offset, value) {
4479
+ const high = Math.floor(value / 4294967296);
4480
+ const low = value;
4481
+ view.setUint32(offset, high);
4482
+ view.setUint32(offset + 4, low);
4483
+ }
4484
+ function getInt64(view, offset) {
4485
+ const high = view.getInt32(offset);
4486
+ const low = view.getUint32(offset + 4);
4487
+ return high * 4294967296 + low;
4488
+ }
4489
+ const EXT_TIMESTAMP = -1;
4490
+ const TIMESTAMP32_MAX_SEC = 4294967296 - 1;
4491
+ const TIMESTAMP64_MAX_SEC = 17179869184 - 1;
4492
+ function encodeTimeSpecToTimestamp({ sec, nsec }) {
4493
+ if (sec >= 0 && nsec >= 0 && sec <= TIMESTAMP64_MAX_SEC) {
4494
+ if (nsec === 0 && sec <= TIMESTAMP32_MAX_SEC) {
4495
+ const rv = new Uint8Array(4);
4496
+ const view = new DataView(rv.buffer);
4497
+ view.setUint32(0, sec);
4498
+ return rv;
4499
+ } else {
4500
+ const secHigh = sec / 4294967296;
4501
+ const secLow = sec & 4294967295;
4502
+ const rv = new Uint8Array(8);
4503
+ const view = new DataView(rv.buffer);
4504
+ view.setUint32(0, nsec << 2 | secHigh & 3);
4505
+ view.setUint32(4, secLow);
4506
+ return rv;
4507
+ }
4508
+ } else {
4509
+ const rv = new Uint8Array(12);
4510
+ const view = new DataView(rv.buffer);
4511
+ view.setUint32(0, nsec);
4512
+ setInt64(view, 4, sec);
4513
+ return rv;
4514
+ }
4515
+ }
4516
+ function encodeDateToTimeSpec(date) {
4517
+ const msec = date.getTime();
4518
+ const sec = Math.floor(msec / 1e3);
4519
+ const nsec = (msec - sec * 1e3) * 1e6;
4520
+ const nsecInSec = Math.floor(nsec / 1e9);
4521
+ return {
4522
+ sec: sec + nsecInSec,
4523
+ nsec: nsec - nsecInSec * 1e9
4524
+ };
4525
+ }
4526
+ function encodeTimestampExtension(object) {
4527
+ if (object instanceof Date) {
4528
+ const timeSpec = encodeDateToTimeSpec(object);
4529
+ return encodeTimeSpecToTimestamp(timeSpec);
4530
+ } else {
4531
+ return null;
4532
+ }
4533
+ }
4534
+ function decodeTimestampToTimeSpec(data) {
4535
+ const view = new DataView(data.buffer, data.byteOffset, data.byteLength);
4536
+ switch (data.byteLength) {
4537
+ case 4: {
4538
+ const sec = view.getUint32(0);
4539
+ const nsec = 0;
4540
+ return { sec, nsec };
4541
+ }
4542
+ case 8: {
4543
+ const nsec30AndSecHigh2 = view.getUint32(0);
4544
+ const secLow32 = view.getUint32(4);
4545
+ const sec = (nsec30AndSecHigh2 & 3) * 4294967296 + secLow32;
4546
+ const nsec = nsec30AndSecHigh2 >>> 2;
4547
+ return { sec, nsec };
4548
+ }
4549
+ case 12: {
4550
+ const sec = getInt64(view, 4);
4551
+ const nsec = view.getUint32(0);
4552
+ return { sec, nsec };
4553
+ }
4554
+ default:
4555
+ throw new DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${data.length}`);
4556
+ }
4557
+ }
4558
+ function decodeTimestampExtension(data) {
4559
+ const timeSpec = decodeTimestampToTimeSpec(data);
4560
+ return new Date(timeSpec.sec * 1e3 + timeSpec.nsec / 1e6);
4561
+ }
4562
+ const timestampExtension = {
4563
+ type: EXT_TIMESTAMP,
4564
+ encode: encodeTimestampExtension,
4565
+ decode: decodeTimestampExtension
4566
+ };
4567
+ class ExtensionCodec {
4568
+ static defaultCodec = new ExtensionCodec();
4569
+ // ensures ExtensionCodecType<X> matches ExtensionCodec<X>
4570
+ // this will make type errors a lot more clear
4571
+ // eslint-disable-next-line @typescript-eslint/naming-convention
4572
+ __brand;
4573
+ // built-in extensions
4574
+ builtInEncoders = [];
4575
+ builtInDecoders = [];
4576
+ // custom extensions
4577
+ encoders = [];
4578
+ decoders = [];
4579
+ constructor() {
4580
+ this.register(timestampExtension);
4581
+ }
4582
+ register({ type, encode: encode2, decode }) {
4583
+ if (type >= 0) {
4584
+ this.encoders[type] = encode2;
4585
+ this.decoders[type] = decode;
4586
+ } else {
4587
+ const index = -1 - type;
4588
+ this.builtInEncoders[index] = encode2;
4589
+ this.builtInDecoders[index] = decode;
4590
+ }
4591
+ }
4592
+ tryToEncode(object, context) {
4593
+ for (let i = 0; i < this.builtInEncoders.length; i++) {
4594
+ const encodeExt = this.builtInEncoders[i];
4595
+ if (encodeExt != null) {
4596
+ const data = encodeExt(object, context);
4597
+ if (data != null) {
4598
+ const type = -1 - i;
4599
+ return new ExtData(type, data);
4600
+ }
4601
+ }
4602
+ }
4603
+ for (let i = 0; i < this.encoders.length; i++) {
4604
+ const encodeExt = this.encoders[i];
4605
+ if (encodeExt != null) {
4606
+ const data = encodeExt(object, context);
4607
+ if (data != null) {
4608
+ const type = i;
4609
+ return new ExtData(type, data);
4610
+ }
4611
+ }
4612
+ }
4613
+ if (object instanceof ExtData) {
4614
+ return object;
4615
+ }
4616
+ return null;
4617
+ }
4618
+ decode(data, type, context) {
4619
+ const decodeExt = type < 0 ? this.builtInDecoders[-1 - type] : this.decoders[type];
4620
+ if (decodeExt) {
4621
+ return decodeExt(data, type, context);
4622
+ } else {
4623
+ return new ExtData(type, data);
4624
+ }
4625
+ }
4626
+ }
4627
+ const STSInstrumentControllerPluginKey = /* @__PURE__ */ Symbol("instrumentController");
4628
+ const instrumentationObservationInterval = 1e3;
4629
+ const instrumentationTimeWindow = 600;
4630
+ const consoleLogging = false;
4631
+ const instrumentLogging = true;
4632
+ ({
4633
+ coreFieldList: [
4634
+ { fieldName: "requestCount", gauge: Gauge.REQUEST_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4635
+ { fieldName: "errorCount", gauge: Gauge.ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4636
+ { fieldName: "retryCount", gauge: Gauge.RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4637
+ { fieldName: "authenticationCount", gauge: Gauge.AUTHENTICATION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4638
+ { fieldName: "authenticationErrorCount", gauge: Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4639
+ { fieldName: "authenticationRetryCount", gauge: Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4640
+ { fieldName: "velocity", gauge: Gauge.VELOCITY_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4641
+ {
4642
+ fieldName: "activeRequestCount",
4643
+ gauge: Gauge.ACTIVE_REQUEST_GAUGE,
4644
+ instrumentProperty: "val",
4645
+ dataType: "number",
4646
+ timeSeriesIndex: true,
4647
+ quantile: true,
4648
+ influxdbDataType: "intField",
4649
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4650
+ instrumentOptions: {
4651
+ interval: instrumentationObservationInterval,
4652
+ sampleSize: instrumentationTimeWindow
4653
+ }
4654
+ },
4655
+ { fieldName: "coreCount", gauge: Gauge.CORE_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4656
+ { fieldName: "rx", gauge: Gauge.NETWORK_RX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4657
+ { fieldName: "tx", gauge: Gauge.NETWORK_TX_GAUGE, instrumentProperty: "va", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_VELOCITY },
4658
+ { fieldName: "timer", gauge: Gauge.TIMER_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_TIMER },
4659
+ {
4660
+ fieldName: "duration",
4661
+ gauge: Gauge.DURATION_GAUGE,
4662
+ instrumentProperty: "val",
4663
+ dataType: "number",
4664
+ timeSeriesIndex: true,
4665
+ quantile: true,
4666
+ influxdbDataType: "floatField",
4667
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4668
+ instrumentOptions: {
4669
+ interval: instrumentationObservationInterval,
4670
+ sampleSize: instrumentationTimeWindow
4671
+ },
4672
+ histo: [
4673
+ { label: "B10", bucketLimit: 10 },
4674
+ { label: "B20", bucketLimit: 20 },
4675
+ { label: "B50", bucketLimit: 50 },
4676
+ { label: "B100", bucketLimit: 100 },
4677
+ { label: "B1000", bucketLimit: 1e3 },
4678
+ { label: "B50000", bucketLimit: 5e4 },
4679
+ { label: "BInfinity", bucketLimit: -1 }
4680
+ ],
4681
+ histoGauge: Gauge.DURATION_HISTOGRAM_GAUGE
4682
+ },
4683
+ {
4684
+ fieldName: "latency",
4685
+ gauge: Gauge.LATENCY_GAUGE,
4686
+ instrumentProperty: "val",
4687
+ dataType: "number",
4688
+ timeSeriesIndex: true,
4689
+ quantile: true,
4690
+ influxdbDataType: "floatField",
4691
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4692
+ instrumentOptions: {
4693
+ interval: instrumentationObservationInterval,
4694
+ sampleSize: instrumentationTimeWindow
4695
+ },
4696
+ histo: [
4697
+ { label: "B10", bucketLimit: 10 },
4698
+ { label: "B20", bucketLimit: 20 },
4699
+ { label: "B50", bucketLimit: 50 },
4700
+ { label: "B100", bucketLimit: 100 },
4701
+ { label: "B1000", bucketLimit: 1e3 },
4702
+ { label: "B50000", bucketLimit: 5e4 },
4703
+ { label: "BInfinity", bucketLimit: -1 }
4704
+ ],
4705
+ histoGauge: Gauge.LATENCY_HISTOGRAM_GAUGE
4706
+ }
4707
+ ],
4708
+ logFieldList: [
4709
+ {
4710
+ fieldName: "log",
4711
+ gauge: Gauge.LOGGER,
4712
+ instrumentProperty: "val",
4713
+ dataType: "string",
4714
+ timeSeriesIndex: false,
4715
+ quantile: false,
4716
+ influxdbDataType: "stringField",
4717
+ gaugeType: GaugeTypes.INSTRUMENT_LOG,
4718
+ instrumentOptions: {
4719
+ consoleLogging,
4720
+ instrumentLogging
4721
+ }
4722
+ }
4723
+ ],
4724
+ services: {
4725
+ ["service"]: {
4726
+ fieldList: [
4727
+ {
4728
+ fieldName: "cpu",
4729
+ gauge: Gauge.CPU_LOAD_GAUGE,
4730
+ instrumentProperty: "val",
4731
+ dataType: "number",
4732
+ timeSeriesIndex: true,
4733
+ quantile: true,
4734
+ influxdbDataType: "floatField",
4735
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4736
+ instrumentOptions: {
4737
+ interval: instrumentationObservationInterval,
4738
+ sampleSize: instrumentationTimeWindow
4739
+ }
4740
+ },
4741
+ {
4742
+ fieldName: "connectionCount",
4743
+ gauge: Gauge.CONNECTION_COUNT_GAUGE,
4744
+ instrumentProperty: "val",
4745
+ dataType: "number",
4746
+ timeSeriesIndex: true,
4747
+ quantile: true,
4748
+ influxdbDataType: "intField",
4749
+ gaugeType: GaugeTypes.INSTRUMENT_GAUGE,
4750
+ instrumentOptions: {
4751
+ interval: instrumentationObservationInterval,
4752
+ sampleSize: instrumentationTimeWindow
4753
+ }
4754
+ },
4755
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4756
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4757
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4758
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4759
+ {
4760
+ fieldName: "memory",
4761
+ gauge: Gauge.OBJECT_GAUGE,
4762
+ instrumentProperty: "val",
4763
+ dataType: "JSON",
4764
+ influxdbDataType: "stringField",
4765
+ gaugeType: GaugeTypes.INSTRUMENT_OBJECT,
4766
+ instrumentOptions: {
4767
+ label: "InstrumentObjectMaster"
4768
+ }
4769
+ }
4770
+ ],
4771
+ subscriptionTopics: [
4772
+ {
4773
+ subscriptionTopic: SubscriptionTopic.AllServicesCombined,
4774
+ route: "/metrics"
4775
+ },
4776
+ {
4777
+ subscriptionTopic: SubscriptionTopic.Services,
4778
+ route: "/metrics/services"
4779
+ },
4780
+ {
4781
+ subscriptionTopic: SubscriptionTopic.ServiceInstances,
4782
+ route: "/metrics/services/:key"
4783
+ },
4784
+ {
4785
+ subscriptionTopic: SubscriptionTopic.ServiceInstance,
4786
+ route: "/metrics/services/:key/:subkey"
4787
+ }
4788
+ ]
4789
+ },
4790
+ ["agent"]: {
4791
+ fieldList: [
4792
+ { fieldName: "childCount", gauge: Gauge.CHILD_COUNT, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE }
4793
+ ],
4794
+ subscriptionTopics: [
4795
+ {
4796
+ subscriptionTopic: SubscriptionTopic.AllAgentsCombined,
4797
+ route: "/metrics"
4798
+ },
4799
+ {
4800
+ subscriptionTopic: SubscriptionTopic.Agents,
4801
+ route: "/metrics/agents"
4802
+ },
4803
+ {
4804
+ subscriptionTopic: SubscriptionTopic.AgentWorkers,
4805
+ route: "/metrics/agents/:key"
4806
+ },
4807
+ {
4808
+ subscriptionTopic: SubscriptionTopic.AgentWorker,
4809
+ route: "/metrics/agents/:key/:subkey"
4810
+ }
4811
+ ]
4812
+ },
4813
+ ["lambda"]: {
4814
+ fieldList: [
4815
+ { fieldName: "cpu", gauge: Gauge.CPU_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4816
+ { fieldName: "connectionCount", gauge: Gauge.CONNECTION_COUNT_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4817
+ { fieldName: "connectionPoolCount", gauge: Gauge.CONNECTION_POOL_TOTAL_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4818
+ { fieldName: "connectionIdleCount", gauge: Gauge.CONNECTION_POOL_IDLE_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4819
+ { fieldName: "connectionWaitingCount", gauge: Gauge.CONNECTION_POOL_WAITING_GAUGE, instrumentProperty: "val", dataType: "number", influxdbDataType: "intField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4820
+ { fieldName: "systemcpu", gauge: Gauge.CPU_SYSTEM_LOAD_GAUGE, instrumentProperty: "val", dataType: "number", timeSeriesIndex: true, quantile: true, influxdbDataType: "floatField", gaugeType: GaugeTypes.INSTRUMENT_GAUGE },
4821
+ { fieldName: "memory", gauge: Gauge.OBJECT_GAUGE, instrumentProperty: "val", dataType: "JSON", influxdbDataType: "stringField", gaugeType: GaugeTypes.INSTRUMENT_OBJECT }
4822
+ ],
4823
+ subscriptionTopics: [
4824
+ {
4825
+ subscriptionTopic: SubscriptionTopic.AllLambdasCombined,
4826
+ // uicontrollerlanding
4827
+ route: "/metrics"
4828
+ },
4829
+ {
4830
+ subscriptionTopic: SubscriptionTopic.LambdaTechnologies,
4831
+ // uicontrollerlambda
4832
+ route: "/metrics/lambdas"
4833
+ },
4834
+ {
4835
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologies,
4836
+ // uicontrollerlambdasubtechnologies
4837
+ route: "/metrics/lambdas/:key"
4838
+ },
4839
+ {
4840
+ subscriptionTopic: SubscriptionTopic.LambdaSubTechnologiesInstance,
4841
+ // uicontrollerlambdasubtechnologiesinstance
4842
+ route: "/metrics/lambdas/:key/:subkey"
4843
+ }
4844
+ ]
4845
+ }
4846
+ }
4847
+ });
4848
+ const byteToHex = [];
4849
+ for (let i = 0; i < 256; ++i) {
4850
+ byteToHex.push((i + 256).toString(16).slice(1));
4851
+ }
4852
+ typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
1601
4853
  class STSOAuth2Manager {
1602
4854
  #router = null;
1603
4855
  #STORAGE_AUTHORIZE_OPTIONS_KEY = "authorize_options.stsmda.com.au";
@@ -1961,7 +5213,7 @@ var hasRequiredCore;
1961
5213
  function requireCore() {
1962
5214
  if (hasRequiredCore) return core$1.exports;
1963
5215
  hasRequiredCore = 1;
1964
- (function(module, exports) {
5216
+ (function(module, exports$1) {
1965
5217
  (function(root, factory) {
1966
5218
  {
1967
5219
  module.exports = factory();
@@ -2568,7 +5820,7 @@ var hasRequiredSha256;
2568
5820
  function requireSha256() {
2569
5821
  if (hasRequiredSha256) return sha256$2.exports;
2570
5822
  hasRequiredSha256 = 1;
2571
- (function(module, exports) {
5823
+ (function(module, exports$1) {
2572
5824
  (function(root, factory) {
2573
5825
  {
2574
5826
  module.exports = factory(requireCore());
@@ -2691,7 +5943,7 @@ var hasRequiredEncBase64;
2691
5943
  function requireEncBase64() {
2692
5944
  if (hasRequiredEncBase64) return encBase64$1.exports;
2693
5945
  hasRequiredEncBase64 = 1;
2694
- (function(module, exports) {
5946
+ (function(module, exports$1) {
2695
5947
  (function(root, factory) {
2696
5948
  {
2697
5949
  module.exports = factory(requireCore());
@@ -2941,7 +6193,7 @@ class STSOAuth2Worker {
2941
6193
  });
2942
6194
  }
2943
6195
  this.SetupListener();
2944
- this.#UpdateInstrument(Gauge.LOGGER, {
6196
+ this.#UpdateInstrument(Gauge$1.LOGGER, {
2945
6197
  LogMessage: `STSOauth2 Plugin - Successfully Loaded`
2946
6198
  });
2947
6199
  }