@webex/plugin-meetings 3.12.0-next.2 → 3.12.0-next.21

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.
Files changed (67) hide show
  1. package/dist/aiEnableRequest/index.js +1 -1
  2. package/dist/breakouts/breakout.js +1 -1
  3. package/dist/breakouts/index.js +1 -1
  4. package/dist/controls-options-manager/constants.js +11 -1
  5. package/dist/controls-options-manager/constants.js.map +1 -1
  6. package/dist/controls-options-manager/index.js +23 -21
  7. package/dist/controls-options-manager/index.js.map +1 -1
  8. package/dist/controls-options-manager/util.js +91 -0
  9. package/dist/controls-options-manager/util.js.map +1 -1
  10. package/dist/hashTree/constants.js +10 -1
  11. package/dist/hashTree/constants.js.map +1 -1
  12. package/dist/hashTree/hashTreeParser.js +56 -31
  13. package/dist/hashTree/hashTreeParser.js.map +1 -1
  14. package/dist/hashTree/utils.js +22 -0
  15. package/dist/hashTree/utils.js.map +1 -1
  16. package/dist/interpretation/index.js +1 -1
  17. package/dist/interpretation/siLanguage.js +1 -1
  18. package/dist/locus-info/index.js +51 -23
  19. package/dist/locus-info/index.js.map +1 -1
  20. package/dist/meeting/index.js +372 -292
  21. package/dist/meeting/index.js.map +1 -1
  22. package/dist/meeting/util.js +1 -0
  23. package/dist/meeting/util.js.map +1 -1
  24. package/dist/meetings/index.js +8 -9
  25. package/dist/meetings/index.js.map +1 -1
  26. package/dist/meetings/util.js +21 -2
  27. package/dist/meetings/util.js.map +1 -1
  28. package/dist/metrics/constants.js +5 -1
  29. package/dist/metrics/constants.js.map +1 -1
  30. package/dist/multistream/sendSlotManager.js +116 -2
  31. package/dist/multistream/sendSlotManager.js.map +1 -1
  32. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  33. package/dist/types/hashTree/constants.d.ts +1 -0
  34. package/dist/types/hashTree/hashTreeParser.d.ts +12 -2
  35. package/dist/types/hashTree/utils.d.ts +11 -0
  36. package/dist/types/locus-info/index.d.ts +9 -5
  37. package/dist/types/meeting/index.d.ts +11 -0
  38. package/dist/types/metrics/constants.d.ts +4 -0
  39. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  40. package/dist/webinar/index.js +301 -226
  41. package/dist/webinar/index.js.map +1 -1
  42. package/package.json +16 -16
  43. package/src/controls-options-manager/constants.ts +14 -1
  44. package/src/controls-options-manager/index.ts +26 -19
  45. package/src/controls-options-manager/util.ts +81 -1
  46. package/src/hashTree/constants.ts +9 -0
  47. package/src/hashTree/hashTreeParser.ts +60 -36
  48. package/src/hashTree/utils.ts +17 -0
  49. package/src/locus-info/index.ts +56 -30
  50. package/src/meeting/index.ts +98 -11
  51. package/src/meeting/util.ts +1 -0
  52. package/src/meetings/index.ts +15 -16
  53. package/src/meetings/util.ts +26 -1
  54. package/src/metrics/constants.ts +5 -0
  55. package/src/multistream/sendSlotManager.ts +97 -3
  56. package/src/webinar/index.ts +75 -1
  57. package/test/unit/spec/controls-options-manager/index.js +114 -6
  58. package/test/unit/spec/controls-options-manager/util.js +165 -0
  59. package/test/unit/spec/hashTree/hashTreeParser.ts +441 -30
  60. package/test/unit/spec/hashTree/utils.ts +88 -1
  61. package/test/unit/spec/locus-info/index.js +75 -27
  62. package/test/unit/spec/meeting/index.js +54 -36
  63. package/test/unit/spec/meeting/utils.js +4 -0
  64. package/test/unit/spec/meetings/index.js +36 -3
  65. package/test/unit/spec/meetings/utils.js +108 -0
  66. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  67. package/test/unit/spec/webinar/index.ts +60 -0
