mftsccs-browser 1.1.53-beta → 1.1.55-beta

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.
@@ -1579,6 +1579,7 @@ function GetConceptBulk(passedConcepts) {
1579
1579
  let concept = result[i];
1580
1580
  _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_0__.ConceptsData.AddConcept(concept);
1581
1581
  }
1582
+ console.log("this is the concept for the binary tree", _app__WEBPACK_IMPORTED_MODULE_4__.BinaryTree.root, result.length);
1582
1583
  }
1583
1584
  }
1584
1585
  else {
@@ -1872,6 +1873,7 @@ __webpack_require__.r(__webpack_exports__);
1872
1873
  /* harmony import */ var _Services_Security_GetRequestHeader__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Services/Security/GetRequestHeader */ "./src/Services/Security/GetRequestHeader.ts");
1873
1874
  /* harmony import */ var _Services_Common_ErrorPosting__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Services/Common/ErrorPosting */ "./src/Services/Common/ErrorPosting.ts");
1874
1875
  /* harmony import */ var _app__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../app */ "./src/app.ts");
1876
+ /* harmony import */ var _DataStructures_ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../DataStructures/ConnectionBinaryTree/ConnectionBinaryTree */ "./src/DataStructures/ConnectionBinaryTree/ConnectionBinaryTree.ts");
1875
1877
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
1876
1878
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
1877
1879
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -1887,6 +1889,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
1887
1889
 
1888
1890
 
1889
1891
 
