@nsshunt/stsvueutils 1.2.32 → 1.2.34

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.
@@ -38,7 +38,7 @@ var __privateMethod = (obj, member, method) => {
38
38
  return method;
39
39
  };
40
40
 
41
- var _store, _storage, _workersEx, _runner, _workerId, _options, _STSInstrumentController, _app, _CreateRunnerCopy, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _CreateAsyncRunner, _PostMessageToWorker, _TerminateWorker, _StopRunner, _StopWorker, _requestResponseMessages, _requestResponseMessageTimeout, _port, _SetupListener, _collectorCollectorPort, _requestResponseHelper, _runners, _options2, _SetMessagePort, _AddAsyncRunner, _StopRunners;
41
+ var _store, _storage, _workersEx, _runner, _workerId, _options, _STSInstrumentController, _app, _CreateRunnerCopy, CreateRunnerCopy_fn, _SetRunnerIntoWorker, _ProcessTelemetry, _CreateAsyncRunner, _PostMessageToWorker, _TerminateWorker, _StopRunner, _StopWorker, _requestResponseMessages, _requestResponseMessageTimeout, _port, _SetupListener, _collectorCollectorPort, _requestResponseHelper, _runners, _options2, _SetMessagePort, _AddAsyncRunner, _StopRunners, _socket, _observabilitySocketIOSubscriber, _logger, _observabilitySubscriptionManager, _store2, _state, _modelId, _options3, _tinyEmitter, _id, _SocketIOConnect, _SetupObservabilitySubscriber, _SetupSocketIO, _SocketConnect, _ProcessSocketError, _ProcessSocketEvents;
42
42
  const STSStoragePluginKey = Symbol("storage");
43
43
  const STSEmitterPluginKey = Symbol("emitter");
44
44
  const STSWorkerManagerPluginKey = Symbol("workerManager");
@@ -2607,7 +2607,7 @@ var __privateMethod = (obj, member, method) => {
2607
2607
  }
2608
2608
  }
2609
2609
  });
2610
- const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
2610
+ const _sfc_main$9 = /* @__PURE__ */ vue.defineComponent({
2611
2611
  __name: "UXBarChart",
2612
2612
  setup(__props, { expose: __expose }) {
2613
2613
  const VueApexCharts = vue.defineAsyncComponent(() => import("vue3-apexcharts"));
@@ -2688,7 +2688,7 @@ var __privateMethod = (obj, member, method) => {
2688
2688
  };
2689
2689
  }
2690
2690
  });
2691
- const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
2691
+ const _sfc_main$8 = /* @__PURE__ */ vue.defineComponent({
2692
2692
  __name: "UXLineChart",
2693
2693
  setup(__props, { expose: __expose }) {
2694
2694
  const VueApexCharts = vue.defineAsyncComponent(() => import("vue3-apexcharts"));
@@ -2790,7 +2790,7 @@ var __privateMethod = (obj, member, method) => {
2790
2790
  };
2791
2791
  }
2792
2792
  });
2793
- const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2793
+ const _sfc_main$7 = /* @__PURE__ */ vue.defineComponent({
2794
2794
  __name: "UXMultiBarChart",
2795
2795
  props: {
2796
2796
  series: {},
@@ -2890,7 +2890,7 @@ var __privateMethod = (obj, member, method) => {
2890
2890
  };
2891
2891
  }
2892
2892
  });