@@ -8,8 +8,10 @@ _Object$defineProperty(exports, "__esModule", {
8
8
  exports.deleteNestedObjectsWithHtMeta = void 0;
9
9
  exports.isMetadata = isMetadata;
10
10
  exports.isSelf = isSelf;
11
+ exports.sortByInitPriority = sortByInitPriority;
11
12
  var _isArray = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/is-array"));
12
13
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
14
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/toConsumableArray"));
13
15
  var _typeof2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/typeof"));
14
16
  var _types = require("./types");
15
17
  /* eslint-disable import/prefer-default-export */
@@ -66,4 +68,24 @@ var _deleteNestedObjectsWithHtMeta = exports.deleteNestedObjectsWithHtMeta = fun
66
68
  }
67
69
  }
68
70
  };
71
+
72
+ /**
73
+ * Reorders items so that those matching the given priority list come first (in priority order),
74
+ * followed by everything else in their original order.
75
+ *
76
+ * @param {Array<T>} items - The items to reorder
77
+ * @param {string[]} priority - Ordered list of names that should come first
78
+ * @returns {Array<T>} A new array with prioritized items first
79
+ */
80
+ function sortByInitPriority(items, priority) {
81
+ var prioritized = priority.map(function (name) {
82
+ return items.find(function (item) {
83
+ return item.name === name;
84
+ });
85
+ }).filter(Boolean);
86
+ var rest = items.filter(function (item) {
87
+ return !priority.includes(item.name);
88
+ });
89
+ return [].concat((0, _toConsumableArray2.default)(prioritized), (0, _toConsumableArray2.default)(rest));
90
+ }
69
91
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_types","require","isSelf","object","htMeta","elementId","type","toLowerCase","ObjectType","self","isMetadata","metadata","deleteNestedObjectsWithHtMeta","exports","currentLocusPart","parent","currentKey","_typeof2","default","undefined","_isArray","splice","Number","i","length","_i","_Object$keys","_keys","key","Object","prototype","hasOwnProperty","call"],"sources":["utils.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport {ObjectType, HashTreeObject} from './types';\n\n/**\n * Checks if the given hash tree object is of type \"self\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"self\", false otherwise\n */\nexport function isSelf(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.self;\n}\n\n/**\n * Checks if the given hash tree object is of type \"Metadata\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"Metadata\", false otherwise\n */\nexport function isMetadata(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.metadata;\n}\n\n/**\n * Analyzes given part of Locus DTO recursively and delete any nested objects that have their own htMeta\n *\n * @param {Object} currentLocusPart part of locus DTO to analyze\n * @param {Object} parent parent object\n * @param {string|number} currentKey key of the parent object that currentLocusPart is\n * @returns {void}\n */\nexport const deleteNestedObjectsWithHtMeta = (\n currentLocusPart: any,\n parent?: any,\n currentKey?: string | number\n) => {\n if (typeof currentLocusPart !== 'object' || currentLocusPart === null) {\n return;\n }\n\n if (parent && currentKey !== undefined && currentLocusPart.htMeta) {\n if (Array.isArray(parent)) {\n parent.splice(Number(currentKey), 1);\n } else {\n delete parent[currentKey];\n }\n\n return;\n }\n\n if (Array.isArray(currentLocusPart)) {\n // iterate array in reverse, so that indexes remain valid when deleting elements\n for (let i = currentLocusPart.length - 1; i >= 0; i -= 1) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[i], currentLocusPart, i);\n }\n } else {\n for (const key of Object.keys(currentLocusPart)) {\n if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[key], currentLocusPart, key);\n }\n }\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,MAAsB,EAAE;EAC7C,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACC,IAAI;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACP,MAAsB,EAAE;EACjD,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACG,QAAQ;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,8BAA6B,GAAAC,OAAA,CA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","elementId","type","toLowerCase","ObjectType","self","isMetadata","metadata","deleteNestedObjectsWithHtMeta","exports","currentLocusPart","parent","currentKey","_typeof2","default","undefined","_isArray","splice","Number","i","length","_i","_Object$keys","_keys","key","Object","prototype","hasOwnProperty","call","sortByInitPriority","items","priority","prioritized","map","name","find","item","filter","Boolean","rest","includes","concat","_toConsumableArray2"],"sources":["utils.ts"],"sourcesContent":["/* eslint-disable import/prefer-default-export */\n\nimport {ObjectType, HashTreeObject} from './types';\n\n/**\n * Checks if the given hash tree object is of type \"self\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"self\", false otherwise\n */\nexport function isSelf(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.self;\n}\n\n/**\n * Checks if the given hash tree object is of type \"Metadata\"\n * @param {HashTreeObject} object object to check\n * @returns {boolean} True if the object is of type \"Metadata\", false otherwise\n */\nexport function isMetadata(object: HashTreeObject) {\n return object.htMeta.elementId.type.toLowerCase() === ObjectType.metadata;\n}\n\n/**\n * Analyzes given part of Locus DTO recursively and delete any nested objects that have their own htMeta\n *\n * @param {Object} currentLocusPart part of locus DTO to analyze\n * @param {Object} parent parent object\n * @param {string|number} currentKey key of the parent object that currentLocusPart is\n * @returns {void}\n */\nexport const deleteNestedObjectsWithHtMeta = (\n currentLocusPart: any,\n parent?: any,\n currentKey?: string | number\n) => {\n if (typeof currentLocusPart !== 'object' || currentLocusPart === null) {\n return;\n }\n\n if (parent && currentKey !== undefined && currentLocusPart.htMeta) {\n if (Array.isArray(parent)) {\n parent.splice(Number(currentKey), 1);\n } else {\n delete parent[currentKey];\n }\n\n return;\n }\n\n if (Array.isArray(currentLocusPart)) {\n // iterate array in reverse, so that indexes remain valid when deleting elements\n for (let i = currentLocusPart.length - 1; i >= 0; i -= 1) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[i], currentLocusPart, i);\n }\n } else {\n for (const key of Object.keys(currentLocusPart)) {\n if (Object.prototype.hasOwnProperty.call(currentLocusPart, key)) {\n deleteNestedObjectsWithHtMeta(currentLocusPart[key], currentLocusPart, key);\n }\n }\n }\n};\n\n/**\n * Reorders items so that those matching the given priority list come first (in priority order),\n * followed by everything else in their original order.\n *\n * @param {Array<T>} items - The items to reorder\n * @param {string[]} priority - Ordered list of names that should come first\n * @returns {Array<T>} A new array with prioritized items first\n */\nexport function sortByInitPriority<T extends {name: string}>(items: T[], priority: string[]): T[] {\n const prioritized = priority\n .map((name) => items.find((item) => item.name === name))\n .filter(Boolean) as T[];\n const rest = items.filter((item) => !priority.includes(item.name));\n\n return [...prioritized, ...rest];\n}\n"],"mappings":";;;;;;;;;;;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AAFA;;AAIA;AACA;AACA;AACA;AACA;AACO,SAASC,MAAMA,CAACC,MAAsB,EAAE;EAC7C,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACC,IAAI;AACvE;;AAEA;AACA;AACA;AACA;AACA;AACO,SAASC,UAAUA,CAACP,MAAsB,EAAE;EACjD,OAAOA,MAAM,CAACC,MAAM,CAACC,SAAS,CAACC,IAAI,CAACC,WAAW,CAAC,CAAC,KAAKC,iBAAU,CAACG,QAAQ;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMC,8BAA6B,GAAAC,OAAA,CAAAD,6BAAA,GAAG,SAAhCA,6BAA6BA,CACxCE,gBAAqB,EACrBC,MAAY,EACZC,UAA4B,EACzB;EACH,IAAI,IAAAC,QAAA,CAAAC,OAAA,EAAOJ,gBAAgB,MAAK,QAAQ,IAAIA,gBAAgB,KAAK,IAAI,EAAE;IACrE;EACF;EAEA,IAAIC,MAAM,IAAIC,UAAU,KAAKG,SAAS,IAAIL,gBAAgB,CAACV,MAAM,EAAE;IACjE,IAAI,IAAAgB,QAAA,CAAAF,OAAA,EAAcH,MAAM,CAAC,EAAE;MACzBA,MAAM,CA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,QAAQ,CAACJ,IAAI,CAACF,IAAI,CAAC;EAAA,EAAC;EAElE,UAAAO,MAAA,KAAAC,mBAAA,CAAA5B,OAAA,EAAWkB,WAAW,OAAAU,mBAAA,CAAA5B,OAAA,EAAKyB,IAAI;AACjC","ignoreList":[]}
@@ -372,7 +372,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
372
372
  throw error;
373
373
  });