1892
+
1890
1893
  /**
1891
1894
  * After fetching these connections it is saved in the local static ConnectionBinaryTree so it can be reused without being fetched
1892
1895
  * @param connectionIds array of connection ids that need to fetched by the local system
@@ -1937,6 +1940,7 @@ function GetConnectionBulk() {
1937
1940
  connectionList.push(connection);
1938
1941
  _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_0__.ConnectionData.AddConnection(connection);
1939
1942
  }
1943
+ console.log("this is all the connections", connectionList.length, connectionList, _DataStructures_ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_6__.ConnectionBinaryTree.connectionroot);
1940
1944
  }
1941
1945
  }
1942
1946
  else {
@@ -4611,8 +4615,8 @@ class CompositionNode {
4611
4615
  const T2 = y.leftNode;
4612
4616
  y.leftNode = x;
4613
4617
  x.rightNode = T2;
4614
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
4615
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
4618
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
4619
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
4616
4620
  return y;
4617
4621
  }
4618
4622
  //return y;
@@ -4814,7 +4818,7 @@ class ConceptsData {
4814
4818
  }
4815
4819
  static AddConcept(concept) {
4816
4820
  if (_app__WEBPACK_IMPORTED_MODULE_5__.serviceWorker) {
4817
- const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('AddConcept', { concept }); // is async function
4821
+ const res = (0,_app__WEBPACK_IMPORTED_MODULE_5__.sendMessage)('ConceptsData__AddConcept', { concept }); // is async function
4818
4822
  // console.log('data received from sw', res)
4819
4823
  // return res.data // remove comment when this function is async
4820
4824
  }
@@ -5028,12 +5032,18 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
5028
5032
 
5029
5033
  class ConnectionBinaryTree {
5030
5034
  static addNodeToTree(node) {
5031
- if (this.connectionroot == null) {
5032
- this.connectionroot = node;
5033
- return this.connectionroot;
5035
+ try {
5036
+ if (this.connectionroot == null) {
5037
+ this.connectionroot = node;
5038
+ return this.connectionroot;
5039
+ }
5040
+ else {
5041
+ this.connectionroot = this.connectionroot.addNode(node, this.connectionroot, this.connectionroot.height);
5042
+ }
5034
5043
  }
5035
- else {
5036
- this.connectionroot = this.connectionroot.addNode(node, this.connectionroot, this.connectionroot.height);
5044
+ catch (error) {
5045
+ console.log("This is the error in making the tree", error);
5046
+ throw error;
5037
5047
  }
5038
5048
  }
5039
5049
  static addConnectionToTree(connection) {
@@ -5072,11 +5082,16 @@ class ConnectionBinaryTree {
5072
5082
  }
5073
5083
  static getNodeFromTree(id) {
5074
5084
  return __awaiter(this, void 0, void 0, function* () {
5075
- if (this.connectionroot) {
5076
- let Node = this.connectionroot.getFromNode(id, this.connectionroot);
5077
- return Node;
5085
+ try {
5086
+ if (this.connectionroot) {
5087
+ let Node = this.connectionroot.getFromNode(id, this.connectionroot);
5088
+ return Node;
5089
+ }
5090
+ return this.connectionroot;
5091
+ }
5092
+ catch (ex) {
5093
+ console.log("this is the getNodeFromTree", id, this.connectionroot);
5078
5094
  }
5079
- return this.connectionroot;
5080
5095
  });
5081
5096
  }
5082
5097
  static getConnectionListFromIds(ids, connectionArray, remainingIds) {
@@ -5106,6 +5121,8 @@ __webpack_require__.r(__webpack_exports__);
5106
5121
 
5107
5122
  class ConnectionNode {
5108
5123
  constructor(key, value, leftNode, rightNode) {
5124
+ this.leftNode = null;
5125
+ this.rightNode = null;
5109
5126
  this.variants = [];
5110
5127
  this.height = 1;
5111
5128
  this.key = key;
@@ -5144,17 +5161,25 @@ class ConnectionNode {
5144
5161
  //node.currentNode = this.addCurrentNode(passedNode, node.currentNode);
5145
5162
  return node;
5146
5163
  }
5164
+ getMax(a, b) {
5165
+ if (a > b) {
5166
+ return a;
5167
+ }
5168
+ return b;
5169
+ }
5147
5170
  addNode(passedNode, node, height) {
5171
+ // try{
5148
5172
  if (node == null) {
5149
- node = passedNode;
5150
- return node;
5173
+ //node = passedNode;
5174
+ //ConnectionBinaryTree.connectionAll.push(node.value);
5175
+ return passedNode;
5151
5176
  }
5152
5177
  let LeftNode = node.leftNode;
5153
5178
  let RightNode = node.rightNode;
5154
- if (node.key > passedNode.key) {
5179
+ if (passedNode.key < node.key) {
5155
5180
  node.leftNode = this.addNode(passedNode, LeftNode, height);
5156
5181
  }
5157
- else if (node.key < passedNode.key) {
5182
+ else if (passedNode.key > node.key) {
5158
5183
  node.rightNode = this.addNode(passedNode, RightNode, height);
5159
5184
  }
5160
5185
  // else if (node.key == passedNode.key && node.key != ""){
@@ -5163,31 +5188,38 @@ class ConnectionNode {
5163
5188
  else {
5164
5189
  return node;
5165
5190
  }
5166
- node.height = 1 + Math.max(this.getHeight(node.leftNode), this.getHeight(node.rightNode));
5191
+ node.height = 1 + this.getMax(this.getHeight(node.leftNode), this.getHeight(node.rightNode));
5167
5192
  let balancingFactor = this.getBalanceFactor(node);
5193
+ // this is left heavy
5168
5194
  if (balancingFactor > 1) {
5169
5195
  if (node.leftNode) {
5170
- if (passedNode.key < node.leftNode.key) {
5196
+ if (this.getBalanceFactor(node.leftNode) >= 0) {
5171
5197
  return this.rightRotate(node);
5172
5198
  }
5173
- else if (passedNode.key > node.leftNode.key) {
5199
+ if (this.getBalanceFactor(node.leftNode) < 0) {
5174
5200
  node.leftNode = this.leftRotate(node.leftNode);
5175
5201
  return this.rightRotate(node);
5176
5202
  }
5177
5203
  }
5178
5204
  }
5205
+ // this is right heavy
5179
5206
  if (balancingFactor < -1) {
5180
5207
  if (node.rightNode) {
5181
- if (passedNode.key > node.rightNode.key) {
5208
+ if (this.getBalanceFactor(node.rightNode) <= 0) {
5182
5209
  return this.leftRotate(node);
5183
5210
  }
5184
- else if (passedNode.key < node.rightNode.key) {
5211
+ if (this.getBalanceFactor(node.rightNode) > 0) {
5185
5212
  node.rightNode = this.rightRotate(node.rightNode);
5186
5213
  return this.leftRotate(node);
5187
5214
  }
5188
5215
  }
5189
5216
  }
5190
5217
  return node;
5218
+ // }
5219
+ // catch(error){
5220
+ // console.log("this is the error in binary tree making", error, passedNode, node, height);
5221
+ // //throw error;
5222
+ // }
5191
5223
  }
5192
5224
  addTypeNode(passedNode, node, height) {
5193
5225
  let debugFlag = false;
@@ -5226,7 +5258,7 @@ class ConnectionNode {
5226
5258
  }
5227
5259
  return node;
5228
5260
  }
5229
- node.height = 1 + Math.max(this.getHeight(node.leftNode), this.getHeight(node.rightNode));
5261
+ node.height = 1 + this.getMax(this.getHeight(node.leftNode), this.getHeight(node.rightNode));
5230
5262
  if (debugFlag) {
5231
5263
  console.log("height here", node.height);
5232
5264
  }
@@ -5290,10 +5322,12 @@ class ConnectionNode {
5290
5322
  let T2 = x.rightNode;
5291
5323
  y.leftNode = T2;
5292
5324
  x.rightNode = y;
5293
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(y.rightNode)) + 1;
5294
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
5325
+ y.height = this.getMax(this.getHeight(y.leftNode), this.getHeight(y.rightNode)) + 1;
5326
+ x.height = this.getMax(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
5295
5327
  return x;
5296
5328
  }
5329
+ console.log("this is the error in right rotation", y, x);
5330
+ throw new Error("Cannot perform right rotation: left node is null.");
5297
5331
  // return x;
5298
5332
  }
5299
5333
  return y;
@@ -5305,10 +5339,12 @@ class ConnectionNode {
5305
5339
  let T2 = y.leftNode;
5306
5340
  y.leftNode = x;
5307
5341
  x.rightNode = T2;
5308
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
5309
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
5342
+ x.height = this.getMax(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
5343
+ y.height = this.getMax(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
5310
5344
  return y;
5311
5345
  }
5346
+ console.log("this is the error in left rotation", x, y);
5347
+ throw new Error("Cannot perform left rotation: right node is null.");
5312
5348
  //return y;
5313
5349
  }
5314
5350
  return x;
@@ -5326,23 +5362,29 @@ class ConnectionNode {
5326
5362
  return this.getHeight(N.leftNode) - this.getHeight(N.rightNode);
5327
5363
  }
5328
5364
  getFromNode(id, node) {
5329
- if (node) {
5330
- if (id == node.key) {
5331
- if (node.value.count) {
5332
- node.value.count++;
5365
+ try {
5366
+ if (node) {
5367
+ // console.log("this is the node test", id, node, node.leftNode, node.rightNode);
5368
+ if (id == node.key) {
5369
+ if (node.value.count) {
5370
+ node.value.count++;
5371
+ }
5372
+ else {
5373
+ node.value.count = 1;
5374
+ }
5375
+ return node;
5333
5376
  }
5334
- else {
5335
- node.value.count = 1;
5377
+ else if (id < node.key) {
5378
+ return this.getFromNode(id, node.leftNode);
5379
+ }
5380
+ else if (id > node.key) {
5381
+ return this.getFromNode(id, node.rightNode);
5336
5382
  }
5337
5383
  return node;
5338
5384
  }
5339
- else if (id < node.key) {
5340
- return this.getFromNode(id, node.leftNode);
5341
- }
5342
- else if (id > node.key) {
5343
- return this.getFromNode(id, node.rightNode);
5344
- }
5345
- return node;
5385
+ }
5386
+ catch (exception) {
5387
+ console.log("this is the exception", id, node, node === null || node === void 0 ? void 0 : node.leftNode, node === null || node === void 0 ? void 0 : node.rightNode);
5346
5388
  }
5347
5389
  return node;
5348
5390
  }
@@ -5531,10 +5573,10 @@ class ConnectionOfNode extends _NodePrimitive__WEBPACK_IMPORTED_MODULE_0__.NodeP
5531
5573
  }
5532
5574
  addNode(passedNode, node, height) {
5533
5575
  if (node == null) {
5534
- node = passedNode;
5576
+ //node= passedNode;
5535
5577
  // let event = new Event(`${passedNode.key}`);
5536
5578
  // dispatchEvent(event);
5537
- return node;
5579
+ return passedNode;
5538
5580
  }
5539
5581
  let LeftNode = node.leftNode;
5540
5582
  let RightNode = node.rightNode;
@@ -5551,11 +5593,11 @@ class ConnectionOfNode extends _NodePrimitive__WEBPACK_IMPORTED_MODULE_0__.NodeP
5551
5593
  let balancingFactor = this.getBalanceFactor(node);
5552
5594
  if (balancingFactor > 1) {
5553
5595
  if (node.leftNode) {
5554
- if (passedNode.key < node.leftNode.key) {
5596
+ if (this.getBalanceFactor(node.leftNode) >= 0) {
5555
5597
  let returner = this.rightRotate(node);
5556
5598
  return returner;
5557
5599
  }
5558
- else if (passedNode.key > node.leftNode.key) {
5600
+ if (this.getBalanceFactor(node.leftNode) < 0) {
5559
5601
  node.leftNode = this.leftRotate(node.leftNode);
5560
5602
  let returner = this.rightRotate(node);
5561
5603
  return returner;
@@ -5564,11 +5606,11 @@ class ConnectionOfNode extends _NodePrimitive__WEBPACK_IMPORTED_MODULE_0__.NodeP
5564
5606
  }
5565
5607
  if (balancingFactor < -1) {
5566
5608
  if (node.rightNode) {
5567
- if (passedNode.key > node.rightNode.key) {
5609
+ if (this.getBalanceFactor(node.rightNode) <= 0) {
5568
5610
  let returner = this.leftRotate(node);
5569
5611
  return returner;
5570
5612
  }
5571
- else if (passedNode.key < node.rightNode.key) {
5613
+ if (this.getBalanceFactor(node.rightNode) > 0) {
5572
5614
  node.rightNode = this.rightRotate(node.rightNode);
5573
5615
  let returner = this.leftRotate(node);
5574
5616
  return returner;
@@ -5940,8 +5982,8 @@ class NodePrimitive {
5940
5982
  let T2 = y.leftNode;
5941
5983
  y.leftNode = x;
5942
5984
  x.rightNode = T2;
5943
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
5944
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
5985
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
5986
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
5945
5987
  return y;
5946
5988
  }
5947
5989
  //return y;
@@ -6073,9 +6115,15 @@ class ConnectionData {
6073
6115
  // this.connectionArray.push(connection);
6074
6116
  // if(!connection.isTemp){
6075
6117
  //UpdateToDatabase("connection", connection);
6076
- _ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_3__.ConnectionBinaryTree.addConnectionToTree(connection);
6077
- _ConnectionBinaryTree_ConnectionTypeTree__WEBPACK_IMPORTED_MODULE_5__.ConnectionTypeTree.addConnectionToTree(connection);
6078
- _ConnectionBinaryTree_ConnectionOfTheTree__WEBPACK_IMPORTED_MODULE_4__.ConnectionOfTheTree.addConnection(connection);
6118
+ try {
6119
+ _ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_3__.ConnectionBinaryTree.addConnectionToTree(connection);
6120
+ _ConnectionBinaryTree_ConnectionTypeTree__WEBPACK_IMPORTED_MODULE_5__.ConnectionTypeTree.addConnectionToTree(connection);
6121
+ _ConnectionBinaryTree_ConnectionOfTheTree__WEBPACK_IMPORTED_MODULE_4__.ConnectionOfTheTree.addConnection(connection);
6122
+ }
6123
+ catch (error) {
6124
+ console.log("this is the error in making the connection");
6125
+ throw error;
6126
+ }
6079
6127
  }
6080
6128
  static AddConnectionToMemory(connection) {
6081
6129
  if (!connection.isTemp) {
@@ -6180,14 +6228,19 @@ class ConnectionData {
6180
6228
  return res.data;
6181
6229
  }
6182
6230
  let connections = [];
6183
- let connectionIds = [];
6184
- connectionIds = ConnectionData.GetConnectionByOfType(id, id);
6185
- for (let i = 0; i < connectionIds.length; i++) {
6186
- let conn = yield _ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_3__.ConnectionBinaryTree.getNodeFromTree(connectionIds[i]);
6187
- if (conn) {
6188
- connections.push(conn.value);
6231
+ try {
6232
+ let connectionIds = [];
6233
+ connectionIds = ConnectionData.GetConnectionByOfType(id, id);
6234
+ for (let i = 0; i < connectionIds.length; i++) {
6235
+ let conn = yield _ConnectionBinaryTree_ConnectionBinaryTree__WEBPACK_IMPORTED_MODULE_3__.ConnectionBinaryTree.getNodeFromTree(connectionIds[i]);
6236
+ if (conn) {
6237
+ connections.push(conn.value);
6238
+ }
6189
6239
  }
6190
6240
  }
6241
+ catch (error) {
6242
+ console.log("this is the error GetConnectionsOfCompositionLocal", id, connections);
6243
+ }
6191
6244
  return connections;
6192
6245
  //let node = await ConnectionTypeTree.getNodeFromTree(id);
6193
6246
  // if(node?.value){
@@ -6677,8 +6730,8 @@ class LNode {
6677
6730
  let T2 = y.leftNode;
6678
6731
  y.leftNode = x;
6679
6732
  x.rightNode = T2;
6680
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
6681
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
6733
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
6734
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
6682
6735
  return y;
6683
6736
  }
6684
6737
  //return y;
@@ -8497,8 +8550,8 @@ class Node {
8497
8550
  let T2 = y.leftNode;
8498
8551
  y.leftNode = x;
8499
8552
  x.rightNode = T2;
8500
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
8501
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
8553
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
8554
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
8502
8555
  return y;
8503
8556
  }
8504
8557
  //return y;
@@ -9422,8 +9475,8 @@ class TypeNode {
9422
9475
  let T2 = y.leftNode;
9423
9476
  y.leftNode = x;
9424
9477
  x.rightNode = T2;
9425
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
9426
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
9478
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
9479
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
9427
9480
  return y;
9428
9481
  }
9429
9482
  //return y;
@@ -9705,8 +9758,8 @@ class UserNode {
9705
9758
  let T2 = y.leftNode;
9706
9759
  y.leftNode = x;
9707
9760
  x.rightNode = T2;
9708
- x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode) + 1);
9709
- y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode) + 1);
9761
+ x.height = Math.max(this.getHeight(x.leftNode), this.getHeight(x.rightNode)) + 1;
9762
+ y.height = Math.max(this.getHeight(y.leftNode), this.getHeight(x.rightNode)) + 1;
9710
9763
  return y;
9711
9764
  }
9712
9765
  //return y;
@@ -12481,29 +12534,34 @@ function GetCompositionWithIdFromMemory(id) {
12481
12534
  // console.log('data received from sw', res)
12482
12535
  return res.data;
12483
12536
  }
12537
+ let FinalReturn = {};
12484
12538
  let connectionList = [];
12485
12539
  let returnOutput = {};
12486
12540
  // connectionList = await ConnectionData.GetConnectionsOfConcept(id);
12487
- connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);
12488
- let compositionList = [];
12489
- for (let i = 0; i < connectionList.length; i++) {
12490
- if (!compositionList.includes(connectionList[i].ofTheConceptId)) {
12491
- compositionList.push(connectionList[i].ofTheConceptId);
12541
+ try {
12542
+ connectionList = yield _DataStructures_ConnectionData__WEBPACK_IMPORTED_MODULE_3__.ConnectionData.GetConnectionsOfCompositionLocal(id);
12543
+ let compositionList = [];
12544
+ for (let i = 0; i < connectionList.length; i++) {
12545
+ if (!compositionList.includes(connectionList[i].ofTheConceptId)) {
12546
+ compositionList.push(connectionList[i].ofTheConceptId);
12547
+ }
12492
12548
  }
12549
+ let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);
12550
+ if (concept.id == 0 && id != null && id != undefined) {
12551
+ let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);
12552
+ concept = conceptString;
12553
+ }
12554
+ let output = yield recursiveFetchConcept(concept, connectionList, compositionList);
12555
+ // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );
12556
+ let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "";
12557
+ returnOutput[mainString] = output;
12558
+ FinalReturn['created_at'] = concept.entryTimeStamp;
12559
+ FinalReturn['data'] = returnOutput;
12560
+ FinalReturn['id'] = id;
12493
12561
  }
12494
- let concept = yield _DataStructures_ConceptData__WEBPACK_IMPORTED_MODULE_2__.ConceptsData.GetConcept(id);
12495
- if (concept.id == 0 && id != null && id != undefined) {
12496
- let conceptString = yield (0,_Api_GetConcept__WEBPACK_IMPORTED_MODULE_0__.GetConcept)(id);
12497
- concept = conceptString;
12562
+ catch (error) {
12563
+ console.log("this is the exception in GetCompositionWithIdFromMemory", id);
12498
12564
  }
12499
- let output = yield recursiveFetchConcept(concept, connectionList, compositionList);
12500
- // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );
12501
- let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "";
12502
- returnOutput[mainString] = output;
12503
- let FinalReturn = {};
12504
- FinalReturn['created_at'] = concept.entryTimeStamp;
12505
- FinalReturn['data'] = returnOutput;
12506
- FinalReturn['id'] = id;
12507
12565
  return FinalReturn;
12508
12566
  });
12509
12567
  }
@@ -12573,6 +12631,7 @@ function GetCompositionWithIdFromMemoryFromConnection(id, connectionList) {
12573
12631
  concept = conceptString;
12574
12632
  }
12575
12633
  let output = yield recursiveFetchConcept(concept, connectionList, compositionList);
12634
+ console.log("this is the output", output, concept);
12576
12635
  // let output = await recursiveFetchConceptSingleLoop(concept, connectionList,compositionList );
12577
12636
  let mainString = (_b = (_a = concept === null || concept === void 0 ? void 0 : concept.type) === null || _a === void 0 ? void 0 : _a.characterValue) !== null && _b !== void 0 ? _b : "";
12578
12637
  returnOutput[mainString] = output;
@@ -20099,10 +20158,10 @@ __webpack_require__.r(__webpack_exports__);
20099
20158
  /* harmony export */ ADMIN: () => (/* reexport safe */ _Constants_AccessConstants__WEBPACK_IMPORTED_MODULE_66__.ADMIN),