2893
- const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
2893
+ const _sfc_main$6 = /* @__PURE__ */ vue.defineComponent({
2894
2894
  __name: "UXRadialChart",
2895
2895
  props: {
2896
2896
  series: {},
@@ -9161,7 +9161,7 @@ var __privateMethod = (obj, member, method) => {
9161
9161
  return DOMPurify;
9162
9162
  }
9163
9163
  var purify = createDOMPurify();
9164
- const _hoisted_1$4 = { class: "instDisplay text-right" };
9164
+ const _hoisted_1$5 = { class: "instDisplay text-right" };
9165
9165
  const _hoisted_2$4 = {
9166
9166
  key: 0,
9167
9167
  class: "instDisplayWide ml-6"
@@ -9202,7 +9202,7 @@ var __privateMethod = (obj, member, method) => {
9202
9202
  const _hoisted_27$2 = ["innerHTML"];
9203
9203
  const _hoisted_28$2 = { key: 1 };
9204
9204
  const _hoisted_29$1 = ["innerHTML"];
9205
- const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
9205
+ const _sfc_main$5 = /* @__PURE__ */ vue.defineComponent({
9206
9206
  __name: "UXModelInstrumentAgentCommon",
9207
9207
  props: {
9208
9208
  modelId: {},
@@ -9352,7 +9352,7 @@ var __privateMethod = (obj, member, method) => {
9352
9352
  }),
9353
9353
  vue.createVNode(_component_v_col, { md: "10" }, {
9354
9354
  default: vue.withCtx(() => [
9355
- vue.createElementVNode("span", _hoisted_1$4, vue.toDisplayString(round2Places(_ctx.instrumentData[`${vue.unref(stsobservability.Gauge).DURATION_GAUGE}`].val)), 1),
9355
+ vue.createElementVNode("span", _hoisted_1$5, vue.toDisplayString(round2Places(_ctx.instrumentData[`${vue.unref(stsobservability.Gauge).DURATION_GAUGE}`].val)), 1),
9356
9356
  _ctx.isLeafNode === false ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_2$4, vue.toDisplayString(round2PlacesArray(_ctx.instrumentData[`${vue.unref(stsobservability.Gauge).DURATION_GAUGE}`].percentile)), 1)) : vue.createCommentVNode("", true)
9357
9357
  ]),
9358
9358
  _: 1
@@ -9431,7 +9431,7 @@ var __privateMethod = (obj, member, method) => {
9431
9431
  vue.createVNode(_component_v_col, { md: "12" }, {
9432
9432
  default: vue.withCtx(() => [
9433
9433
  vue.createElementVNode("div", null, [
9434
- vue.createVNode(_sfc_main$8, {
9434
+ vue.createVNode(_sfc_main$9, {
9435
9435
  ref_key: "barChartEx",
9436
9436
  ref: barChartEx
9437
9437
  }, null, 512)
@@ -9611,8 +9611,8 @@ var __privateMethod = (obj, member, method) => {
9611
9611
  }
9612
9612
  return target2;
9613
9613
  };
9614
- const UXModelInstrumentAgentCommon = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-00273855"]]);
9615
- const _hoisted_1$3 = { class: "ststitle" };
9614
+ const UXModelInstrumentAgentCommon = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-00273855"]]);
9615
+ const _hoisted_1$4 = { class: "ststitle" };
9616
9616
  const _hoisted_2$3 = {
9617
9617
  key: 0,
9618
9618
  class: "stssubtitle"
@@ -9667,7 +9667,7 @@ var __privateMethod = (obj, member, method) => {
9667
9667
  const _hoisted_41 = ["innerHTML"];
9668
9668
  const _hoisted_42 = { key: 1 };
9669
9669
  const _hoisted_43 = ["innerHTML"];
9670
- const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
9670
+ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
9671
9671
  __name: "UXModelInstrumentServiceCommon",
9672
9672
  props: {
9673
9673
  modelId: {},
@@ -9813,7 +9813,7 @@ var __privateMethod = (obj, member, method) => {
9813
9813
  onClick: _cache[0] || (_cache[0] = ($event) => clicked(_ctx.nodeid))
9814
9814
  }, {
9815
9815
  default: vue.withCtx(() => [
9816
- vue.createElementVNode("div", _hoisted_1$3, [
9816
+ vue.createElementVNode("div", _hoisted_1$4, [
9817
9817
  vue.createTextVNode(vue.toDisplayString(friendlyTitle(_ctx.title)) + " ", 1),
9818
9818
  _ctx.title.length > 30 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
9819
9819
  vue.createTextVNode(vue.toDisplayString(_ctx.title.split("@")[0]) + " ", 1),
@@ -9860,7 +9860,7 @@ var __privateMethod = (obj, member, method) => {
9860
9860
  }, {
9861
9861
  default: vue.withCtx(() => [
9862
9862
  vue.createElementVNode("div", null, [
9863
- vue.createVNode(_sfc_main$7, {
9863
+ vue.createVNode(_sfc_main$8, {
9864
9864
  ref_key: "lineChartEx",
9865
9865
  ref: lineChartEx
9866
9866
  }, null, 512)
@@ -9992,7 +9992,7 @@ var __privateMethod = (obj, member, method) => {
9992
9992
  vue.createVNode(_component_v_col, { md: "12" }, {
9993
9993
  default: vue.withCtx(() => [
9994
9994
  vue.createElementVNode("div", null, [
9995
- vue.createVNode(_sfc_main$8, {
9995
+ vue.createVNode(_sfc_main$9, {
9996
9996
  ref_key: "barChartEx",
9997
9997
  ref: barChartEx
9998
9998
  }, null, 512)
@@ -10263,9 +10263,9 @@ var __privateMethod = (obj, member, method) => {
10263
10263
  };
10264
10264
  }
10265
10265
  });
10266
- const UXModelInstrumentServiceCommon = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-02af10f2"]]);
10266
+ const UXModelInstrumentServiceCommon = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-02af10f2"]]);
10267
10267
  const _withScopeId = (n) => (vue.pushScopeId("data-v-3eab32be"), n = n(), vue.popScopeId(), n);
10268
- const _hoisted_1$2 = { class: "ststitle" };
10268
+ const _hoisted_1$3 = { class: "ststitle" };
10269
10269
  const _hoisted_2$2 = {
10270
10270
  key: 0,
10271
10271
  class: "stssubtitle"
@@ -10323,7 +10323,7 @@ var __privateMethod = (obj, member, method) => {
10323
10323
  class: "stsinfo",
10324
10324
  style: { "text-align": "right", "padding-left": "15px" }
10325
10325
  };
10326
- const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
10326
+ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
10327
10327
  __name: "UXModelInstrumentServiceSmall",
10328
10328
  props: {
10329
10329
  modelId: {},
@@ -10585,7 +10585,7 @@ var __privateMethod = (obj, member, method) => {
10585
10585
  onClick: _cache[0] || (_cache[0] = ($event) => clicked(_ctx.nodeid))
10586
10586
  }, {
10587
10587
  default: vue.withCtx(() => [
10588
- vue.createElementVNode("div", _hoisted_1$2, [
10588
+ vue.createElementVNode("div", _hoisted_1$3, [
10589
10589
  vue.createTextVNode(vue.toDisplayString(friendlyTitle(_ctx.title)) + " ", 1),
10590
10590
  _ctx.title.length > 30 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$2, [
10591
10591
  vue.createTextVNode(vue.toDisplayString(_ctx.title.split("@")[0]) + " ", 1),
@@ -10836,10 +10836,10 @@ var __privateMethod = (obj, member, method) => {
10836
10836
  };
10837
10837
  }
10838
10838
  });
10839
- const UXModelInstrumentServiceSmall = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-3eab32be"]]);
10840
- const _hoisted_1$1 = ["value"];
10839
+ const UXModelInstrumentServiceSmall = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-3eab32be"]]);
10840
+ const _hoisted_1$2 = ["value"];
10841
10841
  const _hoisted_2$1 = { key: 0 };
10842
- const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
10842
+ const _sfc_main$2 = /* @__PURE__ */ vue.defineComponent({
10843
10843
  __name: "UXModelNode",
10844
10844
  props: {
10845
10845
  modelId: {},
@@ -10894,11 +10894,544 @@ var __privateMethod = (obj, member, method) => {
10894
10894
  onMyclick: navigate
10895
10895
  }, null, 40, ["model-id", "nodeid", "contextdata", "instrumentdata", "title"]))
10896
10896
  ])) : vue.createCommentVNode("", true)
10897
- ], 8, _hoisted_1$1);
10897
+ ], 8, _hoisted_1$2);
10898
10898
  }), 128);
10899
10899
  };
10900
10900
  }
10901
10901
  });
10902
+ let getRandomValues;
10903
+ const rnds8 = new Uint8Array(16);
10904
+ function rng() {
10905
+ if (!getRandomValues) {
10906
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
10907
+ if (!getRandomValues) {
10908
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
10909
+ }
10910
+ }
10911
+ return getRandomValues(rnds8);
10912
+ }
10913
+ const byteToHex = [];
10914
+ for (let i = 0; i < 256; ++i) {
10915
+ byteToHex.push((i + 256).toString(16).slice(1));
10916
+ }
10917
+ function unsafeStringify(arr, offset = 0) {
10918
+ return byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]];
10919
+ }
10920
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
10921
+ const native = {
10922
+ randomUUID
10923
+ };
10924
+ function v4(options, buf, offset) {
10925
+ if (native.randomUUID && !buf && !options) {
10926
+ return native.randomUUID();
10927
+ }
10928
+ options = options || {};
10929
+ const rnds = options.random || (options.rng || rng)();
10930
+ rnds[6] = rnds[6] & 15 | 64;
10931
+ rnds[8] = rnds[8] & 63 | 128;
10932
+ if (buf) {
10933
+ offset = offset || 0;
10934
+ for (let i = 0; i < 16; ++i) {
10935
+ buf[offset + i] = rnds[i];
10936
+ }
10937
+ return buf;
10938
+ }
10939
+ return unsafeStringify(rnds);
10940
+ }
10941
+ const SOCKET_NAMESPACE = "stsinstrumentmanager/stsmonitor";
10942
+ class ObservabilitySubscriberManager {
10943
+ constructor(options) {
10944
+ __privateAdd(this, _socket, null);
10945
+ __privateAdd(this, _observabilitySocketIOSubscriber, null);
10946
+ __privateAdd(this, _logger, void 0);
10947
+ __privateAdd(this, _observabilitySubscriptionManager, null);
10948
+ __privateAdd(this, _store2, void 0);
10949
+ __privateAdd(this, _state, "init");
10950
+ __privateAdd(this, _modelId, void 0);
10951
+ __privateAdd(this, _options3, void 0);
10952
+ __privateAdd(this, _tinyEmitter, void 0);
10953
+ __privateAdd(this, _id, void 0);
10954
+ __privateAdd(this, _SocketIOConnect, (socket) => {
10955
+ var _a, _b;
10956
+ try {
10957
+ console.log(chalk$1.cyan(`SocketIOConnect(): Starting`));
10958
+ console.log(chalk$1.cyan(`SocketIOConnect(): State: [${__privateGet(this, _state)}]`));
10959
+ console.log(chalk$1.cyan(`SocketIOConnect(): Current Model Subscriptions: [${(_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.subscriptions}]`));
10960
+ if (__privateGet(this, _observabilitySocketIOSubscriber) instanceof stsobservability.ObservabilitySocketIOSubscriber) {
10961
+ if (socket.id) {
10962
+ const observabilitySocketIOSubscriberSocketId = __privateGet(this, _observabilitySocketIOSubscriber).socket.id;
10963
+ if (observabilitySocketIOSubscriberSocketId) {
10964
+ if (socket.id.localeCompare(observabilitySocketIOSubscriberSocketId) === 0) {
10965
+ __privateGet(this, _logger).debug(chalk$1.cyan(`AgentSocketClient:constructor:SocketIOConnectSocket(): ids are the same - ignoring`));
10966
+ }
10967
+ }
10968
+ }
10969
+ __privateGet(this, _logger).debug(chalk$1.cyan(`AgentSocketClient:constructor:SocketIOConnect(): Socket ids are different - update with new socket`));
10970
+ __privateGet(this, _observabilitySocketIOSubscriber).socket = socket;
10971
+ (_b = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _b.Stop();
10972
+ if (__privateGet(this, _state).localeCompare("started") === 0) {
10973
+ setTimeout(() => {
10974
+ var _a2;
10975
+ __privateGet(this, _logger).debug(chalk$1.cyan(`AgentSocketClient:constructor:SocketIOConnect(): observabilitySubscriptionManager Start`));
10976
+ (_a2 = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a2.Start();
10977
+ __privateGet(this, _tinyEmitter).emit("connected");
10978
+ }, 2500);
10979
+ } else {
10980
+ __privateGet(this, _logger).debug(chalk$1.cyan(`AgentSocketClient:constructor:SocketIOConnect(): state not in the started state, current state: [${__privateGet(this, _state)}]`));
10981
+ __privateGet(this, _tinyEmitter).emit("connected");
10982
+ }
10983
+ } else {
10984
+ __privateGet(this, _logger).debug(chalk$1.cyan(`SocketIOConnect(): this.#observabilitySocketIOSubscriber not instance of ObservabilitySocketIOSubscriber`));
10985
+ __privateGet(this, _logger).debug(chalk$1.cyan(__privateGet(this, _observabilitySocketIOSubscriber)));
10986
+ __privateGet(this, _tinyEmitter).emit("connected");
10987
+ }
10988
+ } catch (error) {
10989
+ __privateGet(this, _logger).error(chalk$1.red(`SocketIOConnect(): Error: [${error}]`));
10990
+ __privateGet(this, _tinyEmitter).emit("connected");
10991
+ } finally {
10992
+ __privateGet(this, _logger).debug(chalk$1.cyan(`SocketIOConnect(): Ended`));
10993
+ }
10994
+ });
10995
+ __privateAdd(this, _SetupObservabilitySubscriber, () => {
10996
+ __privateGet(this, _logger).debug(`ObservabilitySubscriberManager:SetupObservabilitySubscriber(): consumeInstrumentationMode: [${__privateGet(this, _options3).consumeInstrumentationMode}]`);
10997
+ switch (__privateGet(this, _options3).consumeInstrumentationMode) {
10998
+ case "PROXY":
10999
+ __privateSet(this, _observabilitySocketIOSubscriber, new stsobservability.ObservabilitySocketIOSubscriber({
11000
+ socket: __privateGet(this, _socket),
11001
+ keepAlive: 2500,
11002
+ //@@
11003
+ logger: __privateGet(this, _logger)
11004
+ }));
11005
+ break;
11006
+ case "REST":
11007
+ __privateSet(this, _observabilitySocketIOSubscriber, new stsobservability.ObservabilityRESTAPISubscriber({
11008
+ keepAlive: 1e3,
11009
+ //@@
11010
+ urlBase: `${__privateGet(this, _options3).instrumentManagerEndpoint}:${__privateGet(this, _options3).instrumentManagerPort}${__privateGet(this, _options3).instrumentManagerAPIRoot}`,
11011
+ logger: __privateGet(this, _logger)
11012
+ }));
11013
+ break;
11014
+ default:
11015
+ __privateGet(this, _logger).error(chalk$1.red(`ObservabilitySubscriberManager:SetupObservabilitySubscriber(): Unsupported consumeInstrumentationMode mode: [${__privateGet(this, _options3).consumeInstrumentationMode}]`));
11016
+ return;
11017
+ }
11018
+ __privateSet(this, _observabilitySubscriptionManager, new stsobservability.ObservabilitySubscriptionManager({
11019
+ logger: __privateGet(this, _logger),
11020
+ maxLogLength: 100
11021
+ }));
11022
+ __privateGet(this, _observabilitySubscriptionManager).observabilitySocketIOSubscriber = __privateGet(this, _observabilitySocketIOSubscriber);
11023
+ });
11024
+ __publicField(this, "Start", () => {
11025
+ return new Promise((resolve) => {
11026
+ if (__privateGet(this, _options3).consumeInstrumentationMode.localeCompare("PROXY") === 0) {
11027
+ const onConnected = () => {
11028
+ __privateGet(this, _tinyEmitter).off("connected", onConnected);
11029
+ __privateGet(this, _logger).debug(chalk$1.cyan(`ObservabilitySubscriberManager:Start() connected`));
11030
+ resolve(true);
11031
+ };
11032
+ __privateGet(this, _tinyEmitter).on("connected", onConnected);
11033
+ __privateGet(this, _SetupSocketIO).call(this);
11034
+ } else {
11035
+ __privateGet(this, _SetupObservabilitySubscriber).call(this);
11036
+ resolve(true);
11037
+ }
11038
+ });
11039
+ });
11040
+ __privateAdd(this, _SetupSocketIO, () => {
11041
+ const socketUtils = new stsobservability.SocketIoClientHelper({});
11042
+ __privateSet(this, _socket, socketUtils.SetupClientSideSocket(
11043
+ "STSVueTilsTester",
11044
+ `${__privateGet(this, _options3).instrumentManagerEndpoint}:${__privateGet(this, _options3).instrumentManagerPort}/${SOCKET_NAMESPACE}/`,
11045
+ __privateGet(this, _SocketConnect),
11046
+ // Connected call back
11047
+ __privateGet(this, _ProcessSocketEvents),
11048
+ // Custom Events
11049
+ __privateGet(this, _ProcessSocketError)
11050
+ // Handle socket errors
11051
+ ));
11052
+ });
11053
+ __privateAdd(this, _SocketConnect, (socket) => {
11054
+ stsutils.defaultLogger.debug(chalk$1.magenta(`SocketIOConnect(): Socket ID: [${socket.id}]`));
11055
+ if (__privateGet(this, _observabilitySubscriptionManager) === null) {
11056
+ __privateGet(this, _SetupObservabilitySubscriber).call(this);
11057
+ }
11058
+ __privateGet(this, _SocketIOConnect).call(this, socket);
11059
+ });
11060
+ __privateAdd(this, _ProcessSocketError, (error) => {
11061
+ stsutils.defaultLogger.error(chalk$1.red(`SetupClientSideSocket error callback: [${error}]`));
11062
+ });
11063
+ __privateAdd(this, _ProcessSocketEvents, (socket) => {
11064
+ });
11065
+ __privateSet(this, _id, v4());
11066
+ __privateSet(this, _options3, options);
11067
+ __privateSet(this, _modelId, options.modelId);
11068
+ __privateSet(this, _logger, stsutils.defaultLogger);
11069
+ __privateSet(this, _store2, ModelStore());
11070
+ __privateSet(this, _tinyEmitter, new TinyEmitter());
11071
+ if (!__privateGet(this, _options3).consumeInstrumentationMode) {
11072
+ __privateGet(this, _options3).consumeInstrumentationMode = "PROXY";
11073
+ }
11074
+ }
11075
+ get id() {
11076
+ return __privateGet(this, _id);
11077
+ }
11078
+ UpdateModelCursor(subscriptions) {
11079
+ var _a;
11080
+ __privateGet(this, _logger).debug(chalk$1.yellow(`UpdateModelCursor`));
11081
+ (_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.Stop();
11082
+ __privateSet(this, _state, "stopped");
11083
+ setTimeout(() => {
11084
+ if (__privateGet(this, _observabilitySubscriptionManager)) {
11085
+ __privateGet(this, _observabilitySubscriptionManager).subscriptions = subscriptions;
11086
+ __privateGet(this, _observabilitySubscriptionManager).Start();
11087
+ } else {
11088
+ __privateGet(this, _logger).debug(chalk$1.yellow(`UpdateModelCursor(): Could not update subscriptions, this.#observabilitySubscriptionManager not set`));
11089
+ }
11090
+ __privateSet(this, _state, "started");
11091
+ }, 0);
11092
+ }
11093
+ TransformSubscriptionPayloadCallback(subscriptionPayload) {
11094
+ try {
11095
+ if (__privateGet(this, _observabilitySubscriptionManager)) {
11096
+ __privateGet(this, _observabilitySubscriptionManager).TransformSubscriptionPayloadCallback(subscriptionPayload, false);
11097
+ if (subscriptionPayload.subscriptionKey.topic.localeCompare(stsobservability.SubscriptionTopic.AllAgentsCombined) === 0) {
11098
+ const agentModel = __privateGet(this, _observabilitySubscriptionManager).agentModel;
11099
+ __privateGet(this, _store2).UpdateAgentModel(__privateGet(this, _modelId), agentModel, subscriptionPayload.subscriptionKey);
11100
+ }
11101
+ if (subscriptionPayload.subscriptionKey.topic.localeCompare(stsobservability.SubscriptionTopic.AllServicesCombined) === 0) {
11102
+ const serviceModel = __privateGet(this, _observabilitySubscriptionManager).serviceModel;
11103
+ __privateGet(this, _store2).UpdateServiceModel(__privateGet(this, _modelId), serviceModel, subscriptionPayload.subscriptionKey);
11104
+ }
11105
+ if (subscriptionPayload.subscriptionKey.topic.localeCompare(stsobservability.SubscriptionTopic.Services) === 0) {
11106
+ const serviceModel = __privateGet(this, _observabilitySubscriptionManager).serviceModel;
11107
+ __privateGet(this, _store2).UpdateServiceModel(__privateGet(this, _modelId), serviceModel, subscriptionPayload.subscriptionKey);
11108
+ }
11109
+ if (subscriptionPayload.subscriptionKey.topic.localeCompare(stsobservability.SubscriptionTopic.ServiceInstances) === 0) {
11110
+ const serviceModel = __privateGet(this, _observabilitySubscriptionManager).serviceModel;
11111
+ __privateGet(this, _store2).UpdateServiceModel(__privateGet(this, _modelId), serviceModel, subscriptionPayload.subscriptionKey);
11112
+ }
11113
+ if (subscriptionPayload.subscriptionKey.topic.localeCompare(stsobservability.SubscriptionTopic.ServiceInstance) === 0) {
11114
+ const serviceModel = __privateGet(this, _observabilitySubscriptionManager).serviceModel;
11115
+ __privateGet(this, _store2).UpdateServiceModel(__privateGet(this, _modelId), serviceModel, subscriptionPayload.subscriptionKey);
11116
+ }
11117
+ } else {
11118
+ __privateGet(this, _logger).error(`TransformSubscriptionPayloadCallback(): observabilitySubscriptionManager not set`);
11119
+ }
11120
+ } catch (error) {
11121
+ __privateGet(this, _logger).error(`TransformSubscriptionPayloadCallback(): #modelId: [${__privateGet(this, _modelId)}], Error: [${error}]`);
11122
+ }
11123
+ }
11124
+ Unsubscribe() {
11125
+ var _a;
11126
+ __privateGet(this, _logger).debug(chalk$1.cyan(`ObservabilitySubscriberManager:Unsubscribe()`));
11127
+ __privateSet(this, _state, "stopped");
11128
+ (_a = __privateGet(this, _observabilitySubscriptionManager)) == null ? void 0 : _a.Stop();
11129
+ if (__privateGet(this, _options3).consumeInstrumentationMode.localeCompare("PROXY") === 0) {
11130
+ setTimeout(() => {
11131
+ var _a2;
11132
+ __privateGet(this, _logger).debug(chalk$1.cyan(`ObservabilitySubscriberManager:Unsubscribe() socket.disconnect`));
11133
+ (_a2 = __privateGet(this, _socket)) == null ? void 0 : _a2.disconnect();
11134
+ __privateSet(this, _socket, null);
11135
+ }, 1e3);
11136
+ }
11137
+ }
11138
+ }
11139
+ _socket = new WeakMap();
11140
+ _observabilitySocketIOSubscriber = new WeakMap();
11141
+ _logger = new WeakMap();
11142
+ _observabilitySubscriptionManager = new WeakMap();
11143
+ _store2 = new WeakMap();
11144
+ _state = new WeakMap();
11145
+ _modelId = new WeakMap();
11146
+ _options3 = new WeakMap();
11147
+ _tinyEmitter = new WeakMap();
11148
+ _id = new WeakMap();
11149
+ _SocketIOConnect = new WeakMap();
11150
+ _SetupObservabilitySubscriber = new WeakMap();
11151
+ _SetupSocketIO = new WeakMap();
11152
+ _SocketConnect = new WeakMap();
11153
+ _ProcessSocketError = new WeakMap();
11154
+ _ProcessSocketEvents = new WeakMap();
11155
+ const _hoisted_1$1 = { class: "d-flex flex-wrap justify-space-between" };
11156
+ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
11157
+ __name: "UXModelNavigator",
11158
+ props: {
11159
+ modelId: {}
11160
+ },
11161
+ setup(__props, { expose: __expose }) {
11162
+ chalk$1.level = 3;
11163
+ const props = __props;
11164
+ const store = ModelStore();
11165
+ let observabilitySubscriberManager = null;
11166
+ const TransformSubscriptionPayloadCallback = (subscriptionPayload) => {
11167
+ observabilitySubscriberManager == null ? void 0 : observabilitySubscriberManager.TransformSubscriptionPayloadCallback(subscriptionPayload);
11168
+ };
11169
+ let rootLevelSubscriptions = [{
11170
+ subscriptionKey: {
11171
+ id: v4(),
11172
+ topic: stsobservability.SubscriptionTopic.AllServicesCombined
11173
+ },
11174
+ cb: TransformSubscriptionPayloadCallback
11175
+ }, {
11176
+ subscriptionKey: {
11177
+ id: v4(),
11178
+ topic: stsobservability.SubscriptionTopic.AllAgentsCombined
11179
+ },
11180
+ cb: TransformSubscriptionPayloadCallback
11181
+ }];
11182
+ const ServicesSubscriptions = [{
11183
+ subscriptionKey: {
11184
+ id: v4(),
11185
+ topic: stsobservability.SubscriptionTopic.Services
11186
+ },
11187
+ cb: TransformSubscriptionPayloadCallback
11188
+ }];
11189
+ const GetServiceInstancesSubscriptions = (serviceId) => {
11190
+ return [{
11191
+ subscriptionKey: {
11192
+ id: v4(),
11193
+ topic: stsobservability.SubscriptionTopic.ServiceInstances,
11194
+ key: serviceId
11195
+ },
11196
+ cb: TransformSubscriptionPayloadCallback
11197
+ }];
11198
+ };
11199
+ const GetServiceInstanceSubscriptions = (serviceId, serviceInstanceId) => {
11200
+ return [{
11201
+ subscriptionKey: {
11202
+ id: v4(),
11203
+ topic: stsobservability.SubscriptionTopic.ServiceInstance,
11204
+ key: serviceId,
11205
+ subkey: serviceInstanceId
11206
+ },
11207
+ cb: TransformSubscriptionPayloadCallback
11208
+ }];
11209
+ };
11210
+ let navSubscriptions = rootLevelSubscriptions;
11211
+ let navigationSubscriptions = {
11212
+ subscriptions: [],
11213
+ currentSubscriptions: null
11214
+ };
11215
+ let obj = vue.reactive(navigationSubscriptions);
11216
+ const getPathString = (sub2) => {
11217
+ if (sub2.subscriptionKey.key && sub2.subscriptionKey.subkey) {
11218
+ return `${sub2.subscriptionKey.topic}[${sub2.subscriptionKey.key}/${sub2.subscriptionKey.subkey}]`;
11219
+ }
11220
+ if (sub2.subscriptionKey.key) {
11221
+ return `${sub2.subscriptionKey.topic}[${sub2.subscriptionKey.key}]`;
11222
+ }
11223
+ return `${sub2.subscriptionKey.topic}`;
11224
+ };
11225
+ const navigationPath = vue.computed(() => {
11226
+ let pathString = "";
11227
+ let sep = "";
11228
+ obj.subscriptions.forEach((s) => {
11229
+ pathString += sep + getPathString(s[0]);
11230
+ sep = "/";
11231
+ });
11232
+ if (obj.currentSubscriptions) {
11233
+ return pathString + sep + getPathString(obj.currentSubscriptions[0]);
11234
+ }
11235
+ return pathString;
11236
+ });
11237
+ const BackDisabled = vue.computed(() => {
11238
+ return obj.subscriptions.length < 1;
11239
+ });
11240
+ const modelNode = vue.reactive({
11241
+ node: {}
11242
+ });
11243
+ vue.computed({
11244
+ get: () => modelNode.node,
11245
+ set: (val) => {
11246
+ modelNode.node = val;
11247
+ }
11248
+ });
11249
+ const clicked = function(id) {
11250
+ var _a, _b;
11251
+ if (store._models[props.modelId]) {
11252
+ if (store._models[props.modelId].serviceModelSubscriptionKey) {
11253
+ switch ((_a = store._models[props.modelId].serviceModelSubscriptionKey) == null ? void 0 : _a.topic) {
11254
+ case stsobservability.SubscriptionTopic.AllServicesCombined:
11255
+ navigate(ServicesSubscriptions);
11256
+ break;
11257
+ case stsobservability.SubscriptionTopic.Services:
11258
+ navigate(GetServiceInstancesSubscriptions(id));
11259
+ break;
11260
+ case stsobservability.SubscriptionTopic.ServiceInstances:
11261
+ navigate(GetServiceInstanceSubscriptions((_b = store._models[props.modelId].serviceModelSubscriptionKey) == null ? void 0 : _b.key, id));
11262
+ break;
11263
+ }
11264
+ }
11265
+ }
11266
+ };
11267
+ const navigate = function(subscriptions) {
11268
+ obj.subscriptions.push(navSubscriptions);
11269
+ navSubscriptions = subscriptions;
11270
+ obj.currentSubscriptions = subscriptions;
11271
+ observabilitySubscriberManager == null ? void 0 : observabilitySubscriberManager.UpdateModelCursor(subscriptions);
11272
+ };
11273
+ const GoBack = function() {
11274
+ if (obj.subscriptions.length > 0) {
11275
+ let key = obj.subscriptions.pop();
11276
+ if (key) {
11277
+ navSubscriptions = key;
11278
+ obj.currentSubscriptions = key;
11279
+ observabilitySubscriberManager == null ? void 0 : observabilitySubscriberManager.UpdateModelCursor(navSubscriptions);
11280
+ }
11281
+ }
11282
+ };
11283
+ const TopLevel = function() {
11284
+ obj.subscriptions = [];
11285
+ navSubscriptions = rootLevelSubscriptions;
11286
+ obj.currentSubscriptions = rootLevelSubscriptions;
11287
+ observabilitySubscriberManager == null ? void 0 : observabilitySubscriberManager.UpdateModelCursor(navSubscriptions);
11288
+ };
11289
+ vue.onMounted(() => {
11290
+ console.log(`UXModelNavigator: onMounted()`);
11291
+ });
11292
+ vue.onBeforeUnmount(() => {
11293
+ console.log(`UXModelNavigator: onBeforeUnmount()`);
11294
+ Stop();
11295
+ });
11296
+ let tab = vue.ref(null);
11297
+ const Stop = () => {
11298
+ store.UpdateSate(props.modelId, _estate.STOPPING);
11299
+ if (observabilitySubscriberManager) {
11300
+ observabilitySubscriberManager.Unsubscribe();
11301
+ store.UpdateObservabilitySubscriberManager(observabilitySubscriberManager.id, null);
11302
+ }
11303
+ observabilitySubscriberManager = null;
11304
+ store.UpdateSate(props.modelId, _estate.IDLE);
11305
+ };
11306
+ const Start = async (options) => {
11307
+ store.UpdateSate(props.modelId, _estate.STARTING);
11308
+ observabilitySubscriberManager = new ObservabilitySubscriberManager(options);
11309
+ store.UpdateObservabilitySubscriberManager(observabilitySubscriberManager.id, observabilitySubscriberManager);
11310
+ await observabilitySubscriberManager.Start();
11311
+ obj.currentSubscriptions = rootLevelSubscriptions;
11312
+ observabilitySubscriberManager == null ? void 0 : observabilitySubscriberManager.UpdateModelCursor(rootLevelSubscriptions);
11313
+ store.UpdateSate(props.modelId, _estate.STARTED);
11314
+ };
11315
+ __expose({
11316
+ Start,
11317
+ Stop
11318
+ });
11319
+ return (_ctx, _cache) => {
11320
+ const _component_v_tab = vue.resolveComponent("v-tab");
11321
+ const _component_v_tabs = vue.resolveComponent("v-tabs");
11322
+ const _component_v_window_item = vue.resolveComponent("v-window-item");
11323
+ const _component_v_window = vue.resolveComponent("v-window");
11324
+ const _component_v_col = vue.resolveComponent("v-col");
11325
+ const _component_v_row = vue.resolveComponent("v-row");
11326
+ const _component_v_icon = vue.resolveComponent("v-icon");
11327
+ const _component_v_btn = vue.resolveComponent("v-btn");
11328
+ const _component_v_sheet = vue.resolveComponent("v-sheet");
11329
+ return vue.openBlock(), vue.createBlock(_component_v_sheet, {
11330
+ theme: "light",
11331
+ rounded: "lg",
11332
+ class: "ma-4 mr-0 pa-2",
11333
+ elevation: 10
11334
+ }, {
11335
+ default: vue.withCtx(() => [
11336
+ vue.createTextVNode(" UXModelNavigator - Path: " + vue.toDisplayString(navigationPath.value) + " ", 1),
11337
+ vue.createVNode(_component_v_row, { "no-gutters": "" }, {
11338
+ default: vue.withCtx(() => [
11339
+ vue.createVNode(_component_v_col, null, {
11340
+ default: vue.withCtx(() => [
11341
+ vue.createVNode(_component_v_tabs, {
11342
+ modelValue: vue.unref(tab),
11343
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => vue.isRef(tab) ? tab.value = $event : tab = $event),
11344
+ "background-color": "primary"
11345
+ }, {
11346
+ default: vue.withCtx(() => [
11347
+ vue.createVNode(_component_v_tab, { value: "summary" }, {
11348
+ default: vue.withCtx(() => [
11349
+ vue.createTextVNode(" Summary ")
11350
+ ]),
11351
+ _: 1
11352
+ }),
11353
+ vue.createVNode(_component_v_tab, { value: "detailed" }, {
11354
+ default: vue.withCtx(() => [
11355
+ vue.createTextVNode(" Detailed ")
11356
+ ]),
11357
+ _: 1
11358
+ })
11359
+ ]),
11360
+ _: 1
11361
+ }, 8, ["modelValue"]),
11362
+ vue.createVNode(_component_v_window, {
11363
+ modelValue: vue.unref(tab),
11364
+ "onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => vue.isRef(tab) ? tab.value = $event : tab = $event)
11365
+ }, {
11366
+ default: vue.withCtx(() => [
11367
+ vue.createVNode(_component_v_window_item, { value: "summary" }, {
11368
+ default: vue.withCtx(() => [
11369
+ vue.createVNode(_sfc_main$2, {
11370
+ "model-id": props.modelId,
11371
+ nodeid: "_",
11372
+ "small-mode": true,
11373
+ onMyclick: clicked
11374
+ }, null, 8, ["model-id"])
11375
+ ]),
11376
+ _: 1
11377
+ }),
11378
+ vue.createVNode(_component_v_window_item, { value: "detailed" }, {
11379
+ default: vue.withCtx(() => [
11380
+ vue.createVNode(_sfc_main$2, {
11381
+ "model-id": props.modelId,
11382
+ nodeid: "_",
11383
+ "small-mode": false,
11384
+ onMyclick: clicked
11385
+ }, null, 8, ["model-id"])
11386
+ ]),
11387
+ _: 1
11388
+ })
11389
+ ]),
11390
+ _: 1
11391
+ }, 8, ["modelValue"])
11392
+ ]),
11393
+ _: 1
11394
+ })
11395
+ ]),
11396
+ _: 1
11397
+ }),
11398
+ vue.createElementVNode("div", _hoisted_1$1, [
11399
+ vue.createVNode(_component_v_btn, {
11400
+ color: "secondary",
11401
+ class: "ma-1",
11402
+ onClick: TopLevel
11403
+ }, {
11404
+ default: vue.withCtx(() => [
11405
+ vue.createTextVNode(" Top Level"),
11406
+ vue.createVNode(_component_v_icon, {
11407
+ end: "",
11408
+ icon: "mdi-arrow-up-circle"
11409
+ })
11410
+ ]),
11411
+ _: 1
11412
+ }),
11413
+ vue.createVNode(_component_v_btn, {
11414
+ class: "ma-1",
11415
+ color: "secondary",
11416
+ disabled: BackDisabled.value,
11417
+ onClick: GoBack
11418
+ }, {
11419
+ default: vue.withCtx(() => [
11420
+ vue.createTextVNode(" Go Back"),
11421
+ vue.createVNode(_component_v_icon, {
11422
+ end: "",
11423
+ icon: "mdi-arrow-left-circle"
11424
+ })
11425
+ ]),
11426
+ _: 1
11427
+ }, 8, ["disabled"])
11428
+ ])
11429
+ ]),
11430
+ _: 1
11431
+ });
11432
+ };
11433
+ }
11434
+ });
10902
11435
  const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", null, " UXTestForm ", -1);
10903
11436
  const _hoisted_2 = { class: "text-wrap" };
10904
11437
  const _hoisted_3 = { class: "ml-0 text-caption" };
@@ -11145,15 +11678,15 @@ var __privateMethod = (obj, member, method) => {
11145
11678
  exports2.STSWorkerManagerPluginKey = STSWorkerManagerPluginKey;
11146
11679
  exports2.TelemetryStore = TelemetryStore;
11147
11680
  exports2.URI_BASE_VUEUTILS = URI_BASE_VUEUTILS;
11148
- exports2.UXBarChart = _sfc_main$8;
11149
- exports2.UXLineChart = _sfc_main$7;
11681
+ exports2.UXBarChart = _sfc_main$9;
11682
+ exports2.UXLineChart = _sfc_main$8;
11150
11683
  exports2.UXModelInstrumentAgentCommon = UXModelInstrumentAgentCommon;
11151
11684
  exports2.UXModelInstrumentServiceCommon = UXModelInstrumentServiceCommon;
11152
11685
  exports2.UXModelInstrumentServiceSmall = UXModelInstrumentServiceSmall;
11153
11686
  exports2.UXModelNavigator = _sfc_main$1;
11154
- exports2.UXModelNode = _sfc_main$1;
11155
- exports2.UXMultiBarChart = _sfc_main$6;
11156
- exports2.UXRadialChart = _sfc_main$5;
11687
+ exports2.UXModelNode = _sfc_main$2;
11688
+ exports2.UXMultiBarChart = _sfc_main$7;
11689
+ exports2.UXRadialChart = _sfc_main$6;
11157
11690
  exports2.UXTestForm = _sfc_main;
11158
11691
  exports2.WorkerInstance = WorkerInstance;
11159
11692
  exports2._estate = _estate;