374
374
  },
375
- version: "3.12.0-next.2"
375
+ version: "3.12.0-next.21"
376
376
  });
377
377
  var _default = exports.default = SimultaneousInterpretation;
378
378
  //# sourceMappingURL=index.js.map
@@ -18,7 +18,7 @@ var SILanguage = _webexCore.WebexPlugin.extend({
18
18
  languageCode: 'number',
19
19
  languageName: 'string'
20
20
  },
21
- version: "3.12.0-next.2"
21
+ version: "3.12.0-next.21"
22
22
  });
23
23
  var _default = exports.default = SILanguage;
24
24
  //# sourceMappingURL=siLanguage.js.map
@@ -76,7 +76,7 @@ var LocusObjectStateAfterUpdates = {
76
76
  * Gets the replacement information
77
77
  *
78
78
  * @param {any} self - "self" object from Locus DTO
79
- * @param {string} deviceUrl - The URL of the user's device
79
+ * @param {string} deviceUrl - The URL of the specified device
80
80
  * @returns {any} The replace information if available, otherwise undefined
81
81
  */
82
82
  function getReplaceInfoFromSelf(self, deviceUrl) {
@@ -115,11 +115,13 @@ function findLocusUrlInAnyHashTreeParser(meetingCollection, locusUrl) {
115
115
  *
116
116
  * @param {HashTreeMessage} message - The hash tree message to find the meeting for
117
117
  * @param {MeetingCollection} meetingCollection - The collection of meetings to search
118
- * @param {string} deviceUrl - The URL of the user's device
119
118
  * @returns {any} The meeting if found, otherwise undefined
120
119
  */
121
- function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
120
+ function findMeetingForHashTreeMessage(message, meetingCollection) {
122
121
  var _message$locusStateEl, _message$locusStateEl2;
122
+ if (!message) {
123
+ return undefined;
124
+ }
123
125
  var foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, message.locusUrl);
124
126
  if (foundMeeting) {
125
127
  return foundMeeting;
@@ -130,7 +132,7 @@ function findMeetingForHashTreeMessage(message, meetingCollection, deviceUrl) {
130
132
  var self = (_message$locusStateEl = message.locusStateElements) === null || _message$locusStateEl === void 0 ? void 0 : (_message$locusStateEl2 = _message$locusStateEl.find(function (el) {
131
133
  return (0, _utils.isSelf)(el);
132
134
  })) === null || _message$locusStateEl2 === void 0 ? void 0 : _message$locusStateEl2.data;
133
- var replaces = getReplaceInfoFromSelf(self, deviceUrl);
135
+ var replaces = getReplaceInfoFromSelf(self, self === null || self === void 0 ? void 0 : self.deviceUrl);
134
136
  if (replaces !== null && replaces !== void 0 && replaces.locusUrl) {
135
137
  foundMeeting = findLocusUrlInAnyHashTreeParser(meetingCollection, replaces.locusUrl);
136
138
  return foundMeeting;
@@ -511,7 +513,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
511
513
  }, {
512
514
  key: "createHashTreeParser",
513
515
  value: function createHashTreeParser(_ref) {
514
- var _this$webex$config$me;
516
+ var _locusUrl$split, _locusUrl$split$pop, _this$webex$config$me;
515
517
  var locusUrl = _ref.locusUrl,
516
518
  initialLocus = _ref.initialLocus,
517
519
  metadata = _ref.metadata,
@@ -521,7 +523,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
521
523
  metadata: metadata,
522
524
  webexRequest: this.webex.request.bind(this.webex),
523
525
  locusInfoUpdateCallback: this.updateFromHashTree.bind(this, locusUrl),
524
- debugId: "HT-".concat(locusUrl.split('/').pop().substring(0, 4)),
526
+ debugId: "HT-".concat((_locusUrl$split = locusUrl.split('/')) === null || _locusUrl$split === void 0 ? void 0 : (_locusUrl$split$pop = _locusUrl$split.pop()) === null || _locusUrl$split$pop === void 0 ? void 0 : _locusUrl$split$pop.substring(0, 4)),
525
527
  excludedDataSets: (_this$webex$config$me = this.webex.config.meetings.locus) === null || _this$webex$config$me === void 0 ? void 0 : _this$webex$config$me.excludedDataSets
526
528
  });
527
529
 
@@ -903,7 +905,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
903
905
  var metadata = (_message$locusStateEl5 = message.locusStateElements) === null || _message$locusStateEl5 === void 0 ? void 0 : _message$locusStateEl5.find(function (el) {
904
906
  return (0, _utils.isMetadata)(el);
905
907
  });
906
- if ((metadata === null || metadata === void 0 ? void 0 : (_metadata$data = metadata.data) === null || _metadata$data === void 0 ? void 0 : (_metadata$data$visibl = _metadata$data.visibleDataSets) === null || _metadata$data$visibl === void 0 ? void 0 : _metadata$data$visibl.length) > 0) {
908
+ if (metadata && ((_metadata$data = metadata.data) === null || _metadata$data === void 0 ? void 0 : (_metadata$data$visibl = _metadata$data.visibleDataSets) === null || _metadata$data$visibl === void 0 ? void 0 : _metadata$data$visibl.length) > 0) {
907
909
  _loggerProxy.default.logger.info("Locus-info:index#handleHashTreeParserSwitch --> no hash tree parser found for locusUrl ".concat(message.locusUrl, ", creating a new one"));
908
910
  var parser = this.createHashTreeParser({
909
911
  locusUrl: message.locusUrl,
@@ -970,7 +972,11 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
970
972
  return;
971
973
  }
972
974
  var entry = this.hashTreeParsers.get(message.locusUrl);
973
- entry.parser.handleMessage(message);
975
+
976
+ // the check is just for typescript, the case of no entry in hashTreeParsers is handled in handleHashTreeParserSwitch() above
977
+ if (entry) {
978
+ entry.parser.handleMessage(message);
979
+ }
974
980
  }
975
981
 
976
982
  /**
@@ -978,15 +984,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
978
984
  * Updates our locus info based on the data parsed by the hash tree parser.
979
985
  *
980
986
  * @param {string} locusUrl - the locus URL for which the update is received
981
- * @param {LocusInfoUpdateType} updateType - The type of update received.
982
- * @param {Object} [data] - Additional data for the update, if applicable.
987
+ * @param {LocusInfoUpdate} update - Details about the update.
983
988
  * @returns {void}
984
989
  */
985
990
  }, {
986
991
  key: "updateFromHashTree",
987
- value: function updateFromHashTree(locusUrl, updateType, data) {
992
+ value: function updateFromHashTree(locusUrl, update) {
988
993
  var _this5 = this;
989
- switch (updateType) {
994
+ switch (update.updateType) {
990
995
  case _hashTreeParser2.LocusInfoUpdateType.OBJECTS_UPDATED:
991
996
  {
992
997
  // initialize our new locus
@@ -1000,7 +1005,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1000
1005
 
1001
1006
  // first go over all the updates and check what happens with the main locus object
1002
1007
  var locusObjectStateAfterUpdates = LocusObjectStateAfterUpdates.unchanged;
1003
- data.updatedObjects.forEach(function (object) {
1008
+ update.updatedObjects.forEach(function (object) {
1004
1009
  if (object.htMeta.elementId.type.toLowerCase() === _types.ObjectType.locus) {
1005
1010
  if (locusObjectStateAfterUpdates === LocusObjectStateAfterUpdates.updated) {
1006
1011
  var _object$data;
@@ -1021,12 +1026,17 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1021
1026
  }
1022
1027
  });
1023
1028
  var hashTreeParserEntry = this.hashTreeParsers.get(locusUrl);
1029
+ if (!hashTreeParserEntry) {
1030
+ _loggerProxy.default.logger.warn("Locus-info:index#updateFromHashTree --> no HashTreeParser found for locusUrl ".concat(locusUrl, " when trying to apply updates from hash tree"));
1031
+ return;
1032
+ }
1024
1033
  if (!hashTreeParserEntry.initializedFromHashTree) {
1025
1034
  // this is the first time we're getting an update for this locusUrl,
1026
1035
  // so it's probably a move to/from breakout. We need to start from a clean state,
1027
1036
  // so empty locus and we rely on Locus giving us sufficient data in the updates to populate it.
1028
1037
  _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> first INITIAL update for locusUrl ".concat(locusUrl, ", starting from empty state"));
1029
1038
  hashTreeParserEntry.initializedFromHashTree = true;
1039
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1030
1040
  locus.jsSdkMeta.forceReplaceMembers = true;
1031
1041
  } else if (
1032
1042
  // if Locus object is unchanged or removed, we need to keep using the existing locus
@@ -1050,7 +1060,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1050
1060
  }
1051
1061
  });
1052
1062
  }
1053
- _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> LOCUS object is ".concat(locusObjectStateAfterUpdates, ", all updates: ").concat((0, _stringify.default)(data.updatedObjects.map(function (o) {
1063
+ _loggerProxy.default.logger.info("Locus-info:index#updateFromHashTree --> LOCUS object is ".concat(locusObjectStateAfterUpdates, ", all updates: ").concat((0, _stringify.default)(update.updatedObjects.map(function (o) {
1054
1064
  return {
1055
1065
  type: o.htMeta.elementId.type,
1056
1066
  id: o.htMeta.elementId.id,
@@ -1058,7 +1068,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1058
1068
  };
1059
1069
  }))));
1060
1070
  // now apply all the updates from the hash tree onto the locus
1061
- data.updatedObjects.forEach(function (object) {
1071
+ update.updatedObjects.forEach(function (object) {
1062
1072
  locus = _this5.updateLocusFromHashTreeObject(object, locus);
1063
1073
  });
1064
1074
 
@@ -1148,13 +1158,13 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1148
1158
  * @param {string} debugText string explaining the trigger for this call, added to logs for debugging purposes
1149
1159
  * @param {object} locus locus object
1150
1160
  * @param {object} metadata locus hash trees metadata
1151
- * @param {string} eventType locus event
1152
1161
  * @param {DataSet[]} dataSets
1162
+ * @param {string} eventType locus event
1153
1163
  * @returns {void}
1154
1164
  */
1155
1165
  }, {
1156
1166
  key: "onFullLocusWithHashTrees",
1157
- value: function onFullLocusWithHashTrees(debugText, locus, metadata, eventType, dataSets) {
1167
+ value: function onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType) {
1158
1168
  if (!this.hashTreeParsers.has(locus.url)) {
1159
1169
  _loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> creating hash tree parser for locusUrl=").concat(locus.url));
1160
1170
  _loggerProxy.default.logger.info("Locus-info:index#onFullLocus (".concat(debugText, ") --> dataSets:"), dataSets, ' and locus:', locus, ' and metadata:', metadata);
@@ -1167,6 +1177,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1167
1177
  metadata: metadata
1168
1178
  });
1169
1179
  // we have a full locus to start with, so we consider Locus info to be "initialized"
1180
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
1170
1181
  this.hashTreeParsers.get(locus.url).initializedFromHashTree = true;
1171
1182
  this.onFullLocusCommon(locus, eventType);
1172
1183
  } else {
@@ -1221,7 +1232,7 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
1221
1232
  throw new Error("Locus-info:index#onFullLocus (".concat(debugText, ") --> hash tree metadata is missing with full Locus"));
1222
1233
  }
1223
1234
  // this is the new hashmap Locus DTO format (only applicable to webinars for now)
1224
- this.onFullLocusWithHashTrees(debugText, locus, metadata, eventType, dataSets);
1235
+ this.onFullLocusWithHashTrees(debugText, locus, metadata, dataSets, eventType);
1225
1236
  } else {
1226
1237
  this.onFullLocusClassic(debugText, locus, eventType);
1227
1238
  }
@@ -2243,12 +2254,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2243
2254
  });
2244
2255
  }
2245
2256
  if (parsedSelves.updates.isMutedByOthersChanged) {
2257
+ var _parsedSelves$current2;
2246
2258
  this.emitScoped({
2247
2259
  file: 'locus-info',
2248
2260
  function: 'updateSelf'
2249
2261
  }, _constants.LOCUSINFO.EVENTS.SELF_REMOTE_MUTE_STATUS_UPDATED, {
2250
2262
  muted: parsedSelves.current.remoteMuted,
2251
- unmuteAllowed: parsedSelves.current.unmuteAllowed
2263
+ unmuteAllowed: parsedSelves.current.unmuteAllowed,
2264
+ modifiedBy: (_parsedSelves$current2 = parsedSelves.current.modifiedBy) !== null && _parsedSelves$current2 !== void 0 ? _parsedSelves$current2 : null
2252
2265
  });
2253
2266
  }
2254
2267
  if (parsedSelves.updates.localAudioUnmuteRequestedByServer) {
@@ -2278,14 +2291,14 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2278
2291
  _constants.LOCUSINFO.EVENTS.MEDIA_INACTIVITY, _selfUtils.default.getMediaStatus(self.mediaSessions));
2279
2292
  }
2280
2293
  if (parsedSelves.updates.audioStateChange || parsedSelves.updates.videoStateChange || parsedSelves.updates.shareStateChange) {
2281
- var _parsedSelves$current2, _parsedSelves$current3, _parsedSelves$current4;
2294
+ var _parsedSelves$current3, _parsedSelves$current4, _parsedSelves$current5;
2282
2295
  this.emitScoped({
2283
2296
  file: 'locus-info',
2284
2297
  function: 'updateSelf'
2285
2298
  }, _constants.LOCUSINFO.EVENTS.MEDIA_STATUS_CHANGE, {
2286
- audioStatus: (_parsedSelves$current2 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current2 === void 0 ? void 0 : _parsedSelves$current2.audio,
2287
- videoStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.video,
2288
- shareStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.share
2299
+ audioStatus: (_parsedSelves$current3 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current3 === void 0 ? void 0 : _parsedSelves$current3.audio,
2300
+ videoStatus: (_parsedSelves$current4 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current4 === void 0 ? void 0 : _parsedSelves$current4.video,
2301
+ shareStatus: (_parsedSelves$current5 = parsedSelves.current.currentMediaStatus) === null || _parsedSelves$current5 === void 0 ? void 0 : _parsedSelves$current5.share
2289
2302
  });
2290
2303
  }
2291
2304
  if (parsedSelves.updates.isUserObserving) {
@@ -2495,6 +2508,21 @@ var LocusInfo = exports.default = /*#__PURE__*/function (_EventsScope) {
2495
2508
  value: function clearMainSessionLocusCache() {
2496
2509
  this.mainSessionLocusCache = null;
2497
2510
  }
2511
+
2512
+ /**
2513
+ * Cleans up all hash tree parsers and clears internal maps.
2514
+ * @returns {void}
2515
+ * @memberof LocusInfo
2516
+ */
2517
+ }, {
2518
+ key: "cleanUp",
2519
+ value: function cleanUp() {
2520
+ this.hashTreeParsers.forEach(function (entry) {
2521
+ entry.parser.cleanUp();
2522
+ });
2523
+ this.hashTreeParsers.clear();
2524
+ this.hashTreeObjectId2ParticipantId.clear();
2525
+ }
2498
2526
  }]);
2499
2527
  }(_eventsScope.default);
2500
2528
  //# sourceMappingURL=index.js.map