20100
20159
  /* harmony export */ ALLID: () => (/* reexport safe */ _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_65__.ALLID),
20101
20160
  /* harmony export */ AddGhostConcept: () => (/* reexport safe */ _Services_User_UserTranslation__WEBPACK_IMPORTED_MODULE_50__.AddGhostConcept),
20102
- /* harmony export */ Anomaly: () => (/* reexport safe */ _Anomaly_anomaly__WEBPACK_IMPORTED_MODULE_103__.Anomaly),
20161
+ /* harmony export */ Anomaly: () => (/* reexport safe */ _Anomaly_anomaly__WEBPACK_IMPORTED_MODULE_104__.Anomaly),
20103
20162
  /* harmony export */ BaseUrl: () => (/* reexport safe */ _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__.BaseUrl),
20104
20163
  /* harmony export */ BinaryTree: () => (/* reexport safe */ _DataStructures_BinaryTree__WEBPACK_IMPORTED_MODULE_83__.BinaryTree),
20105
- /* harmony export */ BuilderStatefulWidget: () => (/* reexport safe */ _Widgets_BuilderStatefulWidget__WEBPACK_IMPORTED_MODULE_101__.BuilderStatefulWidget),
20164
+ /* harmony export */ BuilderStatefulWidget: () => (/* reexport safe */ _Widgets_BuilderStatefulWidget__WEBPACK_IMPORTED_MODULE_102__.BuilderStatefulWidget),
20106
20165
  /* harmony export */ Composition: () => (/* reexport safe */ _DataStructures_Composition_Composition__WEBPACK_IMPORTED_MODULE_87__.Composition),
