@nsshunt/stsuxvue 1.0.9 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/stsuxvue.mjs +2562 -273
- package/dist/stsuxvue.mjs.map +1 -1
- package/dist/stsuxvue.umd.js +2542 -254
- package/dist/stsuxvue.umd.js.map +1 -1
- package/package.json +17 -17
package/dist/stsuxvue.mjs
CHANGED
|
@@ -8,12 +8,13 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
8
8
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
-
var _socket, _observabilitySocketIOSubscriber, _logger, _observabilitySubscriptionManager, _store, _state, _modelId,
|
|
11
|
+
var _socket, _observabilitySocketIOSubscriber, _logger, _observabilitySubscriptionManager, _store, _state, _modelId, _options2, _tinyEmitter, _id, _SocketIOConnect, _SetupObservabilitySubscriber, _SetupSocketIO, _SocketConnect, _ProcessSocketError, _ProcessSocketEvents;
|
|
12
12
|
import { defineStore } from "pinia";
|
|
13
13
|
import _cloneDeep from "lodash.clonedeep";
|
|
14
14
|
import { defineComponent, defineAsyncComponent, ref, openBlock, createElementBlock, createVNode, unref, reactive, computed, watch, resolveComponent, createBlock, withCtx, createTextVNode, toDisplayString, createElementVNode, createCommentVNode, Fragment, renderList, onMounted, onBeforeUnmount, resolveDynamicComponent, isRef } from "vue";
|
|
15
|
-
import { Gauge, ObservabilitySocketIOSubscriber, ObservabilityRESTAPISubscriber, ObservabilitySubscriptionManager, SubscriptionTopic
|
|
15
|
+
import { Gauge, ObservabilitySocketIOSubscriber, ObservabilityRESTAPISubscriber, ObservabilitySubscriptionManager, SubscriptionTopic } from "@nsshunt/stsobservability";
|
|
16
16
|
import { defaultLogger } from "@nsshunt/stsutils";
|
|
17
|
+
import { io } from "socket.io-client";
|
|
17
18
|
var _estate = /* @__PURE__ */ ((_estate2) => {
|
|
18
19
|
_estate2["IDLE"] = "idle";
|
|
19
20
|
_estate2["STARTING"] = "starting";
|
|
@@ -528,6 +529,30 @@ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof win
|
|
|
528
529
|
function getDefaultExportFromCjs(x) {
|
|
529
530
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
530
531
|
}
|
|
532
|
+
function getAugmentedNamespace(n) {
|
|
533
|
+
if (n.__esModule) return n;
|
|
534
|
+
var f = n.default;
|
|
535
|
+
if (typeof f == "function") {
|
|
536
|
+
var a = function a2() {
|
|
537
|
+
if (this instanceof a2) {
|
|
538
|
+
return Reflect.construct(f, arguments, this.constructor);
|
|
539
|
+
}
|
|
540
|
+
return f.apply(this, arguments);
|
|
541
|
+
};
|
|
542
|
+
a.prototype = f.prototype;
|
|
543
|
+
} else a = {};
|
|
544
|
+
Object.defineProperty(a, "__esModule", { value: true });
|
|
545
|
+
Object.keys(n).forEach(function(k) {
|
|
546
|
+
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
547
|
+
Object.defineProperty(a, k, d.get ? d : {
|
|
548
|
+
enumerable: true,
|
|
549
|
+
get: function() {
|
|
550
|
+
return n[k];
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
return a;
|
|
555
|
+
}
|
|
531
556
|
var lib = {};
|
|
532
557
|
var decode = {};
|
|
533
558
|
const Aacute$1 = "Á";
|
|
@@ -5136,8 +5161,8 @@ var htmlReplacer = getInverseReplacer(inverseHTML);
|
|
|
5136
5161
|
encode.encodeHTML = getInverse(inverseHTML, htmlReplacer);
|
|
5137
5162
|
encode.encodeNonAsciiHTML = getASCIIEncoder(inverseHTML);
|
|
5138
5163
|
function getInverseObj(obj) {
|
|
5139
|
-
return Object.keys(obj).sort().reduce(function(inverse,
|
|
5140
|
-
inverse[obj[
|
|
5164
|
+
return Object.keys(obj).sort().reduce(function(inverse, name2) {
|
|
5165
|
+
inverse[obj[name2]] = "&" + name2 + ";";
|
|
5141
5166
|
return inverse;
|
|
5142
5167
|
}, {});
|
|
5143
5168
|
}
|
|
@@ -5186,8 +5211,8 @@ function singleCharReplacer(c) {
|
|
|
5186
5211
|
}
|
|
5187
5212
|
function getInverse(inverse, re) {
|
|
5188
5213
|
return function(data) {
|
|
5189
|
-
return data.replace(re, function(
|
|
5190
|
-
return inverse[
|
|
5214
|
+
return data.replace(re, function(name2) {
|
|
5215
|
+
return inverse[name2];
|
|
5191
5216
|
}).replace(reNonASCII, singleCharReplacer);
|
|
5192
5217
|
};
|
|
5193
5218
|
}
|
|
@@ -5207,68 +5232,68 @@ function getASCIIEncoder(obj) {
|
|
|
5207
5232
|
});
|
|
5208
5233
|
};
|
|
5209
5234
|
}
|
|
5210
|
-
(function(
|
|
5211
|
-
Object.defineProperty(
|
|
5212
|
-
|
|
5235
|
+
(function(exports2) {
|
|
5236
|
+
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
5237
|
+
exports2.decodeXMLStrict = exports2.decodeHTML5Strict = exports2.decodeHTML4Strict = exports2.decodeHTML5 = exports2.decodeHTML4 = exports2.decodeHTMLStrict = exports2.decodeHTML = exports2.decodeXML = exports2.encodeHTML5 = exports2.encodeHTML4 = exports2.escapeUTF8 = exports2.escape = exports2.encodeNonAsciiHTML = exports2.encodeHTML = exports2.encodeXML = exports2.encode = exports2.decodeStrict = exports2.decode = void 0;
|
|
5213
5238
|
var decode_1 = decode;
|
|
5214
5239
|
var encode_1 = encode;
|
|
5215
5240
|
function decode$1(data, level) {
|
|
5216
5241
|
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTML)(data);
|
|
5217
5242
|
}
|
|
5218
|
-
|
|
5243
|
+
exports2.decode = decode$1;
|
|
5219
5244
|
function decodeStrict(data, level) {
|
|
5220
5245
|
return (!level || level <= 0 ? decode_1.decodeXML : decode_1.decodeHTMLStrict)(data);
|
|
5221
5246
|
}
|
|
5222
|
-
|
|
5247
|
+
exports2.decodeStrict = decodeStrict;
|
|
5223
5248
|
function encode$1(data, level) {
|
|
5224
5249
|
return (!level || level <= 0 ? encode_1.encodeXML : encode_1.encodeHTML)(data);
|
|
5225
5250
|
}
|
|
5226
|
-
|
|
5251
|
+
exports2.encode = encode$1;
|
|
5227
5252
|
var encode_2 = encode;
|
|
5228
|
-
Object.defineProperty(
|
|
5253
|
+
Object.defineProperty(exports2, "encodeXML", { enumerable: true, get: function() {
|
|
5229
5254
|
return encode_2.encodeXML;
|
|
5230
5255
|
} });
|
|
5231
|
-
Object.defineProperty(
|
|
5256
|
+
Object.defineProperty(exports2, "encodeHTML", { enumerable: true, get: function() {
|
|
5232
5257
|
return encode_2.encodeHTML;
|
|
5233
5258
|
} });
|
|
5234
|
-
Object.defineProperty(
|
|
5259
|
+
Object.defineProperty(exports2, "encodeNonAsciiHTML", { enumerable: true, get: function() {
|
|
5235
5260
|
return encode_2.encodeNonAsciiHTML;
|
|
5236
5261
|
} });
|
|
5237
|
-
Object.defineProperty(
|
|
5262
|
+
Object.defineProperty(exports2, "escape", { enumerable: true, get: function() {
|
|
5238
5263
|
return encode_2.escape;
|
|
5239
5264
|
} });
|
|
5240
|
-
Object.defineProperty(
|
|
5265
|
+
Object.defineProperty(exports2, "escapeUTF8", { enumerable: true, get: function() {
|
|
5241
5266
|
return encode_2.escapeUTF8;
|
|
5242
5267
|
} });
|
|
5243
|
-
Object.defineProperty(
|
|
5268
|
+
Object.defineProperty(exports2, "encodeHTML4", { enumerable: true, get: function() {
|
|
5244
5269
|
return encode_2.encodeHTML;
|
|
5245
5270
|
} });
|
|
5246
|
-
Object.defineProperty(
|
|
5271
|
+
Object.defineProperty(exports2, "encodeHTML5", { enumerable: true, get: function() {
|
|
5247
5272
|
return encode_2.encodeHTML;
|
|
5248
5273
|
} });
|
|
5249
5274
|
var decode_2 = decode;
|
|
5250
|
-
Object.defineProperty(
|
|
5275
|
+
Object.defineProperty(exports2, "decodeXML", { enumerable: true, get: function() {
|
|
5251
5276
|
return decode_2.decodeXML;
|
|
5252
5277
|
} });
|
|
5253
|
-
Object.defineProperty(
|
|
5278
|
+
Object.defineProperty(exports2, "decodeHTML", { enumerable: true, get: function() {
|
|
5254
5279
|
return decode_2.decodeHTML;
|
|
5255
5280
|
} });
|
|
5256
|
-
Object.defineProperty(
|
|
5281
|
+
Object.defineProperty(exports2, "decodeHTMLStrict", { enumerable: true, get: function() {
|
|
5257
5282
|
return decode_2.decodeHTMLStrict;
|
|
5258
5283
|
} });
|
|
5259
|
-
Object.defineProperty(
|
|
5284
|
+
Object.defineProperty(exports2, "decodeHTML4", { enumerable: true, get: function() {
|
|
5260
5285
|
return decode_2.decodeHTML;
|
|
5261
5286
|
} });
|
|
5262
|
-
Object.defineProperty(
|
|
5287
|
+
Object.defineProperty(exports2, "decodeHTML5", { enumerable: true, get: function() {
|
|
5263
5288
|
return decode_2.decodeHTML;
|
|
5264
5289
|
} });
|
|
5265
|
-
Object.defineProperty(
|
|
5290
|
+
Object.defineProperty(exports2, "decodeHTML4Strict", { enumerable: true, get: function() {
|
|
5266
5291
|
return decode_2.decodeHTMLStrict;
|
|
5267
5292
|
} });
|
|
5268
|
-
Object.defineProperty(
|
|
5293
|
+
Object.defineProperty(exports2, "decodeHTML5Strict", { enumerable: true, get: function() {
|
|
5269
5294
|
return decode_2.decodeHTMLStrict;
|
|
5270
5295
|
} });
|
|
5271
|
-
Object.defineProperty(
|
|
5296
|
+
Object.defineProperty(exports2, "decodeXMLStrict", { enumerable: true, get: function() {
|
|
5272
5297
|
return decode_2.decodeXML;
|
|
5273
5298
|
} });
|
|
5274
5299
|
})(lib);
|
|
@@ -5675,7 +5700,7 @@ function tokenize(text2, options, callback) {
|
|
|
5675
5700
|
pattern: /^(([^\x1b\x08\r\n])+)/,
|
|
5676
5701
|
sub: realText
|
|
5677
5702
|
}];
|
|
5678
|
-
function
|
|
5703
|
+
function process2(handler2, i2) {
|
|
5679
5704
|
if (i2 > ansiHandler && ansiMatch) {
|
|
5680
5705
|
return;
|
|
5681
5706
|
}
|
|
@@ -5687,7 +5712,7 @@ function tokenize(text2, options, callback) {
|
|
|
5687
5712
|
outer: while (length > 0) {
|
|
5688
5713
|
for (var i = 0, o = 0, len = tokens.length; o < len; i = ++o) {
|
|
5689
5714
|
var handler = tokens[i];
|
|
5690
|
-
|
|
5715
|
+
process2(handler, i);
|
|
5691
5716
|
if (text2.length !== length) {
|
|
5692
5717
|
length = text2.length;
|
|
5693
5718
|
continue outer;
|
|
@@ -5755,7 +5780,7 @@ var Filter = /* @__PURE__ */ function() {
|
|
|
5755
5780
|
}();
|
|
5756
5781
|
var ansi_to_html = Filter;
|
|
5757
5782
|
const Convert = /* @__PURE__ */ getDefaultExportFromCjs(ansi_to_html);
|
|
5758
|
-
/*! @license DOMPurify 3.
|
|
5783
|
+
/*! @license DOMPurify 3.2.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.0/LICENSE */
|
|
5759
5784
|
const {
|
|
5760
5785
|
entries,
|
|
5761
5786
|
setPrototypeOf,
|
|
@@ -5913,16 +5938,16 @@ const DOCTYPE_NAME = seal(/^html$/i);
|
|
|
5913
5938
|
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
5914
5939
|
var EXPRESSIONS = /* @__PURE__ */ Object.freeze({
|
|
5915
5940
|
__proto__: null,
|
|
5916
|
-
MUSTACHE_EXPR,
|
|
5917
|
-
ERB_EXPR,
|
|
5918
|
-
TMPLIT_EXPR,
|
|
5919
|
-
DATA_ATTR,
|
|
5920
5941
|
ARIA_ATTR,
|
|
5921
|
-
IS_ALLOWED_URI,
|
|
5922
|
-
IS_SCRIPT_OR_DATA,
|
|
5923
5942
|
ATTR_WHITESPACE,
|
|
5943
|
+
CUSTOM_ELEMENT,
|
|
5944
|
+
DATA_ATTR,
|
|
5924
5945
|
DOCTYPE_NAME,
|
|
5925
|
-
|
|
5946
|
+
ERB_EXPR,
|
|
5947
|
+
IS_ALLOWED_URI,
|
|
5948
|
+
IS_SCRIPT_OR_DATA,
|
|
5949
|
+
MUSTACHE_EXPR,
|
|
5950
|
+
TMPLIT_EXPR
|
|
5926
5951
|
});
|
|
5927
5952
|
const NODE_TYPE = {
|
|
5928
5953
|
element: 1,
|
|
@@ -5971,7 +5996,7 @@ const _createTrustedTypesPolicy = function _createTrustedTypesPolicy2(trustedTyp
|
|
|
5971
5996
|
function createDOMPurify() {
|
|
5972
5997
|
let window2 = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : getGlobal();
|
|
5973
5998
|
const DOMPurify = (root) => createDOMPurify(root);
|
|
5974
|
-
DOMPurify.version = "3.
|
|
5999
|
+
DOMPurify.version = "3.2.0";
|
|
5975
6000
|
DOMPurify.removed = [];
|
|
5976
6001
|
if (!window2 || !window2.document || window2.document.nodeType !== NODE_TYPE.document) {
|
|
5977
6002
|
DOMPurify.isSupported = false;
|
|
@@ -6088,6 +6113,9 @@ function createDOMPurify() {
|
|
|
6088
6113
|
let IS_EMPTY_INPUT = false;
|
|
6089
6114
|
let ALLOWED_NAMESPACES = null;
|
|
6090
6115
|
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
6116
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
|
6117
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
|
|
6118
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
|
6091
6119
|
let PARSER_MEDIA_TYPE = null;
|
|
6092
6120
|
const SUPPORTED_PARSER_MEDIA_TYPES = ["application/xhtml+xml", "text/html"];
|
|
6093
6121
|
const DEFAULT_PARSER_MEDIA_TYPE = "text/html";
|
|
@@ -6112,22 +6140,8 @@ function createDOMPurify() {
|
|
|
6112
6140
|
ALLOWED_TAGS = objectHasOwnProperty(cfg, "ALLOWED_TAGS") ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
6113
6141
|
ALLOWED_ATTR = objectHasOwnProperty(cfg, "ALLOWED_ATTR") ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
6114
6142
|
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, "ALLOWED_NAMESPACES") ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
6115
|
-
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(
|
|
6116
|
-
|
|
6117
|
-
// eslint-disable-line indent
|
|
6118
|
-
cfg.ADD_URI_SAFE_ATTR,
|
|
6119
|
-
// eslint-disable-line indent
|
|
6120
|
-
transformCaseFunc
|
|
6121
|
-
// eslint-disable-line indent
|
|
6122
|
-
) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
6123
|
-
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(
|
|
6124
|
-
clone(DEFAULT_DATA_URI_TAGS),
|
|
6125
|
-
// eslint-disable-line indent
|
|
6126
|
-
cfg.ADD_DATA_URI_TAGS,
|
|
6127
|
-
// eslint-disable-line indent
|
|
6128
|
-
transformCaseFunc
|
|
6129
|
-
// eslint-disable-line indent
|
|
6130
|
-
) : DEFAULT_DATA_URI_TAGS;
|
|
6143
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, "ADD_URI_SAFE_ATTR") ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
|
6144
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, "ADD_DATA_URI_TAGS") ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
|
6131
6145
|
FORBID_CONTENTS = objectHasOwnProperty(cfg, "FORBID_CONTENTS") ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
6132
6146
|
FORBID_TAGS = objectHasOwnProperty(cfg, "FORBID_TAGS") ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};
|
|
6133
6147
|
FORBID_ATTR = objectHasOwnProperty(cfg, "FORBID_ATTR") ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};
|
|
@@ -6149,6 +6163,8 @@ function createDOMPurify() {
|
|
|
6149
6163
|
IN_PLACE = cfg.IN_PLACE || false;
|
|
6150
6164
|
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
6151
6165
|
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
6166
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
6167
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
6152
6168
|
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
6153
6169
|
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
6154
6170
|
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
@@ -6241,9 +6257,6 @@ function createDOMPurify() {
|
|
|
6241
6257
|
}
|
|
6242
6258
|
CONFIG = cfg;
|
|
6243
6259
|
};
|
|
6244
|
-
const MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ["mi", "mo", "mn", "ms", "mtext"]);
|
|
6245
|
-
const HTML_INTEGRATION_POINTS = addToSet({}, ["annotation-xml"]);
|
|
6246
|
-
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ["title", "style", "font", "a", "script"]);
|
|
6247
6260
|
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
6248
6261
|
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
6249
6262
|
const _checkValidNamespace = function _checkValidNamespace2(element) {
|
|
@@ -6301,28 +6314,28 @@ function createDOMPurify() {
|
|
|
6301
6314
|
remove(node);
|
|
6302
6315
|
}
|
|
6303
6316
|
};
|
|
6304
|
-
const _removeAttribute = function _removeAttribute2(
|
|
6317
|
+
const _removeAttribute = function _removeAttribute2(name2, element) {
|
|
6305
6318
|
try {
|
|
6306
6319
|
arrayPush(DOMPurify.removed, {
|
|
6307
|
-
attribute:
|
|
6308
|
-
from:
|
|
6320
|
+
attribute: element.getAttributeNode(name2),
|
|
6321
|
+
from: element
|
|
6309
6322
|
});
|
|
6310
6323
|
} catch (_) {
|
|
6311
6324
|
arrayPush(DOMPurify.removed, {
|
|
6312
6325
|
attribute: null,
|
|
6313
|
-
from:
|
|
6326
|
+
from: element
|
|
6314
6327
|
});
|
|
6315
6328
|
}
|
|
6316
|
-
|
|
6317
|
-
if (
|
|
6329
|
+
element.removeAttribute(name2);
|
|
6330
|
+
if (name2 === "is" && !ALLOWED_ATTR[name2]) {
|
|
6318
6331
|
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
6319
6332
|
try {
|
|
6320
|
-
_forceRemove(
|
|
6333
|
+
_forceRemove(element);
|
|
6321
6334
|
} catch (_) {
|
|
6322
6335
|
}
|
|
6323
6336
|
} else {
|
|
6324
6337
|
try {
|
|
6325
|
-
|
|
6338
|
+
element.setAttribute(name2, "");
|
|
6326
6339
|
} catch (_) {
|
|
6327
6340
|
}
|
|
6328
6341
|
}
|
|
@@ -6372,20 +6385,20 @@ function createDOMPurify() {
|
|
|
6372
6385
|
null
|
|
6373
6386
|
);
|
|
6374
6387
|
};
|
|
6375
|
-
const _isClobbered = function _isClobbered2(
|
|
6376
|
-
return
|
|
6388
|
+
const _isClobbered = function _isClobbered2(element) {
|
|
6389
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== "string" || typeof element.textContent !== "string" || typeof element.removeChild !== "function" || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== "function" || typeof element.setAttribute !== "function" || typeof element.namespaceURI !== "string" || typeof element.insertBefore !== "function" || typeof element.hasChildNodes !== "function");
|
|
6377
6390
|
};
|
|
6378
|
-
const _isNode = function _isNode2(
|
|
6379
|
-
return typeof Node === "function" &&
|
|
6391
|
+
const _isNode = function _isNode2(value) {
|
|
6392
|
+
return typeof Node === "function" && value instanceof Node;
|
|
6380
6393
|
};
|
|
6381
|
-
|
|
6394
|
+
function _executeHook(entryPoint, currentNode, data) {
|
|
6382
6395
|
if (!hooks[entryPoint]) {
|
|
6383
6396
|
return;
|
|
6384
6397
|
}
|
|
6385
6398
|
arrayForEach(hooks[entryPoint], (hook) => {
|
|
6386
6399
|
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
6387
6400
|
});
|
|
6388
|
-
}
|
|
6401
|
+
}
|
|
6389
6402
|
const _sanitizeElements = function _sanitizeElements2(currentNode) {
|
|
6390
6403
|
let content = null;
|
|
6391
6404
|
_executeHook("beforeSanitizeElements", currentNode, null);
|
|
@@ -6499,33 +6512,42 @@ function createDOMPurify() {
|
|
|
6499
6512
|
attrName: "",
|
|
6500
6513
|
attrValue: "",
|
|
6501
6514
|
keepAttr: true,
|
|
6502
|
-
allowedAttributes: ALLOWED_ATTR
|
|
6515
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
6516
|
+
forceKeepAttr: void 0
|
|
6503
6517
|
};
|
|
6504
6518
|
let l = attributes.length;
|
|
6505
6519
|
while (l--) {
|
|
6506
6520
|
const attr = attributes[l];
|
|
6507
6521
|
const {
|
|
6508
|
-
name,
|
|
6522
|
+
name: name2,
|
|
6509
6523
|
namespaceURI,
|
|
6510
6524
|
value: attrValue
|
|
6511
6525
|
} = attr;
|
|
6512
|
-
const lcName = transformCaseFunc(
|
|
6513
|
-
let value =
|
|
6526
|
+
const lcName = transformCaseFunc(name2);
|
|
6527
|
+
let value = name2 === "value" ? attrValue : stringTrim(attrValue);
|
|
6514
6528
|
hookEvent.attrName = lcName;
|
|
6515
6529
|
hookEvent.attrValue = value;
|
|
6516
6530
|
hookEvent.keepAttr = true;
|
|
6517
6531
|
hookEvent.forceKeepAttr = void 0;
|
|
6518
6532
|
_executeHook("uponSanitizeAttribute", currentNode, hookEvent);
|
|
6519
6533
|
value = hookEvent.attrValue;
|
|
6534
|
+
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
|
6535
|
+
_removeAttribute(name2, currentNode);
|
|
6536
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
6537
|
+
}
|
|
6538
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
6539
|
+
_removeAttribute(name2, currentNode);
|
|
6540
|
+
continue;
|
|
6541
|
+
}
|
|
6520
6542
|
if (hookEvent.forceKeepAttr) {
|
|
6521
6543
|
continue;
|
|
6522
6544
|
}
|
|
6523
|
-
_removeAttribute(
|
|
6545
|
+
_removeAttribute(name2, currentNode);
|
|
6524
6546
|
if (!hookEvent.keepAttr) {
|
|
6525
6547
|
continue;
|
|
6526
6548
|
}
|
|
6527
6549
|
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
6528
|
-
_removeAttribute(
|
|
6550
|
+
_removeAttribute(name2, currentNode);
|
|
6529
6551
|
continue;
|
|
6530
6552
|
}
|
|
6531
6553
|
if (SAFE_FOR_TEMPLATES) {
|
|
@@ -6537,14 +6559,6 @@ function createDOMPurify() {
|
|
|
6537
6559
|
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
6538
6560
|
continue;
|
|
6539
6561
|
}
|
|
6540
|
-
if (SANITIZE_NAMED_PROPS && (lcName === "id" || lcName === "name")) {
|
|
6541
|
-
_removeAttribute(name, currentNode);
|
|
6542
|
-
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
6543
|
-
}
|
|
6544
|
-
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
6545
|
-
_removeAttribute(name, currentNode);
|
|
6546
|
-
continue;
|
|
6547
|
-
}
|
|
6548
6562
|
if (trustedTypesPolicy && typeof trustedTypes === "object" && typeof trustedTypes.getAttributeType === "function") {
|
|
6549
6563
|
if (namespaceURI) ;
|
|
6550
6564
|
else {
|
|
@@ -6562,9 +6576,9 @@ function createDOMPurify() {
|
|
|
6562
6576
|
}
|
|
6563
6577
|
try {
|
|
6564
6578
|
if (namespaceURI) {
|
|
6565
|
-
currentNode.setAttributeNS(namespaceURI,
|
|
6579
|
+
currentNode.setAttributeNS(namespaceURI, name2, value);
|
|
6566
6580
|
} else {
|
|
6567
|
-
currentNode.setAttribute(
|
|
6581
|
+
currentNode.setAttribute(name2, value);
|
|
6568
6582
|
}
|
|
6569
6583
|
if (_isClobbered(currentNode)) {
|
|
6570
6584
|
_forceRemove(currentNode);
|
|
@@ -7181,13 +7195,13 @@ const _export_sfc = (sfc, props) => {
|
|
|
7181
7195
|
return target2;
|
|
7182
7196
|
};
|
|
7183
7197
|
const UXModelInstrumentAgentCommon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-c034ae06"]]);
|
|
7184
|
-
var ansiStyles$
|
|
7185
|
-
var colorName;
|
|
7186
|
-
var hasRequiredColorName;
|
|
7187
|
-
function requireColorName() {
|
|
7188
|
-
if (hasRequiredColorName) return colorName;
|
|
7189
|
-
hasRequiredColorName = 1;
|
|
7190
|
-
colorName = {
|
|
7198
|
+
var ansiStyles$3 = { exports: {} };
|
|
7199
|
+
var colorName$1;
|
|
7200
|
+
var hasRequiredColorName$1;
|
|
7201
|
+
function requireColorName$1() {
|
|
7202
|
+
if (hasRequiredColorName$1) return colorName$1;
|
|
7203
|
+
hasRequiredColorName$1 = 1;
|
|
7204
|
+
colorName$1 = {
|
|
7191
7205
|
"aliceblue": [240, 248, 255],
|
|
7192
7206
|
"antiquewhite": [250, 235, 215],
|
|
7193
7207
|
"aqua": [0, 255, 255],
|
|
@@ -7337,14 +7351,14 @@ function requireColorName() {
|
|
|
7337
7351
|
"yellow": [255, 255, 0],
|
|
7338
7352
|
"yellowgreen": [154, 205, 50]
|
|
7339
7353
|
};
|
|
7340
|
-
return colorName;
|
|
7354
|
+
return colorName$1;
|
|
7341
7355
|
}
|
|
7342
|
-
var conversions;
|
|
7343
|
-
var hasRequiredConversions;
|
|
7344
|
-
function requireConversions() {
|
|
7345
|
-
if (hasRequiredConversions) return conversions;
|
|
7346
|
-
hasRequiredConversions = 1;
|
|
7347
|
-
const cssKeywords = requireColorName();
|
|
7356
|
+
var conversions$1;
|
|
7357
|
+
var hasRequiredConversions$1;
|
|
7358
|
+
function requireConversions$1() {
|
|
7359
|
+
if (hasRequiredConversions$1) return conversions$1;
|
|
7360
|
+
hasRequiredConversions$1 = 1;
|
|
7361
|
+
const cssKeywords = requireColorName$1();
|
|
7348
7362
|
const reverseKeywords = {};
|
|
7349
7363
|
for (const key of Object.keys(cssKeywords)) {
|
|
7350
7364
|
reverseKeywords[cssKeywords[key]] = key;
|
|
@@ -7366,7 +7380,7 @@ function requireConversions() {
|
|
|
7366
7380
|
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
7367
7381
|
gray: { channels: 1, labels: ["gray"] }
|
|
7368
7382
|
};
|
|
7369
|
-
conversions = convert;
|
|
7383
|
+
conversions$1 = convert;
|
|
7370
7384
|
for (const model of Object.keys(convert)) {
|
|
7371
7385
|
if (!("channels" in convert[model])) {
|
|
7372
7386
|
throw new Error("missing channels property: " + model);
|
|
@@ -8009,14 +8023,14 @@ function requireConversions() {
|
|
|
8009
8023
|
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
8010
8024
|
return [val / 255 * 100];
|
|
8011
8025
|
};
|
|
8012
|
-
return conversions;
|
|
8026
|
+
return conversions$1;
|
|
8013
8027
|
}
|
|
8014
|
-
var route;
|
|
8015
|
-
var hasRequiredRoute;
|
|
8016
|
-
function requireRoute() {
|
|
8017
|
-
if (hasRequiredRoute) return route;
|
|
8018
|
-
hasRequiredRoute = 1;
|
|
8019
|
-
const conversions2 = requireConversions();
|
|
8028
|
+
var route$1;
|
|
8029
|
+
var hasRequiredRoute$1;
|
|
8030
|
+
function requireRoute$1() {
|
|
8031
|
+
if (hasRequiredRoute$1) return route$1;
|
|
8032
|
+
hasRequiredRoute$1 = 1;
|
|
8033
|
+
const conversions2 = requireConversions$1();
|
|
8020
8034
|
function buildGraph() {
|
|
8021
8035
|
const graph = {};
|
|
8022
8036
|
const models2 = Object.keys(conversions2);
|
|
@@ -8055,18 +8069,18 @@ function requireRoute() {
|
|
|
8055
8069
|
};
|
|
8056
8070
|
}
|
|
8057
8071
|
function wrapConversion(toModel, graph) {
|
|
8058
|
-
const
|
|
8072
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
8059
8073
|
let fn = conversions2[graph[toModel].parent][toModel];
|
|
8060
8074
|
let cur = graph[toModel].parent;
|
|
8061
8075
|
while (graph[cur].parent) {
|
|
8062
|
-
|
|
8076
|
+
path2.unshift(graph[cur].parent);
|
|
8063
8077
|
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
8064
8078
|
cur = graph[cur].parent;
|
|
8065
8079
|
}
|
|
8066
|
-
fn.conversion =
|
|
8080
|
+
fn.conversion = path2;
|
|
8067
8081
|
return fn;
|
|
8068
8082
|
}
|
|
8069
|
-
route = function(fromModel) {
|
|
8083
|
+
route$1 = function(fromModel) {
|
|
8070
8084
|
const graph = deriveBFS(fromModel);
|
|
8071
8085
|
const conversion = {};
|
|
8072
8086
|
const models2 = Object.keys(graph);
|
|
@@ -8080,15 +8094,15 @@ function requireRoute() {
|
|
|
8080
8094
|
}
|
|
8081
8095
|
return conversion;
|
|
8082
8096
|
};
|
|
8083
|
-
return route;
|
|
8097
|
+
return route$1;
|
|
8084
8098
|
}
|
|
8085
|
-
var colorConvert;
|
|
8086
|
-
var hasRequiredColorConvert;
|
|
8087
|
-
function requireColorConvert() {
|
|
8088
|
-
if (hasRequiredColorConvert) return colorConvert;
|
|
8089
|
-
hasRequiredColorConvert = 1;
|
|
8090
|
-
const conversions2 = requireConversions();
|
|
8091
|
-
const route2 = requireRoute();
|
|
8099
|
+
var colorConvert$1;
|
|
8100
|
+
var hasRequiredColorConvert$1;
|
|
8101
|
+
function requireColorConvert$1() {
|
|
8102
|
+
if (hasRequiredColorConvert$1) return colorConvert$1;
|
|
8103
|
+
hasRequiredColorConvert$1 = 1;
|
|
8104
|
+
const conversions2 = requireConversions$1();
|
|
8105
|
+
const route2 = requireRoute$1();
|
|
8092
8106
|
const convert = {};
|
|
8093
8107
|
const models2 = Object.keys(conversions2);
|
|
8094
8108
|
function wrapRaw(fn) {
|
|
@@ -8141,10 +8155,10 @@ function requireColorConvert() {
|
|
|
8141
8155
|
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
8142
8156
|
});
|
|
8143
8157
|
});
|
|
8144
|
-
colorConvert = convert;
|
|
8145
|
-
return colorConvert;
|
|
8158
|
+
colorConvert$1 = convert;
|
|
8159
|
+
return colorConvert$1;
|
|
8146
8160
|
}
|
|
8147
|
-
ansiStyles$
|
|
8161
|
+
ansiStyles$3.exports;
|
|
8148
8162
|
(function(module) {
|
|
8149
8163
|
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
8150
8164
|
const code = fn(...args);
|
|
@@ -8178,16 +8192,16 @@ ansiStyles$1.exports;
|
|
|
8178
8192
|
let colorConvert2;
|
|
8179
8193
|
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
8180
8194
|
if (colorConvert2 === void 0) {
|
|
8181
|
-
colorConvert2 = requireColorConvert();
|
|
8195
|
+
colorConvert2 = requireColorConvert$1();
|
|
8182
8196
|
}
|
|
8183
8197
|
const offset = isBackground ? 10 : 0;
|
|
8184
8198
|
const styles2 = {};
|
|
8185
8199
|
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
8186
|
-
const
|
|
8200
|
+
const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
8187
8201
|
if (sourceSpace === targetSpace) {
|
|
8188
|
-
styles2[
|
|
8202
|
+
styles2[name2] = wrap(identity, offset);
|
|
8189
8203
|
} else if (typeof suite === "object") {
|
|
8190
|
-
styles2[
|
|
8204
|
+
styles2[name2] = wrap(suite[targetSpace], offset);
|
|
8191
8205
|
}
|
|
8192
8206
|
}
|
|
8193
8207
|
return styles2;
|
|
@@ -8281,13 +8295,13 @@ ansiStyles$1.exports;
|
|
|
8281
8295
|
enumerable: true,
|
|
8282
8296
|
get: assembleStyles
|
|
8283
8297
|
});
|
|
8284
|
-
})(ansiStyles$
|
|
8285
|
-
var ansiStylesExports = ansiStyles$
|
|
8286
|
-
var browser = {
|
|
8298
|
+
})(ansiStyles$3);
|
|
8299
|
+
var ansiStylesExports$1 = ansiStyles$3.exports;
|
|
8300
|
+
var browser$2 = {
|
|
8287
8301
|
stdout: false,
|
|
8288
8302
|
stderr: false
|
|
8289
8303
|
};
|
|
8290
|
-
const stringReplaceAll$
|
|
8304
|
+
const stringReplaceAll$3 = (string, substring, replacer) => {
|
|
8291
8305
|
let index = string.indexOf(substring);
|
|
8292
8306
|
if (index === -1) {
|
|
8293
8307
|
return string;
|
|
@@ -8303,7 +8317,7 @@ const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
|
8303
8317
|
returnValue += string.substr(endIndex);
|
|
8304
8318
|
return returnValue;
|
|
8305
8319
|
};
|
|
8306
|
-
const stringEncaseCRLFWithFirstIndex$
|
|
8320
|
+
const stringEncaseCRLFWithFirstIndex$3 = (string, prefix, postfix, index) => {
|
|
8307
8321
|
let endIndex = 0;
|
|
8308
8322
|
let returnValue = "";
|
|
8309
8323
|
do {
|
|
@@ -8315,15 +8329,15 @@ const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
|
8315
8329
|
returnValue += string.substr(endIndex);
|
|
8316
8330
|
return returnValue;
|
|
8317
8331
|
};
|
|
8318
|
-
var util = {
|
|
8319
|
-
stringReplaceAll: stringReplaceAll$
|
|
8320
|
-
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$
|
|
8332
|
+
var util$1 = {
|
|
8333
|
+
stringReplaceAll: stringReplaceAll$3,
|
|
8334
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$3
|
|
8321
8335
|
};
|
|
8322
|
-
var templates;
|
|
8323
|
-
var hasRequiredTemplates;
|
|
8324
|
-
function requireTemplates() {
|
|
8325
|
-
if (hasRequiredTemplates) return templates;
|
|
8326
|
-
hasRequiredTemplates = 1;
|
|
8336
|
+
var templates$1;
|
|
8337
|
+
var hasRequiredTemplates$1;
|
|
8338
|
+
function requireTemplates$1() {
|
|
8339
|
+
if (hasRequiredTemplates$1) return templates$1;
|
|
8340
|
+
hasRequiredTemplates$1 = 1;
|
|
8327
8341
|
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;
|
|
8328
8342
|
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
8329
8343
|
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
@@ -8351,7 +8365,7 @@ function requireTemplates() {
|
|
|
8351
8365
|
}
|
|
8352
8366
|
return ESCAPES.get(c) || c;
|
|
8353
8367
|
}
|
|
8354
|
-
function parseArguments(
|
|
8368
|
+
function parseArguments(name2, arguments_) {
|
|
8355
8369
|
const results = [];
|
|
8356
8370
|
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
8357
8371
|
let matches;
|
|
@@ -8362,7 +8376,7 @@ function requireTemplates() {
|
|
|
8362
8376
|
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
8363
8377
|
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape(escape2) : character));
|
|
8364
8378
|
} else {
|
|
8365
|
-
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${
|
|
8379
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
|
|
8366
8380
|
}
|
|
8367
8381
|
}
|
|
8368
8382
|
return results;
|
|
@@ -8372,12 +8386,12 @@ function requireTemplates() {
|
|
|
8372
8386
|
const results = [];
|
|
8373
8387
|
let matches;
|
|
8374
8388
|
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
8375
|
-
const
|
|
8389
|
+
const name2 = matches[1];
|
|
8376
8390
|
if (matches[2]) {
|
|
8377
|
-
const args = parseArguments(
|
|
8378
|
-
results.push([
|
|
8391
|
+
const args = parseArguments(name2, matches[2]);
|
|
8392
|
+
results.push([name2].concat(args));
|
|
8379
8393
|
} else {
|
|
8380
|
-
results.push([
|
|
8394
|
+
results.push([name2]);
|
|
8381
8395
|
}
|
|
8382
8396
|
}
|
|
8383
8397
|
return results;
|
|
@@ -8401,7 +8415,7 @@ function requireTemplates() {
|
|
|
8401
8415
|
}
|
|
8402
8416
|
return current;
|
|
8403
8417
|
}
|
|
8404
|
-
templates = (chalk2, temporary) => {
|
|
8418
|
+
templates$1 = (chalk2, temporary) => {
|
|
8405
8419
|
const styles2 = [];
|
|
8406
8420
|
const chunks = [];
|
|
8407
8421
|
let chunk = [];
|
|
@@ -8431,92 +8445,92 @@ function requireTemplates() {
|
|
|
8431
8445
|
}
|
|
8432
8446
|
return chunks.join("");
|
|
8433
8447
|
};
|
|
8434
|
-
return templates;
|
|
8448
|
+
return templates$1;
|
|
8435
8449
|
}
|
|
8436
|
-
const ansiStyles = ansiStylesExports;
|
|
8437
|
-
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
8450
|
+
const ansiStyles$2 = ansiStylesExports$1;
|
|
8451
|
+
const { stdout: stdoutColor$1, stderr: stderrColor$1 } = browser$2;
|
|
8438
8452
|
const {
|
|
8439
|
-
stringReplaceAll,
|
|
8440
|
-
stringEncaseCRLFWithFirstIndex
|
|
8441
|
-
} = util;
|
|
8442
|
-
const { isArray } = Array;
|
|
8443
|
-
const levelMapping = [
|
|
8453
|
+
stringReplaceAll: stringReplaceAll$2,
|
|
8454
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$2
|
|
8455
|
+
} = util$1;
|
|
8456
|
+
const { isArray: isArray$1 } = Array;
|
|
8457
|
+
const levelMapping$1 = [
|
|
8444
8458
|
"ansi",
|
|
8445
8459
|
"ansi",
|
|
8446
8460
|
"ansi256",
|
|
8447
8461
|
"ansi16m"
|
|
8448
8462
|
];
|
|
8449
|
-
const styles = /* @__PURE__ */ Object.create(null);
|
|
8450
|
-
const applyOptions = (object, options = {}) => {
|
|
8463
|
+
const styles$1 = /* @__PURE__ */ Object.create(null);
|
|
8464
|
+
const applyOptions$1 = (object, options = {}) => {
|
|
8451
8465
|
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
8452
8466
|
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
8453
8467
|
}
|
|
8454
|
-
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
8468
|
+
const colorLevel = stdoutColor$1 ? stdoutColor$1.level : 0;
|
|
8455
8469
|
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
8456
8470
|
};
|
|
8457
|
-
class ChalkClass {
|
|
8471
|
+
let ChalkClass$1 = class ChalkClass {
|
|
8458
8472
|
constructor(options) {
|
|
8459
|
-
return chalkFactory(options);
|
|
8473
|
+
return chalkFactory$1(options);
|
|
8460
8474
|
}
|
|
8461
|
-
}
|
|
8462
|
-
const chalkFactory = (options) => {
|
|
8475
|
+
};
|
|
8476
|
+
const chalkFactory$1 = (options) => {
|
|
8463
8477
|
const chalk2 = {};
|
|
8464
|
-
applyOptions(chalk2, options);
|
|
8465
|
-
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
8466
|
-
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
8478
|
+
applyOptions$1(chalk2, options);
|
|
8479
|
+
chalk2.template = (...arguments_) => chalkTag$1(chalk2.template, ...arguments_);
|
|
8480
|
+
Object.setPrototypeOf(chalk2, Chalk$1.prototype);
|
|
8467
8481
|
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
8468
8482
|
chalk2.template.constructor = () => {
|
|
8469
8483
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
8470
8484
|
};
|
|
8471
|
-
chalk2.template.Instance = ChalkClass;
|
|
8485
|
+
chalk2.template.Instance = ChalkClass$1;
|
|
8472
8486
|
return chalk2.template;
|
|
8473
8487
|
};
|
|
8474
|
-
function Chalk(options) {
|
|
8475
|
-
return chalkFactory(options);
|
|
8488
|
+
function Chalk$1(options) {
|
|
8489
|
+
return chalkFactory$1(options);
|
|
8476
8490
|
}
|
|
8477
|
-
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
8478
|
-
styles[styleName] = {
|
|
8491
|
+
for (const [styleName, style] of Object.entries(ansiStyles$2)) {
|
|
8492
|
+
styles$1[styleName] = {
|
|
8479
8493
|
get() {
|
|
8480
|
-
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
8494
|
+
const builder = createBuilder$1(this, createStyler$1(style.open, style.close, this._styler), this._isEmpty);
|
|
8481
8495
|
Object.defineProperty(this, styleName, { value: builder });
|
|
8482
8496
|
return builder;
|
|
8483
8497
|
}
|
|
8484
8498
|
};
|
|
8485
8499
|
}
|
|
8486
|
-
styles.visible = {
|
|
8500
|
+
styles$1.visible = {
|
|
8487
8501
|
get() {
|
|
8488
|
-
const builder = createBuilder(this, this._styler, true);
|
|
8502
|
+
const builder = createBuilder$1(this, this._styler, true);
|
|
8489
8503
|
Object.defineProperty(this, "visible", { value: builder });
|
|
8490
8504
|
return builder;
|
|
8491
8505
|
}
|
|
8492
8506
|
};
|
|
8493
|
-
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
8494
|
-
for (const model of usedModels) {
|
|
8495
|
-
styles[model] = {
|
|
8507
|
+
const usedModels$1 = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
8508
|
+
for (const model of usedModels$1) {
|
|
8509
|
+
styles$1[model] = {
|
|
8496
8510
|
get() {
|
|
8497
8511
|
const { level } = this;
|
|
8498
8512
|
return function(...arguments_) {
|
|
8499
|
-
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
8500
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
8513
|
+
const styler = createStyler$1(ansiStyles$2.color[levelMapping$1[level]][model](...arguments_), ansiStyles$2.color.close, this._styler);
|
|
8514
|
+
return createBuilder$1(this, styler, this._isEmpty);
|
|
8501
8515
|
};
|
|
8502
8516
|
}
|
|
8503
8517
|
};
|
|
8504
8518
|
}
|
|
8505
|
-
for (const model of usedModels) {
|
|
8519
|
+
for (const model of usedModels$1) {
|
|
8506
8520
|
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
8507
|
-
styles[bgModel] = {
|
|
8521
|
+
styles$1[bgModel] = {
|
|
8508
8522
|
get() {
|
|
8509
8523
|
const { level } = this;
|
|
8510
8524
|
return function(...arguments_) {
|
|
8511
|
-
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
8512
|
-
return createBuilder(this, styler, this._isEmpty);
|
|
8525
|
+
const styler = createStyler$1(ansiStyles$2.bgColor[levelMapping$1[level]][model](...arguments_), ansiStyles$2.bgColor.close, this._styler);
|
|
8526
|
+
return createBuilder$1(this, styler, this._isEmpty);
|
|
8513
8527
|
};
|
|
8514
8528
|
}
|
|
8515
8529
|
};
|
|
8516
8530
|
}
|
|
8517
|
-
const proto = Object.defineProperties(() => {
|
|
8531
|
+
const proto$1 = Object.defineProperties(() => {
|
|
8518
8532
|
}, {
|
|
8519
|
-
...styles,
|
|
8533
|
+
...styles$1,
|
|
8520
8534
|
level: {
|
|
8521
8535
|
enumerable: true,
|
|
8522
8536
|
get() {
|
|
@@ -8527,7 +8541,7 @@ const proto = Object.defineProperties(() => {
|
|
|
8527
8541
|
}
|
|
8528
8542
|
}
|
|
8529
8543
|
});
|
|
8530
|
-
const createStyler = (open, close, parent) => {
|
|
8544
|
+
const createStyler$1 = (open, close, parent) => {
|
|
8531
8545
|
let openAll;
|
|
8532
8546
|
let closeAll;
|
|
8533
8547
|
if (parent === void 0) {
|
|
@@ -8545,20 +8559,20 @@ const createStyler = (open, close, parent) => {
|
|
|
8545
8559
|
parent
|
|
8546
8560
|
};
|
|
8547
8561
|
};
|
|
8548
|
-
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
8562
|
+
const createBuilder$1 = (self2, _styler, _isEmpty) => {
|
|
8549
8563
|
const builder = (...arguments_) => {
|
|
8550
|
-
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
8551
|
-
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
8564
|
+
if (isArray$1(arguments_[0]) && isArray$1(arguments_[0].raw)) {
|
|
8565
|
+
return applyStyle$1(builder, chalkTag$1(builder, ...arguments_));
|
|
8552
8566
|
}
|
|
8553
|
-
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
8567
|
+
return applyStyle$1(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
8554
8568
|
};
|
|
8555
|
-
Object.setPrototypeOf(builder, proto);
|
|
8569
|
+
Object.setPrototypeOf(builder, proto$1);
|
|
8556
8570
|
builder._generator = self2;
|
|
8557
8571
|
builder._styler = _styler;
|
|
8558
8572
|
builder._isEmpty = _isEmpty;
|
|
8559
8573
|
return builder;
|
|
8560
8574
|
};
|
|
8561
|
-
const applyStyle = (self2, string) => {
|
|
8575
|
+
const applyStyle$1 = (self2, string) => {
|
|
8562
8576
|
if (self2.level <= 0 || !string) {
|
|
8563
8577
|
return self2._isEmpty ? "" : string;
|
|
8564
8578
|
}
|
|
@@ -8569,20 +8583,20 @@ const applyStyle = (self2, string) => {
|
|
|
8569
8583
|
const { openAll, closeAll } = styler;
|
|
8570
8584
|
if (string.indexOf("\x1B") !== -1) {
|
|
8571
8585
|
while (styler !== void 0) {
|
|
8572
|
-
string = stringReplaceAll(string, styler.close, styler.open);
|
|
8586
|
+
string = stringReplaceAll$2(string, styler.close, styler.open);
|
|
8573
8587
|
styler = styler.parent;
|
|
8574
8588
|
}
|
|
8575
8589
|
}
|
|
8576
8590
|
const lfIndex = string.indexOf("\n");
|
|
8577
8591
|
if (lfIndex !== -1) {
|
|
8578
|
-
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
8592
|
+
string = stringEncaseCRLFWithFirstIndex$2(string, closeAll, openAll, lfIndex);
|
|
8579
8593
|
}
|
|
8580
8594
|
return openAll + string + closeAll;
|
|
8581
8595
|
};
|
|
8582
|
-
let template;
|
|
8583
|
-
const chalkTag = (chalk2, ...strings) => {
|
|
8596
|
+
let template$1;
|
|
8597
|
+
const chalkTag$1 = (chalk2, ...strings) => {
|
|
8584
8598
|
const [firstString] = strings;
|
|
8585
|
-
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
8599
|
+
if (!isArray$1(firstString) || !isArray$1(firstString.raw)) {
|
|
8586
8600
|
return strings.join(" ");
|
|
8587
8601
|
}
|
|
8588
8602
|
const arguments_ = strings.slice(1);
|
|
@@ -8593,18 +8607,18 @@ const chalkTag = (chalk2, ...strings) => {
|
|
|
8593
8607
|
String(firstString.raw[i])
|
|
8594
8608
|
);
|
|
8595
8609
|
}
|
|
8596
|
-
if (template === void 0) {
|
|
8597
|
-
template = requireTemplates();
|
|
8610
|
+
if (template$1 === void 0) {
|
|
8611
|
+
template$1 = requireTemplates$1();
|
|
8598
8612
|
}
|
|
8599
|
-
return template(chalk2, parts.join(""));
|
|
8613
|
+
return template$1(chalk2, parts.join(""));
|
|
8600
8614
|
};
|
|
8601
|
-
Object.defineProperties(Chalk.prototype, styles);
|
|
8602
|
-
const chalk = Chalk();
|
|
8603
|
-
chalk.supportsColor = stdoutColor;
|
|
8604
|
-
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
8605
|
-
chalk.stderr.supportsColor = stderrColor;
|
|
8606
|
-
var source = chalk;
|
|
8607
|
-
const chalk$
|
|
8615
|
+
Object.defineProperties(Chalk$1.prototype, styles$1);
|
|
8616
|
+
const chalk$1 = Chalk$1();
|
|
8617
|
+
chalk$1.supportsColor = stdoutColor$1;
|
|
8618
|
+
chalk$1.stderr = Chalk$1({ level: stderrColor$1 ? stderrColor$1.level : 0 });
|
|
8619
|
+
chalk$1.stderr.supportsColor = stderrColor$1;
|
|
8620
|
+
var source = chalk$1;
|
|
8621
|
+
const chalk$2 = /* @__PURE__ */ getDefaultExportFromCjs(source);
|
|
8608
8622
|
const _hoisted_1$4 = { class: "ststitle" };
|
|
8609
8623
|
const _hoisted_2$3 = {
|
|
8610
8624
|
key: 0,
|
|
@@ -8672,7 +8686,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
8672
8686
|
},
|
|
8673
8687
|
emits: ["myclick"],
|
|
8674
8688
|
setup(__props, { emit: __emit }) {
|
|
8675
|
-
chalk$
|
|
8689
|
+
chalk$2.level = 3;
|
|
8676
8690
|
const friendlyTitle = (id) => {
|
|
8677
8691
|
if (id.length > 30) {
|
|
8678
8692
|
return store.GetFriendName(props.modelId, id);
|
|
@@ -8704,7 +8718,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
8704
8718
|
try {
|
|
8705
8719
|
return (props.instrumentdata[`${Gauge.NETWORK_RX_GAUGE}`].val / 1e6).toFixed(2);
|
|
8706
8720
|
} catch (error) {
|
|
8707
|
-
console.log(chalk$
|
|
8721
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
8708
8722
|
return "0.0";
|
|
8709
8723
|
}
|
|
8710
8724
|
});
|
|
@@ -8712,7 +8726,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
8712
8726
|
try {
|
|
8713
8727
|
return (props.instrumentdata[`${Gauge.NETWORK_TX_GAUGE}`].val / 1e6).toFixed(2);
|
|
8714
8728
|
} catch (error) {
|
|
8715
|
-
console.log(chalk$
|
|
8729
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
8716
8730
|
return "0.0";
|
|
8717
8731
|
}
|
|
8718
8732
|
});
|
|
@@ -9314,7 +9328,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9314
9328
|
},
|
|
9315
9329
|
emits: ["myclick"],
|
|
9316
9330
|
setup(__props, { emit: __emit }) {
|
|
9317
|
-
chalk$
|
|
9331
|
+
chalk$2.level = 3;
|
|
9318
9332
|
const store = ModelStore();
|
|
9319
9333
|
const emit = __emit;
|
|
9320
9334
|
const clicked = function(id) {
|
|
@@ -9346,10 +9360,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9346
9360
|
return topic;
|
|
9347
9361
|
});
|
|
9348
9362
|
onMounted(() => {
|
|
9349
|
-
console.log(chalk$
|
|
9363
|
+
console.log(chalk$2.magenta(`onMounted`));
|
|
9350
9364
|
});
|
|
9351
9365
|
onBeforeUnmount(() => {
|
|
9352
|
-
console.log(chalk$
|
|
9366
|
+
console.log(chalk$2.magenta(`onBeforeUnmount`));
|
|
9353
9367
|
});
|
|
9354
9368
|
watch(() => props.instrumentdata, (val) => {
|
|
9355
9369
|
if (lineChartEx.value && lineChartEx.value) {
|
|
@@ -9388,7 +9402,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9388
9402
|
try {
|
|
9389
9403
|
return props.instrumentdata[`${Gauge.CPU_LOAD_GAUGE}`].val;
|
|
9390
9404
|
} catch (error) {
|
|
9391
|
-
console.log(chalk$
|
|
9405
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9392
9406
|
return 0;
|
|
9393
9407
|
}
|
|
9394
9408
|
});
|
|
@@ -9396,7 +9410,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9396
9410
|
try {
|
|
9397
9411
|
return props.instrumentdata[`${Gauge.ACTIVE_REQUEST_GAUGE}`].val;
|
|
9398
9412
|
} catch (error) {
|
|
9399
|
-
console.log(chalk$
|
|
9413
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9400
9414
|
return 0;
|
|
9401
9415
|
}
|
|
9402
9416
|
});
|
|
@@ -9404,7 +9418,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9404
9418
|
try {
|
|
9405
9419
|
return `${props.instrumentdata[`${Gauge.REQUEST_COUNT_GAUGE}`].val}/${props.instrumentdata[`${Gauge.ERROR_COUNT_GAUGE}`].val}/${props.instrumentdata[`${Gauge.RETRY_COUNT_GAUGE}`].val}`;
|
|
9406
9420
|
} catch (error) {
|
|
9407
|
-
console.log(chalk$
|
|
9421
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9408
9422
|
return "0/0/0";
|
|
9409
9423
|
}
|
|
9410
9424
|
});
|
|
@@ -9412,7 +9426,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9412
9426
|
try {
|
|
9413
9427
|
return props.instrumentdata[`${Gauge.CORE_COUNT_GAUGE}`].val;
|
|
9414
9428
|
} catch (error) {
|
|
9415
|
-
console.log(chalk$
|
|
9429
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9416
9430
|
return 0;
|
|
9417
9431
|
}
|
|
9418
9432
|
});
|
|
@@ -9420,7 +9434,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9420
9434
|
try {
|
|
9421
9435
|
return Math.round(props.instrumentdata[`${Gauge.TIMER_GAUGE}`].val);
|
|
9422
9436
|
} catch (error) {
|
|
9423
|
-
console.log(chalk$
|
|
9437
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9424
9438
|
return 0;
|
|
9425
9439
|
}
|
|
9426
9440
|
});
|
|
@@ -9428,7 +9442,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9428
9442
|
try {
|
|
9429
9443
|
return (props.instrumentdata[`${Gauge.DURATION_GAUGE}`].val * 100 / 100).toFixed(2);
|
|
9430
9444
|
} catch (error) {
|
|
9431
|
-
console.log(chalk$
|
|
9445
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9432
9446
|
return "0.0";
|
|
9433
9447
|
}
|
|
9434
9448
|
});
|
|
@@ -9436,7 +9450,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9436
9450
|
try {
|
|
9437
9451
|
return (props.instrumentdata[`${Gauge.NETWORK_RX_GAUGE}`].val / 1e6).toFixed(2);
|
|
9438
9452
|
} catch (error) {
|
|
9439
|
-
console.log(chalk$
|
|
9453
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9440
9454
|
return "0.0";
|
|
9441
9455
|
}
|
|
9442
9456
|
});
|
|
@@ -9444,7 +9458,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9444
9458
|
try {
|
|
9445
9459
|
return (props.instrumentdata[`${Gauge.NETWORK_TX_GAUGE}`].val / 1e6).toFixed(2);
|
|
9446
9460
|
} catch (error) {
|
|
9447
|
-
console.log(chalk$
|
|
9461
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9448
9462
|
return "0.0";
|
|
9449
9463
|
}
|
|
9450
9464
|
});
|
|
@@ -9452,7 +9466,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9452
9466
|
try {
|
|
9453
9467
|
return (props.instrumentdata[`${Gauge.LATENCY_GAUGE}`].val * 100 / 100).toFixed(2);
|
|
9454
9468
|
} catch (error) {
|
|
9455
|
-
console.log(chalk$
|
|
9469
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9456
9470
|
return "0.0";
|
|
9457
9471
|
}
|
|
9458
9472
|
});
|
|
@@ -9460,7 +9474,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9460
9474
|
try {
|
|
9461
9475
|
return `${props.instrumentdata[`${Gauge.CONNECTION_POOL_TOTAL_GAUGE}`].val}/${props.instrumentdata[`${Gauge.CONNECTION_POOL_IDLE_GAUGE}`].val}/${props.instrumentdata[`${Gauge.CONNECTION_POOL_WAITING_GAUGE}`].val}`;
|
|
9462
9476
|
} catch (error) {
|
|
9463
|
-
console.log(chalk$
|
|
9477
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9464
9478
|
return "[Unknown]";
|
|
9465
9479
|
}
|
|
9466
9480
|
});
|
|
@@ -9468,7 +9482,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9468
9482
|
try {
|
|
9469
9483
|
return `${props.instrumentdata[`${Gauge.AUTHENTICATION_COUNT_GAUGE}`].val}/${props.instrumentdata[`${Gauge.AUTHENTICATION_ERROR_COUNT_GAUGE}`].val}/${props.instrumentdata[`${Gauge.AUTHENTICATION_RETRY_COUNT_GAUGE}`].val}`;
|
|
9470
9484
|
} catch (error) {
|
|
9471
|
-
console.log(chalk$
|
|
9485
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9472
9486
|
return "[Unknown]";
|
|
9473
9487
|
}
|
|
9474
9488
|
});
|
|
@@ -9476,7 +9490,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9476
9490
|
try {
|
|
9477
9491
|
return props.instrumentdata[`${Gauge.ACTIVE_REQUEST_GAUGE}`].val / 20 * 100;
|
|
9478
9492
|
} catch (error) {
|
|
9479
|
-
console.log(chalk$
|
|
9493
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9480
9494
|
return 0;
|
|
9481
9495
|
}
|
|
9482
9496
|
});
|
|
@@ -9484,7 +9498,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9484
9498
|
try {
|
|
9485
9499
|
return props.instrumentdata[`${Gauge.CONNECTION_COUNT_GAUGE}`].val;
|
|
9486
9500
|
} catch (error) {
|
|
9487
|
-
console.log(chalk$
|
|
9501
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9488
9502
|
return 0;
|
|
9489
9503
|
}
|
|
9490
9504
|
});
|
|
@@ -9492,7 +9506,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9492
9506
|
try {
|
|
9493
9507
|
return props.instrumentdata[`${Gauge.CONNECTION_COUNT_GAUGE}`].val / 20 * 100;
|
|
9494
9508
|
} catch (error) {
|
|
9495
|
-
console.log(chalk$
|
|
9509
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9496
9510
|
return 0;
|
|
9497
9511
|
}
|
|
9498
9512
|
});
|
|
@@ -9500,7 +9514,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9500
9514
|
try {
|
|
9501
9515
|
return props.instrumentdata[`${Gauge.VELOCITY_GAUGE}`].val;
|
|
9502
9516
|
} catch (error) {
|
|
9503
|
-
console.log(chalk$
|
|
9517
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9504
9518
|
return 0;
|
|
9505
9519
|
}
|
|
9506
9520
|
});
|
|
@@ -9508,7 +9522,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
9508
9522
|
try {
|
|
9509
9523
|
return props.instrumentdata[`${Gauge.VELOCITY_GAUGE}`].va / 1e3 * 100;
|
|
9510
9524
|
} catch (error) {
|
|
9511
|
-
console.log(chalk$
|
|
9525
|
+
console.log(chalk$2.red(`${props.instrumentdata}`));
|
|
9512
9526
|
return 0;
|
|
9513
9527
|
}
|
|
9514
9528
|
});
|
|
@@ -9827,7 +9841,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
9827
9841
|
},
|
|
9828
9842
|
emits: ["myclick"],
|
|
9829
9843
|
setup(__props, { emit: __emit }) {
|
|
9830
|
-
chalk$
|
|
9844
|
+
chalk$2.level = 3;
|
|
9831
9845
|
const store = ModelStore();
|
|
9832
9846
|
const props = __props;
|
|
9833
9847
|
const emit = __emit;
|
|
@@ -9849,7 +9863,7 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
9849
9863
|
try {
|
|
9850
9864
|
return model.instruments[`${Gauge.CPU_LOAD_GAUGE}`].val;
|
|
9851
9865
|
} catch (error) {
|
|
9852
|
-
console.log(chalk$
|
|
9866
|
+
console.log(chalk$2.red(`${error}`));
|
|
9853
9867
|
}
|
|
9854
9868
|
};
|
|
9855
9869
|
const navigate = function(id) {
|
|
@@ -9910,30 +9924,2305 @@ function v4(options, buf, offset) {
|
|
|
9910
9924
|
rnds[8] = rnds[8] & 63 | 128;
|
|
9911
9925
|
return unsafeStringify(rnds);
|
|
9912
9926
|
}
|
|
9927
|
+
const http = {};
|
|
9928
|
+
const fs$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
9929
|
+
__proto__: null,
|
|
9930
|
+
default: http
|
|
9931
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
9932
|
+
var main$1 = { exports: {} };
|
|
9933
|
+
const require$$3 = /* @__PURE__ */ getAugmentedNamespace(fs$1);
|
|
9934
|
+
const name = "dotenv";
|
|
9935
|
+
const version$1 = "16.4.5";
|
|
9936
|
+
const description = "Loads environment variables from .env file";
|
|
9937
|
+
const main = "lib/main.js";
|
|
9938
|
+
const types = "lib/main.d.ts";
|
|
9939
|
+
const exports = {
|
|
9940
|
+
".": {
|
|
9941
|
+
types: "./lib/main.d.ts",
|
|
9942
|
+
require: "./lib/main.js",
|
|
9943
|
+
"default": "./lib/main.js"
|
|
9944
|
+
},
|
|
9945
|
+
"./config": "./config.js",
|
|
9946
|
+
"./config.js": "./config.js",
|
|
9947
|
+
"./lib/env-options": "./lib/env-options.js",
|
|
9948
|
+
"./lib/env-options.js": "./lib/env-options.js",
|
|
9949
|
+
"./lib/cli-options": "./lib/cli-options.js",
|
|
9950
|
+
"./lib/cli-options.js": "./lib/cli-options.js",
|
|
9951
|
+
"./package.json": "./package.json"
|
|
9952
|
+
};
|
|
9953
|
+
const scripts = {
|
|
9954
|
+
"dts-check": "tsc --project tests/types/tsconfig.json",
|
|
9955
|
+
lint: "standard",
|
|
9956
|
+
"lint-readme": "standard-markdown",
|
|
9957
|
+
pretest: "npm run lint && npm run dts-check",
|
|
9958
|
+
test: "tap tests/*.js --100 -Rspec",
|
|
9959
|
+
"test:coverage": "tap --coverage-report=lcov",
|
|
9960
|
+
prerelease: "npm test",
|
|
9961
|
+
release: "standard-version"
|
|
9962
|
+
};
|
|
9963
|
+
const repository = {
|
|
9964
|
+
type: "git",
|
|
9965
|
+
url: "git://github.com/motdotla/dotenv.git"
|
|
9966
|
+
};
|
|
9967
|
+
const funding = "https://dotenvx.com";
|
|
9968
|
+
const keywords = [
|
|
9969
|
+
"dotenv",
|
|
9970
|
+
"env",
|
|
9971
|
+
".env",
|
|
9972
|
+
"environment",
|
|
9973
|
+
"variables",
|
|
9974
|
+
"config",
|
|
9975
|
+
"settings"
|
|
9976
|
+
];
|
|
9977
|
+
const readmeFilename = "README.md";
|
|
9978
|
+
const license = "BSD-2-Clause";
|
|
9979
|
+
const devDependencies = {
|
|
9980
|
+
"@definitelytyped/dtslint": "^0.0.133",
|
|
9981
|
+
"@types/node": "^18.11.3",
|
|
9982
|
+
decache: "^4.6.1",
|
|
9983
|
+
sinon: "^14.0.1",
|
|
9984
|
+
standard: "^17.0.0",
|
|
9985
|
+
"standard-markdown": "^7.1.0",
|
|
9986
|
+
"standard-version": "^9.5.0",
|
|
9987
|
+
tap: "^16.3.0",
|
|
9988
|
+
tar: "^6.1.11",
|
|
9989
|
+
typescript: "^4.8.4"
|
|
9990
|
+
};
|
|
9991
|
+
const engines = {
|
|
9992
|
+
node: ">=12"
|
|
9993
|
+
};
|
|
9994
|
+
const browser$1 = {
|
|
9995
|
+
fs: false
|
|
9996
|
+
};
|
|
9997
|
+
const require$$4 = {
|
|
9998
|
+
name,
|
|
9999
|
+
version: version$1,
|
|
10000
|
+
description,
|
|
10001
|
+
main,
|
|
10002
|
+
types,
|
|
10003
|
+
exports,
|
|
10004
|
+
scripts,
|
|
10005
|
+
repository,
|
|
10006
|
+
funding,
|
|
10007
|
+
keywords,
|
|
10008
|
+
readmeFilename,
|
|
10009
|
+
license,
|
|
10010
|
+
devDependencies,
|
|
10011
|
+
engines,
|
|
10012
|
+
browser: browser$1
|
|
10013
|
+
};
|
|
10014
|
+
const fs = require$$3;
|
|
10015
|
+
const path = require$$3;
|
|
10016
|
+
const os = require$$3;
|
|
10017
|
+
const crypto$1 = require$$3;
|
|
10018
|
+
const packageJson = require$$4;
|
|
10019
|
+
const version = packageJson.version;
|
|
10020
|
+
const LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
|
|
10021
|
+
function parse(src) {
|
|
10022
|
+
const obj = {};
|
|
10023
|
+
let lines = src.toString();
|
|
10024
|
+
lines = lines.replace(/\r\n?/mg, "\n");
|
|
10025
|
+
let match;
|
|
10026
|
+
while ((match = LINE.exec(lines)) != null) {
|
|
10027
|
+
const key = match[1];
|
|
10028
|
+
let value = match[2] || "";
|
|
10029
|
+
value = value.trim();
|
|
10030
|
+
const maybeQuote = value[0];
|
|
10031
|
+
value = value.replace(/^(['"`])([\s\S]*)\1$/mg, "$2");
|
|
10032
|
+
if (maybeQuote === '"') {
|
|
10033
|
+
value = value.replace(/\\n/g, "\n");
|
|
10034
|
+
value = value.replace(/\\r/g, "\r");
|
|
10035
|
+
}
|
|
10036
|
+
obj[key] = value;
|
|
10037
|
+
}
|
|
10038
|
+
return obj;
|
|
10039
|
+
}
|
|
10040
|
+
function _parseVault(options) {
|
|
10041
|
+
const vaultPath = _vaultPath(options);
|
|
10042
|
+
const result = DotenvModule.configDotenv({ path: vaultPath });
|
|
10043
|
+
if (!result.parsed) {
|
|
10044
|
+
const err = new Error(`MISSING_DATA: Cannot parse ${vaultPath} for an unknown reason`);
|
|
10045
|
+
err.code = "MISSING_DATA";
|
|
10046
|
+
throw err;
|
|
10047
|
+
}
|
|
10048
|
+
const keys = _dotenvKey(options).split(",");
|
|
10049
|
+
const length = keys.length;
|
|
10050
|
+
let decrypted;
|
|
10051
|
+
for (let i = 0; i < length; i++) {
|
|
10052
|
+
try {
|
|
10053
|
+
const key = keys[i].trim();
|
|
10054
|
+
const attrs = _instructions(result, key);
|
|
10055
|
+
decrypted = DotenvModule.decrypt(attrs.ciphertext, attrs.key);
|
|
10056
|
+
break;
|
|
10057
|
+
} catch (error) {
|
|
10058
|
+
if (i + 1 >= length) {
|
|
10059
|
+
throw error;
|
|
10060
|
+
}
|
|
10061
|
+
}
|
|
10062
|
+
}
|
|
10063
|
+
return DotenvModule.parse(decrypted);
|
|
10064
|
+
}
|
|
10065
|
+
function _log(message) {
|
|
10066
|
+
console.log(`[dotenv@${version}][INFO] ${message}`);
|
|
10067
|
+
}
|
|
10068
|
+
function _warn(message) {
|
|
10069
|
+
console.log(`[dotenv@${version}][WARN] ${message}`);
|
|
10070
|
+
}
|
|
10071
|
+
function _debug(message) {
|
|
10072
|
+
console.log(`[dotenv@${version}][DEBUG] ${message}`);
|
|
10073
|
+
}
|
|
10074
|
+
function _dotenvKey(options) {
|
|
10075
|
+
if (options && options.DOTENV_KEY && options.DOTENV_KEY.length > 0) {
|
|
10076
|
+
return options.DOTENV_KEY;
|
|
10077
|
+
}
|
|
10078
|
+
if (process.env.DOTENV_KEY && process.env.DOTENV_KEY.length > 0) {
|
|
10079
|
+
return process.env.DOTENV_KEY;
|
|
10080
|
+
}
|
|
10081
|
+
return "";
|
|
10082
|
+
}
|
|
10083
|
+
function _instructions(result, dotenvKey) {
|
|
10084
|
+
let uri;
|
|
10085
|
+
try {
|
|
10086
|
+
uri = new URL(dotenvKey);
|
|
10087
|
+
} catch (error) {
|
|
10088
|
+
if (error.code === "ERR_INVALID_URL") {
|
|
10089
|
+
const err = new Error("INVALID_DOTENV_KEY: Wrong format. Must be in valid uri format like dotenv://:key_1234@dotenvx.com/vault/.env.vault?environment=development");
|
|
10090
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
10091
|
+
throw err;
|
|
10092
|
+
}
|
|
10093
|
+
throw error;
|
|
10094
|
+
}
|
|
10095
|
+
const key = uri.password;
|
|
10096
|
+
if (!key) {
|
|
10097
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing key part");
|
|
10098
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
10099
|
+
throw err;
|
|
10100
|
+
}
|
|
10101
|
+
const environment = uri.searchParams.get("environment");
|
|
10102
|
+
if (!environment) {
|
|
10103
|
+
const err = new Error("INVALID_DOTENV_KEY: Missing environment part");
|
|
10104
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
10105
|
+
throw err;
|
|
10106
|
+
}
|
|
10107
|
+
const environmentKey = `DOTENV_VAULT_${environment.toUpperCase()}`;
|
|
10108
|
+
const ciphertext = result.parsed[environmentKey];
|
|
10109
|
+
if (!ciphertext) {
|
|
10110
|
+
const err = new Error(`NOT_FOUND_DOTENV_ENVIRONMENT: Cannot locate environment ${environmentKey} in your .env.vault file.`);
|
|
10111
|
+
err.code = "NOT_FOUND_DOTENV_ENVIRONMENT";
|
|
10112
|
+
throw err;
|
|
10113
|
+
}
|
|
10114
|
+
return { ciphertext, key };
|
|
10115
|
+
}
|
|
10116
|
+
function _vaultPath(options) {
|
|
10117
|
+
let possibleVaultPath = null;
|
|
10118
|
+
if (options && options.path && options.path.length > 0) {
|
|
10119
|
+
if (Array.isArray(options.path)) {
|
|
10120
|
+
for (const filepath of options.path) {
|
|
10121
|
+
if (fs.existsSync(filepath)) {
|
|
10122
|
+
possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
10123
|
+
}
|
|
10124
|
+
}
|
|
10125
|
+
} else {
|
|
10126
|
+
possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
10127
|
+
}
|
|
10128
|
+
} else {
|
|
10129
|
+
possibleVaultPath = path.resolve(process.cwd(), ".env.vault");
|
|
10130
|
+
}
|
|
10131
|
+
if (fs.existsSync(possibleVaultPath)) {
|
|
10132
|
+
return possibleVaultPath;
|
|
10133
|
+
}
|
|
10134
|
+
return null;
|
|
10135
|
+
}
|
|
10136
|
+
function _resolveHome(envPath) {
|
|
10137
|
+
return envPath[0] === "~" ? path.join(os.homedir(), envPath.slice(1)) : envPath;
|
|
10138
|
+
}
|
|
10139
|
+
function _configVault(options) {
|
|
10140
|
+
_log("Loading env from encrypted .env.vault");
|
|
10141
|
+
const parsed = DotenvModule._parseVault(options);
|
|
10142
|
+
let processEnv = process.env;
|
|
10143
|
+
if (options && options.processEnv != null) {
|
|
10144
|
+
processEnv = options.processEnv;
|
|
10145
|
+
}
|
|
10146
|
+
DotenvModule.populate(processEnv, parsed, options);
|
|
10147
|
+
return { parsed };
|
|
10148
|
+
}
|
|
10149
|
+
function configDotenv(options) {
|
|
10150
|
+
const dotenvPath = path.resolve(process.cwd(), ".env");
|
|
10151
|
+
let encoding = "utf8";
|
|
10152
|
+
const debug = Boolean(options && options.debug);
|
|
10153
|
+
if (options && options.encoding) {
|
|
10154
|
+
encoding = options.encoding;
|
|
10155
|
+
} else {
|
|
10156
|
+
if (debug) {
|
|
10157
|
+
_debug("No encoding is specified. UTF-8 is used by default");
|
|
10158
|
+
}
|
|
10159
|
+
}
|
|
10160
|
+
let optionPaths = [dotenvPath];
|
|
10161
|
+
if (options && options.path) {
|
|
10162
|
+
if (!Array.isArray(options.path)) {
|
|
10163
|
+
optionPaths = [_resolveHome(options.path)];
|
|
10164
|
+
} else {
|
|
10165
|
+
optionPaths = [];
|
|
10166
|
+
for (const filepath of options.path) {
|
|
10167
|
+
optionPaths.push(_resolveHome(filepath));
|
|
10168
|
+
}
|
|
10169
|
+
}
|
|
10170
|
+
}
|
|
10171
|
+
let lastError;
|
|
10172
|
+
const parsedAll = {};
|
|
10173
|
+
for (const path2 of optionPaths) {
|
|
10174
|
+
try {
|
|
10175
|
+
const parsed = DotenvModule.parse(fs.readFileSync(path2, { encoding }));
|
|
10176
|
+
DotenvModule.populate(parsedAll, parsed, options);
|
|
10177
|
+
} catch (e) {
|
|
10178
|
+
if (debug) {
|
|
10179
|
+
_debug(`Failed to load ${path2} ${e.message}`);
|
|
10180
|
+
}
|
|
10181
|
+
lastError = e;
|
|
10182
|
+
}
|
|
10183
|
+
}
|
|
10184
|
+
let processEnv = process.env;
|
|
10185
|
+
if (options && options.processEnv != null) {
|
|
10186
|
+
processEnv = options.processEnv;
|
|
10187
|
+
}
|
|
10188
|
+
DotenvModule.populate(processEnv, parsedAll, options);
|
|
10189
|
+
if (lastError) {
|
|
10190
|
+
return { parsed: parsedAll, error: lastError };
|
|
10191
|
+
} else {
|
|
10192
|
+
return { parsed: parsedAll };
|
|
10193
|
+
}
|
|
10194
|
+
}
|
|
10195
|
+
function config(options) {
|
|
10196
|
+
if (_dotenvKey(options).length === 0) {
|
|
10197
|
+
return DotenvModule.configDotenv(options);
|
|
10198
|
+
}
|
|
10199
|
+
const vaultPath = _vaultPath(options);
|
|
10200
|
+
if (!vaultPath) {
|
|
10201
|
+
_warn(`You set DOTENV_KEY but you are missing a .env.vault file at ${vaultPath}. Did you forget to build it?`);
|
|
10202
|
+
return DotenvModule.configDotenv(options);
|
|
10203
|
+
}
|
|
10204
|
+
return DotenvModule._configVault(options);
|
|
10205
|
+
}
|
|
10206
|
+
function decrypt(encrypted, keyStr) {
|
|
10207
|
+
const key = Buffer.from(keyStr.slice(-64), "hex");
|
|
10208
|
+
let ciphertext = Buffer.from(encrypted, "base64");
|
|
10209
|
+
const nonce = ciphertext.subarray(0, 12);
|
|
10210
|
+
const authTag = ciphertext.subarray(-16);
|
|
10211
|
+
ciphertext = ciphertext.subarray(12, -16);
|
|
10212
|
+
try {
|
|
10213
|
+
const aesgcm = crypto$1.createDecipheriv("aes-256-gcm", key, nonce);
|
|
10214
|
+
aesgcm.setAuthTag(authTag);
|
|
10215
|
+
return `${aesgcm.update(ciphertext)}${aesgcm.final()}`;
|
|
10216
|
+
} catch (error) {
|
|
10217
|
+
const isRange = error instanceof RangeError;
|
|
10218
|
+
const invalidKeyLength = error.message === "Invalid key length";
|
|
10219
|
+
const decryptionFailed = error.message === "Unsupported state or unable to authenticate data";
|
|
10220
|
+
if (isRange || invalidKeyLength) {
|
|
10221
|
+
const err = new Error("INVALID_DOTENV_KEY: It must be 64 characters long (or more)");
|
|
10222
|
+
err.code = "INVALID_DOTENV_KEY";
|
|
10223
|
+
throw err;
|
|
10224
|
+
} else if (decryptionFailed) {
|
|
10225
|
+
const err = new Error("DECRYPTION_FAILED: Please check your DOTENV_KEY");
|
|
10226
|
+
err.code = "DECRYPTION_FAILED";
|
|
10227
|
+
throw err;
|
|
10228
|
+
} else {
|
|
10229
|
+
throw error;
|
|
10230
|
+
}
|
|
10231
|
+
}
|
|
10232
|
+
}
|
|
10233
|
+
function populate(processEnv, parsed, options = {}) {
|
|
10234
|
+
const debug = Boolean(options && options.debug);
|
|
10235
|
+
const override = Boolean(options && options.override);
|
|
10236
|
+
if (typeof parsed !== "object") {
|
|
10237
|
+
const err = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
10238
|
+
err.code = "OBJECT_REQUIRED";
|
|
10239
|
+
throw err;
|
|
10240
|
+
}
|
|
10241
|
+
for (const key of Object.keys(parsed)) {
|
|
10242
|
+
if (Object.prototype.hasOwnProperty.call(processEnv, key)) {
|
|
10243
|
+
if (override === true) {
|
|
10244
|
+
processEnv[key] = parsed[key];
|
|
10245
|
+
}
|
|
10246
|
+
if (debug) {
|
|
10247
|
+
if (override === true) {
|
|
10248
|
+
_debug(`"${key}" is already defined and WAS overwritten`);
|
|
10249
|
+
} else {
|
|
10250
|
+
_debug(`"${key}" is already defined and was NOT overwritten`);
|
|
10251
|
+
}
|
|
10252
|
+
}
|
|
10253
|
+
} else {
|
|
10254
|
+
processEnv[key] = parsed[key];
|
|
10255
|
+
}
|
|
10256
|
+
}
|
|
10257
|
+
}
|
|
10258
|
+
const DotenvModule = {
|
|
10259
|
+
configDotenv,
|
|
10260
|
+
_configVault,
|
|
10261
|
+
_parseVault,
|
|
10262
|
+
config,
|
|
10263
|
+
decrypt,
|
|
10264
|
+
parse,
|
|
10265
|
+
populate
|
|
10266
|
+
};
|
|
10267
|
+
main$1.exports.configDotenv = DotenvModule.configDotenv;
|
|
10268
|
+
main$1.exports._configVault = DotenvModule._configVault;
|
|
10269
|
+
main$1.exports._parseVault = DotenvModule._parseVault;
|
|
10270
|
+
var config_1 = main$1.exports.config = DotenvModule.config;
|
|
10271
|
+
main$1.exports.decrypt = DotenvModule.decrypt;
|
|
10272
|
+
main$1.exports.parse = DotenvModule.parse;
|
|
10273
|
+
main$1.exports.populate = DotenvModule.populate;
|
|
10274
|
+
main$1.exports = DotenvModule;
|
|
10275
|
+
var __typeError$1 = (msg) => {
|
|
10276
|
+
throw TypeError(msg);
|
|
10277
|
+
};
|
|
10278
|
+
var __accessCheck$1 = (obj, member, msg) => member.has(obj) || __typeError$1("Cannot " + msg);
|
|
10279
|
+
var __privateGet$1 = (obj, member, getter) => (__accessCheck$1(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
10280
|
+
var __privateAdd$1 = (obj, member, value) => member.has(obj) ? __typeError$1("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10281
|
+
var __privateSet$1 = (obj, member, value, setter) => (__accessCheck$1(obj, member, "write to private field"), member.set(obj, value), value);
|
|
10282
|
+
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
10283
|
+
set _(value) {
|
|
10284
|
+
__privateSet$1(obj, member, value);
|
|
10285
|
+
},
|
|
10286
|
+
get _() {
|
|
10287
|
+
return __privateGet$1(obj, member, getter);
|
|
10288
|
+
}
|
|
10289
|
+
});
|
|
10290
|
+
var _options$1, _httpAgent, _httpsAgent, _agentResetInterval, _requestCount, _SetupResetInterval, _GetAgentOptions;
|
|
10291
|
+
var ansiStyles$1 = { exports: {} };
|
|
10292
|
+
var colorName;
|
|
10293
|
+
var hasRequiredColorName;
|
|
10294
|
+
function requireColorName() {
|
|
10295
|
+
if (hasRequiredColorName) return colorName;
|
|
10296
|
+
hasRequiredColorName = 1;
|
|
10297
|
+
colorName = {
|
|
10298
|
+
"aliceblue": [240, 248, 255],
|
|
10299
|
+
"antiquewhite": [250, 235, 215],
|
|
10300
|
+
"aqua": [0, 255, 255],
|
|
10301
|
+
"aquamarine": [127, 255, 212],
|
|
10302
|
+
"azure": [240, 255, 255],
|
|
10303
|
+
"beige": [245, 245, 220],
|
|
10304
|
+
"bisque": [255, 228, 196],
|
|
10305
|
+
"black": [0, 0, 0],
|
|
10306
|
+
"blanchedalmond": [255, 235, 205],
|
|
10307
|
+
"blue": [0, 0, 255],
|
|
10308
|
+
"blueviolet": [138, 43, 226],
|
|
10309
|
+
"brown": [165, 42, 42],
|
|
10310
|
+
"burlywood": [222, 184, 135],
|
|
10311
|
+
"cadetblue": [95, 158, 160],
|
|
10312
|
+
"chartreuse": [127, 255, 0],
|
|
10313
|
+
"chocolate": [210, 105, 30],
|
|
10314
|
+
"coral": [255, 127, 80],
|
|
10315
|
+
"cornflowerblue": [100, 149, 237],
|
|
10316
|
+
"cornsilk": [255, 248, 220],
|
|
10317
|
+
"crimson": [220, 20, 60],
|
|
10318
|
+
"cyan": [0, 255, 255],
|
|
10319
|
+
"darkblue": [0, 0, 139],
|
|
10320
|
+
"darkcyan": [0, 139, 139],
|
|
10321
|
+
"darkgoldenrod": [184, 134, 11],
|
|
10322
|
+
"darkgray": [169, 169, 169],
|
|
10323
|
+
"darkgreen": [0, 100, 0],
|
|
10324
|
+
"darkgrey": [169, 169, 169],
|
|
10325
|
+
"darkkhaki": [189, 183, 107],
|
|
10326
|
+
"darkmagenta": [139, 0, 139],
|
|
10327
|
+
"darkolivegreen": [85, 107, 47],
|
|
10328
|
+
"darkorange": [255, 140, 0],
|
|
10329
|
+
"darkorchid": [153, 50, 204],
|
|
10330
|
+
"darkred": [139, 0, 0],
|
|
10331
|
+
"darksalmon": [233, 150, 122],
|
|
10332
|
+
"darkseagreen": [143, 188, 143],
|
|
10333
|
+
"darkslateblue": [72, 61, 139],
|
|
10334
|
+
"darkslategray": [47, 79, 79],
|
|
10335
|
+
"darkslategrey": [47, 79, 79],
|
|
10336
|
+
"darkturquoise": [0, 206, 209],
|
|
10337
|
+
"darkviolet": [148, 0, 211],
|
|
10338
|
+
"deeppink": [255, 20, 147],
|
|
10339
|
+
"deepskyblue": [0, 191, 255],
|
|
10340
|
+
"dimgray": [105, 105, 105],
|
|
10341
|
+
"dimgrey": [105, 105, 105],
|
|
10342
|
+
"dodgerblue": [30, 144, 255],
|
|
10343
|
+
"firebrick": [178, 34, 34],
|
|
10344
|
+
"floralwhite": [255, 250, 240],
|
|
10345
|
+
"forestgreen": [34, 139, 34],
|
|
10346
|
+
"fuchsia": [255, 0, 255],
|
|
10347
|
+
"gainsboro": [220, 220, 220],
|
|
10348
|
+
"ghostwhite": [248, 248, 255],
|
|
10349
|
+
"gold": [255, 215, 0],
|
|
10350
|
+
"goldenrod": [218, 165, 32],
|
|
10351
|
+
"gray": [128, 128, 128],
|
|
10352
|
+
"green": [0, 128, 0],
|
|
10353
|
+
"greenyellow": [173, 255, 47],
|
|
10354
|
+
"grey": [128, 128, 128],
|
|
10355
|
+
"honeydew": [240, 255, 240],
|
|
10356
|
+
"hotpink": [255, 105, 180],
|
|
10357
|
+
"indianred": [205, 92, 92],
|
|
10358
|
+
"indigo": [75, 0, 130],
|
|
10359
|
+
"ivory": [255, 255, 240],
|
|
10360
|
+
"khaki": [240, 230, 140],
|
|
10361
|
+
"lavender": [230, 230, 250],
|
|
10362
|
+
"lavenderblush": [255, 240, 245],
|
|
10363
|
+
"lawngreen": [124, 252, 0],
|
|
10364
|
+
"lemonchiffon": [255, 250, 205],
|
|
10365
|
+
"lightblue": [173, 216, 230],
|
|
10366
|
+
"lightcoral": [240, 128, 128],
|
|
10367
|
+
"lightcyan": [224, 255, 255],
|
|
10368
|
+
"lightgoldenrodyellow": [250, 250, 210],
|
|
10369
|
+
"lightgray": [211, 211, 211],
|
|
10370
|
+
"lightgreen": [144, 238, 144],
|
|
10371
|
+
"lightgrey": [211, 211, 211],
|
|
10372
|
+
"lightpink": [255, 182, 193],
|
|
10373
|
+
"lightsalmon": [255, 160, 122],
|
|
10374
|
+
"lightseagreen": [32, 178, 170],
|
|
10375
|
+
"lightskyblue": [135, 206, 250],
|
|
10376
|
+
"lightslategray": [119, 136, 153],
|
|
10377
|
+
"lightslategrey": [119, 136, 153],
|
|
10378
|
+
"lightsteelblue": [176, 196, 222],
|
|
10379
|
+
"lightyellow": [255, 255, 224],
|
|
10380
|
+
"lime": [0, 255, 0],
|
|
10381
|
+
"limegreen": [50, 205, 50],
|
|
10382
|
+
"linen": [250, 240, 230],
|
|
10383
|
+
"magenta": [255, 0, 255],
|
|
10384
|
+
"maroon": [128, 0, 0],
|
|
10385
|
+
"mediumaquamarine": [102, 205, 170],
|
|
10386
|
+
"mediumblue": [0, 0, 205],
|
|
10387
|
+
"mediumorchid": [186, 85, 211],
|
|
10388
|
+
"mediumpurple": [147, 112, 219],
|
|
10389
|
+
"mediumseagreen": [60, 179, 113],
|
|
10390
|
+
"mediumslateblue": [123, 104, 238],
|
|
10391
|
+
"mediumspringgreen": [0, 250, 154],
|
|
10392
|
+
"mediumturquoise": [72, 209, 204],
|
|
10393
|
+
"mediumvioletred": [199, 21, 133],
|
|
10394
|
+
"midnightblue": [25, 25, 112],
|
|
10395
|
+
"mintcream": [245, 255, 250],
|
|
10396
|
+
"mistyrose": [255, 228, 225],
|
|
10397
|
+
"moccasin": [255, 228, 181],
|
|
10398
|
+
"navajowhite": [255, 222, 173],
|
|
10399
|
+
"navy": [0, 0, 128],
|
|
10400
|
+
"oldlace": [253, 245, 230],
|
|
10401
|
+
"olive": [128, 128, 0],
|
|
10402
|
+
"olivedrab": [107, 142, 35],
|
|
10403
|
+
"orange": [255, 165, 0],
|
|
10404
|
+
"orangered": [255, 69, 0],
|
|
10405
|
+
"orchid": [218, 112, 214],
|
|
10406
|
+
"palegoldenrod": [238, 232, 170],
|
|
10407
|
+
"palegreen": [152, 251, 152],
|
|
10408
|
+
"paleturquoise": [175, 238, 238],
|
|
10409
|
+
"palevioletred": [219, 112, 147],
|
|
10410
|
+
"papayawhip": [255, 239, 213],
|
|
10411
|
+
"peachpuff": [255, 218, 185],
|
|
10412
|
+
"peru": [205, 133, 63],
|
|
10413
|
+
"pink": [255, 192, 203],
|
|
10414
|
+
"plum": [221, 160, 221],
|
|
10415
|
+
"powderblue": [176, 224, 230],
|
|
10416
|
+
"purple": [128, 0, 128],
|
|
10417
|
+
"rebeccapurple": [102, 51, 153],
|
|
10418
|
+
"red": [255, 0, 0],
|
|
10419
|
+
"rosybrown": [188, 143, 143],
|
|
10420
|
+
"royalblue": [65, 105, 225],
|
|
10421
|
+
"saddlebrown": [139, 69, 19],
|
|
10422
|
+
"salmon": [250, 128, 114],
|
|
10423
|
+
"sandybrown": [244, 164, 96],
|
|
10424
|
+
"seagreen": [46, 139, 87],
|
|
10425
|
+
"seashell": [255, 245, 238],
|
|
10426
|
+
"sienna": [160, 82, 45],
|
|
10427
|
+
"silver": [192, 192, 192],
|
|
10428
|
+
"skyblue": [135, 206, 235],
|
|
10429
|
+
"slateblue": [106, 90, 205],
|
|
10430
|
+
"slategray": [112, 128, 144],
|
|
10431
|
+
"slategrey": [112, 128, 144],
|
|
10432
|
+
"snow": [255, 250, 250],
|
|
10433
|
+
"springgreen": [0, 255, 127],
|
|
10434
|
+
"steelblue": [70, 130, 180],
|
|
10435
|
+
"tan": [210, 180, 140],
|
|
10436
|
+
"teal": [0, 128, 128],
|
|
10437
|
+
"thistle": [216, 191, 216],
|
|
10438
|
+
"tomato": [255, 99, 71],
|
|
10439
|
+
"turquoise": [64, 224, 208],
|
|
10440
|
+
"violet": [238, 130, 238],
|
|
10441
|
+
"wheat": [245, 222, 179],
|
|
10442
|
+
"white": [255, 255, 255],
|
|
10443
|
+
"whitesmoke": [245, 245, 245],
|
|
10444
|
+
"yellow": [255, 255, 0],
|
|
10445
|
+
"yellowgreen": [154, 205, 50]
|
|
10446
|
+
};
|
|
10447
|
+
return colorName;
|
|
10448
|
+
}
|
|
10449
|
+
var conversions;
|
|
10450
|
+
var hasRequiredConversions;
|
|
10451
|
+
function requireConversions() {
|
|
10452
|
+
if (hasRequiredConversions) return conversions;
|
|
10453
|
+
hasRequiredConversions = 1;
|
|
10454
|
+
const cssKeywords = requireColorName();
|
|
10455
|
+
const reverseKeywords = {};
|
|
10456
|
+
for (const key of Object.keys(cssKeywords)) {
|
|
10457
|
+
reverseKeywords[cssKeywords[key]] = key;
|
|
10458
|
+
}
|
|
10459
|
+
const convert = {
|
|
10460
|
+
rgb: { channels: 3, labels: "rgb" },
|
|
10461
|
+
hsl: { channels: 3, labels: "hsl" },
|
|
10462
|
+
hsv: { channels: 3, labels: "hsv" },
|
|
10463
|
+
hwb: { channels: 3, labels: "hwb" },
|
|
10464
|
+
cmyk: { channels: 4, labels: "cmyk" },
|
|
10465
|
+
xyz: { channels: 3, labels: "xyz" },
|
|
10466
|
+
lab: { channels: 3, labels: "lab" },
|
|
10467
|
+
lch: { channels: 3, labels: "lch" },
|
|
10468
|
+
hex: { channels: 1, labels: ["hex"] },
|
|
10469
|
+
keyword: { channels: 1, labels: ["keyword"] },
|
|
10470
|
+
ansi16: { channels: 1, labels: ["ansi16"] },
|
|
10471
|
+
ansi256: { channels: 1, labels: ["ansi256"] },
|
|
10472
|
+
hcg: { channels: 3, labels: ["h", "c", "g"] },
|
|
10473
|
+
apple: { channels: 3, labels: ["r16", "g16", "b16"] },
|
|
10474
|
+
gray: { channels: 1, labels: ["gray"] }
|
|
10475
|
+
};
|
|
10476
|
+
conversions = convert;
|
|
10477
|
+
for (const model of Object.keys(convert)) {
|
|
10478
|
+
if (!("channels" in convert[model])) {
|
|
10479
|
+
throw new Error("missing channels property: " + model);
|
|
10480
|
+
}
|
|
10481
|
+
if (!("labels" in convert[model])) {
|
|
10482
|
+
throw new Error("missing channel labels property: " + model);
|
|
10483
|
+
}
|
|
10484
|
+
if (convert[model].labels.length !== convert[model].channels) {
|
|
10485
|
+
throw new Error("channel and label counts mismatch: " + model);
|
|
10486
|
+
}
|
|
10487
|
+
const { channels, labels } = convert[model];
|
|
10488
|
+
delete convert[model].channels;
|
|
10489
|
+
delete convert[model].labels;
|
|
10490
|
+
Object.defineProperty(convert[model], "channels", { value: channels });
|
|
10491
|
+
Object.defineProperty(convert[model], "labels", { value: labels });
|
|
10492
|
+
}
|
|
10493
|
+
convert.rgb.hsl = function(rgb) {
|
|
10494
|
+
const r = rgb[0] / 255;
|
|
10495
|
+
const g = rgb[1] / 255;
|
|
10496
|
+
const b = rgb[2] / 255;
|
|
10497
|
+
const min = Math.min(r, g, b);
|
|
10498
|
+
const max = Math.max(r, g, b);
|
|
10499
|
+
const delta2 = max - min;
|
|
10500
|
+
let h;
|
|
10501
|
+
let s;
|
|
10502
|
+
if (max === min) {
|
|
10503
|
+
h = 0;
|
|
10504
|
+
} else if (r === max) {
|
|
10505
|
+
h = (g - b) / delta2;
|
|
10506
|
+
} else if (g === max) {
|
|
10507
|
+
h = 2 + (b - r) / delta2;
|
|
10508
|
+
} else if (b === max) {
|
|
10509
|
+
h = 4 + (r - g) / delta2;
|
|
10510
|
+
}
|
|
10511
|
+
h = Math.min(h * 60, 360);
|
|
10512
|
+
if (h < 0) {
|
|
10513
|
+
h += 360;
|
|
10514
|
+
}
|
|
10515
|
+
const l = (min + max) / 2;
|
|
10516
|
+
if (max === min) {
|
|
10517
|
+
s = 0;
|
|
10518
|
+
} else if (l <= 0.5) {
|
|
10519
|
+
s = delta2 / (max + min);
|
|
10520
|
+
} else {
|
|
10521
|
+
s = delta2 / (2 - max - min);
|
|
10522
|
+
}
|
|
10523
|
+
return [h, s * 100, l * 100];
|
|
10524
|
+
};
|
|
10525
|
+
convert.rgb.hsv = function(rgb) {
|
|
10526
|
+
let rdif;
|
|
10527
|
+
let gdif;
|
|
10528
|
+
let bdif;
|
|
10529
|
+
let h;
|
|
10530
|
+
let s;
|
|
10531
|
+
const r = rgb[0] / 255;
|
|
10532
|
+
const g = rgb[1] / 255;
|
|
10533
|
+
const b = rgb[2] / 255;
|
|
10534
|
+
const v = Math.max(r, g, b);
|
|
10535
|
+
const diff = v - Math.min(r, g, b);
|
|
10536
|
+
const diffc = function(c) {
|
|
10537
|
+
return (v - c) / 6 / diff + 1 / 2;
|
|
10538
|
+
};
|
|
10539
|
+
if (diff === 0) {
|
|
10540
|
+
h = 0;
|
|
10541
|
+
s = 0;
|
|
10542
|
+
} else {
|
|
10543
|
+
s = diff / v;
|
|
10544
|
+
rdif = diffc(r);
|
|
10545
|
+
gdif = diffc(g);
|
|
10546
|
+
bdif = diffc(b);
|
|
10547
|
+
if (r === v) {
|
|
10548
|
+
h = bdif - gdif;
|
|
10549
|
+
} else if (g === v) {
|
|
10550
|
+
h = 1 / 3 + rdif - bdif;
|
|
10551
|
+
} else if (b === v) {
|
|
10552
|
+
h = 2 / 3 + gdif - rdif;
|
|
10553
|
+
}
|
|
10554
|
+
if (h < 0) {
|
|
10555
|
+
h += 1;
|
|
10556
|
+
} else if (h > 1) {
|
|
10557
|
+
h -= 1;
|
|
10558
|
+
}
|
|
10559
|
+
}
|
|
10560
|
+
return [
|
|
10561
|
+
h * 360,
|
|
10562
|
+
s * 100,
|
|
10563
|
+
v * 100
|
|
10564
|
+
];
|
|
10565
|
+
};
|
|
10566
|
+
convert.rgb.hwb = function(rgb) {
|
|
10567
|
+
const r = rgb[0];
|
|
10568
|
+
const g = rgb[1];
|
|
10569
|
+
let b = rgb[2];
|
|
10570
|
+
const h = convert.rgb.hsl(rgb)[0];
|
|
10571
|
+
const w = 1 / 255 * Math.min(r, Math.min(g, b));
|
|
10572
|
+
b = 1 - 1 / 255 * Math.max(r, Math.max(g, b));
|
|
10573
|
+
return [h, w * 100, b * 100];
|
|
10574
|
+
};
|
|
10575
|
+
convert.rgb.cmyk = function(rgb) {
|
|
10576
|
+
const r = rgb[0] / 255;
|
|
10577
|
+
const g = rgb[1] / 255;
|
|
10578
|
+
const b = rgb[2] / 255;
|
|
10579
|
+
const k = Math.min(1 - r, 1 - g, 1 - b);
|
|
10580
|
+
const c = (1 - r - k) / (1 - k) || 0;
|
|
10581
|
+
const m = (1 - g - k) / (1 - k) || 0;
|
|
10582
|
+
const y = (1 - b - k) / (1 - k) || 0;
|
|
10583
|
+
return [c * 100, m * 100, y * 100, k * 100];
|
|
10584
|
+
};
|
|
10585
|
+
function comparativeDistance(x, y) {
|
|
10586
|
+
return (x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2 + (x[2] - y[2]) ** 2;
|
|
10587
|
+
}
|
|
10588
|
+
convert.rgb.keyword = function(rgb) {
|
|
10589
|
+
const reversed = reverseKeywords[rgb];
|
|
10590
|
+
if (reversed) {
|
|
10591
|
+
return reversed;
|
|
10592
|
+
}
|
|
10593
|
+
let currentClosestDistance = Infinity;
|
|
10594
|
+
let currentClosestKeyword;
|
|
10595
|
+
for (const keyword of Object.keys(cssKeywords)) {
|
|
10596
|
+
const value = cssKeywords[keyword];
|
|
10597
|
+
const distance = comparativeDistance(rgb, value);
|
|
10598
|
+
if (distance < currentClosestDistance) {
|
|
10599
|
+
currentClosestDistance = distance;
|
|
10600
|
+
currentClosestKeyword = keyword;
|
|
10601
|
+
}
|
|
10602
|
+
}
|
|
10603
|
+
return currentClosestKeyword;
|
|
10604
|
+
};
|
|
10605
|
+
convert.keyword.rgb = function(keyword) {
|
|
10606
|
+
return cssKeywords[keyword];
|
|
10607
|
+
};
|
|
10608
|
+
convert.rgb.xyz = function(rgb) {
|
|
10609
|
+
let r = rgb[0] / 255;
|
|
10610
|
+
let g = rgb[1] / 255;
|
|
10611
|
+
let b = rgb[2] / 255;
|
|
10612
|
+
r = r > 0.04045 ? ((r + 0.055) / 1.055) ** 2.4 : r / 12.92;
|
|
10613
|
+
g = g > 0.04045 ? ((g + 0.055) / 1.055) ** 2.4 : g / 12.92;
|
|
10614
|
+
b = b > 0.04045 ? ((b + 0.055) / 1.055) ** 2.4 : b / 12.92;
|
|
10615
|
+
const x = r * 0.4124 + g * 0.3576 + b * 0.1805;
|
|
10616
|
+
const y = r * 0.2126 + g * 0.7152 + b * 0.0722;
|
|
10617
|
+
const z = r * 0.0193 + g * 0.1192 + b * 0.9505;
|
|
10618
|
+
return [x * 100, y * 100, z * 100];
|
|
10619
|
+
};
|
|
10620
|
+
convert.rgb.lab = function(rgb) {
|
|
10621
|
+
const xyz = convert.rgb.xyz(rgb);
|
|
10622
|
+
let x = xyz[0];
|
|
10623
|
+
let y = xyz[1];
|
|
10624
|
+
let z = xyz[2];
|
|
10625
|
+
x /= 95.047;
|
|
10626
|
+
y /= 100;
|
|
10627
|
+
z /= 108.883;
|
|
10628
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
10629
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
10630
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
10631
|
+
const l = 116 * y - 16;
|
|
10632
|
+
const a = 500 * (x - y);
|
|
10633
|
+
const b = 200 * (y - z);
|
|
10634
|
+
return [l, a, b];
|
|
10635
|
+
};
|
|
10636
|
+
convert.hsl.rgb = function(hsl) {
|
|
10637
|
+
const h = hsl[0] / 360;
|
|
10638
|
+
const s = hsl[1] / 100;
|
|
10639
|
+
const l = hsl[2] / 100;
|
|
10640
|
+
let t2;
|
|
10641
|
+
let t3;
|
|
10642
|
+
let val;
|
|
10643
|
+
if (s === 0) {
|
|
10644
|
+
val = l * 255;
|
|
10645
|
+
return [val, val, val];
|
|
10646
|
+
}
|
|
10647
|
+
if (l < 0.5) {
|
|
10648
|
+
t2 = l * (1 + s);
|
|
10649
|
+
} else {
|
|
10650
|
+
t2 = l + s - l * s;
|
|
10651
|
+
}
|
|
10652
|
+
const t1 = 2 * l - t2;
|
|
10653
|
+
const rgb = [0, 0, 0];
|
|
10654
|
+
for (let i = 0; i < 3; i++) {
|
|
10655
|
+
t3 = h + 1 / 3 * -(i - 1);
|
|
10656
|
+
if (t3 < 0) {
|
|
10657
|
+
t3++;
|
|
10658
|
+
}
|
|
10659
|
+
if (t3 > 1) {
|
|
10660
|
+
t3--;
|
|
10661
|
+
}
|
|
10662
|
+
if (6 * t3 < 1) {
|
|
10663
|
+
val = t1 + (t2 - t1) * 6 * t3;
|
|
10664
|
+
} else if (2 * t3 < 1) {
|
|
10665
|
+
val = t2;
|
|
10666
|
+
} else if (3 * t3 < 2) {
|
|
10667
|
+
val = t1 + (t2 - t1) * (2 / 3 - t3) * 6;
|
|
10668
|
+
} else {
|
|
10669
|
+
val = t1;
|
|
10670
|
+
}
|
|
10671
|
+
rgb[i] = val * 255;
|
|
10672
|
+
}
|
|
10673
|
+
return rgb;
|
|
10674
|
+
};
|
|
10675
|
+
convert.hsl.hsv = function(hsl) {
|
|
10676
|
+
const h = hsl[0];
|
|
10677
|
+
let s = hsl[1] / 100;
|
|
10678
|
+
let l = hsl[2] / 100;
|
|
10679
|
+
let smin = s;
|
|
10680
|
+
const lmin = Math.max(l, 0.01);
|
|
10681
|
+
l *= 2;
|
|
10682
|
+
s *= l <= 1 ? l : 2 - l;
|
|
10683
|
+
smin *= lmin <= 1 ? lmin : 2 - lmin;
|
|
10684
|
+
const v = (l + s) / 2;
|
|
10685
|
+
const sv = l === 0 ? 2 * smin / (lmin + smin) : 2 * s / (l + s);
|
|
10686
|
+
return [h, sv * 100, v * 100];
|
|
10687
|
+
};
|
|
10688
|
+
convert.hsv.rgb = function(hsv) {
|
|
10689
|
+
const h = hsv[0] / 60;
|
|
10690
|
+
const s = hsv[1] / 100;
|
|
10691
|
+
let v = hsv[2] / 100;
|
|
10692
|
+
const hi = Math.floor(h) % 6;
|
|
10693
|
+
const f = h - Math.floor(h);
|
|
10694
|
+
const p = 255 * v * (1 - s);
|
|
10695
|
+
const q = 255 * v * (1 - s * f);
|
|
10696
|
+
const t = 255 * v * (1 - s * (1 - f));
|
|
10697
|
+
v *= 255;
|
|
10698
|
+
switch (hi) {
|
|
10699
|
+
case 0:
|
|
10700
|
+
return [v, t, p];
|
|
10701
|
+
case 1:
|
|
10702
|
+
return [q, v, p];
|
|
10703
|
+
case 2:
|
|
10704
|
+
return [p, v, t];
|
|
10705
|
+
case 3:
|
|
10706
|
+
return [p, q, v];
|
|
10707
|
+
case 4:
|
|
10708
|
+
return [t, p, v];
|
|
10709
|
+
case 5:
|
|
10710
|
+
return [v, p, q];
|
|
10711
|
+
}
|
|
10712
|
+
};
|
|
10713
|
+
convert.hsv.hsl = function(hsv) {
|
|
10714
|
+
const h = hsv[0];
|
|
10715
|
+
const s = hsv[1] / 100;
|
|
10716
|
+
const v = hsv[2] / 100;
|
|
10717
|
+
const vmin = Math.max(v, 0.01);
|
|
10718
|
+
let sl;
|
|
10719
|
+
let l;
|
|
10720
|
+
l = (2 - s) * v;
|
|
10721
|
+
const lmin = (2 - s) * vmin;
|
|
10722
|
+
sl = s * vmin;
|
|
10723
|
+
sl /= lmin <= 1 ? lmin : 2 - lmin;
|
|
10724
|
+
sl = sl || 0;
|
|
10725
|
+
l /= 2;
|
|
10726
|
+
return [h, sl * 100, l * 100];
|
|
10727
|
+
};
|
|
10728
|
+
convert.hwb.rgb = function(hwb) {
|
|
10729
|
+
const h = hwb[0] / 360;
|
|
10730
|
+
let wh = hwb[1] / 100;
|
|
10731
|
+
let bl = hwb[2] / 100;
|
|
10732
|
+
const ratio2 = wh + bl;
|
|
10733
|
+
let f;
|
|
10734
|
+
if (ratio2 > 1) {
|
|
10735
|
+
wh /= ratio2;
|
|
10736
|
+
bl /= ratio2;
|
|
10737
|
+
}
|
|
10738
|
+
const i = Math.floor(6 * h);
|
|
10739
|
+
const v = 1 - bl;
|
|
10740
|
+
f = 6 * h - i;
|
|
10741
|
+
if ((i & 1) !== 0) {
|
|
10742
|
+
f = 1 - f;
|
|
10743
|
+
}
|
|
10744
|
+
const n = wh + f * (v - wh);
|
|
10745
|
+
let r;
|
|
10746
|
+
let g;
|
|
10747
|
+
let b;
|
|
10748
|
+
switch (i) {
|
|
10749
|
+
default:
|
|
10750
|
+
case 6:
|
|
10751
|
+
case 0:
|
|
10752
|
+
r = v;
|
|
10753
|
+
g = n;
|
|
10754
|
+
b = wh;
|
|
10755
|
+
break;
|
|
10756
|
+
case 1:
|
|
10757
|
+
r = n;
|
|
10758
|
+
g = v;
|
|
10759
|
+
b = wh;
|
|
10760
|
+
break;
|
|
10761
|
+
case 2:
|
|
10762
|
+
r = wh;
|
|
10763
|
+
g = v;
|
|
10764
|
+
b = n;
|
|
10765
|
+
break;
|
|
10766
|
+
case 3:
|
|
10767
|
+
r = wh;
|
|
10768
|
+
g = n;
|
|
10769
|
+
b = v;
|
|
10770
|
+
break;
|
|
10771
|
+
case 4:
|
|
10772
|
+
r = n;
|
|
10773
|
+
g = wh;
|
|
10774
|
+
b = v;
|
|
10775
|
+
break;
|
|
10776
|
+
case 5:
|
|
10777
|
+
r = v;
|
|
10778
|
+
g = wh;
|
|
10779
|
+
b = n;
|
|
10780
|
+
break;
|
|
10781
|
+
}
|
|
10782
|
+
return [r * 255, g * 255, b * 255];
|
|
10783
|
+
};
|
|
10784
|
+
convert.cmyk.rgb = function(cmyk) {
|
|
10785
|
+
const c = cmyk[0] / 100;
|
|
10786
|
+
const m = cmyk[1] / 100;
|
|
10787
|
+
const y = cmyk[2] / 100;
|
|
10788
|
+
const k = cmyk[3] / 100;
|
|
10789
|
+
const r = 1 - Math.min(1, c * (1 - k) + k);
|
|
10790
|
+
const g = 1 - Math.min(1, m * (1 - k) + k);
|
|
10791
|
+
const b = 1 - Math.min(1, y * (1 - k) + k);
|
|
10792
|
+
return [r * 255, g * 255, b * 255];
|
|
10793
|
+
};
|
|
10794
|
+
convert.xyz.rgb = function(xyz) {
|
|
10795
|
+
const x = xyz[0] / 100;
|
|
10796
|
+
const y = xyz[1] / 100;
|
|
10797
|
+
const z = xyz[2] / 100;
|
|
10798
|
+
let r;
|
|
10799
|
+
let g;
|
|
10800
|
+
let b;
|
|
10801
|
+
r = x * 3.2406 + y * -1.5372 + z * -0.4986;
|
|
10802
|
+
g = x * -0.9689 + y * 1.8758 + z * 0.0415;
|
|
10803
|
+
b = x * 0.0557 + y * -0.204 + z * 1.057;
|
|
10804
|
+
r = r > 31308e-7 ? 1.055 * r ** (1 / 2.4) - 0.055 : r * 12.92;
|
|
10805
|
+
g = g > 31308e-7 ? 1.055 * g ** (1 / 2.4) - 0.055 : g * 12.92;
|
|
10806
|
+
b = b > 31308e-7 ? 1.055 * b ** (1 / 2.4) - 0.055 : b * 12.92;
|
|
10807
|
+
r = Math.min(Math.max(0, r), 1);
|
|
10808
|
+
g = Math.min(Math.max(0, g), 1);
|
|
10809
|
+
b = Math.min(Math.max(0, b), 1);
|
|
10810
|
+
return [r * 255, g * 255, b * 255];
|
|
10811
|
+
};
|
|
10812
|
+
convert.xyz.lab = function(xyz) {
|
|
10813
|
+
let x = xyz[0];
|
|
10814
|
+
let y = xyz[1];
|
|
10815
|
+
let z = xyz[2];
|
|
10816
|
+
x /= 95.047;
|
|
10817
|
+
y /= 100;
|
|
10818
|
+
z /= 108.883;
|
|
10819
|
+
x = x > 8856e-6 ? x ** (1 / 3) : 7.787 * x + 16 / 116;
|
|
10820
|
+
y = y > 8856e-6 ? y ** (1 / 3) : 7.787 * y + 16 / 116;
|
|
10821
|
+
z = z > 8856e-6 ? z ** (1 / 3) : 7.787 * z + 16 / 116;
|
|
10822
|
+
const l = 116 * y - 16;
|
|
10823
|
+
const a = 500 * (x - y);
|
|
10824
|
+
const b = 200 * (y - z);
|
|
10825
|
+
return [l, a, b];
|
|
10826
|
+
};
|
|
10827
|
+
convert.lab.xyz = function(lab) {
|
|
10828
|
+
const l = lab[0];
|
|
10829
|
+
const a = lab[1];
|
|
10830
|
+
const b = lab[2];
|
|
10831
|
+
let x;
|
|
10832
|
+
let y;
|
|
10833
|
+
let z;
|
|
10834
|
+
y = (l + 16) / 116;
|
|
10835
|
+
x = a / 500 + y;
|
|
10836
|
+
z = y - b / 200;
|
|
10837
|
+
const y2 = y ** 3;
|
|
10838
|
+
const x2 = x ** 3;
|
|
10839
|
+
const z2 = z ** 3;
|
|
10840
|
+
y = y2 > 8856e-6 ? y2 : (y - 16 / 116) / 7.787;
|
|
10841
|
+
x = x2 > 8856e-6 ? x2 : (x - 16 / 116) / 7.787;
|
|
10842
|
+
z = z2 > 8856e-6 ? z2 : (z - 16 / 116) / 7.787;
|
|
10843
|
+
x *= 95.047;
|
|
10844
|
+
y *= 100;
|
|
10845
|
+
z *= 108.883;
|
|
10846
|
+
return [x, y, z];
|
|
10847
|
+
};
|
|
10848
|
+
convert.lab.lch = function(lab) {
|
|
10849
|
+
const l = lab[0];
|
|
10850
|
+
const a = lab[1];
|
|
10851
|
+
const b = lab[2];
|
|
10852
|
+
let h;
|
|
10853
|
+
const hr = Math.atan2(b, a);
|
|
10854
|
+
h = hr * 360 / 2 / Math.PI;
|
|
10855
|
+
if (h < 0) {
|
|
10856
|
+
h += 360;
|
|
10857
|
+
}
|
|
10858
|
+
const c = Math.sqrt(a * a + b * b);
|
|
10859
|
+
return [l, c, h];
|
|
10860
|
+
};
|
|
10861
|
+
convert.lch.lab = function(lch) {
|
|
10862
|
+
const l = lch[0];
|
|
10863
|
+
const c = lch[1];
|
|
10864
|
+
const h = lch[2];
|
|
10865
|
+
const hr = h / 360 * 2 * Math.PI;
|
|
10866
|
+
const a = c * Math.cos(hr);
|
|
10867
|
+
const b = c * Math.sin(hr);
|
|
10868
|
+
return [l, a, b];
|
|
10869
|
+
};
|
|
10870
|
+
convert.rgb.ansi16 = function(args, saturation = null) {
|
|
10871
|
+
const [r, g, b] = args;
|
|
10872
|
+
let value = saturation === null ? convert.rgb.hsv(args)[2] : saturation;
|
|
10873
|
+
value = Math.round(value / 50);
|
|
10874
|
+
if (value === 0) {
|
|
10875
|
+
return 30;
|
|
10876
|
+
}
|
|
10877
|
+
let ansi = 30 + (Math.round(b / 255) << 2 | Math.round(g / 255) << 1 | Math.round(r / 255));
|
|
10878
|
+
if (value === 2) {
|
|
10879
|
+
ansi += 60;
|
|
10880
|
+
}
|
|
10881
|
+
return ansi;
|
|
10882
|
+
};
|
|
10883
|
+
convert.hsv.ansi16 = function(args) {
|
|
10884
|
+
return convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);
|
|
10885
|
+
};
|
|
10886
|
+
convert.rgb.ansi256 = function(args) {
|
|
10887
|
+
const r = args[0];
|
|
10888
|
+
const g = args[1];
|
|
10889
|
+
const b = args[2];
|
|
10890
|
+
if (r === g && g === b) {
|
|
10891
|
+
if (r < 8) {
|
|
10892
|
+
return 16;
|
|
10893
|
+
}
|
|
10894
|
+
if (r > 248) {
|
|
10895
|
+
return 231;
|
|
10896
|
+
}
|
|
10897
|
+
return Math.round((r - 8) / 247 * 24) + 232;
|
|
10898
|
+
}
|
|
10899
|
+
const ansi = 16 + 36 * Math.round(r / 255 * 5) + 6 * Math.round(g / 255 * 5) + Math.round(b / 255 * 5);
|
|
10900
|
+
return ansi;
|
|
10901
|
+
};
|
|
10902
|
+
convert.ansi16.rgb = function(args) {
|
|
10903
|
+
let color = args % 10;
|
|
10904
|
+
if (color === 0 || color === 7) {
|
|
10905
|
+
if (args > 50) {
|
|
10906
|
+
color += 3.5;
|
|
10907
|
+
}
|
|
10908
|
+
color = color / 10.5 * 255;
|
|
10909
|
+
return [color, color, color];
|
|
10910
|
+
}
|
|
10911
|
+
const mult = (~~(args > 50) + 1) * 0.5;
|
|
10912
|
+
const r = (color & 1) * mult * 255;
|
|
10913
|
+
const g = (color >> 1 & 1) * mult * 255;
|
|
10914
|
+
const b = (color >> 2 & 1) * mult * 255;
|
|
10915
|
+
return [r, g, b];
|
|
10916
|
+
};
|
|
10917
|
+
convert.ansi256.rgb = function(args) {
|
|
10918
|
+
if (args >= 232) {
|
|
10919
|
+
const c = (args - 232) * 10 + 8;
|
|
10920
|
+
return [c, c, c];
|
|
10921
|
+
}
|
|
10922
|
+
args -= 16;
|
|
10923
|
+
let rem;
|
|
10924
|
+
const r = Math.floor(args / 36) / 5 * 255;
|
|
10925
|
+
const g = Math.floor((rem = args % 36) / 6) / 5 * 255;
|
|
10926
|
+
const b = rem % 6 / 5 * 255;
|
|
10927
|
+
return [r, g, b];
|
|
10928
|
+
};
|
|
10929
|
+
convert.rgb.hex = function(args) {
|
|
10930
|
+
const integer = ((Math.round(args[0]) & 255) << 16) + ((Math.round(args[1]) & 255) << 8) + (Math.round(args[2]) & 255);
|
|
10931
|
+
const string = integer.toString(16).toUpperCase();
|
|
10932
|
+
return "000000".substring(string.length) + string;
|
|
10933
|
+
};
|
|
10934
|
+
convert.hex.rgb = function(args) {
|
|
10935
|
+
const match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);
|
|
10936
|
+
if (!match) {
|
|
10937
|
+
return [0, 0, 0];
|
|
10938
|
+
}
|
|
10939
|
+
let colorString = match[0];
|
|
10940
|
+
if (match[0].length === 3) {
|
|
10941
|
+
colorString = colorString.split("").map((char) => {
|
|
10942
|
+
return char + char;
|
|
10943
|
+
}).join("");
|
|
10944
|
+
}
|
|
10945
|
+
const integer = parseInt(colorString, 16);
|
|
10946
|
+
const r = integer >> 16 & 255;
|
|
10947
|
+
const g = integer >> 8 & 255;
|
|
10948
|
+
const b = integer & 255;
|
|
10949
|
+
return [r, g, b];
|
|
10950
|
+
};
|
|
10951
|
+
convert.rgb.hcg = function(rgb) {
|
|
10952
|
+
const r = rgb[0] / 255;
|
|
10953
|
+
const g = rgb[1] / 255;
|
|
10954
|
+
const b = rgb[2] / 255;
|
|
10955
|
+
const max = Math.max(Math.max(r, g), b);
|
|
10956
|
+
const min = Math.min(Math.min(r, g), b);
|
|
10957
|
+
const chroma = max - min;
|
|
10958
|
+
let grayscale;
|
|
10959
|
+
let hue;
|
|
10960
|
+
if (chroma < 1) {
|
|
10961
|
+
grayscale = min / (1 - chroma);
|
|
10962
|
+
} else {
|
|
10963
|
+
grayscale = 0;
|
|
10964
|
+
}
|
|
10965
|
+
if (chroma <= 0) {
|
|
10966
|
+
hue = 0;
|
|
10967
|
+
} else if (max === r) {
|
|
10968
|
+
hue = (g - b) / chroma % 6;
|
|
10969
|
+
} else if (max === g) {
|
|
10970
|
+
hue = 2 + (b - r) / chroma;
|
|
10971
|
+
} else {
|
|
10972
|
+
hue = 4 + (r - g) / chroma;
|
|
10973
|
+
}
|
|
10974
|
+
hue /= 6;
|
|
10975
|
+
hue %= 1;
|
|
10976
|
+
return [hue * 360, chroma * 100, grayscale * 100];
|
|
10977
|
+
};
|
|
10978
|
+
convert.hsl.hcg = function(hsl) {
|
|
10979
|
+
const s = hsl[1] / 100;
|
|
10980
|
+
const l = hsl[2] / 100;
|
|
10981
|
+
const c = l < 0.5 ? 2 * s * l : 2 * s * (1 - l);
|
|
10982
|
+
let f = 0;
|
|
10983
|
+
if (c < 1) {
|
|
10984
|
+
f = (l - 0.5 * c) / (1 - c);
|
|
10985
|
+
}
|
|
10986
|
+
return [hsl[0], c * 100, f * 100];
|
|
10987
|
+
};
|
|
10988
|
+
convert.hsv.hcg = function(hsv) {
|
|
10989
|
+
const s = hsv[1] / 100;
|
|
10990
|
+
const v = hsv[2] / 100;
|
|
10991
|
+
const c = s * v;
|
|
10992
|
+
let f = 0;
|
|
10993
|
+
if (c < 1) {
|
|
10994
|
+
f = (v - c) / (1 - c);
|
|
10995
|
+
}
|
|
10996
|
+
return [hsv[0], c * 100, f * 100];
|
|
10997
|
+
};
|
|
10998
|
+
convert.hcg.rgb = function(hcg) {
|
|
10999
|
+
const h = hcg[0] / 360;
|
|
11000
|
+
const c = hcg[1] / 100;
|
|
11001
|
+
const g = hcg[2] / 100;
|
|
11002
|
+
if (c === 0) {
|
|
11003
|
+
return [g * 255, g * 255, g * 255];
|
|
11004
|
+
}
|
|
11005
|
+
const pure = [0, 0, 0];
|
|
11006
|
+
const hi = h % 1 * 6;
|
|
11007
|
+
const v = hi % 1;
|
|
11008
|
+
const w = 1 - v;
|
|
11009
|
+
let mg = 0;
|
|
11010
|
+
switch (Math.floor(hi)) {
|
|
11011
|
+
case 0:
|
|
11012
|
+
pure[0] = 1;
|
|
11013
|
+
pure[1] = v;
|
|
11014
|
+
pure[2] = 0;
|
|
11015
|
+
break;
|
|
11016
|
+
case 1:
|
|
11017
|
+
pure[0] = w;
|
|
11018
|
+
pure[1] = 1;
|
|
11019
|
+
pure[2] = 0;
|
|
11020
|
+
break;
|
|
11021
|
+
case 2:
|
|
11022
|
+
pure[0] = 0;
|
|
11023
|
+
pure[1] = 1;
|
|
11024
|
+
pure[2] = v;
|
|
11025
|
+
break;
|
|
11026
|
+
case 3:
|
|
11027
|
+
pure[0] = 0;
|
|
11028
|
+
pure[1] = w;
|
|
11029
|
+
pure[2] = 1;
|
|
11030
|
+
break;
|
|
11031
|
+
case 4:
|
|
11032
|
+
pure[0] = v;
|
|
11033
|
+
pure[1] = 0;
|
|
11034
|
+
pure[2] = 1;
|
|
11035
|
+
break;
|
|
11036
|
+
default:
|
|
11037
|
+
pure[0] = 1;
|
|
11038
|
+
pure[1] = 0;
|
|
11039
|
+
pure[2] = w;
|
|
11040
|
+
}
|
|
11041
|
+
mg = (1 - c) * g;
|
|
11042
|
+
return [
|
|
11043
|
+
(c * pure[0] + mg) * 255,
|
|
11044
|
+
(c * pure[1] + mg) * 255,
|
|
11045
|
+
(c * pure[2] + mg) * 255
|
|
11046
|
+
];
|
|
11047
|
+
};
|
|
11048
|
+
convert.hcg.hsv = function(hcg) {
|
|
11049
|
+
const c = hcg[1] / 100;
|
|
11050
|
+
const g = hcg[2] / 100;
|
|
11051
|
+
const v = c + g * (1 - c);
|
|
11052
|
+
let f = 0;
|
|
11053
|
+
if (v > 0) {
|
|
11054
|
+
f = c / v;
|
|
11055
|
+
}
|
|
11056
|
+
return [hcg[0], f * 100, v * 100];
|
|
11057
|
+
};
|
|
11058
|
+
convert.hcg.hsl = function(hcg) {
|
|
11059
|
+
const c = hcg[1] / 100;
|
|
11060
|
+
const g = hcg[2] / 100;
|
|
11061
|
+
const l = g * (1 - c) + 0.5 * c;
|
|
11062
|
+
let s = 0;
|
|
11063
|
+
if (l > 0 && l < 0.5) {
|
|
11064
|
+
s = c / (2 * l);
|
|
11065
|
+
} else if (l >= 0.5 && l < 1) {
|
|
11066
|
+
s = c / (2 * (1 - l));
|
|
11067
|
+
}
|
|
11068
|
+
return [hcg[0], s * 100, l * 100];
|
|
11069
|
+
};
|
|
11070
|
+
convert.hcg.hwb = function(hcg) {
|
|
11071
|
+
const c = hcg[1] / 100;
|
|
11072
|
+
const g = hcg[2] / 100;
|
|
11073
|
+
const v = c + g * (1 - c);
|
|
11074
|
+
return [hcg[0], (v - c) * 100, (1 - v) * 100];
|
|
11075
|
+
};
|
|
11076
|
+
convert.hwb.hcg = function(hwb) {
|
|
11077
|
+
const w = hwb[1] / 100;
|
|
11078
|
+
const b = hwb[2] / 100;
|
|
11079
|
+
const v = 1 - b;
|
|
11080
|
+
const c = v - w;
|
|
11081
|
+
let g = 0;
|
|
11082
|
+
if (c < 1) {
|
|
11083
|
+
g = (v - c) / (1 - c);
|
|
11084
|
+
}
|
|
11085
|
+
return [hwb[0], c * 100, g * 100];
|
|
11086
|
+
};
|
|
11087
|
+
convert.apple.rgb = function(apple) {
|
|
11088
|
+
return [apple[0] / 65535 * 255, apple[1] / 65535 * 255, apple[2] / 65535 * 255];
|
|
11089
|
+
};
|
|
11090
|
+
convert.rgb.apple = function(rgb) {
|
|
11091
|
+
return [rgb[0] / 255 * 65535, rgb[1] / 255 * 65535, rgb[2] / 255 * 65535];
|
|
11092
|
+
};
|
|
11093
|
+
convert.gray.rgb = function(args) {
|
|
11094
|
+
return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
|
|
11095
|
+
};
|
|
11096
|
+
convert.gray.hsl = function(args) {
|
|
11097
|
+
return [0, 0, args[0]];
|
|
11098
|
+
};
|
|
11099
|
+
convert.gray.hsv = convert.gray.hsl;
|
|
11100
|
+
convert.gray.hwb = function(gray) {
|
|
11101
|
+
return [0, 100, gray[0]];
|
|
11102
|
+
};
|
|
11103
|
+
convert.gray.cmyk = function(gray) {
|
|
11104
|
+
return [0, 0, 0, gray[0]];
|
|
11105
|
+
};
|
|
11106
|
+
convert.gray.lab = function(gray) {
|
|
11107
|
+
return [gray[0], 0, 0];
|
|
11108
|
+
};
|
|
11109
|
+
convert.gray.hex = function(gray) {
|
|
11110
|
+
const val = Math.round(gray[0] / 100 * 255) & 255;
|
|
11111
|
+
const integer = (val << 16) + (val << 8) + val;
|
|
11112
|
+
const string = integer.toString(16).toUpperCase();
|
|
11113
|
+
return "000000".substring(string.length) + string;
|
|
11114
|
+
};
|
|
11115
|
+
convert.rgb.gray = function(rgb) {
|
|
11116
|
+
const val = (rgb[0] + rgb[1] + rgb[2]) / 3;
|
|
11117
|
+
return [val / 255 * 100];
|
|
11118
|
+
};
|
|
11119
|
+
return conversions;
|
|
11120
|
+
}
|
|
11121
|
+
var route;
|
|
11122
|
+
var hasRequiredRoute;
|
|
11123
|
+
function requireRoute() {
|
|
11124
|
+
if (hasRequiredRoute) return route;
|
|
11125
|
+
hasRequiredRoute = 1;
|
|
11126
|
+
const conversions2 = requireConversions();
|
|
11127
|
+
function buildGraph() {
|
|
11128
|
+
const graph = {};
|
|
11129
|
+
const models2 = Object.keys(conversions2);
|
|
11130
|
+
for (let len = models2.length, i = 0; i < len; i++) {
|
|
11131
|
+
graph[models2[i]] = {
|
|
11132
|
+
// http://jsperf.com/1-vs-infinity
|
|
11133
|
+
// micro-opt, but this is simple.
|
|
11134
|
+
distance: -1,
|
|
11135
|
+
parent: null
|
|
11136
|
+
};
|
|
11137
|
+
}
|
|
11138
|
+
return graph;
|
|
11139
|
+
}
|
|
11140
|
+
function deriveBFS(fromModel) {
|
|
11141
|
+
const graph = buildGraph();
|
|
11142
|
+
const queue = [fromModel];
|
|
11143
|
+
graph[fromModel].distance = 0;
|
|
11144
|
+
while (queue.length) {
|
|
11145
|
+
const current = queue.pop();
|
|
11146
|
+
const adjacents = Object.keys(conversions2[current]);
|
|
11147
|
+
for (let len = adjacents.length, i = 0; i < len; i++) {
|
|
11148
|
+
const adjacent = adjacents[i];
|
|
11149
|
+
const node = graph[adjacent];
|
|
11150
|
+
if (node.distance === -1) {
|
|
11151
|
+
node.distance = graph[current].distance + 1;
|
|
11152
|
+
node.parent = current;
|
|
11153
|
+
queue.unshift(adjacent);
|
|
11154
|
+
}
|
|
11155
|
+
}
|
|
11156
|
+
}
|
|
11157
|
+
return graph;
|
|
11158
|
+
}
|
|
11159
|
+
function link(from, to) {
|
|
11160
|
+
return function(args) {
|
|
11161
|
+
return to(from(args));
|
|
11162
|
+
};
|
|
11163
|
+
}
|
|
11164
|
+
function wrapConversion(toModel, graph) {
|
|
11165
|
+
const path2 = [graph[toModel].parent, toModel];
|
|
11166
|
+
let fn = conversions2[graph[toModel].parent][toModel];
|
|
11167
|
+
let cur = graph[toModel].parent;
|
|
11168
|
+
while (graph[cur].parent) {
|
|
11169
|
+
path2.unshift(graph[cur].parent);
|
|
11170
|
+
fn = link(conversions2[graph[cur].parent][cur], fn);
|
|
11171
|
+
cur = graph[cur].parent;
|
|
11172
|
+
}
|
|
11173
|
+
fn.conversion = path2;
|
|
11174
|
+
return fn;
|
|
11175
|
+
}
|
|
11176
|
+
route = function(fromModel) {
|
|
11177
|
+
const graph = deriveBFS(fromModel);
|
|
11178
|
+
const conversion = {};
|
|
11179
|
+
const models2 = Object.keys(graph);
|
|
11180
|
+
for (let len = models2.length, i = 0; i < len; i++) {
|
|
11181
|
+
const toModel = models2[i];
|
|
11182
|
+
const node = graph[toModel];
|
|
11183
|
+
if (node.parent === null) {
|
|
11184
|
+
continue;
|
|
11185
|
+
}
|
|
11186
|
+
conversion[toModel] = wrapConversion(toModel, graph);
|
|
11187
|
+
}
|
|
11188
|
+
return conversion;
|
|
11189
|
+
};
|
|
11190
|
+
return route;
|
|
11191
|
+
}
|
|
11192
|
+
var colorConvert;
|
|
11193
|
+
var hasRequiredColorConvert;
|
|
11194
|
+
function requireColorConvert() {
|
|
11195
|
+
if (hasRequiredColorConvert) return colorConvert;
|
|
11196
|
+
hasRequiredColorConvert = 1;
|
|
11197
|
+
const conversions2 = requireConversions();
|
|
11198
|
+
const route2 = requireRoute();
|
|
11199
|
+
const convert = {};
|
|
11200
|
+
const models2 = Object.keys(conversions2);
|
|
11201
|
+
function wrapRaw(fn) {
|
|
11202
|
+
const wrappedFn = function(...args) {
|
|
11203
|
+
const arg0 = args[0];
|
|
11204
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
11205
|
+
return arg0;
|
|
11206
|
+
}
|
|
11207
|
+
if (arg0.length > 1) {
|
|
11208
|
+
args = arg0;
|
|
11209
|
+
}
|
|
11210
|
+
return fn(args);
|
|
11211
|
+
};
|
|
11212
|
+
if ("conversion" in fn) {
|
|
11213
|
+
wrappedFn.conversion = fn.conversion;
|
|
11214
|
+
}
|
|
11215
|
+
return wrappedFn;
|
|
11216
|
+
}
|
|
11217
|
+
function wrapRounded(fn) {
|
|
11218
|
+
const wrappedFn = function(...args) {
|
|
11219
|
+
const arg0 = args[0];
|
|
11220
|
+
if (arg0 === void 0 || arg0 === null) {
|
|
11221
|
+
return arg0;
|
|
11222
|
+
}
|
|
11223
|
+
if (arg0.length > 1) {
|
|
11224
|
+
args = arg0;
|
|
11225
|
+
}
|
|
11226
|
+
const result = fn(args);
|
|
11227
|
+
if (typeof result === "object") {
|
|
11228
|
+
for (let len = result.length, i = 0; i < len; i++) {
|
|
11229
|
+
result[i] = Math.round(result[i]);
|
|
11230
|
+
}
|
|
11231
|
+
}
|
|
11232
|
+
return result;
|
|
11233
|
+
};
|
|
11234
|
+
if ("conversion" in fn) {
|
|
11235
|
+
wrappedFn.conversion = fn.conversion;
|
|
11236
|
+
}
|
|
11237
|
+
return wrappedFn;
|
|
11238
|
+
}
|
|
11239
|
+
models2.forEach((fromModel) => {
|
|
11240
|
+
convert[fromModel] = {};
|
|
11241
|
+
Object.defineProperty(convert[fromModel], "channels", { value: conversions2[fromModel].channels });
|
|
11242
|
+
Object.defineProperty(convert[fromModel], "labels", { value: conversions2[fromModel].labels });
|
|
11243
|
+
const routes = route2(fromModel);
|
|
11244
|
+
const routeModels = Object.keys(routes);
|
|
11245
|
+
routeModels.forEach((toModel) => {
|
|
11246
|
+
const fn = routes[toModel];
|
|
11247
|
+
convert[fromModel][toModel] = wrapRounded(fn);
|
|
11248
|
+
convert[fromModel][toModel].raw = wrapRaw(fn);
|
|
11249
|
+
});
|
|
11250
|
+
});
|
|
11251
|
+
colorConvert = convert;
|
|
11252
|
+
return colorConvert;
|
|
11253
|
+
}
|
|
11254
|
+
ansiStyles$1.exports;
|
|
11255
|
+
(function(module) {
|
|
11256
|
+
const wrapAnsi16 = (fn, offset) => (...args) => {
|
|
11257
|
+
const code = fn(...args);
|
|
11258
|
+
return `\x1B[${code + offset}m`;
|
|
11259
|
+
};
|
|
11260
|
+
const wrapAnsi256 = (fn, offset) => (...args) => {
|
|
11261
|
+
const code = fn(...args);
|
|
11262
|
+
return `\x1B[${38 + offset};5;${code}m`;
|
|
11263
|
+
};
|
|
11264
|
+
const wrapAnsi16m = (fn, offset) => (...args) => {
|
|
11265
|
+
const rgb = fn(...args);
|
|
11266
|
+
return `\x1B[${38 + offset};2;${rgb[0]};${rgb[1]};${rgb[2]}m`;
|
|
11267
|
+
};
|
|
11268
|
+
const ansi2ansi = (n) => n;
|
|
11269
|
+
const rgb2rgb = (r, g, b) => [r, g, b];
|
|
11270
|
+
const setLazyProperty = (object, property, get) => {
|
|
11271
|
+
Object.defineProperty(object, property, {
|
|
11272
|
+
get: () => {
|
|
11273
|
+
const value = get();
|
|
11274
|
+
Object.defineProperty(object, property, {
|
|
11275
|
+
value,
|
|
11276
|
+
enumerable: true,
|
|
11277
|
+
configurable: true
|
|
11278
|
+
});
|
|
11279
|
+
return value;
|
|
11280
|
+
},
|
|
11281
|
+
enumerable: true,
|
|
11282
|
+
configurable: true
|
|
11283
|
+
});
|
|
11284
|
+
};
|
|
11285
|
+
let colorConvert2;
|
|
11286
|
+
const makeDynamicStyles = (wrap, targetSpace, identity, isBackground) => {
|
|
11287
|
+
if (colorConvert2 === void 0) {
|
|
11288
|
+
colorConvert2 = requireColorConvert();
|
|
11289
|
+
}
|
|
11290
|
+
const offset = isBackground ? 10 : 0;
|
|
11291
|
+
const styles2 = {};
|
|
11292
|
+
for (const [sourceSpace, suite] of Object.entries(colorConvert2)) {
|
|
11293
|
+
const name2 = sourceSpace === "ansi16" ? "ansi" : sourceSpace;
|
|
11294
|
+
if (sourceSpace === targetSpace) {
|
|
11295
|
+
styles2[name2] = wrap(identity, offset);
|
|
11296
|
+
} else if (typeof suite === "object") {
|
|
11297
|
+
styles2[name2] = wrap(suite[targetSpace], offset);
|
|
11298
|
+
}
|
|
11299
|
+
}
|
|
11300
|
+
return styles2;
|
|
11301
|
+
};
|
|
11302
|
+
function assembleStyles() {
|
|
11303
|
+
const codes = /* @__PURE__ */ new Map();
|
|
11304
|
+
const styles2 = {
|
|
11305
|
+
modifier: {
|
|
11306
|
+
reset: [0, 0],
|
|
11307
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
11308
|
+
bold: [1, 22],
|
|
11309
|
+
dim: [2, 22],
|
|
11310
|
+
italic: [3, 23],
|
|
11311
|
+
underline: [4, 24],
|
|
11312
|
+
inverse: [7, 27],
|
|
11313
|
+
hidden: [8, 28],
|
|
11314
|
+
strikethrough: [9, 29]
|
|
11315
|
+
},
|
|
11316
|
+
color: {
|
|
11317
|
+
black: [30, 39],
|
|
11318
|
+
red: [31, 39],
|
|
11319
|
+
green: [32, 39],
|
|
11320
|
+
yellow: [33, 39],
|
|
11321
|
+
blue: [34, 39],
|
|
11322
|
+
magenta: [35, 39],
|
|
11323
|
+
cyan: [36, 39],
|
|
11324
|
+
white: [37, 39],
|
|
11325
|
+
// Bright color
|
|
11326
|
+
blackBright: [90, 39],
|
|
11327
|
+
redBright: [91, 39],
|
|
11328
|
+
greenBright: [92, 39],
|
|
11329
|
+
yellowBright: [93, 39],
|
|
11330
|
+
blueBright: [94, 39],
|
|
11331
|
+
magentaBright: [95, 39],
|
|
11332
|
+
cyanBright: [96, 39],
|
|
11333
|
+
whiteBright: [97, 39]
|
|
11334
|
+
},
|
|
11335
|
+
bgColor: {
|
|
11336
|
+
bgBlack: [40, 49],
|
|
11337
|
+
bgRed: [41, 49],
|
|
11338
|
+
bgGreen: [42, 49],
|
|
11339
|
+
bgYellow: [43, 49],
|
|
11340
|
+
bgBlue: [44, 49],
|
|
11341
|
+
bgMagenta: [45, 49],
|
|
11342
|
+
bgCyan: [46, 49],
|
|
11343
|
+
bgWhite: [47, 49],
|
|
11344
|
+
// Bright color
|
|
11345
|
+
bgBlackBright: [100, 49],
|
|
11346
|
+
bgRedBright: [101, 49],
|
|
11347
|
+
bgGreenBright: [102, 49],
|
|
11348
|
+
bgYellowBright: [103, 49],
|
|
11349
|
+
bgBlueBright: [104, 49],
|
|
11350
|
+
bgMagentaBright: [105, 49],
|
|
11351
|
+
bgCyanBright: [106, 49],
|
|
11352
|
+
bgWhiteBright: [107, 49]
|
|
11353
|
+
}
|
|
11354
|
+
};
|
|
11355
|
+
styles2.color.gray = styles2.color.blackBright;
|
|
11356
|
+
styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
|
|
11357
|
+
styles2.color.grey = styles2.color.blackBright;
|
|
11358
|
+
styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
|
|
11359
|
+
for (const [groupName, group] of Object.entries(styles2)) {
|
|
11360
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
11361
|
+
styles2[styleName] = {
|
|
11362
|
+
open: `\x1B[${style[0]}m`,
|
|
11363
|
+
close: `\x1B[${style[1]}m`
|
|
11364
|
+
};
|
|
11365
|
+
group[styleName] = styles2[styleName];
|
|
11366
|
+
codes.set(style[0], style[1]);
|
|
11367
|
+
}
|
|
11368
|
+
Object.defineProperty(styles2, groupName, {
|
|
11369
|
+
value: group,
|
|
11370
|
+
enumerable: false
|
|
11371
|
+
});
|
|
11372
|
+
}
|
|
11373
|
+
Object.defineProperty(styles2, "codes", {
|
|
11374
|
+
value: codes,
|
|
11375
|
+
enumerable: false
|
|
11376
|
+
});
|
|
11377
|
+
styles2.color.close = "\x1B[39m";
|
|
11378
|
+
styles2.bgColor.close = "\x1B[49m";
|
|
11379
|
+
setLazyProperty(styles2.color, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, false));
|
|
11380
|
+
setLazyProperty(styles2.color, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, false));
|
|
11381
|
+
setLazyProperty(styles2.color, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, false));
|
|
11382
|
+
setLazyProperty(styles2.bgColor, "ansi", () => makeDynamicStyles(wrapAnsi16, "ansi16", ansi2ansi, true));
|
|
11383
|
+
setLazyProperty(styles2.bgColor, "ansi256", () => makeDynamicStyles(wrapAnsi256, "ansi256", ansi2ansi, true));
|
|
11384
|
+
setLazyProperty(styles2.bgColor, "ansi16m", () => makeDynamicStyles(wrapAnsi16m, "rgb", rgb2rgb, true));
|
|
11385
|
+
return styles2;
|
|
11386
|
+
}
|
|
11387
|
+
Object.defineProperty(module, "exports", {
|
|
11388
|
+
enumerable: true,
|
|
11389
|
+
get: assembleStyles
|
|
11390
|
+
});
|
|
11391
|
+
})(ansiStyles$1);
|
|
11392
|
+
var ansiStylesExports = ansiStyles$1.exports;
|
|
11393
|
+
var browser = {
|
|
11394
|
+
stdout: false,
|
|
11395
|
+
stderr: false
|
|
11396
|
+
};
|
|
11397
|
+
const stringReplaceAll$1 = (string, substring, replacer) => {
|
|
11398
|
+
let index = string.indexOf(substring);
|
|
11399
|
+
if (index === -1) {
|
|
11400
|
+
return string;
|
|
11401
|
+
}
|
|
11402
|
+
const substringLength = substring.length;
|
|
11403
|
+
let endIndex = 0;
|
|
11404
|
+
let returnValue = "";
|
|
11405
|
+
do {
|
|
11406
|
+
returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
|
|
11407
|
+
endIndex = index + substringLength;
|
|
11408
|
+
index = string.indexOf(substring, endIndex);
|
|
11409
|
+
} while (index !== -1);
|
|
11410
|
+
returnValue += string.substr(endIndex);
|
|
11411
|
+
return returnValue;
|
|
11412
|
+
};
|
|
11413
|
+
const stringEncaseCRLFWithFirstIndex$1 = (string, prefix, postfix, index) => {
|
|
11414
|
+
let endIndex = 0;
|
|
11415
|
+
let returnValue = "";
|
|
11416
|
+
do {
|
|
11417
|
+
const gotCR = string[index - 1] === "\r";
|
|
11418
|
+
returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
11419
|
+
endIndex = index + 1;
|
|
11420
|
+
index = string.indexOf("\n", endIndex);
|
|
11421
|
+
} while (index !== -1);
|
|
11422
|
+
returnValue += string.substr(endIndex);
|
|
11423
|
+
return returnValue;
|
|
11424
|
+
};
|
|
11425
|
+
var util = {
|
|
11426
|
+
stringReplaceAll: stringReplaceAll$1,
|
|
11427
|
+
stringEncaseCRLFWithFirstIndex: stringEncaseCRLFWithFirstIndex$1
|
|
11428
|
+
};
|
|
11429
|
+
var templates;
|
|
11430
|
+
var hasRequiredTemplates;
|
|
11431
|
+
function requireTemplates() {
|
|
11432
|
+
if (hasRequiredTemplates) return templates;
|
|
11433
|
+
hasRequiredTemplates = 1;
|
|
11434
|
+
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;
|
|
11435
|
+
const STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
11436
|
+
const STRING_REGEX = /^(['"])((?:\\.|(?!\1)[^\\])*)\1$/;
|
|
11437
|
+
const ESCAPE_REGEX = /\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi;
|
|
11438
|
+
const ESCAPES = /* @__PURE__ */ new Map([
|
|
11439
|
+
["n", "\n"],
|
|
11440
|
+
["r", "\r"],
|
|
11441
|
+
["t", " "],
|
|
11442
|
+
["b", "\b"],
|
|
11443
|
+
["f", "\f"],
|
|
11444
|
+
["v", "\v"],
|
|
11445
|
+
["0", "\0"],
|
|
11446
|
+
["\\", "\\"],
|
|
11447
|
+
["e", "\x1B"],
|
|
11448
|
+
["a", "\x07"]
|
|
11449
|
+
]);
|
|
11450
|
+
function unescape(c) {
|
|
11451
|
+
const u = c[0] === "u";
|
|
11452
|
+
const bracket = c[1] === "{";
|
|
11453
|
+
if (u && !bracket && c.length === 5 || c[0] === "x" && c.length === 3) {
|
|
11454
|
+
return String.fromCharCode(parseInt(c.slice(1), 16));
|
|
11455
|
+
}
|
|
11456
|
+
if (u && bracket) {
|
|
11457
|
+
return String.fromCodePoint(parseInt(c.slice(2, -1), 16));
|
|
11458
|
+
}
|
|
11459
|
+
return ESCAPES.get(c) || c;
|
|
11460
|
+
}
|
|
11461
|
+
function parseArguments(name2, arguments_) {
|
|
11462
|
+
const results = [];
|
|
11463
|
+
const chunks = arguments_.trim().split(/\s*,\s*/g);
|
|
11464
|
+
let matches;
|
|
11465
|
+
for (const chunk of chunks) {
|
|
11466
|
+
const number = Number(chunk);
|
|
11467
|
+
if (!Number.isNaN(number)) {
|
|
11468
|
+
results.push(number);
|
|
11469
|
+
} else if (matches = chunk.match(STRING_REGEX)) {
|
|
11470
|
+
results.push(matches[2].replace(ESCAPE_REGEX, (m, escape2, character) => escape2 ? unescape(escape2) : character));
|
|
11471
|
+
} else {
|
|
11472
|
+
throw new Error(`Invalid Chalk template style argument: ${chunk} (in style '${name2}')`);
|
|
11473
|
+
}
|
|
11474
|
+
}
|
|
11475
|
+
return results;
|
|
11476
|
+
}
|
|
11477
|
+
function parseStyle(style) {
|
|
11478
|
+
STYLE_REGEX.lastIndex = 0;
|
|
11479
|
+
const results = [];
|
|
11480
|
+
let matches;
|
|
11481
|
+
while ((matches = STYLE_REGEX.exec(style)) !== null) {
|
|
11482
|
+
const name2 = matches[1];
|
|
11483
|
+
if (matches[2]) {
|
|
11484
|
+
const args = parseArguments(name2, matches[2]);
|
|
11485
|
+
results.push([name2].concat(args));
|
|
11486
|
+
} else {
|
|
11487
|
+
results.push([name2]);
|
|
11488
|
+
}
|
|
11489
|
+
}
|
|
11490
|
+
return results;
|
|
11491
|
+
}
|
|
11492
|
+
function buildStyle(chalk2, styles2) {
|
|
11493
|
+
const enabled = {};
|
|
11494
|
+
for (const layer of styles2) {
|
|
11495
|
+
for (const style of layer.styles) {
|
|
11496
|
+
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
11497
|
+
}
|
|
11498
|
+
}
|
|
11499
|
+
let current = chalk2;
|
|
11500
|
+
for (const [styleName, styles3] of Object.entries(enabled)) {
|
|
11501
|
+
if (!Array.isArray(styles3)) {
|
|
11502
|
+
continue;
|
|
11503
|
+
}
|
|
11504
|
+
if (!(styleName in current)) {
|
|
11505
|
+
throw new Error(`Unknown Chalk style: ${styleName}`);
|
|
11506
|
+
}
|
|
11507
|
+
current = styles3.length > 0 ? current[styleName](...styles3) : current[styleName];
|
|
11508
|
+
}
|
|
11509
|
+
return current;
|
|
11510
|
+
}
|
|
11511
|
+
templates = (chalk2, temporary) => {
|
|
11512
|
+
const styles2 = [];
|
|
11513
|
+
const chunks = [];
|
|
11514
|
+
let chunk = [];
|
|
11515
|
+
temporary.replace(TEMPLATE_REGEX, (m, escapeCharacter, inverse, style, close, character) => {
|
|
11516
|
+
if (escapeCharacter) {
|
|
11517
|
+
chunk.push(unescape(escapeCharacter));
|
|
11518
|
+
} else if (style) {
|
|
11519
|
+
const string = chunk.join("");
|
|
11520
|
+
chunk = [];
|
|
11521
|
+
chunks.push(styles2.length === 0 ? string : buildStyle(chalk2, styles2)(string));
|
|
11522
|
+
styles2.push({ inverse, styles: parseStyle(style) });
|
|
11523
|
+
} else if (close) {
|
|
11524
|
+
if (styles2.length === 0) {
|
|
11525
|
+
throw new Error("Found extraneous } in Chalk template literal");
|
|
11526
|
+
}
|
|
11527
|
+
chunks.push(buildStyle(chalk2, styles2)(chunk.join("")));
|
|
11528
|
+
chunk = [];
|
|
11529
|
+
styles2.pop();
|
|
11530
|
+
} else {
|
|
11531
|
+
chunk.push(character);
|
|
11532
|
+
}
|
|
11533
|
+
});
|
|
11534
|
+
chunks.push(chunk.join(""));
|
|
11535
|
+
if (styles2.length > 0) {
|
|
11536
|
+
const errMessage = `Chalk template literal is missing ${styles2.length} closing bracket${styles2.length === 1 ? "" : "s"} (\`}\`)`;
|
|
11537
|
+
throw new Error(errMessage);
|
|
11538
|
+
}
|
|
11539
|
+
return chunks.join("");
|
|
11540
|
+
};
|
|
11541
|
+
return templates;
|
|
11542
|
+
}
|
|
11543
|
+
const ansiStyles = ansiStylesExports;
|
|
11544
|
+
const { stdout: stdoutColor, stderr: stderrColor } = browser;
|
|
11545
|
+
const {
|
|
11546
|
+
stringReplaceAll,
|
|
11547
|
+
stringEncaseCRLFWithFirstIndex
|
|
11548
|
+
} = util;
|
|
11549
|
+
const { isArray } = Array;
|
|
11550
|
+
const levelMapping = [
|
|
11551
|
+
"ansi",
|
|
11552
|
+
"ansi",
|
|
11553
|
+
"ansi256",
|
|
11554
|
+
"ansi16m"
|
|
11555
|
+
];
|
|
11556
|
+
const styles = /* @__PURE__ */ Object.create(null);
|
|
11557
|
+
const applyOptions = (object, options = {}) => {
|
|
11558
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
11559
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
11560
|
+
}
|
|
11561
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
11562
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
11563
|
+
};
|
|
11564
|
+
class ChalkClass2 {
|
|
11565
|
+
constructor(options) {
|
|
11566
|
+
return chalkFactory(options);
|
|
11567
|
+
}
|
|
11568
|
+
}
|
|
11569
|
+
const chalkFactory = (options) => {
|
|
11570
|
+
const chalk2 = {};
|
|
11571
|
+
applyOptions(chalk2, options);
|
|
11572
|
+
chalk2.template = (...arguments_) => chalkTag(chalk2.template, ...arguments_);
|
|
11573
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
11574
|
+
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
11575
|
+
chalk2.template.constructor = () => {
|
|
11576
|
+
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
11577
|
+
};
|
|
11578
|
+
chalk2.template.Instance = ChalkClass2;
|
|
11579
|
+
return chalk2.template;
|
|
11580
|
+
};
|
|
11581
|
+
function Chalk(options) {
|
|
11582
|
+
return chalkFactory(options);
|
|
11583
|
+
}
|
|
11584
|
+
for (const [styleName, style] of Object.entries(ansiStyles)) {
|
|
11585
|
+
styles[styleName] = {
|
|
11586
|
+
get() {
|
|
11587
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this._styler), this._isEmpty);
|
|
11588
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
11589
|
+
return builder;
|
|
11590
|
+
}
|
|
11591
|
+
};
|
|
11592
|
+
}
|
|
11593
|
+
styles.visible = {
|
|
11594
|
+
get() {
|
|
11595
|
+
const builder = createBuilder(this, this._styler, true);
|
|
11596
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
11597
|
+
return builder;
|
|
11598
|
+
}
|
|
11599
|
+
};
|
|
11600
|
+
const usedModels = ["rgb", "hex", "keyword", "hsl", "hsv", "hwb", "ansi", "ansi256"];
|
|
11601
|
+
for (const model of usedModels) {
|
|
11602
|
+
styles[model] = {
|
|
11603
|
+
get() {
|
|
11604
|
+
const { level } = this;
|
|
11605
|
+
return function(...arguments_) {
|
|
11606
|
+
const styler = createStyler(ansiStyles.color[levelMapping[level]][model](...arguments_), ansiStyles.color.close, this._styler);
|
|
11607
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
11608
|
+
};
|
|
11609
|
+
}
|
|
11610
|
+
};
|
|
11611
|
+
}
|
|
11612
|
+
for (const model of usedModels) {
|
|
11613
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
11614
|
+
styles[bgModel] = {
|
|
11615
|
+
get() {
|
|
11616
|
+
const { level } = this;
|
|
11617
|
+
return function(...arguments_) {
|
|
11618
|
+
const styler = createStyler(ansiStyles.bgColor[levelMapping[level]][model](...arguments_), ansiStyles.bgColor.close, this._styler);
|
|
11619
|
+
return createBuilder(this, styler, this._isEmpty);
|
|
11620
|
+
};
|
|
11621
|
+
}
|
|
11622
|
+
};
|
|
11623
|
+
}
|
|
11624
|
+
const proto = Object.defineProperties(() => {
|
|
11625
|
+
}, {
|
|
11626
|
+
...styles,
|
|
11627
|
+
level: {
|
|
11628
|
+
enumerable: true,
|
|
11629
|
+
get() {
|
|
11630
|
+
return this._generator.level;
|
|
11631
|
+
},
|
|
11632
|
+
set(level) {
|
|
11633
|
+
this._generator.level = level;
|
|
11634
|
+
}
|
|
11635
|
+
}
|
|
11636
|
+
});
|
|
11637
|
+
const createStyler = (open, close, parent) => {
|
|
11638
|
+
let openAll;
|
|
11639
|
+
let closeAll;
|
|
11640
|
+
if (parent === void 0) {
|
|
11641
|
+
openAll = open;
|
|
11642
|
+
closeAll = close;
|
|
11643
|
+
} else {
|
|
11644
|
+
openAll = parent.openAll + open;
|
|
11645
|
+
closeAll = close + parent.closeAll;
|
|
11646
|
+
}
|
|
11647
|
+
return {
|
|
11648
|
+
open,
|
|
11649
|
+
close,
|
|
11650
|
+
openAll,
|
|
11651
|
+
closeAll,
|
|
11652
|
+
parent
|
|
11653
|
+
};
|
|
11654
|
+
};
|
|
11655
|
+
const createBuilder = (self2, _styler, _isEmpty) => {
|
|
11656
|
+
const builder = (...arguments_) => {
|
|
11657
|
+
if (isArray(arguments_[0]) && isArray(arguments_[0].raw)) {
|
|
11658
|
+
return applyStyle(builder, chalkTag(builder, ...arguments_));
|
|
11659
|
+
}
|
|
11660
|
+
return applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
11661
|
+
};
|
|
11662
|
+
Object.setPrototypeOf(builder, proto);
|
|
11663
|
+
builder._generator = self2;
|
|
11664
|
+
builder._styler = _styler;
|
|
11665
|
+
builder._isEmpty = _isEmpty;
|
|
11666
|
+
return builder;
|
|
11667
|
+
};
|
|
11668
|
+
const applyStyle = (self2, string) => {
|
|
11669
|
+
if (self2.level <= 0 || !string) {
|
|
11670
|
+
return self2._isEmpty ? "" : string;
|
|
11671
|
+
}
|
|
11672
|
+
let styler = self2._styler;
|
|
11673
|
+
if (styler === void 0) {
|
|
11674
|
+
return string;
|
|
11675
|
+
}
|
|
11676
|
+
const { openAll, closeAll } = styler;
|
|
11677
|
+
if (string.indexOf("\x1B") !== -1) {
|
|
11678
|
+
while (styler !== void 0) {
|
|
11679
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
11680
|
+
styler = styler.parent;
|
|
11681
|
+
}
|
|
11682
|
+
}
|
|
11683
|
+
const lfIndex = string.indexOf("\n");
|
|
11684
|
+
if (lfIndex !== -1) {
|
|
11685
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
11686
|
+
}
|
|
11687
|
+
return openAll + string + closeAll;
|
|
11688
|
+
};
|
|
11689
|
+
let template;
|
|
11690
|
+
const chalkTag = (chalk2, ...strings) => {
|
|
11691
|
+
const [firstString] = strings;
|
|
11692
|
+
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
11693
|
+
return strings.join(" ");
|
|
11694
|
+
}
|
|
11695
|
+
const arguments_ = strings.slice(1);
|
|
11696
|
+
const parts = [firstString.raw[0]];
|
|
11697
|
+
for (let i = 1; i < firstString.length; i++) {
|
|
11698
|
+
parts.push(
|
|
11699
|
+
String(arguments_[i - 1]).replace(/[{}\\]/g, "\\$&"),
|
|
11700
|
+
String(firstString.raw[i])
|
|
11701
|
+
);
|
|
11702
|
+
}
|
|
11703
|
+
if (template === void 0) {
|
|
11704
|
+
template = requireTemplates();
|
|
11705
|
+
}
|
|
11706
|
+
return template(chalk2, parts.join(""));
|
|
11707
|
+
};
|
|
11708
|
+
Object.defineProperties(Chalk.prototype, styles);
|
|
11709
|
+
const chalk = Chalk();
|
|
11710
|
+
chalk.supportsColor = stdoutColor;
|
|
11711
|
+
chalk.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
11712
|
+
chalk.stderr.supportsColor = stderrColor;
|
|
11713
|
+
const { accessSync, constants, readFileSync } = fs$1;
|
|
11714
|
+
const envOptions = {};
|
|
11715
|
+
function SetupConfig(envOptions2, logger) {
|
|
11716
|
+
const envfile = process.env.STSENVFILE === void 0 ? "/.env" : process.env.STSENVFILE;
|
|
11717
|
+
config_1({ path: envfile });
|
|
11718
|
+
const defconfig = {
|
|
11719
|
+
// Node runtime environment
|
|
11720
|
+
isProduction: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "production" ? true : false,
|
|
11721
|
+
isTest: process.env.NODE_ENV === void 0 ? false : process.env.NODE_ENV === "test" ? true : false,
|
|
11722
|
+
dbuser: process.env.DB_USER === void 0 ? "postgres" : process.env.DB_USER,
|
|
11723
|
+
dbpassword: process.env.DB_PASSWORD === void 0 ? "postgres" : process.env.DB_PASSWORD,
|
|
11724
|
+
dbpasswordfile: process.env.DB_PASSWORD_FILE,
|
|
11725
|
+
dbhost: process.env.DB_HOST === void 0 ? "localhost:5432" : process.env.DB_HOST,
|
|
11726
|
+
database: process.env.DB_DATABASE === void 0 ? "stsrestmsdb01" : process.env.DB_DATABASE,
|
|
11727
|
+
databaseUrl: process.env.DATABASE_URL,
|
|
11728
|
+
connectionString: "",
|
|
11729
|
+
defaultDatabaseConnectionString: "",
|
|
11730
|
+
STSServerType: process.env.STS_SERVER_TYPE === void 0 ? "EXPRESS_TLS" : process.env.STS_SERVER_TYPE,
|
|
11731
|
+
logToFile: process.env.LOG_TO_FILE === void 0 ? false : process.env.LOG_TO_FILE === "true" ? true : false,
|
|
11732
|
+
logFilePath: process.env.LOG_FILE_PATH === void 0 ? "/var/lib/sts" : process.env.LOG_FILE_PATH,
|
|
11733
|
+
logFileFormat: process.env.LOG_FILE_FORMAT === void 0 ? "csv" : process.env.LOG_FILE_FORMAT,
|
|
11734
|
+
poolSize: process.env.POOL_SIZE === void 0 ? 500 : parseInt(process.env.POOL_SIZE),
|
|
11735
|
+
useCPUs: process.env.MAX_CPU === void 0 ? -1 : parseFloat(process.env.MAX_CPU),
|
|
11736
|
+
respawnOnFail: process.env.RESPAWN === void 0 ? true : process.env.RESPAWN === "true" ? true : false,
|
|
11737
|
+
defaultDatabaseEntries: process.env.DEFAULT_DB_ENTRIES === void 0 ? 1e4 : parseInt(process.env.DEFAULT_DB_ENTRIES),
|
|
11738
|
+
useRedisDatabaseCache: process.env.USE_REDIS_DATABASE_CACHE === void 0 ? false : process.env.USE_REDIS_DATABASE_CACHE === "true" ? true : false,
|
|
11739
|
+
useSocketIoRedisAdaptor: process.env.USE_SOCKET_IO_REDIS_ADAPTOR === void 0 ? false : process.env.USE_SOCKET_IO_REDIS_ADAPTOR === "true" ? true : false,
|
|
11740
|
+
socketIoRedisAdaptorUrl: process.env.SOCKET_IO_REDIS_ADAPTOR_URL === void 0 ? "redis://localhost:6379" : process.env.SOCKET_IO_REDIS_ADAPTOR_URL,
|
|
11741
|
+
useRedisInstrumentationTransport: process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === void 0 ? false : process.env.USE_REDIS_INSTRUMENTATION_TRANSPORT === "true" ? true : false,
|
|
11742
|
+
redisInstrumentationTransportUrl: process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_INSTRUMENTATION_TRANSPORT_URL,
|
|
11743
|
+
redisDatabaseCacheEndFlush: process.env.REDIS_DATABASE_CACHE_END_FLUSH === void 0 ? false : process.env.REDIS_DATABASE_CACHE_END_FLUSH === "true" ? true : false,
|
|
11744
|
+
redisDatabaseCacheUrl: process.env.REDIS_DATABASE_CACHE_URL === void 0 ? "redis://localhost:6379" : process.env.REDIS_DATABASE_CACHE_URL,
|
|
11745
|
+
defaultDatabaseMinExtraDataSize: process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE === void 0 ? 0 : parseInt(process.env.DEFAULT_DATABASE_MIN_EXTRA_DATA_SIZE),
|
|
11746
|
+
defaultDatabaseMaxExtraDataSize: process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE === void 0 ? 2e3 : parseInt(process.env.DEFAULT_DATABASE_MAX_EXTRA_DATA_SIZE),
|
|
11747
|
+
rest01endpoint: process.env.REST01_ENDPOINT === void 0 ? "https://localhost" : process.env.REST01_ENDPOINT,
|
|
11748
|
+
rest01hostport: process.env.REST01_HOST_PORT === void 0 ? "3003" : process.env.REST01_HOST_PORT,
|
|
11749
|
+
rest01port: process.env.REST01_PORT === void 0 ? "3003" : process.env.REST01_PORT,
|
|
11750
|
+
rest01apiroot: process.env.REST01_APIROOT === void 0 ? "/stsrest01/v1" : process.env.REST01_APIROOT,
|
|
11751
|
+
rest01prometheussupport: process.env.REST01_PROM_SUPPORT === void 0 ? true : process.env.REST01_PROM_SUPPORT === "true" ? true : false,
|
|
11752
|
+
rest01prometheusclusterport: process.env.REST01_PROM_CLUSTER_PORT === void 0 ? "3013" : process.env.REST01_PROM_CLUSTER_PORT,
|
|
11753
|
+
rest01servicename: process.env.REST01_SERVICE_NAME === void 0 ? "STSRest01" : process.env.REST01_SERVICE_NAME,
|
|
11754
|
+
rest01serviceversion: process.env.REST01_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.REST01_SERVICE_VERSION,
|
|
11755
|
+
stsfhirendpoint: process.env.STSFHIR_ENDPOINT === void 0 ? "https://localhost" : process.env.STSFHIR_ENDPOINT,
|
|
11756
|
+
stsfhirhostport: process.env.STSFHIR_HOST_PORT === void 0 ? "3005" : process.env.STSFHIR_HOST_PORT,
|
|
11757
|
+
stsfhirport: process.env.STSFHIR_PORT === void 0 ? "3005" : process.env.STSFHIR_PORT,
|
|
11758
|
+
stsfhirapiroot: process.env.STSFHIR_APIROOT === void 0 ? "/stsfhir/r5" : process.env.STSFHIR_APIROOT,
|
|
11759
|
+
stsfhirprometheussupport: process.env.STSFHIR_PROM_SUPPORT === void 0 ? true : process.env.STSFHIR_PROM_SUPPORT === "true" ? true : false,
|
|
11760
|
+
stsfhirprometheusclusterport: process.env.STSFHIR_PROM_CLUSTER_PORT === void 0 ? "3015" : process.env.STSFHIR_PROM_CLUSTER_PORT,
|
|
11761
|
+
stsfhirservicename: process.env.STSFHIR_SERVICE_NAME === void 0 ? "STSFHIR" : process.env.STSFHIR_SERVICE_NAME,
|
|
11762
|
+
stsfhirserviceversion: process.env.STSFHIR_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.STSFHIR_SERVICE_VERSION,
|
|
11763
|
+
imendpoint: process.env.IM_ENDPOINT === void 0 ? "https://localhost" : process.env.IM_ENDPOINT,
|
|
11764
|
+
imhostport: process.env.IM_HOST_PORT === void 0 ? "3001" : process.env.IM_HOST_PORT,
|
|
11765
|
+
import: process.env.IM_PORT === void 0 ? "3001" : process.env.IM_PORT,
|
|
11766
|
+
imapiroot: process.env.IM_APIROOT === void 0 ? "/stsinstrumentmanager/v1" : process.env.IM_APIROOT,
|
|
11767
|
+
imprometheussupport: process.env.IM_PROM_SUPPORT === void 0 ? true : process.env.IM_PROM_SUPPORT === "true" ? true : false,
|
|
11768
|
+
imprometheusclusterport: process.env.IM_PROM_CLUSTER_PORT === void 0 ? "3011" : process.env.IM_PROM_CLUSTER_PORT,
|
|
11769
|
+
imservicename: process.env.IM_SERVICE_NAME === void 0 ? "STSInstrumentManager" : process.env.IM_SERVICE_NAME,
|
|
11770
|
+
imserviceversion: process.env.IM_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.IM_SERVICE_VERSION,
|
|
11771
|
+
imRedisKeepAliveProcessorUrl: process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_KEEP_ALIVE_PROCESSOR_URL,
|
|
11772
|
+
imRedisMessageProcessorUrl: process.env.IM_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.IM_REDIS_MESSAGE_PROCESSOR_URL,
|
|
11773
|
+
asendpoint: process.env.AS_ENDPOINT === void 0 ? "https://localhost" : process.env.AS_ENDPOINT,
|
|
11774
|
+
ashostport: process.env.AS_HOST_PORT === void 0 ? "3002" : process.env.AS_HOST_PORT,
|
|
11775
|
+
asport: process.env.AS_PORT === void 0 ? "3002" : process.env.AS_PORT,
|
|
11776
|
+
asapiroot: process.env.AS_API_ROOT === void 0 ? "/stsauth/v1.0" : process.env.AS_API_ROOT,
|
|
11777
|
+
asoauthapiroot: process.env.AS_OAUTH_API_ROOT === void 0 ? "/oauth2/v2.0" : process.env.AS_OAUTH_API_ROOT,
|
|
11778
|
+
asadminapiroot: process.env.AS_ADMIN_API_ROOT === void 0 ? "/admin/v1.0" : process.env.AS_ADMIN_API_ROOT,
|
|
11779
|
+
asprometheussupport: process.env.AS_PROM_SUPPORT === void 0 ? true : process.env.AS_PROM_SUPPORT === "true" ? true : false,
|
|
11780
|
+
asprometheusclusterport: process.env.AS_PROM_CLUSTER_PORT === void 0 ? "3012" : process.env.AS_PROM_CLUSTER_PORT,
|
|
11781
|
+
asservicename: process.env.AS_SERVICE_NAME === void 0 ? "STSAuth" : process.env.AS_SERVICE_NAME,
|
|
11782
|
+
asserviceversion: process.env.AS_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.AS_SERVICE_VERSION,
|
|
11783
|
+
asjwksjsonpath: process.env.AS_JWKS_JSON_PATH === void 0 ? "/.well-known/jwks.json" : process.env.AS_JWKS_JSON_PATH,
|
|
11784
|
+
asjwkskeyrotationtime: process.env.AS_JWKS_KEY_ROTATION_TIME === void 0 ? 86400 : parseInt(process.env.AS_JWKS_KEY_ROTATION_TIME),
|
|
11785
|
+
asjwkskeypurgetimeoffset: process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET === void 0 ? 300 : parseInt(process.env.AS_JWKS_KEY_PURGE_TIME_OFFSET),
|
|
11786
|
+
asjwkskeycount: process.env.AS_JWKS_KEY_COUNT === void 0 ? 4 : parseInt(process.env.AS_JWKS_KEY_COUNT),
|
|
11787
|
+
asaccesstokenexpire: process.env.AS_ACCESS_TOKEN_EXPIRE === void 0 ? 43200 : parseInt(process.env.AS_ACCESS_TOKEN_EXPIRE),
|
|
11788
|
+
authorizeendpoint: process.env.AUTHORIZE_ENDPOINT === void 0 ? "https://localhost" : process.env.AUTHORIZE_ENDPOINT,
|
|
11789
|
+
authorizeport: process.env.AUTHORIZE_PORT === void 0 ? "3010" : process.env.AUTHORIZE_PORT,
|
|
11790
|
+
authorizeapiroot: process.env.AUTHORIZE_API_ROOT === void 0 ? "/stsa" : process.env.AUTHORIZE_API_ROOT,
|
|
11791
|
+
authorizeapi: process.env.AUTHORIZE_API === void 0 ? "/authorize" : process.env.AUTHORIZE_API,
|
|
11792
|
+
brokerendpoint: process.env.BROKER_ENDPOINT === void 0 ? "https://localhost" : process.env.BROKER_ENDPOINT,
|
|
11793
|
+
brokerhostport: process.env.BROKER_HOST_PORT === void 0 ? "3006" : process.env.BROKER_HOST_PORT,
|
|
11794
|
+
brokerport: process.env.BROKER_PORT === void 0 ? "3006" : process.env.BROKER_PORT,
|
|
11795
|
+
brokerapiroot: process.env.BROKER_APIROOT === void 0 ? "/stsbroker/v1.0" : process.env.BROKER_APIROOT,
|
|
11796
|
+
brokerprometheussupport: process.env.BROKER_PROM_SUPPORT === void 0 ? true : process.env.BROKER_PROM_SUPPORT === "true" ? true : false,
|
|
11797
|
+
brokerprometheusclusterport: process.env.BROKER_PROM_CLUSTER_PORT === void 0 ? "3016" : process.env.BROKER_PROM_CLUSTER_PORT,
|
|
11798
|
+
brokerservicename: process.env.BROKER_SERVICE_NAME === void 0 ? "STSBroker" : process.env.BROKER_SERVICE_NAME,
|
|
11799
|
+
brokerserviceversion: process.env.BROKER_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.BROKER_SERVICE_VERSION,
|
|
11800
|
+
trnendpoint: process.env.TRN_ENDPOINT === void 0 ? "https://localhost" : process.env.TRN_ENDPOINT,
|
|
11801
|
+
trnhostport: process.env.TRN_HOST_PORT === void 0 ? "3007" : process.env.TRN_HOST_PORT,
|
|
11802
|
+
trnport: process.env.TRN_PORT === void 0 ? "3007" : process.env.TRN_PORT,
|
|
11803
|
+
trnapiroot: process.env.TRN_APIROOT === void 0 ? "/ststrn/v1.0" : process.env.TRN_APIROOT,
|
|
11804
|
+
trnprometheussupport: process.env.TRN_PROM_SUPPORT === void 0 ? true : process.env.TRN_PROM_SUPPORT === "true" ? true : false,
|
|
11805
|
+
trnprometheusclusterport: process.env.TRN_PROM_CLUSTER_PORT === void 0 ? "3017" : process.env.TRN_PROM_CLUSTER_PORT,
|
|
11806
|
+
trnservicename: process.env.TRN_SERVICE_NAME === void 0 ? "STSTestRunnerNode" : process.env.TRN_SERVICE_NAME,
|
|
11807
|
+
trnserviceversion: process.env.TRN_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.TRN_SERVICE_VERSION,
|
|
11808
|
+
trnautostartdelay: process.env.TRN_AUTO_START_DELAY === void 0 ? 0 : parseInt(process.env.TRN_AUTO_START_DELAY),
|
|
11809
|
+
trnautostartconfig: process.env.TRN_AUTO_START_CONFIG === void 0 ? "" : process.env.TRN_AUTO_START_CONFIG,
|
|
11810
|
+
trnRedisMessageProcessorUrl: process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL === void 0 ? "redis://localhost:6379" : process.env.TRN_REDIS_MESSAGE_PROCESSOR_URL,
|
|
11811
|
+
lambdaendpoint: process.env.LAMBDA_ENDPOINT === void 0 ? "https://localhost" : process.env.LAMBDA_ENDPOINT,
|
|
11812
|
+
lambdahostport: process.env.LAMBDA_HOST_PORT === void 0 ? "3009" : process.env.LAMBDA_HOST_PORT,
|
|
11813
|
+
lambdaport: process.env.LAMBDA_PORT === void 0 ? "3009" : process.env.LAMBDA_PORT,
|
|
11814
|
+
lambdaapiroot: process.env.LAMBDA_APIROOT === void 0 ? "/stslambda/v1.0" : process.env.LAMBDA_APIROOT,
|
|
11815
|
+
lambdaprometheussupport: process.env.LAMBDA_PROM_SUPPORT === void 0 ? true : process.env.LAMBDA_PROM_SUPPORT === "true" ? true : false,
|
|
11816
|
+
lambdaprometheusclusterport: process.env.LAMBDA_PROM_CLUSTER_PORT === void 0 ? "3019" : process.env.LAMBDA_PROM_CLUSTER_PORT,
|
|
11817
|
+
lambdaservicename: process.env.LAMBDA_SERVICE_NAME === void 0 ? "STSLambda" : process.env.LAMBDA_SERVICE_NAME,
|
|
11818
|
+
lambdaserviceversion: process.env.LAMBDA_SERVICE_VERSION === void 0 ? "1.0.0" : process.env.LAMBDA_SERVICE_VERSION,
|
|
11819
|
+
publishinterval: process.env.PUBLISH_INTERVAL === void 0 ? 1e3 : parseInt(process.env.PUBLISH_INTERVAL),
|
|
11820
|
+
publishtimeout: process.env.PUBLISH_TIMEOUT === void 0 ? 750 : parseInt(process.env.PUBLISH_TIMEOUT),
|
|
11821
|
+
transport: process.env.TRANSPORT === void 0 ? "RESTAPI" : process.env.TRANSPORT,
|
|
11822
|
+
useSecureCookies: process.env.USE_SECURE_COOKIES === void 0 ? false : process.env.USE_SECURE_COOKIES === "true" ? true : false,
|
|
11823
|
+
keepAlive: process.env.KEEP_ALIVE === void 0 ? true : process.env.KEEP_ALIVE === "true" ? true : false,
|
|
11824
|
+
maxSockets: process.env.MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.MAX_SOCKETS),
|
|
11825
|
+
maxTotalSockets: process.env.MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.MAX_TOTAL_SOCKETS),
|
|
11826
|
+
maxFreeSockets: process.env.MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.MAX_FREE_SOCKETS),
|
|
11827
|
+
timeout: process.env.TIMEOUT === void 0 ? 1e4 : parseInt(process.env.TIMEOUT),
|
|
11828
|
+
maxPayloadSize: process.env.MAX_PAYLOAD_SIZE === void 0 ? "50mb" : process.env.MAX_PAYLOAD_SIZE,
|
|
11829
|
+
instrumentationObservationInterval: process.env.INSTRUMENTATION_OBSERVATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.INSTRUMENTATION_OBSERVATION_INTERVAL),
|
|
11830
|
+
instrumentationTimeWindow: process.env.INSTRUMENTATION_TIME_WINDOW === void 0 ? 600 : parseInt(process.env.INSTRUMENTATION_TIME_WINDOW),
|
|
11831
|
+
authJWTAccessTokenTimeout: process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT === void 0 ? 600 : parseInt(process.env.AUTH_JWT_ACCESS_TOKEN_TIMEOUT),
|
|
11832
|
+
authJWTRefreshTokenTimeout: process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_JWT_REFRESH_TOKEN_TIMEOUT),
|
|
11833
|
+
authCookieTimeout: process.env.AUTH_COOKIE_TIMEOUT === void 0 ? 3600 * 24 : parseInt(process.env.AUTH_COOKIE_TIMEOUT),
|
|
11834
|
+
masterProcessExitTime: process.env.MASTER_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.MASTER_PROCESS_EXIT_TIME),
|
|
11835
|
+
childProcessExitTime: process.env.CHILD_PROCESS_EXIT_TIME === void 0 ? 500 : parseInt(process.env.CHILD_PROCESS_EXIT_TIME),
|
|
11836
|
+
systemInformationInterval: process.env.SYSTEM_INFORMATION_INTERVAL === void 0 ? 1e3 : parseInt(process.env.SYSTEM_INFORMATION_INTERVAL),
|
|
11837
|
+
ignoresocketio: process.env.IGNORE_SOCKETIO === void 0 ? true : process.env.IGNORE_SOCKETIO === "true" ? true : false,
|
|
11838
|
+
httpsserverkeypath: process.env.HTTPS_SERVER_KEY_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.key" : process.env.HTTPS_SERVER_KEY_PATH,
|
|
11839
|
+
httpsservercertpath: process.env.HTTPS_SERVER_CERT_PATH === void 0 ? "/var/lib/sts/stsglobalresources/keys/server.cert" : process.env.HTTPS_SERVER_CERT_PATH,
|
|
11840
|
+
tsjwkskeys: process.env.TS_JWKS_KEYS === void 0 ? 3 : parseInt(process.env.TS_JWKS_KEYS),
|
|
11841
|
+
jwksAuthConfigCache: process.env.JWKS_AUTH_CONFIG_CACHE === void 0 ? true : process.env.JWKS_AUTH_CONFIG_CACHE === "true" ? true : false,
|
|
11842
|
+
jwksAuthConfigCacheMaxEntries: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES === void 0 ? 5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_ENTRIES),
|
|
11843
|
+
jwksAuthConfigCacheMaxAge: process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE === void 0 ? 6e5 : parseInt(process.env.JWKS_AUTH_CONFIG_CACHE_MAX_AGE),
|
|
11844
|
+
jwksAuthConfigRateLimit: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === void 0 ? true : process.env.JWKS_AUTH_CONFIG_RATE_LIMIT === "true" ? true : false,
|
|
11845
|
+
jwksAuthConfigRateLimitRequestsPerMinute: process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE === void 0 ? 10 : parseInt(process.env.JWKS_AUTH_CONFIG_RATE_LIMIT_REQUESTS_PER_MINUTE),
|
|
11846
|
+
jwksAuthConfigTimeout: process.env.JWKS_AUTH_CONFIG_TIMEOUT === void 0 ? 3e4 : parseInt(process.env.JWKS_AUTH_CONFIG_TIMEOUT),
|
|
11847
|
+
influxDB_APIToken: process.env.INFLUXDB_API_TOKEN === void 0 ? "password" : process.env.INFLUXDB_API_TOKEN,
|
|
11848
|
+
influxDB_APITokenFile: process.env.INFLUXDB_API_TOKEN_FILE,
|
|
11849
|
+
influxDB_Url: process.env.INFLUXDB_URL === void 0 ? "http://localhost:8086" : process.env.INFLUXDB_URL,
|
|
11850
|
+
influxDB_Org: process.env.INFLUXDB_ORG === void 0 ? "my-org" : process.env.INFLUXDB_ORG,
|
|
11851
|
+
influxDB_Bucket: process.env.INFLUXDB_BUCKET === void 0 ? "TestBucket01" : process.env.INFLUXDB_BUCKET,
|
|
11852
|
+
influxDB_keepAlive: process.env.INFLUXDB_KEEP_ALIVE === void 0 ? true : process.env.INFLUXDB_KEEP_ALIVE === "true" ? true : false,
|
|
11853
|
+
influxDB_maxSockets: process.env.INFLUXDB_MAX_SOCKETS === void 0 ? 10 : parseInt(process.env.INFLUXDB_MAX_SOCKETS),
|
|
11854
|
+
influxDB_maxTotalSockets: process.env.INFLUXDB_MAX_TOTAL_SOCKETS === void 0 ? 20 : parseInt(process.env.INFLUXDB_MAX_TOTAL_SOCKETS),
|
|
11855
|
+
influxDB_maxFreeSockets: process.env.INFLUXDB_MAX_FREE_SOCKETS === void 0 ? 256 : parseInt(process.env.INFLUXDB_MAX_FREE_SOCKETS),
|
|
11856
|
+
influxDB_timeout: process.env.INFLUXDB_TIMEOUT === void 0 ? 1e4 : parseInt(process.env.INFLUXDB_TIMEOUT),
|
|
11857
|
+
influxDB_rejectUnauthorized: process.env.INFLUXDB_REJECT_UNAUTHORIZED === void 0 ? true : process.env.INFLUXDB_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
11858
|
+
influxDB_writeDataPointFlushTimeout: process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT === void 0 ? 1e3 : parseInt(process.env.INFLUXDB_WRITE_DATA_POINT_FLUSH_TIMEOUT),
|
|
11859
|
+
kafka_clientId: process.env.KAFKA_CLIENT_ID === void 0 ? "myclient" : process.env.KAFKA_CLIENT_ID,
|
|
11860
|
+
kafka_brokers: process.env.KAFKA_BROKERS === void 0 ? "localhost:9092" : process.env.KAFKA_BROKERS,
|
|
11861
|
+
kafka_admin_timeout: process.env.KAFKA_ADMIN_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_ADMIN_TIMEOUT),
|
|
11862
|
+
kafka_connection_timeout: process.env.KAFKA_CONNECTION_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_CONNECTION_TIMEOUT),
|
|
11863
|
+
kafka_request_timeout: process.env.KAFKA_REQUEST_TIMEOUT === void 0 ? 5e3 : parseInt(process.env.KAFKA_REQUEST_TIMEOUT),
|
|
11864
|
+
kafka_log_level: process.env.KAFKA_LOG_LEVEL === void 0 ? "nothing" : process.env.KAFKA_LOG_LEVEL,
|
|
11865
|
+
kafka_keep_alive: process.env.KAFKA_KEEP_ALIVE === void 0 ? 3e4 : parseInt(process.env.KAFKA_KEEP_ALIVE),
|
|
11866
|
+
kafka_use_ssl: process.env.KAFKA_USE_SSL === void 0 ? false : process.env.KAFKA_USE_SSL === "true" ? true : false,
|
|
11867
|
+
kafka_ssl_rejectUnauthorized: process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === void 0 ? true : process.env.KAFKA_SSL_REJECT_UNAUTHORIZED === "true" ? true : false,
|
|
11868
|
+
kafka_ssl_cafile: process.env.KAFKA_SSL_CAFILE === void 0 ? "/my/custom/ca.crt" : process.env.KAFKA_SSL_CAFILE,
|
|
11869
|
+
kafka_ssl_keyfile: process.env.KAFKA_SSL_KEYFILE === void 0 ? "/my/custom/client-key.pem" : process.env.KAFKA_SSL_KEYFILE,
|
|
11870
|
+
kafka_ssl_certfile: process.env.KAFKA_SSL_CERTFILE === void 0 ? "/my/custom/client-cert.pem" : process.env.KAFKA_SSL_CERTFILE,
|
|
11871
|
+
kafka_consume_from_beginning: process.env.KAFKA_CONSUME_FROM_BEGINNING === void 0 ? true : process.env.KAFKA_CONSUME_FROM_BEGINNING === "true" ? true : false,
|
|
11872
|
+
observabilityPublishMode: process.env.OBSERVABILITY_PUBLISH_MODE === void 0 ? "PROXY" : process.env.OBSERVABILITY_PUBLISH_MODE,
|
|
11873
|
+
stsUiTermObservabilityConsumptionMode: process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE === void 0 ? "PROXY" : process.env.STSUITERM_OBSERVABILITY_CONSUMPTION_MODE
|
|
11874
|
+
};
|
|
11875
|
+
const ReadFile = (passwordFile) => {
|
|
11876
|
+
try {
|
|
11877
|
+
accessSync(passwordFile, constants.R_OK);
|
|
11878
|
+
const data = readFileSync(passwordFile, "utf8");
|
|
11879
|
+
if (logger) ;
|
|
11880
|
+
return data;
|
|
11881
|
+
} catch (err) {
|
|
11882
|
+
return "";
|
|
11883
|
+
}
|
|
11884
|
+
};
|
|
11885
|
+
const fileconfig = [
|
|
11886
|
+
{ fileprop: "dbpasswordfile", prop: "dbpassword" },
|
|
11887
|
+
// JWKS secret file processing
|
|
11888
|
+
{ fileprop: "tsjwksstorepathfile", prop: "tsjwksstorepath" },
|
|
11889
|
+
// InfluxDB file processing
|
|
11890
|
+
{ fileprop: "influxDB_APITokenFile", prop: "influxDB_APIToken" }
|
|
11891
|
+
];
|
|
11892
|
+
fileconfig.forEach((v) => {
|
|
11893
|
+
if (defconfig[v.fileprop] !== void 0) {
|
|
11894
|
+
defconfig[v.prop] = ReadFile(defconfig[v.fileprop]);
|
|
11895
|
+
}
|
|
11896
|
+
});
|
|
11897
|
+
for (const [key, val] of Object.entries(defconfig)) {
|
|
11898
|
+
envOptions2[key] = val;
|
|
11899
|
+
}
|
|
11900
|
+
}
|
|
11901
|
+
function $SetupOptions(envOptions2) {
|
|
11902
|
+
SetupConfig(envOptions2);
|
|
11903
|
+
const options = envOptions2;
|
|
11904
|
+
if (options.dbhost) {
|
|
11905
|
+
const hosts = options.dbhost.split(",");
|
|
11906
|
+
envOptions2.connectionString = hosts.map((host) => {
|
|
11907
|
+
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/${options.database}`;
|
|
11908
|
+
}).join(",");
|
|
11909
|
+
envOptions2.defaultDatabaseConnectionString = hosts.map((host) => {
|
|
11910
|
+
return `postgresql://${options.dbuser}:${options.dbpassword}@${host}/postgres`;
|
|
11911
|
+
}).join(",");
|
|
11912
|
+
}
|
|
11913
|
+
}
|
|
11914
|
+
const envOptionsHandler = {
|
|
11915
|
+
get(target2, prop2, receiver) {
|
|
11916
|
+
if (Object.keys(target2).length === 0) {
|
|
11917
|
+
$SetupOptions(target2);
|
|
11918
|
+
}
|
|
11919
|
+
return Reflect.get(target2, prop2, receiver);
|
|
11920
|
+
}
|
|
11921
|
+
};
|
|
11922
|
+
const goptions = new Proxy(envOptions, envOptionsHandler);
|
|
11923
|
+
class AgentManager {
|
|
11924
|
+
constructor(agentManagerOptions) {
|
|
11925
|
+
__privateAdd$1(this, _options$1);
|
|
11926
|
+
__privateAdd$1(this, _httpAgent, null);
|
|
11927
|
+
__privateAdd$1(this, _httpsAgent, null);
|
|
11928
|
+
__privateAdd$1(this, _agentResetInterval, null);
|
|
11929
|
+
__privateAdd$1(this, _requestCount, 0);
|
|
11930
|
+
__privateAdd$1(this, _SetupResetInterval, () => {
|
|
11931
|
+
if (__privateGet$1(this, _options$1).agentResetInterval && __privateGet$1(this, _options$1).agentResetInterval > 0) {
|
|
11932
|
+
__privateSet$1(this, _agentResetInterval, setTimeout(() => {
|
|
11933
|
+
this.ResetAgent();
|
|
11934
|
+
__privateGet$1(this, _SetupResetInterval).call(this);
|
|
11935
|
+
}, __privateGet$1(this, _options$1).agentResetInterval).unref());
|
|
11936
|
+
}
|
|
11937
|
+
});
|
|
11938
|
+
__privateAdd$1(this, _GetAgentOptions, (https2) => {
|
|
11939
|
+
let options;
|
|
11940
|
+
if (__privateGet$1(this, _options$1).agentOptions) {
|
|
11941
|
+
options = {
|
|
11942
|
+
keepAlive: __privateGet$1(this, _options$1).agentOptions.keepAlive,
|
|
11943
|
+
maxSockets: __privateGet$1(this, _options$1).agentOptions.maxSockets,
|
|
11944
|
+
maxTotalSockets: __privateGet$1(this, _options$1).agentOptions.maxTotalSockets,
|
|
11945
|
+
maxFreeSockets: __privateGet$1(this, _options$1).agentOptions.maxFreeSockets,
|
|
11946
|
+
timeout: __privateGet$1(this, _options$1).agentOptions.timeout
|
|
11947
|
+
//@@ config
|
|
11948
|
+
};
|
|
11949
|
+
if (https2 === true) {
|
|
11950
|
+
options.rejectUnauthorized = __privateGet$1(this, _options$1).agentOptions.rejectUnauthorized;
|
|
11951
|
+
}
|
|
11952
|
+
} else {
|
|
11953
|
+
options = {
|
|
11954
|
+
keepAlive: process.env.NODE_ENV === "test" ? false : goptions.keepAlive,
|
|
11955
|
+
maxSockets: goptions.maxSockets,
|
|
11956
|
+
maxTotalSockets: goptions.maxTotalSockets,
|
|
11957
|
+
maxFreeSockets: goptions.maxFreeSockets,
|
|
11958
|
+
timeout: 3e4
|
|
11959
|
+
//@@ config
|
|
11960
|
+
};
|
|
11961
|
+
if (https2 === true) {
|
|
11962
|
+
options.rejectUnauthorized = goptions.isProduction;
|
|
11963
|
+
}
|
|
11964
|
+
}
|
|
11965
|
+
return options;
|
|
11966
|
+
});
|
|
11967
|
+
__privateSet$1(this, _options$1, agentManagerOptions);
|
|
11968
|
+
if (__privateGet$1(this, _options$1).agentResetInterval) {
|
|
11969
|
+
__privateGet$1(this, _SetupResetInterval).call(this);
|
|
11970
|
+
}
|
|
11971
|
+
}
|
|
11972
|
+
get agentResetInterval() {
|
|
11973
|
+
return __privateGet$1(this, _options$1).agentResetInterval;
|
|
11974
|
+
}
|
|
11975
|
+
set agentResetInterval(val) {
|
|
11976
|
+
if (__privateGet$1(this, _agentResetInterval)) {
|
|
11977
|
+
clearTimeout(__privateGet$1(this, _agentResetInterval));
|
|
11978
|
+
}
|
|
11979
|
+
__privateGet$1(this, _options$1).agentResetInterval = val;
|
|
11980
|
+
__privateGet$1(this, _SetupResetInterval).call(this);
|
|
11981
|
+
}
|
|
11982
|
+
get agentResetCount() {
|
|
11983
|
+
return __privateGet$1(this, _options$1).agentResetCount;
|
|
11984
|
+
}
|
|
11985
|
+
set agentResetCount(val) {
|
|
11986
|
+
__privateGet$1(this, _options$1).agentResetCount = val;
|
|
11987
|
+
}
|
|
11988
|
+
IncRequestCount() {
|
|
11989
|
+
__privateWrapper(this, _requestCount)._++;
|
|
11990
|
+
if (__privateGet$1(this, _options$1).agentResetCount) {
|
|
11991
|
+
if (__privateGet$1(this, _requestCount) % __privateGet$1(this, _options$1).agentResetCount === 0) {
|
|
11992
|
+
this.ResetAgent();
|
|
11993
|
+
}
|
|
11994
|
+
}
|
|
11995
|
+
}
|
|
11996
|
+
IsHttps(protocol) {
|
|
11997
|
+
if (protocol.toLowerCase().startsWith("https:")) {
|
|
11998
|
+
return true;
|
|
11999
|
+
}
|
|
12000
|
+
return false;
|
|
12001
|
+
}
|
|
12002
|
+
GetAgent(protocol) {
|
|
12003
|
+
if (protocol.toLowerCase().startsWith("https:")) {
|
|
12004
|
+
if (__privateGet$1(this, _httpsAgent) === null) {
|
|
12005
|
+
__privateSet$1(this, _httpsAgent, new http.Agent(__privateGet$1(this, _GetAgentOptions).call(this, true)));
|
|
12006
|
+
}
|
|
12007
|
+
return __privateGet$1(this, _httpsAgent);
|
|
12008
|
+
} else if (protocol.toLowerCase().startsWith("http:")) {
|
|
12009
|
+
if (__privateGet$1(this, _httpAgent) === null) {
|
|
12010
|
+
__privateSet$1(this, _httpAgent, new http.Agent(__privateGet$1(this, _GetAgentOptions).call(this, false)));
|
|
12011
|
+
}
|
|
12012
|
+
return __privateGet$1(this, _httpAgent);
|
|
12013
|
+
} else {
|
|
12014
|
+
return null;
|
|
12015
|
+
}
|
|
12016
|
+
}
|
|
12017
|
+
ResetAgent() {
|
|
12018
|
+
__privateSet$1(this, _httpAgent, null);
|
|
12019
|
+
__privateSet$1(this, _httpsAgent, null);
|
|
12020
|
+
}
|
|
12021
|
+
/*
|
|
12022
|
+
url
|
|
12023
|
+
,method: 'post'
|
|
12024
|
+
,data: payload
|
|
12025
|
+
,headers: headers
|
|
12026
|
+
,httpsAgent: this.#agentManager.GetAgent(url)
|
|
12027
|
+
*/
|
|
12028
|
+
/*
|
|
12029
|
+
postgresContainer = await new GenericContainer("postgres")
|
|
12030
|
+
.withExposedPorts(5432)
|
|
12031
|
+
.withEnvironment({
|
|
12032
|
+
POSTGRES_PASSWORD: "postgres",
|
|
12033
|
+
//UV_THREADPOOL_SIZE: "64"
|
|
12034
|
+
})
|
|
12035
|
+
.withCommand(['-c', 'max_connections=20'])
|
|
12036
|
+
.start();
|
|
12037
|
+
*/
|
|
12038
|
+
Terminate() {
|
|
12039
|
+
if (__privateGet$1(this, _agentResetInterval)) {
|
|
12040
|
+
clearTimeout(__privateGet$1(this, _agentResetInterval));
|
|
12041
|
+
__privateSet$1(this, _agentResetInterval, null);
|
|
12042
|
+
}
|
|
12043
|
+
if (__privateGet$1(this, _httpAgent)) {
|
|
12044
|
+
__privateGet$1(this, _httpAgent).destroy();
|
|
12045
|
+
__privateSet$1(this, _httpAgent, null);
|
|
12046
|
+
}
|
|
12047
|
+
if (__privateGet$1(this, _httpsAgent)) {
|
|
12048
|
+
__privateGet$1(this, _httpsAgent).destroy();
|
|
12049
|
+
__privateSet$1(this, _httpsAgent, null);
|
|
12050
|
+
}
|
|
12051
|
+
}
|
|
12052
|
+
}
|
|
12053
|
+
_options$1 = /* @__PURE__ */ new WeakMap();
|
|
12054
|
+
_httpAgent = /* @__PURE__ */ new WeakMap();
|
|
12055
|
+
_httpsAgent = /* @__PURE__ */ new WeakMap();
|
|
12056
|
+
_agentResetInterval = /* @__PURE__ */ new WeakMap();
|
|
12057
|
+
_requestCount = /* @__PURE__ */ new WeakMap();
|
|
12058
|
+
_SetupResetInterval = /* @__PURE__ */ new WeakMap();
|
|
12059
|
+
_GetAgentOptions = /* @__PURE__ */ new WeakMap();
|
|
12060
|
+
var __typeError2 = (msg) => {
|
|
12061
|
+
throw TypeError(msg);
|
|
12062
|
+
};
|
|
12063
|
+
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
12064
|
+
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
12065
|
+
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
12066
|
+
var __privateSet2 = (obj, member, value, setter) => (__accessCheck2(obj, member, "write to private field"), member.set(obj, value), value);
|
|
12067
|
+
var __privateMethod = (obj, member, method) => (__accessCheck2(obj, member, "access private method"), method);
|
|
12068
|
+
var _options, _sockets, _agentManager, _SocketIoClientHelper_instances, LogDebugMessage_fn, LogErrorMessage_fn, EstablishSocketConnect_fn;
|
|
12069
|
+
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
|
|
12070
|
+
class SocketIoClientHelper {
|
|
12071
|
+
constructor(options) {
|
|
12072
|
+
__privateAdd2(this, _SocketIoClientHelper_instances);
|
|
12073
|
+
__privateAdd2(this, _options);
|
|
12074
|
+
__privateAdd2(this, _sockets, {});
|
|
12075
|
+
__privateAdd2(this, _agentManager, null);
|
|
12076
|
+
__privateSet2(this, _options, options);
|
|
12077
|
+
if (isNode) {
|
|
12078
|
+
__privateSet2(this, _agentManager, new AgentManager({
|
|
12079
|
+
agentOptions: __privateGet2(this, _options).agentOptions
|
|
12080
|
+
}));
|
|
12081
|
+
}
|
|
12082
|
+
}
|
|
12083
|
+
get sockets() {
|
|
12084
|
+
return __privateGet2(this, _sockets);
|
|
12085
|
+
}
|
|
12086
|
+
SetupClientSideSocket(name2, address, onConnectCallBack, socketEventsCallBack, errorCallBack) {
|
|
12087
|
+
this.sockets[name2] = {
|
|
12088
|
+
name: name2,
|
|
12089
|
+
address,
|
|
12090
|
+
socket: null,
|
|
12091
|
+
errorCallBack
|
|
12092
|
+
};
|
|
12093
|
+
__privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack);
|
|
12094
|
+
return this.sockets[name2].socket;
|
|
12095
|
+
}
|
|
12096
|
+
GetSocket(name2) {
|
|
12097
|
+
return this.sockets[name2].socket;
|
|
12098
|
+
}
|
|
12099
|
+
GetSocketDetail(name2) {
|
|
12100
|
+
return this.sockets[name2];
|
|
12101
|
+
}
|
|
12102
|
+
}
|
|
12103
|
+
_options = /* @__PURE__ */ new WeakMap();
|
|
12104
|
+
_sockets = /* @__PURE__ */ new WeakMap();
|
|
12105
|
+
_agentManager = /* @__PURE__ */ new WeakMap();
|
|
12106
|
+
_SocketIoClientHelper_instances = /* @__PURE__ */ new WeakSet();
|
|
12107
|
+
LogDebugMessage_fn = function(message) {
|
|
12108
|
+
if (__privateGet2(this, _options).logger) __privateGet2(this, _options).logger.debug(message);
|
|
12109
|
+
};
|
|
12110
|
+
LogErrorMessage_fn = function(message) {
|
|
12111
|
+
if (__privateGet2(this, _options).logger) __privateGet2(this, _options).logger.error(message);
|
|
12112
|
+
};
|
|
12113
|
+
EstablishSocketConnect_fn = function(name2, onConnectCallBack, socketEventsCallBack) {
|
|
12114
|
+
var _a;
|
|
12115
|
+
const socketDetail = this.sockets[name2];
|
|
12116
|
+
if (socketDetail.socket !== null) {
|
|
12117
|
+
if (socketDetail.socket.connected === true) {
|
|
12118
|
+
socketDetail.socket.disconnect();
|
|
12119
|
+
}
|
|
12120
|
+
socketDetail.socket = null;
|
|
12121
|
+
if (isNode) {
|
|
12122
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
12123
|
+
} else {
|
|
12124
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
|
|
12125
|
+
}
|
|
12126
|
+
return;
|
|
12127
|
+
}
|
|
12128
|
+
let socketOptions;
|
|
12129
|
+
if (isNode) {
|
|
12130
|
+
socketOptions = {
|
|
12131
|
+
transports: ["websocket"],
|
|
12132
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12133
|
+
agent: (_a = __privateGet2(this, _agentManager)) == null ? void 0 : _a.GetAgent(socketDetail.address)
|
|
12134
|
+
};
|
|
12135
|
+
} else {
|
|
12136
|
+
socketOptions = {
|
|
12137
|
+
transports: ["websocket"]
|
|
12138
|
+
};
|
|
12139
|
+
}
|
|
12140
|
+
socketDetail.socket = io(socketDetail.address, socketOptions);
|
|
12141
|
+
socketDetail.socket.on("connect", () => {
|
|
12142
|
+
if (socketDetail.socket) {
|
|
12143
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, `Socket: [${socketDetail.socket.id}]: connected`);
|
|
12144
|
+
if (onConnectCallBack) {
|
|
12145
|
+
setTimeout(() => {
|
|
12146
|
+
onConnectCallBack(socketDetail.socket);
|
|
12147
|
+
}, 0);
|
|
12148
|
+
}
|
|
12149
|
+
if (socketEventsCallBack) {
|
|
12150
|
+
socketEventsCallBack(socketDetail.socket);
|
|
12151
|
+
}
|
|
12152
|
+
} else {
|
|
12153
|
+
const errorMessage = "Could not get socket object from socket.io";
|
|
12154
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogErrorMessage_fn).call(this, errorMessage);
|
|
12155
|
+
socketDetail.errorCallBack(new Error(errorMessage));
|
|
12156
|
+
}
|
|
12157
|
+
});
|
|
12158
|
+
socketDetail.socket.on("disconnect", (reason) => {
|
|
12159
|
+
var _a2, _b;
|
|
12160
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "socket disconnect: " + reason);
|
|
12161
|
+
switch (reason) {
|
|
12162
|
+
case "io server disconnect":
|
|
12163
|
+
{
|
|
12164
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "The server disconnected using disconnectSockets, i.e. normal safe shutdown from explicit disconnection by the server.");
|
|
12165
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "The connection will be re-established when the server becomes available.");
|
|
12166
|
+
const socketDetail2 = this.sockets[name2];
|
|
12167
|
+
socketDetail2.socket = null;
|
|
12168
|
+
if (isNode) {
|
|
12169
|
+
(_a2 = __privateGet2(this, _agentManager)) == null ? void 0 : _a2.ResetAgent();
|
|
12170
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
12171
|
+
} else {
|
|
12172
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
|
|
12173
|
+
}
|
|
12174
|
+
}
|
|
12175
|
+
break;
|
|
12176
|
+
case "io client disconnect":
|
|
12177
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "The client disconnected using disconnectSockets, i.e. normal safe disconnection from explicit disconnection by the client.");
|
|
12178
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "The connection will not be re-established automatically.");
|
|
12179
|
+
break;
|
|
12180
|
+
case "transport close":
|
|
12181
|
+
case "ping timeout":
|
|
12182
|
+
case "transport error":
|
|
12183
|
+
{
|
|
12184
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, `Server unexpectedly disconnected. Reason: [${reason}]`);
|
|
12185
|
+
__privateMethod(this, _SocketIoClientHelper_instances, LogDebugMessage_fn).call(this, "The connection will be re-established when the server becomes available.");
|
|
12186
|
+
const socketDetail2 = this.sockets[name2];
|
|
12187
|
+
if (socketDetail2.socket) {
|
|
12188
|
+
socketDetail2.socket.disconnect();
|
|
12189
|
+
}
|
|
12190
|
+
socketDetail2.socket = null;
|
|
12191
|
+
if (isNode) {
|
|
12192
|
+
(_b = __privateGet2(this, _agentManager)) == null ? void 0 : _b.ResetAgent();
|
|
12193
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100).unref();
|
|
12194
|
+
} else {
|
|
12195
|
+
setTimeout(() => __privateMethod(this, _SocketIoClientHelper_instances, EstablishSocketConnect_fn).call(this, name2, onConnectCallBack, socketEventsCallBack), 100);
|
|
12196
|
+
}
|
|
12197
|
+
}
|
|
12198
|
+
break;
|
|
12199
|
+
}
|
|
12200
|
+
});
|
|
12201
|
+
};
|
|
9913
12202
|
var tinyEmitter = { exports: {} };
|
|
9914
12203
|
function E() {
|
|
9915
12204
|
}
|
|
9916
12205
|
E.prototype = {
|
|
9917
|
-
on: function(
|
|
12206
|
+
on: function(name2, callback, ctx) {
|
|
9918
12207
|
var e = this.e || (this.e = {});
|
|
9919
|
-
(e[
|
|
12208
|
+
(e[name2] || (e[name2] = [])).push({
|
|
9920
12209
|
fn: callback,
|
|
9921
12210
|
ctx
|
|
9922
12211
|
});
|
|
9923
12212
|
return this;
|
|
9924
12213
|
},
|
|
9925
|
-
once: function(
|
|
12214
|
+
once: function(name2, callback, ctx) {
|
|
9926
12215
|
var self2 = this;
|
|
9927
12216
|
function listener() {
|
|
9928
|
-
self2.off(
|
|
12217
|
+
self2.off(name2, listener);
|
|
9929
12218
|
callback.apply(ctx, arguments);
|
|
9930
12219
|
}
|
|
9931
12220
|
listener._ = callback;
|
|
9932
|
-
return this.on(
|
|
12221
|
+
return this.on(name2, listener, ctx);
|
|
9933
12222
|
},
|
|
9934
|
-
emit: function(
|
|
12223
|
+
emit: function(name2) {
|
|
9935
12224
|
var data = [].slice.call(arguments, 1);
|
|
9936
|
-
var evtArr = ((this.e || (this.e = {}))[
|
|
12225
|
+
var evtArr = ((this.e || (this.e = {}))[name2] || []).slice();
|
|
9937
12226
|
var i = 0;
|
|
9938
12227
|
var len = evtArr.length;
|
|
9939
12228
|
for (i; i < len; i++) {
|
|
@@ -9941,9 +12230,9 @@ E.prototype = {
|
|
|
9941
12230
|
}
|
|
9942
12231
|
return this;
|
|
9943
12232
|
},
|
|
9944
|
-
off: function(
|
|
12233
|
+
off: function(name2, callback) {
|
|
9945
12234
|
var e = this.e || (this.e = {});
|
|
9946
|
-
var evts = e[
|
|
12235
|
+
var evts = e[name2];
|
|
9947
12236
|
var liveEvents = [];
|
|
9948
12237
|
if (evts && callback) {
|
|
9949
12238
|
for (var i = 0, len = evts.length; i < len; i++) {
|
|
@@ -9951,7 +12240,7 @@ E.prototype = {
|
|
|
9951
12240
|
liveEvents.push(evts[i]);
|
|
9952
12241
|
}
|
|
9953
12242
|
}
|
|
9954
|
-
liveEvents.length ? e[
|
|
12243
|
+
liveEvents.length ? e[name2] = liveEvents : delete e[name2];
|
|
9955
12244
|
return this;
|
|
9956
12245
|
}
|
|
9957
12246
|
};
|
|
@@ -9967,53 +12256,53 @@ class ObservabilitySubscriberManager {
|
|
|
9967
12256
|
__privateAdd(this, _store);
|
|
9968
12257
|
__privateAdd(this, _state, "init");
|
|
9969
12258
|
__privateAdd(this, _modelId);
|
|
9970
|
-
__privateAdd(this,
|
|
12259
|
+
__privateAdd(this, _options2);
|
|
9971
12260
|
__privateAdd(this, _tinyEmitter);
|
|
9972
12261
|
__privateAdd(this, _id);
|
|
9973
12262
|
__privateAdd(this, _SocketIOConnect, (socket) => {
|
|
9974
12263
|
var _a, _b;
|
|
9975
12264
|
try {
|
|
9976
|
-
console.log(chalk$
|
|
9977
|
-
console.log(chalk$
|
|
9978
|
-
console.log(chalk$
|
|
12265
|
+
console.log(chalk$2.cyan(`SocketIOConnect(): Starting`));
|
|
12266
|
+
console.log(chalk$2.cyan(`SocketIOConnect(): State: [${__privateGet(this, _state)}]`));
|
|
12267
|
+
console.log(chalk$2.cyan(`SocketIOConnect(): Current Model Subscriptions: [${(_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.subscriptions}]`));
|
|
9979
12268
|
if (__privateGet(this, _observabilitySocketIOSubscriber) instanceof ObservabilitySocketIOSubscriber) {
|
|
9980
12269
|
if (socket.id) {
|
|
9981
12270
|
const observabilitySocketIOSubscriberSocketId = __privateGet(this, _observabilitySocketIOSubscriber).socket.id;
|
|
9982
12271
|
if (observabilitySocketIOSubscriberSocketId) {
|
|
9983
12272
|
if (socket.id.localeCompare(observabilitySocketIOSubscriberSocketId) === 0) {
|
|
9984
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12273
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`AgentSocketClient:constructor:SocketIOConnectSocket(): ids are the same - ignoring`));
|
|
9985
12274
|
}
|
|
9986
12275
|
}
|
|
9987
12276
|
}
|
|
9988
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12277
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`AgentSocketClient:constructor:SocketIOConnect(): Socket ids are different - update with new socket`));
|
|
9989
12278
|
__privateGet(this, _observabilitySocketIOSubscriber).socket = socket;
|
|
9990
12279
|
(_b = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _b.Stop();
|
|
9991
12280
|
if (__privateGet(this, _state).localeCompare("started") === 0) {
|
|
9992
12281
|
setTimeout(() => {
|
|
9993
12282
|
var _a2;
|
|
9994
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12283
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`AgentSocketClient:constructor:SocketIOConnect(): observabilitySubscriptionManager Start`));
|
|
9995
12284
|
(_a2 = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a2.Start();
|
|
9996
12285
|
__privateGet(this, _tinyEmitter).emit("connected");
|
|
9997
12286
|
}, 2500);
|
|
9998
12287
|
} else {
|
|
9999
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12288
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`AgentSocketClient:constructor:SocketIOConnect(): state not in the started state, current state: [${__privateGet(this, _state)}]`));
|
|
10000
12289
|
__privateGet(this, _tinyEmitter).emit("connected");
|
|
10001
12290
|
}
|
|
10002
12291
|
} else {
|
|
10003
|
-
__privateGet(this, _logger).debug(chalk$
|
|
10004
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12292
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`SocketIOConnect(): this.#observabilitySocketIOSubscriber not instance of ObservabilitySocketIOSubscriber`));
|
|
12293
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(__privateGet(this, _observabilitySocketIOSubscriber)));
|
|
10005
12294
|
__privateGet(this, _tinyEmitter).emit("connected");
|
|
10006
12295
|
}
|
|
10007
12296
|
} catch (error) {
|
|
10008
|
-
__privateGet(this, _logger).error(chalk$
|
|
12297
|
+
__privateGet(this, _logger).error(chalk$2.red(`SocketIOConnect(): Error: [${error}]`));
|
|
10009
12298
|
__privateGet(this, _tinyEmitter).emit("connected");
|
|
10010
12299
|
} finally {
|
|
10011
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12300
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`SocketIOConnect(): Ended`));
|
|
10012
12301
|
}
|
|
10013
12302
|
});
|
|
10014
12303
|
__privateAdd(this, _SetupObservabilitySubscriber, () => {
|
|
10015
|
-
__privateGet(this, _logger).debug(`ObservabilitySubscriberManager:SetupObservabilitySubscriber(): consumeInstrumentationMode: [${__privateGet(this,
|
|
10016
|
-
switch (__privateGet(this,
|
|
12304
|
+
__privateGet(this, _logger).debug(`ObservabilitySubscriberManager:SetupObservabilitySubscriber(): consumeInstrumentationMode: [${__privateGet(this, _options2).consumeInstrumentationMode}]`);
|
|
12305
|
+
switch (__privateGet(this, _options2).consumeInstrumentationMode) {
|
|
10017
12306
|
case "PROXY":
|
|
10018
12307
|
__privateSet(this, _observabilitySocketIOSubscriber, new ObservabilitySocketIOSubscriber({
|
|
10019
12308
|
socket: __privateGet(this, _socket),
|
|
@@ -10026,12 +12315,12 @@ class ObservabilitySubscriberManager {
|
|
|
10026
12315
|
__privateSet(this, _observabilitySocketIOSubscriber, new ObservabilityRESTAPISubscriber({
|
|
10027
12316
|
keepAlive: 1e3,
|
|
10028
12317
|
//@@
|
|
10029
|
-
urlBase: `${__privateGet(this,
|
|
12318
|
+
urlBase: `${__privateGet(this, _options2).instrumentManagerEndpoint}:${__privateGet(this, _options2).instrumentManagerPort}${__privateGet(this, _options2).instrumentManagerAPIRoot}`,
|
|
10030
12319
|
logger: __privateGet(this, _logger)
|
|
10031
12320
|
}));
|
|
10032
12321
|
break;
|
|
10033
12322
|
default:
|
|
10034
|
-
__privateGet(this, _logger).error(chalk$
|
|
12323
|
+
__privateGet(this, _logger).error(chalk$2.red(`ObservabilitySubscriberManager:SetupObservabilitySubscriber(): Unsupported consumeInstrumentationMode mode: [${__privateGet(this, _options2).consumeInstrumentationMode}]`));
|
|
10035
12324
|
return;
|
|
10036
12325
|
}
|
|
10037
12326
|
__privateSet(this, _observabilitySubscriptionManager, new ObservabilitySubscriptionManager({
|
|
@@ -10042,10 +12331,10 @@ class ObservabilitySubscriberManager {
|
|
|
10042
12331
|
});
|
|
10043
12332
|
__publicField(this, "Start", () => {
|
|
10044
12333
|
return new Promise((resolve) => {
|
|
10045
|
-
if (__privateGet(this,
|
|
12334
|
+
if (__privateGet(this, _options2).consumeInstrumentationMode.localeCompare("PROXY") === 0) {
|
|
10046
12335
|
const onConnected = () => {
|
|
10047
12336
|
__privateGet(this, _tinyEmitter).off("connected", onConnected);
|
|
10048
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12337
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`ObservabilitySubscriberManager:Start() connected`));
|
|
10049
12338
|
resolve(true);
|
|
10050
12339
|
};
|
|
10051
12340
|
__privateGet(this, _tinyEmitter).on("connected", onConnected);
|
|
@@ -10060,7 +12349,7 @@ class ObservabilitySubscriberManager {
|
|
|
10060
12349
|
const socketUtils = new SocketIoClientHelper({});
|
|
10061
12350
|
__privateSet(this, _socket, socketUtils.SetupClientSideSocket(
|
|
10062
12351
|
"STSVueTilsTester",
|
|
10063
|
-
`${__privateGet(this,
|
|
12352
|
+
`${__privateGet(this, _options2).instrumentManagerEndpoint}:${__privateGet(this, _options2).instrumentManagerPort}/${SOCKET_NAMESPACE}/`,
|
|
10064
12353
|
__privateGet(this, _SocketConnect),
|
|
10065
12354
|
// Connected call back
|
|
10066
12355
|
__privateGet(this, _ProcessSocketEvents),
|
|
@@ -10070,25 +12359,25 @@ class ObservabilitySubscriberManager {
|
|
|
10070
12359
|
));
|
|
10071
12360
|
});
|
|
10072
12361
|
__privateAdd(this, _SocketConnect, (socket) => {
|
|
10073
|
-
defaultLogger.debug(chalk$
|
|
12362
|
+
defaultLogger.debug(chalk$2.magenta(`SocketIOConnect(): Socket ID: [${socket.id}]`));
|
|
10074
12363
|
if (__privateGet(this, _observabilitySubscriptionManager) === null) {
|
|
10075
12364
|
__privateGet(this, _SetupObservabilitySubscriber).call(this);
|
|
10076
12365
|
}
|
|
10077
12366
|
__privateGet(this, _SocketIOConnect).call(this, socket);
|
|
10078
12367
|
});
|
|
10079
12368
|
__privateAdd(this, _ProcessSocketError, (error) => {
|
|
10080
|
-
defaultLogger.error(chalk$
|
|
12369
|
+
defaultLogger.error(chalk$2.red(`SetupClientSideSocket error callback: [${error}]`));
|
|
10081
12370
|
});
|
|
10082
12371
|
__privateAdd(this, _ProcessSocketEvents, (socket) => {
|
|
10083
12372
|
});
|
|
10084
12373
|
__privateSet(this, _id, v4());
|
|
10085
|
-
__privateSet(this,
|
|
12374
|
+
__privateSet(this, _options2, options);
|
|
10086
12375
|
__privateSet(this, _modelId, options.modelId);
|
|
10087
12376
|
__privateSet(this, _logger, defaultLogger);
|
|
10088
12377
|
__privateSet(this, _store, ModelStore());
|
|
10089
12378
|
__privateSet(this, _tinyEmitter, new TinyEmitter());
|
|
10090
|
-
if (!__privateGet(this,
|
|
10091
|
-
__privateGet(this,
|
|
12379
|
+
if (!__privateGet(this, _options2).consumeInstrumentationMode) {
|
|
12380
|
+
__privateGet(this, _options2).consumeInstrumentationMode = "PROXY";
|
|
10092
12381
|
}
|
|
10093
12382
|
}
|
|
10094
12383
|
get id() {
|
|
@@ -10096,7 +12385,7 @@ class ObservabilitySubscriberManager {
|
|
|
10096
12385
|
}
|
|
10097
12386
|
UpdateModelCursor(subscriptions) {
|
|
10098
12387
|
var _a;
|
|
10099
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12388
|
+
__privateGet(this, _logger).debug(chalk$2.yellow(`UpdateModelCursor`));
|
|
10100
12389
|
(_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.Stop();
|
|
10101
12390
|
__privateSet(this, _state, "stopped");
|
|
10102
12391
|
setTimeout(() => {
|
|
@@ -10104,7 +12393,7 @@ class ObservabilitySubscriberManager {
|
|
|
10104
12393
|
__privateGet(this, _observabilitySubscriptionManager).subscriptions = subscriptions;
|
|
10105
12394
|
__privateGet(this, _observabilitySubscriptionManager).Start();
|
|
10106
12395
|
} else {
|
|
10107
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12396
|
+
__privateGet(this, _logger).debug(chalk$2.yellow(`UpdateModelCursor(): Could not update subscriptions, this.#observabilitySubscriptionManager not set`));
|
|
10108
12397
|
}
|
|
10109
12398
|
__privateSet(this, _state, "started");
|
|
10110
12399
|
}, 0);
|
|
@@ -10142,13 +12431,13 @@ class ObservabilitySubscriberManager {
|
|
|
10142
12431
|
}
|
|
10143
12432
|
Unsubscribe() {
|
|
10144
12433
|
var _a;
|
|
10145
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12434
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`ObservabilitySubscriberManager:Unsubscribe()`));
|
|
10146
12435
|
__privateSet(this, _state, "stopped");
|
|
10147
12436
|
(_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.Stop();
|
|
10148
|
-
if (__privateGet(this,
|
|
12437
|
+
if (__privateGet(this, _options2).consumeInstrumentationMode.localeCompare("PROXY") === 0) {
|
|
10149
12438
|
setTimeout(() => {
|
|
10150
12439
|
var _a2;
|
|
10151
|
-
__privateGet(this, _logger).debug(chalk$
|
|
12440
|
+
__privateGet(this, _logger).debug(chalk$2.cyan(`ObservabilitySubscriberManager:Unsubscribe() socket.disconnect`));
|
|
10152
12441
|
(_a2 = __privateGet(this, _socket)) == null ? void 0 : _a2.disconnect();
|
|
10153
12442
|
__privateSet(this, _socket, null);
|
|
10154
12443
|
}, 1e3);
|
|
@@ -10162,7 +12451,7 @@ _observabilitySubscriptionManager = new WeakMap();
|
|
|
10162
12451
|
_store = new WeakMap();
|
|
10163
12452
|
_state = new WeakMap();
|
|
10164
12453
|
_modelId = new WeakMap();
|
|
10165
|
-
|
|
12454
|
+
_options2 = new WeakMap();
|
|
10166
12455
|
_tinyEmitter = new WeakMap();
|
|
10167
12456
|
_id = new WeakMap();
|
|
10168
12457
|
_SocketIOConnect = new WeakMap();
|
|
@@ -10178,7 +12467,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
10178
12467
|
modelId: {}
|
|
10179
12468
|
},
|
|
10180
12469
|
setup(__props, { expose: __expose }) {
|
|
10181
|
-
chalk$
|
|
12470
|
+
chalk$2.level = 3;
|
|
10182
12471
|
const props = __props;
|
|
10183
12472
|
const store = ModelStore();
|
|
10184
12473
|
let observabilitySubscriberManager = null;
|
|
@@ -10460,7 +12749,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
10460
12749
|
},
|
|
10461
12750
|
setup(__props, { expose: __expose }) {
|
|
10462
12751
|
onMounted(() => {
|
|
10463
|
-
console.log(chalk$
|
|
12752
|
+
console.log(chalk$2.green("onMounted"));
|
|
10464
12753
|
});
|
|
10465
12754
|
const formData = ref([
|
|
10466
12755
|
{
|