20107
20166
  /* harmony export */ CompositionBinaryTree: () => (/* reexport safe */ _DataStructures_Composition_CompositionBinaryTree__WEBPACK_IMPORTED_MODULE_88__.CompositionBinaryTree),
20108
20167
  /* harmony export */ CompositionNode: () => (/* reexport safe */ _DataStructures_Composition_CompositionNode__WEBPACK_IMPORTED_MODULE_89__.CompositionNode),
@@ -20129,17 +20188,17 @@ __webpack_require__.r(__webpack_exports__);
20129
20188
  /* harmony export */ DeleteConceptById: () => (/* reexport safe */ _Services_DeleteConcept__WEBPACK_IMPORTED_MODULE_24__.DeleteConceptById),
20130
20189
  /* harmony export */ DeleteConceptLocal: () => (/* reexport safe */ _Services_Local_DeleteConceptLocal__WEBPACK_IMPORTED_MODULE_61__.DeleteConceptLocal),
20131
20190
  /* harmony export */ DeleteConnectionById: () => (/* reexport safe */ _Services_DeleteConnection__WEBPACK_IMPORTED_MODULE_25__.DeleteConnectionById),
20132
- /* harmony export */ DeleteConnectionByType: () => (/* reexport safe */ _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_107__.DeleteConnectionByType),
20191
+ /* harmony export */ DeleteConnectionByType: () => (/* reexport safe */ _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_108__.DeleteConnectionByType),
20133
20192
  /* harmony export */ DeleteUser: () => (/* reexport safe */ _Services_DeleteConcept__WEBPACK_IMPORTED_MODULE_24__.DeleteUser),
20134
20193
  /* harmony export */ DependencyObserver: () => (/* reexport safe */ _WrapperFunctions_DepenedencyObserver__WEBPACK_IMPORTED_MODULE_68__.DependencyObserver),
20135
20194
  /* harmony export */ FilterSearch: () => (/* reexport safe */ _DataStructures_FilterSearch__WEBPACK_IMPORTED_MODULE_92__.FilterSearch),
20136
20195
  /* harmony export */ FormatFromConnections: () => (/* reexport safe */ _Services_Search_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_51__.FormatFromConnections),
20137
20196
  /* harmony export */ FormatFromConnectionsAltered: () => (/* reexport safe */ _Services_Search_SearchLinkMultiple__WEBPACK_IMPORTED_MODULE_51__.FormatFromConnectionsAltered),
20138
- /* harmony export */ FreeschemaQuery: () => (/* reexport safe */ _DataStructures_Search_FreeschemaQuery__WEBPACK_IMPORTED_MODULE_108__.FreeschemaQuery),
20139
- /* harmony export */ FreeschemaQueryApi: () => (/* reexport safe */ _Api_Search_FreeschemaQueryApi__WEBPACK_IMPORTED_MODULE_109__.FreeschemaQueryApi),
20197
+ /* harmony export */ FreeschemaQuery: () => (/* reexport safe */ _DataStructures_Search_FreeschemaQuery__WEBPACK_IMPORTED_MODULE_109__.FreeschemaQuery),
20198
+ /* harmony export */ FreeschemaQueryApi: () => (/* reexport safe */ _Api_Search_FreeschemaQueryApi__WEBPACK_IMPORTED_MODULE_110__.FreeschemaQueryApi),
20140
20199
  /* harmony export */ GetAllConnectionsOfComposition: () => (/* reexport safe */ _Api_GetAllConnectionsOfComposition__WEBPACK_IMPORTED_MODULE_6__.GetAllConnectionsOfComposition),
20141
20200
  /* harmony export */ GetAllConnectionsOfCompositionBulk: () => (/* reexport safe */ _Api_GetAllConnectionsOfCompositionBulk__WEBPACK_IMPORTED_MODULE_33__.GetAllConnectionsOfCompositionBulk),
20142
- /* harmony export */ GetAllTheConnectionsByTypeAndOfTheConcept: () => (/* reexport safe */ _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_107__.GetAllTheConnectionsByTypeAndOfTheConcept),
20201
+ /* harmony export */ GetAllTheConnectionsByTypeAndOfTheConcept: () => (/* reexport safe */ _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_108__.GetAllTheConnectionsByTypeAndOfTheConcept),
20143
20202
  /* harmony export */ GetComposition: () => (/* reexport safe */ _Services_GetComposition__WEBPACK_IMPORTED_MODULE_7__.GetComposition),
20144
20203
  /* harmony export */ GetCompositionBulk: () => (/* reexport safe */ _Services_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_30__.GetCompositionBulk),
20145
20204
  /* harmony export */ GetCompositionBulkWithDataId: () => (/* reexport safe */ _Services_GetCompositionBulk__WEBPACK_IMPORTED_MODULE_30__.GetCompositionBulkWithDataId),
@@ -20194,7 +20253,7 @@ __webpack_require__.r(__webpack_exports__);
20194
20253
  /* harmony export */ LISTNORMAL: () => (/* reexport safe */ _Constants_FormatConstants__WEBPACK_IMPORTED_MODULE_65__.LISTNORMAL),
20195
20254
  /* harmony export */ LocalConceptsData: () => (/* reexport safe */ _DataStructures_Local_LocalConceptData__WEBPACK_IMPORTED_MODULE_94__.LocalConceptsData),
20196
20255
  /* harmony export */ LocalSyncData: () => (/* reexport safe */ _DataStructures_Local_LocalSyncData__WEBPACK_IMPORTED_MODULE_90__.LocalSyncData),
20197
- /* harmony export */ LocalTransaction: () => (/* reexport safe */ _Services_Transaction_LocalTransaction__WEBPACK_IMPORTED_MODULE_102__.LocalTransaction),
20256
+ /* harmony export */ LocalTransaction: () => (/* reexport safe */ _Services_Transaction_LocalTransaction__WEBPACK_IMPORTED_MODULE_103__.LocalTransaction),
20198
20257
  /* harmony export */ LoginToBackend: () => (/* reexport safe */ _Api_Login__WEBPACK_IMPORTED_MODULE_34__.LoginToBackend),
20199
20258
  /* harmony export */ MakeTheInstanceConcept: () => (/* reexport safe */ _Services_MakeTheInstanceConcept__WEBPACK_IMPORTED_MODULE_13__["default"]),
20200
20259
  /* harmony export */ MakeTheInstanceConceptLocal: () => (/* reexport safe */ _Services_Local_MakeTheInstanceConceptLocal__WEBPACK_IMPORTED_MODULE_14__.MakeTheInstanceConceptLocal),
@@ -20213,7 +20272,7 @@ __webpack_require__.r(__webpack_exports__);
20213
20272
  /* harmony export */ RecursiveSearchApiRawFullLinker: () => (/* reexport safe */ _Api_RecursiveSearch__WEBPACK_IMPORTED_MODULE_29__.RecursiveSearchApiRawFullLinker),
20214
20273
  /* harmony export */ RecursiveSearchApiWithInternalConnections: () => (/* reexport safe */ _Api_RecursiveSearch__WEBPACK_IMPORTED_MODULE_29__.RecursiveSearchApiWithInternalConnections),
20215
20274
  /* harmony export */ RecursiveSearchListener: () => (/* reexport safe */ _WrapperFunctions_RecursiveSearchObservable__WEBPACK_IMPORTED_MODULE_74__.RecursiveSearchListener),
20216
- /* harmony export */ SchemaQueryListener: () => (/* reexport safe */ _WrapperFunctions_SchemaQueryObservable__WEBPACK_IMPORTED_MODULE_110__.SchemaQueryListener),
20275
+ /* harmony export */ SchemaQueryListener: () => (/* reexport safe */ _WrapperFunctions_SchemaQueryObservable__WEBPACK_IMPORTED_MODULE_111__.SchemaQueryListener),
20217
20276
  /* harmony export */ SearchAllConcepts: () => (/* reexport safe */ _Api_Search_Search__WEBPACK_IMPORTED_MODULE_39__.SearchAllConcepts),
20218
20277
  /* harmony export */ SearchLinkInternal: () => (/* reexport safe */ _Services_Search_SearchLinkInternal__WEBPACK_IMPORTED_MODULE_59__.SearchLinkInternal),
20219
20278
  /* harmony export */ SearchLinkInternalAll: () => (/* reexport safe */ _Services_Search_SearchLinkInternal__WEBPACK_IMPORTED_MODULE_59__.SearchLinkInternalAll),
@@ -20230,19 +20289,19 @@ __webpack_require__.r(__webpack_exports__);
20230
20289
  /* harmony export */ Signup: () => (/* reexport safe */ _Api_Signup__WEBPACK_IMPORTED_MODULE_36__["default"]),
20231
20290
  /* harmony export */ SignupEntity: () => (/* reexport safe */ _Api_Signup__WEBPACK_IMPORTED_MODULE_36__.SignupEntity),
20232
20291
  /* harmony export */ SplitStrings: () => (/* reexport safe */ _Services_SplitStrings__WEBPACK_IMPORTED_MODULE_3__.SplitStrings),
20233
- /* harmony export */ StatefulWidget: () => (/* reexport safe */ _Widgets_StatefulWidget__WEBPACK_IMPORTED_MODULE_106__.StatefulWidget),
20292
+ /* harmony export */ StatefulWidget: () => (/* reexport safe */ _Widgets_StatefulWidget__WEBPACK_IMPORTED_MODULE_107__.StatefulWidget),
20234
20293
  /* harmony export */ SyncData: () => (/* reexport safe */ _DataStructures_SyncData__WEBPACK_IMPORTED_MODULE_76__.SyncData),
20235
20294
  /* harmony export */ TrashTheConcept: () => (/* reexport safe */ _Api_Delete_DeleteConceptInBackend__WEBPACK_IMPORTED_MODULE_26__.TrashTheConcept),
20236
20295
  /* harmony export */ UpdateComposition: () => (/* reexport safe */ _Services_UpdateComposition__WEBPACK_IMPORTED_MODULE_38__["default"]),
20237
20296
  /* harmony export */ UpdateCompositionLocal: () => (/* reexport safe */ _Services_Local_UpdateCompositionLocal__WEBPACK_IMPORTED_MODULE_53__.UpdateCompositionLocal),
20238
20297
  /* harmony export */ UserBinaryTree: () => (/* reexport safe */ _DataStructures_User_UserBinaryTree__WEBPACK_IMPORTED_MODULE_91__.UserBinaryTree),
20239
- /* harmony export */ Validator: () => (/* reexport safe */ _Validator_validator__WEBPACK_IMPORTED_MODULE_104__.Validator),
20298
+ /* harmony export */ Validator: () => (/* reexport safe */ _Validator_validator__WEBPACK_IMPORTED_MODULE_105__.Validator),
20240
20299
  /* harmony export */ ViewInternalData: () => (/* reexport safe */ _Services_View_ViewInternalData__WEBPACK_IMPORTED_MODULE_56__.ViewInternalData),
20241
20300
  /* harmony export */ ViewInternalDataApi: () => (/* reexport safe */ _Api_View_ViewInternalDataApi__WEBPACK_IMPORTED_MODULE_57__.ViewInternalDataApi),
20242
- /* harmony export */ WidgetTree: () => (/* reexport safe */ _Widgets_WidgetTree__WEBPACK_IMPORTED_MODULE_111__.WidgetTree),
20301
+ /* harmony export */ WidgetTree: () => (/* reexport safe */ _Widgets_WidgetTree__WEBPACK_IMPORTED_MODULE_112__.WidgetTree),
20243
20302
  /* harmony export */ convertFromConceptToLConcept: () => (/* reexport safe */ _Services_Conversion_ConvertConcepts__WEBPACK_IMPORTED_MODULE_58__.convertFromConceptToLConcept),
20244
20303
  /* harmony export */ convertFromLConceptToConcept: () => (/* reexport safe */ _Services_Conversion_ConvertConcepts__WEBPACK_IMPORTED_MODULE_58__.convertFromLConceptToConcept),
20245
- /* harmony export */ createFormFieldData: () => (/* reexport safe */ _Validator_utils__WEBPACK_IMPORTED_MODULE_105__.createFormFieldData),
20304
+ /* harmony export */ createFormFieldData: () => (/* reexport safe */ _Validator_utils__WEBPACK_IMPORTED_MODULE_106__.createFormFieldData),
20246
20305
  /* harmony export */ dispatchIdEvent: () => (/* binding */ dispatchIdEvent),
20247
20306
  /* harmony export */ getFromDatabaseWithType: () => (/* reexport safe */ _Database_NoIndexDb__WEBPACK_IMPORTED_MODULE_15__.getFromDatabaseWithType),
20248
20307
  /* harmony export */ getObjectsFromIndexDb: () => (/* reexport safe */ _Database_NoIndexDb__WEBPACK_IMPORTED_MODULE_15__.getObjectsFromIndexDb),
@@ -20357,17 +20416,18 @@ __webpack_require__.r(__webpack_exports__);
20357
20416
  /* harmony import */ var _DataStructures_BaseUrl__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./DataStructures/BaseUrl */ "./src/DataStructures/BaseUrl.ts");
20358
20417
  /* harmony import */ var _DataStructures_Security_TokenStorage__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./DataStructures/Security/TokenStorage */ "./src/DataStructures/Security/TokenStorage.ts");
20359
20418
  /* harmony import */ var _Constants_general_const__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./Constants/general.const */ "./src/Constants/general.const.ts");
20360
- /* harmony import */ var _Widgets_BuilderStatefulWidget__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./Widgets/BuilderStatefulWidget */ "./src/Widgets/BuilderStatefulWidget.ts");
20361
- /* harmony import */ var _Services_Transaction_LocalTransaction__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./Services/Transaction/LocalTransaction */ "./src/Services/Transaction/LocalTransaction.ts");
20362
- /* harmony import */ var _Anomaly_anomaly__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./Anomaly/anomaly */ "./src/Anomaly/anomaly.ts");
20363
- /* harmony import */ var _Validator_validator__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./Validator/validator */ "./src/Validator/validator.ts");
20364
- /* harmony import */ var _Validator_utils__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./Validator/utils */ "./src/Validator/utils.ts");
20365
- /* harmony import */ var _Widgets_StatefulWidget__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./Widgets/StatefulWidget */ "./src/Widgets/StatefulWidget.ts");
20366
- /* harmony import */ var _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./Services/DeleteConnectionByType */ "./src/Services/DeleteConnectionByType.ts");
20367
- /* harmony import */ var _DataStructures_Search_FreeschemaQuery__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./DataStructures/Search/FreeschemaQuery */ "./src/DataStructures/Search/FreeschemaQuery.ts");
20368
- /* harmony import */ var _Api_Search_FreeschemaQueryApi__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./Api/Search/FreeschemaQueryApi */ "./src/Api/Search/FreeschemaQueryApi.ts");
20369
- /* harmony import */ var _WrapperFunctions_SchemaQueryObservable__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./WrapperFunctions/SchemaQueryObservable */ "./src/WrapperFunctions/SchemaQueryObservable.ts");
20370
- /* harmony import */ var _Widgets_WidgetTree__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./Widgets/WidgetTree */ "./src/Widgets/WidgetTree.ts");
20419
+ /* harmony import */ var _Services_Common_ErrorPosting__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./Services/Common/ErrorPosting */ "./src/Services/Common/ErrorPosting.ts");
20420
+ /* harmony import */ var _Widgets_BuilderStatefulWidget__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./Widgets/BuilderStatefulWidget */ "./src/Widgets/BuilderStatefulWidget.ts");
20421
+ /* harmony import */ var _Services_Transaction_LocalTransaction__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./Services/Transaction/LocalTransaction */ "./src/Services/Transaction/LocalTransaction.ts");
20422
+ /* harmony import */ var _Anomaly_anomaly__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./Anomaly/anomaly */ "./src/Anomaly/anomaly.ts");
20423
+ /* harmony import */ var _Validator_validator__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./Validator/validator */ "./src/Validator/validator.ts");
20424
+ /* harmony import */ var _Validator_utils__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./Validator/utils */ "./src/Validator/utils.ts");
20425
+ /* harmony import */ var _Widgets_StatefulWidget__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./Widgets/StatefulWidget */ "./src/Widgets/StatefulWidget.ts");
20426
+ /* harmony import */ var _Services_DeleteConnectionByType__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./Services/DeleteConnectionByType */ "./src/Services/DeleteConnectionByType.ts");
20427
+ /* harmony import */ var _DataStructures_Search_FreeschemaQuery__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./DataStructures/Search/FreeschemaQuery */ "./src/DataStructures/Search/FreeschemaQuery.ts");
20428
+ /* harmony import */ var _Api_Search_FreeschemaQueryApi__WEBPACK_IMPORTED_MODULE_110__ = __webpack_require__(/*! ./Api/Search/FreeschemaQueryApi */ "./src/Api/Search/FreeschemaQueryApi.ts");
20429
+ /* harmony import */ var _WrapperFunctions_SchemaQueryObservable__WEBPACK_IMPORTED_MODULE_111__ = __webpack_require__(/*! ./WrapperFunctions/SchemaQueryObservable */ "./src/WrapperFunctions/SchemaQueryObservable.ts");
20430
+ /* harmony import */ var _Widgets_WidgetTree__WEBPACK_IMPORTED_MODULE_112__ = __webpack_require__(/*! ./Widgets/WidgetTree */ "./src/Widgets/WidgetTree.ts");
20371
20431
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
20372
20432
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
20373
20433
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -20496,6 +20556,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
20496
20556
 
20497
20557
 
20498
20558
 
20559
+
20499
20560
 
20500
20561
 
20501
20562
  var serviceWorker;
@@ -20617,7 +20678,9 @@ function init() {
20617
20678
  })
20618
20679
  .then((registration) => __awaiter(this, void 0, void 0, function* () {
20619
20680
  console.log("Service Worker registered:", registration);
20681
+ // If the service worker is already active, mark it as ready
20620
20682
  if (registration.active) {
20683
+ serviceWorkerReady = true;
20621
20684
  console.log("active sw");
20622
20685
  serviceWorker = registration.active;
20623
20686
  yield sendMessage("init", {
@@ -20629,6 +20692,7 @@ function init() {
20629
20692
  applicationName,
20630
20693
  isTest,
20631
20694
  });
20695
+ processMessageQueue();
20632
20696
  resolve();
20633
20697
  }
20634
20698
  else {
@@ -20691,6 +20755,7 @@ function init() {
20691
20755
  };
20692
20756
  // Listen for the activation of the new service worker
20693
20757
  registration.addEventListener('controllerchange', () => __awaiter(this, void 0, void 0, function* () {
20758
+ console.warn('controller change triggered', navigator.serviceWorker.controller);
20694
20759
  if (navigator.serviceWorker.controller) {
20695
20760
  serviceWorker = navigator.serviceWorker.controller;
20696
20761
  console.log('Service worker has been activated');
@@ -20707,12 +20772,6 @@ function init() {
20707
20772
  // You can reload the page if necessary or handle the update process here
20708
20773
  }
20709
20774
  }));
20710
- // If the service worker is already active, mark it as ready
20711
- if (registration.active) {
20712
- serviceWorkerReady = true;
20713
- console.log('Service Worker is already active');
20714
- processMessageQueue();
20715
- }
20716
20775
  }))
20717
20776
  .catch((error) => __awaiter(this, void 0, void 0, function* () {
20718
20777
  yield initConceptConnection();
@@ -20761,9 +20820,17 @@ function sendMessage(type, payload) {
20761
20820
  // .then((registration) => {
20762
20821
  if (navigator.serviceWorker.controller) {
20763
20822
  const responseHandler = (event) => {
20764
- var _a, _b;
20823
+ var _a, _b, _c;
20765
20824
  if (((_a = event === null || event === void 0 ? void 0 : event.data) === null || _a === void 0 ? void 0 : _a.messageId) == messageId) { // Check if the message ID matches
20766
- if ((_b = event.data) === null || _b === void 0 ? void 0 : _b.actions) {
20825
+ if (!event.data.success) {
20826
+ if (event.data.status == 401) {
20827
+ reject((0,_Services_Common_ErrorPosting__WEBPACK_IMPORTED_MODULE_101__.HandleHttpError)(new Response('Unauthorized', { status: 401, statusText: (_b = event === null || event === void 0 ? void 0 : event.data) === null || _b === void 0 ? void 0 : _b.statusText })));
20828
+ }
20829
+ else {
20830
+ reject(`Failed to handle action ${type} ${JSON.stringify(payload)}`);
20831
+ }
20832
+ }
20833
+ if ((_c = event.data) === null || _c === void 0 ? void 0 : _c.actions) {
20767
20834
  payload.actions = JSON.parse(JSON.stringify(event.data.actions));
20768
20835
  }
20769
20836
  resolve(event.data);
@@ -20774,12 +20841,13 @@ function sendMessage(type, payload) {
20774
20841
  // console.log("before sending message", type, 'new', newPayload);
20775
20842
  // serviceWorker?.postMessage({ type, payload });
20776
20843
  // Send the message to the service worker
20777
- if (navigator.serviceWorker.controller) {
20844
+ if (serviceWorker) {
20778
20845
  try {
20779
- navigator.serviceWorker.controller.postMessage({ type, payload: newPayload });
20846
+ serviceWorker.postMessage({ type, payload: newPayload });
20780
20847
  }
20781
20848
  catch (err) {
20782
20849
  console.log(err);
20850
+ // serviceWorker.postMessage({ type, payload: newPayload });
20783
20851
  serviceWorker.postMessage({ type, payload: newPayload });
20784
20852
  }
20785
20853
  // navigator.serviceWorker.controller.postMessage({ type, payload });
@@ -20789,8 +20857,9 @@ function sendMessage(type, payload) {
20789
20857
  setTimeout(() => {
20790
20858
  // if (navigator.serviceWorker.controller) {
20791
20859
  if (serviceWorker) {
20792
- serviceWorker.postMessage({ type, payload });
20793
- // navigator.serviceWorker.controller.postMessage({ type, payload });
20860
+ // serviceWorker.postMessage({ type, payload });
20861
+ console.info('This is triggered ');
20862
+ serviceWorker === null || serviceWorker === void 0 ? void 0 : serviceWorker.postMessage({ type, payload });
20794
20863
  }
20795
20864
  else {
20796
20865
  console.log('not ready', type);
@@ -20807,6 +20876,8 @@ function sendMessage(type, payload) {
20807
20876
  else {
20808
20877
  messageQueue.push({ message: { type, payload: newPayload } });
20809
20878
  console.log('Message Queued', type, payload);
20879
+ if (type == 'init')
20880
+ resolve(null);
20810
20881
  }
20811
20882
  // })
20812
20883
  // .catch(err => reject(err))