@webex/plugin-meetings 3.9.0-next.1 → 3.9.0-next.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/interpretation/index.js +1 -1
  4. package/dist/interpretation/siLanguage.js +1 -1
  5. package/dist/locus-info/index.js +15 -6
  6. package/dist/locus-info/index.js.map +1 -1
  7. package/dist/locus-info/parser.js +4 -1
  8. package/dist/locus-info/parser.js.map +1 -1
  9. package/dist/meeting/index.js +101 -79
  10. package/dist/meeting/index.js.map +1 -1
  11. package/dist/meeting-info/meeting-info-v2.js +29 -21
  12. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  13. package/dist/meetings/index.js +31 -25
  14. package/dist/meetings/index.js.map +1 -1
  15. package/dist/members/index.js +3 -2
  16. package/dist/members/index.js.map +1 -1
  17. package/dist/members/util.js +7 -2
  18. package/dist/members/util.js.map +1 -1
  19. package/dist/reachability/index.js +3 -3
  20. package/dist/reachability/index.js.map +1 -1
  21. package/dist/types/locus-info/index.d.ts +2 -0
  22. package/dist/types/meeting/index.d.ts +1 -0
  23. package/dist/types/meeting-info/meeting-info-v2.d.ts +6 -3
  24. package/dist/types/meetings/index.d.ts +3 -1
  25. package/dist/types/members/index.d.ts +2 -1
  26. package/dist/types/members/util.d.ts +6 -3
  27. package/dist/webinar/index.js +1 -1
  28. package/package.json +13 -13
  29. package/src/locus-info/index.ts +13 -5
  30. package/src/locus-info/parser.ts +5 -1
  31. package/src/meeting/index.ts +29 -3
  32. package/src/meeting-info/meeting-info-v2.ts +24 -5
  33. package/src/meetings/index.ts +9 -3
  34. package/src/members/index.ts +9 -2
  35. package/src/members/util.ts +18 -2
  36. package/src/reachability/index.ts +3 -3
  37. package/test/unit/spec/locus-info/index.js +7 -7
  38. package/test/unit/spec/locus-info/parser.js +3 -2
  39. package/test/unit/spec/meeting/index.js +96 -22
  40. package/test/unit/spec/meeting-info/meetinginfov2.js +8 -3
  41. package/test/unit/spec/meetings/index.js +10 -1
  42. package/test/unit/spec/members/index.js +30 -2
  43. package/test/unit/spec/members/request.js +55 -0
  44. package/test/unit/spec/members/utils.js +116 -14
  45. package/test/unit/spec/reachability/index.ts +158 -3
@@ -1 +1 @@
1
- {"version":3,"names":["_lodash","require","_queue","_interopRequireDefault","_loggerProxy","_metrics","_constants","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","MAX_OOO_DELTA_COUNT","OOO_DELTA_WAIT_TIME","OOO_DELTA_WAIT_TIME_RANDOM_DELAY","Parser","exports","default","_classCallCheck2","_defineProperty2","deltaCompareFunc","left","right","_Parser$loci","loci","LT","GT","extract","extractComparisonState","isSequenceEmpty","result","compareSequence","baseSequence","queue","SortedQueue","status","onDeltaAction","workingCopy","syncTimer","undefined","_createClass2","key","value","isNewFullLocus","incomingFullDto","isLoci","LoggerProxy","logger","info","comparisonResult","compareFullDtoSequence","USE_INCOMING","isValidLocus","newLoci","isValid","nextEvent","size","processDeltaEvent","action","locus","onDeltaEvent","enqueue","triggerSync","pause","reason","concat","stopSyncTimer","DESYNC","startSyncTimer","_this","timeout","Math","random","setTimeout","clearTimeout","_Parser$loci2","WAIT","LOCUS_URL_CHANGED","dequeue","compare","lociComparison","debug","needToWait","locus2string","error","resume","_locus$sequence","sequence","entries","length","at","checkSequenceOverlap","current","incoming","comparison","min","max","checkUnequalRanges","currentIsNotUnique","unique","incomingIsNotUnique","currentTotalRange","end","incomingTotalRange","EQ","checkForUniqueEntries","currentIsUnique","incomingIsUnique","checkIfOutOfSync","currentUniqueMin","incomingUniqueMin","currentHasNoRange","start","incomingHasNoRange","neitherSeqHasRange","hasUniqOverlap","list","some","seq","currentUniqOverlap","incomingUniqOverlap","debugInfo","pack","packComparisonResult","compareDelta","compareToAction","_Parser$loci3","url","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","LOCUS_DELTA_OUT_OF_ORDER","stack","Error","slice","USE_CURRENT","local","getMetaData","delta","getUniqueSequences","rules","_i","_rules","rule","ERROR","_Parser$loci4","lociComparisonResult","split","first","last","rangeStart","rangeEnd","baseLoci","otherLoci","diff","difference","getNumbersOutOfRange","output","filter","num","sort","a","b","_sequence$entries","hasEmptyEntries","hasEmptyRange","hasProp","prop","Object","prototype","hasOwnProperty","call","newData","oldData","getDebugMessage","debugCode","mStr","strings","join","replace","resolutionMap","debugMap","SO001","title","description","_taggedTemplateLiteral2","logic","SO002","UR001","UR002","UR003","UE001","UE002","OOS001","OOS002","OOS003","debugObj","resolution"],"sources":["parser.ts"],"sourcesContent":["import {difference} from 'lodash';\n\nimport SortedQueue from '../common/queue';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nconst MAX_OOO_DELTA_COUNT = 5; // when we receive an out-of-order delta and the queue builds up to MAX_OOO_DELTA_COUNT, we do a sync with Locus\nconst OOO_DELTA_WAIT_TIME = 10000; // [ms] minimum wait time before we do a sync if we get out-of-order deltas\nconst OOO_DELTA_WAIT_TIME_RANDOM_DELAY = 5000; // [ms] max random delay added to OOO_DELTA_WAIT_TIME\n\ntype LocusDeltaDto = {\n url: string;\n baseSequence: {\n rangeStart: number;\n rangeEnd: number;\n entries: number[];\n };\n sequence: {\n rangeStart: number;\n rangeEnd: number;\n entries: number[];\n };\n syncUrl: string;\n};\n\n/**\n * Locus Delta Parser\n * @private\n * https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Delta-Events\n */\nexport default class Parser {\n // processing status\n status:\n | 'IDLE' // not doing anything\n | 'PAUSED' // paused, because we are doing a sync\n | 'WORKING' // processing a delta event\n | 'BLOCKED'; // received an out-of-order delta, so waiting for the missing one\n\n // loci comparison states\n static loci = {\n EQ: 'EQUAL',\n GT: 'GREATER_THAN',\n LT: 'LESS_THAN',\n DESYNC: 'DESYNC',\n USE_INCOMING: 'USE_INCOMING',\n USE_CURRENT: 'USE_CURRENT',\n WAIT: 'WAIT',\n ERROR: 'ERROR',\n LOCUS_URL_CHANGED: 'LOCUS_URL_CHANGED',\n };\n\n queue: SortedQueue<LocusDeltaDto>;\n workingCopy: any;\n syncTimer?: ReturnType<typeof setTimeout>;\n\n /**\n * @constructs Parser\n */\n constructor() {\n const deltaCompareFunc = (left: LocusDeltaDto, right: LocusDeltaDto) => {\n const {LT, GT} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n\n if (Parser.isSequenceEmpty(left)) {\n return -1;\n }\n if (Parser.isSequenceEmpty(right)) {\n return 1;\n }\n const result = extract(Parser.compareSequence(left.baseSequence, right.baseSequence));\n\n if (result === LT) {\n return -1;\n }\n if (result === GT) {\n return 1;\n }\n\n return 0;\n };\n\n this.queue = new SortedQueue<LocusDeltaDto>(deltaCompareFunc);\n this.status = 'IDLE';\n this.onDeltaAction = null;\n this.workingCopy = null;\n this.syncTimer = undefined;\n }\n\n /**\n * Returns a debug string representing a locus delta - useful for logging\n *\n * @param {LocusDeltaDto} locus Locus delta\n * @returns {string}\n */\n static locus2string(locus: LocusDeltaDto) {\n if (!locus.sequence?.entries) {\n return 'invalid';\n }\n\n return locus.sequence.entries.length ? `seq=${locus.sequence.entries.at(-1)}` : 'empty';\n }\n\n /**\n * Checks if two sequences overlap in time,\n * the sequence with the higher minimum value is greater.\n * Chooses sequence with most recent data.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkSequenceOverlap(current, incoming) {\n let comparison = null;\n\n // if earliest working copy sequence is more recent than last incoming sequence\n if (current.min > incoming.max) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:SO001`;\n }\n // if last working copy sequence is before the earliest incoming sequence\n else if (current.max < incoming.min) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:SO002`;\n }\n\n // if no match above, defaults to null\n return comparison;\n }\n\n /**\n * Checks if two sequences have unequal ranges.\n * Chooses sequence with most larger range.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {object} loci comparison\n */\n static checkUnequalRanges(current, incoming) {\n let comparison = null;\n const currentIsNotUnique = current.unique.length === 0;\n const incomingIsNotUnique = incoming.unique.length === 0;\n const currentTotalRange = current.end - current.min;\n const incomingTotalRange = incoming.end - incoming.min;\n\n // no unique values for both loci\n if (currentIsNotUnique && incomingIsNotUnique) {\n // current working copy loci has a larger range\n if (currentTotalRange > incomingTotalRange) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UR001`;\n }\n // incoming delta loci has a larger range\n else if (currentTotalRange < incomingTotalRange) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UR002`;\n } else {\n // with no unique entries and with ranges either absent or\n // of the same size, the sequences are considered equal.\n comparison = `${Parser.loci.EQ}:UR003`;\n }\n }\n\n return comparison;\n }\n\n /**\n * Checks if either sequences has unique entries.\n * Entries are considered unique if they do not overlap\n * with other Loci sequences or range values.\n * Chooses sequence with the unique entries.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkForUniqueEntries(current, incoming) {\n let comparison = null;\n const currentIsUnique = current.unique.length > 0;\n const incomingIsUnique = incoming.unique.length > 0;\n\n // current has unique entries and incoming does not\n if (currentIsUnique && !incomingIsUnique) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UE001`;\n }\n // current has no unique entries but incoming does\n else if (!currentIsUnique && incomingIsUnique) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UE002`;\n }\n\n return comparison;\n }\n\n /**\n * Checks both Locus Delta objects to see if they are\n * out of sync with one another. If so sends a DESYNC\n * request to the server.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkIfOutOfSync(current, incoming) {\n let comparison = null;\n const currentUniqueMin = current.unique[0];\n const incomingUniqueMin = incoming.unique[0];\n\n const currentHasNoRange = !current.start && !current.end;\n const incomingHasNoRange = !incoming.start && !incoming.end;\n const neitherSeqHasRange = currentHasNoRange && incomingHasNoRange;\n\n const hasUniqOverlap = (list, min, max) => list.some((seq) => min < seq && seq < max);\n // current unique entries overlap the total range of incoming\n const currentUniqOverlap = hasUniqOverlap(current.unique, incoming.min, incoming.max);\n // vice-versa, incoming unique entries overlap the total range of current\n const incomingUniqOverlap = hasUniqOverlap(incoming.unique, current.min, current.max);\n\n if (neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap) {\n // outputs string indicating which condition occurred. ex: 0,1,0\n const debugInfo = `${+neitherSeqHasRange},${+currentUniqOverlap},${+incomingUniqOverlap}`;\n\n // send DESYNC to server\n comparison = `${Parser.loci.DESYNC}:OOS001:${debugInfo}`;\n } else if (currentUniqueMin > incomingUniqueMin) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:OOS002`;\n } else {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:OOS003`;\n }\n\n return comparison;\n }\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static compare(current, incoming) {\n const {isSequenceEmpty} = Parser;\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {\n return pack(Parser.loci.USE_INCOMING, 'C001');\n }\n\n if (incoming.baseSequence) {\n return pack(Parser.compareDelta(current, incoming), 'C002');\n }\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n const action = Parser.compareToAction(extract(result));\n\n return pack(action, result);\n }\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} loci comparison state\n */\n private static compareDelta(current, incoming) {\n const {LT, GT, EQ, DESYNC, USE_INCOMING, WAIT, LOCUS_URL_CHANGED} = Parser.loci;\n\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n let comparison = extract(result);\n\n if (comparison !== LT) {\n return pack(Parser.compareToAction(comparison), result);\n }\n\n if (incoming.url !== current.url) {\n // when moving to/from a breakout session, the locus URL will change and also\n // the baseSequence, making incoming and current incomparable, so use a\n // unique comparison state\n return pack(LOCUS_URL_CHANGED, result);\n }\n\n comparison = Parser.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (extract(comparison)) {\n case GT:\n case EQ:\n comparison = USE_INCOMING;\n break;\n\n case LT:\n if (extract(Parser.compareSequence(incoming.baseSequence, incoming.sequence)) === EQ) {\n // special case where Locus sends a delta with baseSequence === sequence to trigger a sync,\n // because the delta event is too large to be sent over mercury connection\n comparison = DESYNC;\n } else {\n // the incoming locus has baseSequence from the future, so it is out-of-order,\n // we are missing 1 or more locus that should be in front of it, we need to wait for it\n comparison = WAIT;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_DELTA_OUT_OF_ORDER, {\n stack: new Error().stack,\n });\n }\n break;\n default:\n comparison = DESYNC;\n }\n\n return pack(comparison, result);\n }\n\n /**\n * Compares Locus sequences - it should be called only for full Locus DTOs, not deltas\n *\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incomingFullDto New Full Locus DTO\n * @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT\n */\n static compareFullDtoSequence(current, incomingFullDto) {\n if (Parser.isSequenceEmpty(current) || Parser.isSequenceEmpty(incomingFullDto)) {\n return Parser.loci.USE_INCOMING;\n }\n\n // the sequence.entries list will always contain at least 1 entry\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n return incomingFullDto.sequence.entries.slice(-1)[0] > current.sequence.entries.slice(-1)[0]\n ? Parser.loci.USE_INCOMING\n : Parser.loci.USE_CURRENT;\n }\n\n /**\n * Returns true if the incoming full locus DTO is newer than the current working copy\n *\n * @param {Types~Locus} incomingFullDto New Full Locus DTO\n * @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT\n */\n isNewFullLocus(incomingFullDto) {\n if (!Parser.isLoci(incomingFullDto)) {\n LoggerProxy.logger.info('Locus-info:parser#isNewFullLocus --> Ignoring non-locus object.');\n\n return false;\n }\n\n if (!this.workingCopy) {\n // we don't have a working copy yet, so any full locus is better than nothing\n return true;\n }\n\n const comparisonResult = Parser.compareFullDtoSequence(this.workingCopy, incomingFullDto);\n\n return comparisonResult === Parser.loci.USE_INCOMING;\n }\n\n /**\n * Compares Locus sequences\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incoming New Locus delta\n * @returns {string}\n */\n static compareSequence(current, incoming) {\n // Locus sequence comparison rules in order of priority.\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n const local: any = Parser.getMetaData(current);\n const delta: any = Parser.getMetaData(incoming);\n\n // update loci metadata\n local.unique = Parser.getUniqueSequences(local, delta);\n delta.unique = Parser.getUniqueSequences(delta, local);\n\n // Locus sequence comparison rules\n // order matters\n const rules = [\n Parser.checkSequenceOverlap,\n Parser.checkUnequalRanges,\n Parser.checkForUniqueEntries,\n Parser.checkIfOutOfSync,\n ];\n\n for (const rule of rules) {\n // Rule only returns a value if the rule applies,\n // otherwise returns null.\n const result = rule(local, delta);\n\n if (result) {\n return result;\n }\n }\n\n // error, none of rules above applied\n // should never get here as last rule\n // should be catch all.\n return Parser.loci.ERROR;\n }\n\n /**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @returns {string} Locus comparison action\n */\n static compareToAction(result: string) {\n const {DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING} = Parser.loci;\n\n let action = ERROR;\n\n switch (result) {\n case EQ:\n case GT:\n action = USE_CURRENT;\n break;\n case LT:\n action = USE_INCOMING;\n break;\n case DESYNC:\n action = DESYNC;\n break;\n default:\n LoggerProxy.logger.info(\n `Locus-info:parser#compareToAction --> Error: ${result} is not a recognized sequence comparison result.`\n );\n }\n\n return action;\n }\n\n /**\n * Extracts a loci comparison from a string of data.\n * @param {string} lociComparisonResult Comparison result with extra data\n * @returns {string} Comparison of EQ, LT, GT, or DESYNC.\n */\n static extractComparisonState(lociComparisonResult: string) {\n return lociComparisonResult.split(':')[0];\n }\n\n /**\n * @typedef {object} LociMetadata\n * @property {number} start - Starting sequence number\n * @property {number} end - Ending sequence number\n * @property {number} first - First sequence number\n * @property {number} last - Last sequence number\n * @property {number} min - Minimum sequence number\n * @property {number} max - Maximum sequence number\n * @property {number} entries - Loci sequence entries\n */\n\n /**\n * Metadata for Locus delta\n * @param {Array.<number>} sequence Locus delta sequence\n * @returns {LociMetadata} Locus Delta Metadata\n */\n static getMetaData(sequence: any) {\n const {entries} = sequence;\n const first = entries[0];\n const last = entries.slice(-1)[0];\n\n // rangeStart or rangeEnd is 0 if a range doesn't exist\n const start = sequence.rangeStart;\n const end = sequence.rangeEnd;\n\n // sequence data\n return {\n start,\n end,\n first,\n last,\n // Rule is: rangeStart <= rangeEnd <= min(entries)\n min: start || first,\n // Grab last entry if exist else default to rangeEnd\n max: last || end,\n // keep reference to actual sequence entries\n entries,\n };\n }\n\n /**\n * Compares two Locus delta objects and notes unique\n * values contained within baseLoci.\n * @param {LociMetadata} baseLoci\n * @param {LociMetadata} otherLoci\n * @returns {Array.<number>} List of unique sequences\n */\n static getUniqueSequences(baseLoci: any, otherLoci: any) {\n const diff: any = difference(baseLoci.entries, otherLoci.entries);\n\n const {start, end} = otherLoci;\n\n return Parser.getNumbersOutOfRange(diff, start, end);\n }\n\n /**\n * Returns an array of numbers outside of a given range.\n * @param {Array.<number>} list Array to filter\n * @param {number} rangeStart Start of range\n * @param {number} rangeEnd End of range\n * @returns {Array.<number>} Array of numbers sorted ASC\n */\n static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number) {\n // Collect all numbers if number is outside of specified range\n const output = list.filter((num) => num < rangeStart || num > rangeEnd);\n\n // sort ascending\n return output.sort((a, b) => a - b);\n }\n\n /**\n * Checks if newLoci or workingCopy is invalid.\n * @param {Types~Locus} newLoci\n * @returns {boolean}\n */\n isValidLocus(newLoci) {\n let isValid = false;\n const {isLoci} = Parser;\n\n // one or both objects are not locus delta events\n if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {\n LoggerProxy.logger.info(\n 'Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:',\n this.workingCopy,\n 'newLoci:',\n newLoci\n );\n } else {\n isValid = true;\n }\n\n return isValid;\n }\n\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @returns {bool}\n */\n static isSequenceEmpty(locus) {\n const {sequence} = locus;\n const hasEmptyEntries = !sequence.entries?.length;\n const hasEmptyRange = sequence.rangeStart === 0 && sequence.rangeEnd === 0;\n\n return hasEmptyEntries && hasEmptyRange;\n }\n\n /**\n * Determines if an object has basic\n * structure of a locus object.\n * @param {Types~Locus} loci\n * @returns {boolean}\n */\n static isLoci(loci) {\n if (!loci || !loci.sequence) {\n return false;\n }\n const hasProp = (prop) => Object.prototype.hasOwnProperty.call(loci.sequence, prop);\n\n if (hasProp('rangeStart') && hasProp('rangeEnd')) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Processes next event in queue,\n * if queue is empty sets status to idle.\n * @returns {undefined}\n */\n nextEvent() {\n if (this.status === 'PAUSED') {\n LoggerProxy.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');\n\n return;\n }\n\n if (this.status === 'BLOCKED') {\n LoggerProxy.logger.info(\n 'Locus-info:parser#nextEvent --> Locus parser blocked by out-of-order delta.'\n );\n\n return;\n }\n\n // continue processing until queue is empty\n if (this.queue.size() > 0) {\n this.processDeltaEvent();\n } else {\n this.status = 'IDLE';\n }\n }\n\n /**\n * Function handler for delta actions,\n * is set by instance callee.\n * @param {string} action Locus delta action\n * @param {Types~Locus} locus Locus delta\n * @returns {undefined}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDeltaAction(action: string, locus) {}\n\n /**\n * Event handler for locus delta events\n * @param {Types~Locus} loci Locus Delta\n * @returns {undefined}\n */\n onDeltaEvent(loci) {\n // enqueue the new loci\n this.queue.enqueue(loci);\n\n if (this.onDeltaAction) {\n if (this.status === 'BLOCKED') {\n if (this.queue.size() > MAX_OOO_DELTA_COUNT) {\n this.triggerSync('queue too big, blocked on out-of-order delta');\n } else {\n this.processDeltaEvent();\n }\n } else if (this.status === 'IDLE') {\n // Update status, ensure we only process one event at a time.\n this.status = 'WORKING';\n\n this.processDeltaEvent();\n }\n }\n }\n\n /**\n * Appends new data onto a string of existing data.\n * @param {string} newData\n * @param {string} oldData\n * @returns {string}\n */\n static packComparisonResult(newData: string, oldData: string) {\n return `${newData}:${oldData}`;\n }\n\n /**\n * Pause locus processing\n * @returns {undefined}\n */\n pause() {\n this.status = 'PAUSED';\n LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');\n }\n\n /**\n * Triggers a sync with Locus\n *\n * @param {string} reason used just for logging\n * @returns {undefined}\n */\n private triggerSync(reason: string) {\n LoggerProxy.logger.info(`Locus-info:parser#triggerSync --> doing sync, reason: ${reason}`);\n this.stopSyncTimer();\n this.pause();\n this.onDeltaAction(Parser.loci.DESYNC, this.workingCopy);\n }\n\n /**\n * Starts a timer with a random delay. When that timer expires we will do a sync.\n *\n * The main purpose of this timer is to handle a case when we get some out-of-order deltas,\n * so we start waiting to receive the missing delta. If that delta never arrives, this timer\n * will trigger a sync with Locus.\n *\n * @returns {undefined}\n */\n private startSyncTimer() {\n if (this.syncTimer === undefined) {\n const timeout = OOO_DELTA_WAIT_TIME + Math.random() * OOO_DELTA_WAIT_TIME_RANDOM_DELAY;\n\n this.syncTimer = setTimeout(() => {\n this.syncTimer = undefined;\n this.triggerSync('timer expired, blocked on out-of-order delta');\n }, timeout);\n }\n }\n\n /**\n * Stops the timer for triggering a sync\n *\n * @returns {undefined}\n */\n private stopSyncTimer() {\n if (this.syncTimer !== undefined) {\n clearTimeout(this.syncTimer);\n this.syncTimer = undefined;\n }\n }\n\n /**\n * Processes next locus delta in the queue,\n * continues until the queue is empty\n * or cleared.\n * @returns {undefined}\n */\n processDeltaEvent() {\n const {DESYNC, USE_INCOMING, WAIT, LOCUS_URL_CHANGED} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n const newLoci = this.queue.dequeue();\n\n if (!this.isValidLocus(newLoci)) {\n this.nextEvent();\n\n return;\n }\n\n const result = Parser.compare(this.workingCopy, newLoci);\n const lociComparison = extract(result);\n\n // limited debugging, use chrome extension\n // for full debugging.\n LoggerProxy.logger.debug(`Locus-info:parser#processDeltaEvent --> Locus Debug: ${result}`);\n\n let needToWait = false;\n\n switch (lociComparison) {\n case DESYNC:\n // wait for desync response\n this.pause();\n break;\n\n case USE_INCOMING:\n case LOCUS_URL_CHANGED:\n // update working copy for future comparisons.\n // Note: The working copy of parser gets updated in .onFullLocus()\n // and here when USE_INCOMING or LOCUS_URL_CHANGED locus.\n this.workingCopy = newLoci;\n break;\n\n case WAIT:\n // we've taken newLoci from the front of the queue, so put it back there as we have to wait\n // for the one that should be in front of it, before we can process it\n this.queue.enqueue(newLoci);\n needToWait = true;\n break;\n\n default:\n break;\n }\n\n if (needToWait) {\n this.status = 'BLOCKED';\n this.startSyncTimer();\n } else {\n this.stopSyncTimer();\n\n if (this.status === 'BLOCKED') {\n // we are not blocked anymore\n this.status = 'WORKING';\n\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> received delta that we were waiting for ${Parser.locus2string(\n newLoci\n )}, not blocked anymore`\n );\n }\n }\n\n if (this.onDeltaAction) {\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> Locus Delta ${Parser.locus2string(\n newLoci\n )}, Action: ${lociComparison}`\n );\n\n try {\n this.onDeltaAction(lociComparison, newLoci);\n } catch (error) {\n LoggerProxy.logger.error(\n 'Locus-info:parser#processDeltaEvent --> Error in onDeltaAction',\n error\n );\n }\n }\n\n this.nextEvent();\n }\n\n /**\n * Resume from a paused state\n * @returns {undefined}\n */\n resume() {\n LoggerProxy.logger.info('Locus-info:parser#resume --> Locus parser resumed.');\n this.status = 'WORKING';\n this.nextEvent();\n }\n\n /**\n * Gets related debug info for given error code\n * @param {string} debugCode Debug code\n * @param {string} comparison Locus comparison string\n * @returns {object} Debug message\n */\n static getDebugMessage(debugCode: string, comparison: string) {\n // removes extra spaces from multiline string\n const mStr = (strings) => strings.join('').replace(/\\s{2,}/g, ' ');\n\n const resolutionMap = {\n EQ: `${Parser.loci.LT}: is equal (current == incoming).`,\n LT: `${Parser.loci.LT}: choose right side (incoming).`,\n GT: `${Parser.loci.GT}: choose left side (current).`,\n };\n\n const debugMap = {\n SO001: {\n title: 'checkSequenceOverlap-001',\n description: mStr`Occurs if earliest working copy sequence is more \\\n recent than last incoming sequence.`,\n logic: 'current.min > incoming.max',\n },\n\n SO002: {\n title: 'checkSequenceOverlap-002',\n description: mStr`Occurs if last working copy sequence is before the \\\n earliest incoming sequence.`,\n logic: 'current.max < incoming.min',\n },\n\n UR001: {\n title: 'checkUnequalRanges-001',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the current working copy loci has a larger range.`,\n logic: 'currentTotalRange > incomingTotalRange',\n },\n\n UR002: {\n title: 'checkUnequalRanges-002',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the incoming delta loci has a larger range.`,\n logic: 'currentTotalRange < incomingTotalRange',\n },\n\n UR003: {\n title: 'checkUnequalRanges-003',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and with ranges either absent or of the same size, the sequences \\\n are considered equal.`,\n logic: 'currentTotalRange == incomingTotalRange',\n },\n\n UE001: {\n title: 'checkForUniqueEntries-001',\n description: mStr`Occurs if current loci has unique entries and \\\n incoming does not. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: 'currentIsUnique && !incomingIsUnique',\n },\n\n UE002: {\n title: 'checkForUniqueEntries-002',\n description: mStr`Occurs if current has no unique entries but \\\n incoming does. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: '!currentIsUnique && incomingIsUnique',\n },\n\n OOS001: {\n title: 'checkIfOutOfSync-001',\n description: mStr`Occurs if neither sequence has a range, or \\\n if the current loci unique entries overlap the total range of the \\\n incoming sequence, or if the incoming unique entries overlap \\\n the total range of current sequence.`,\n logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap',\n },\n\n OOS002: {\n title: 'checkIfOutOfSync-002',\n description: mStr`Occurs if the minimum value from sequences that are \\\n unique to the current loci is greater than the minimum value from \\\n sequences that are unique to the incoming loci.`,\n logic: 'currentUniqueMin > incomingUniqueMin',\n },\n\n OOS003: {\n title: 'checkIfOutOfSync-003',\n description: mStr`Occurs if none of the comparison rules applied. \\\n It is a catch all.`,\n logic: 'else (catch all)',\n },\n };\n\n const debugObj = debugMap[debugCode];\n\n debugObj.title = `Debug: ${debugObj.title}`;\n debugObj.resolution = resolutionMap[comparison];\n\n return debugObj;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAsD,IAAAM,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,iBAAA;AAEtD,IAAMC,mBAAmB,GAAG,CAAC,CAAC,CAAC;AAC/B,IAAMC,mBAAmB,GAAG,KAAK,CAAC,CAAC;AACnC,IAAMC,gCAAgC,GAAG,IAAI,CAAC,CAAC;AAiB/C;AACA;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UAAU,CAAC;MAE/C,OAAOsG,QAAQ;IACjB;EAAC;EAAA,OAAArL,MAAA;AAAA;AA11Bc;AAEf;AAAA,IAAAI,gBAAA,CAAAF,OAAA,EARmBF,MAAM,UASX;EACZyF,EAAE,EAAE,OAAO;EACX9E,EAAE,EAAE,cAAc;EAClBD,EAAE,EAAE,WAAW;EACf0C,MAAM,EAAE,QAAQ;EAChBhB,YAAY,EAAE,cAAc;EAC5BoF,WAAW,EAAE,aAAa;EAC1B3D,IAAI,EAAE,MAAM;EACZoE,KAAK,EAAE,OAAO;EACdnE,iBAAiB,EAAE;AACrB,CAAC"}
1
+ {"version":3,"names":["_lodash","require","_queue","_interopRequireDefault","_loggerProxy","_metrics","_constants","_templateObject","_templateObject2","_templateObject3","_templateObject4","_templateObject5","_templateObject6","_templateObject7","_templateObject8","_templateObject9","_templateObject10","MAX_OOO_DELTA_COUNT","OOO_DELTA_WAIT_TIME","OOO_DELTA_WAIT_TIME_RANDOM_DELAY","Parser","exports","default","_classCallCheck2","_defineProperty2","deltaCompareFunc","left","right","_Parser$loci","loci","LT","GT","extract","extractComparisonState","isSequenceEmpty","result","compareSequence","baseSequence","queue","SortedQueue","status","onDeltaAction","workingCopy","syncTimer","undefined","_createClass2","key","value","isNewFullLocus","incomingFullDto","isLoci","LoggerProxy","logger","info","comparisonResult","compareFullDtoSequence","USE_INCOMING","isValidLocus","newLoci","isValid","nextEvent","size","processDeltaEvent","action","locus","onDeltaEvent","enqueue","triggerSync","pause","reason","concat","stopSyncTimer","DESYNC","startSyncTimer","_this","timeout","Math","random","setTimeout","clearTimeout","_Parser$loci2","WAIT","LOCUS_URL_CHANGED","dequeue","compare","lociComparison","debug","needToWait","locus2string","error","resume","_locus$sequence","sequence","entries","length","at","checkSequenceOverlap","current","incoming","comparison","min","max","checkUnequalRanges","currentIsNotUnique","unique","incomingIsNotUnique","currentTotalRange","end","incomingTotalRange","EQ","checkForUniqueEntries","currentIsUnique","incomingIsUnique","checkIfOutOfSync","currentUniqueMin","incomingUniqueMin","currentHasNoRange","start","incomingHasNoRange","neitherSeqHasRange","hasUniqOverlap","list","some","seq","currentUniqOverlap","incomingUniqOverlap","debugInfo","pack","packComparisonResult","compareDelta","compareToAction","_Parser$loci3","url","Metrics","sendBehavioralMetric","BEHAVIORAL_METRICS","LOCUS_DELTA_OUT_OF_ORDER","stack","Error","slice","USE_CURRENT","local","getMetaData","delta","getUniqueSequences","rules","_i","_rules","rule","ERROR","_Parser$loci4","lociComparisonResult","split","first","last","rangeStart","rangeEnd","baseLoci","otherLoci","diff","difference","getNumbersOutOfRange","output","filter","num","sort","a","b","_sequence$entries","hasEmptyEntries","hasEmptyRange","hasProp","prop","Object","prototype","hasOwnProperty","call","newData","oldData","getDebugMessage","debugCode","mStr","strings","join","replace","resolutionMap","debugMap","SO001","title","description","_taggedTemplateLiteral2","logic","SO002","UR001","UR002","UR003","UE001","UE002","OOS001","OOS002","OOS003","debugObj","resolution"],"sources":["parser.ts"],"sourcesContent":["import {difference} from 'lodash';\n\nimport SortedQueue from '../common/queue';\nimport LoggerProxy from '../common/logs/logger-proxy';\n\nimport Metrics from '../metrics';\nimport BEHAVIORAL_METRICS from '../metrics/constants';\n\nconst MAX_OOO_DELTA_COUNT = 5; // when we receive an out-of-order delta and the queue builds up to MAX_OOO_DELTA_COUNT, we do a sync with Locus\nconst OOO_DELTA_WAIT_TIME = 10000; // [ms] minimum wait time before we do a sync if we get out-of-order deltas\nconst OOO_DELTA_WAIT_TIME_RANDOM_DELAY = 5000; // [ms] max random delay added to OOO_DELTA_WAIT_TIME\n\ntype LocusDeltaDto = {\n url: string;\n baseSequence: {\n rangeStart: number;\n rangeEnd: number;\n entries: number[];\n };\n sequence: {\n rangeStart: number;\n rangeEnd: number;\n entries: number[];\n };\n syncUrl: string;\n};\n\n/**\n * Locus Delta Parser\n * @private\n * https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Delta-Events\n */\nexport default class Parser {\n // processing status\n status:\n | 'IDLE' // not doing anything\n | 'PAUSED' // paused, because we are doing a sync\n | 'WORKING' // processing a delta event\n | 'BLOCKED'; // received an out-of-order delta, so waiting for the missing one\n\n // loci comparison states\n static loci = {\n EQ: 'EQUAL',\n GT: 'GREATER_THAN',\n LT: 'LESS_THAN',\n DESYNC: 'DESYNC',\n USE_INCOMING: 'USE_INCOMING',\n USE_CURRENT: 'USE_CURRENT',\n WAIT: 'WAIT',\n ERROR: 'ERROR',\n LOCUS_URL_CHANGED: 'LOCUS_URL_CHANGED',\n };\n\n queue: SortedQueue<LocusDeltaDto>;\n workingCopy: any;\n syncTimer?: ReturnType<typeof setTimeout>;\n\n /**\n * @constructs Parser\n */\n constructor() {\n const deltaCompareFunc = (left: LocusDeltaDto, right: LocusDeltaDto) => {\n const {LT, GT} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n\n if (Parser.isSequenceEmpty(left)) {\n return -1;\n }\n if (Parser.isSequenceEmpty(right)) {\n return 1;\n }\n const result = extract(Parser.compareSequence(left.baseSequence, right.baseSequence));\n\n if (result === LT) {\n return -1;\n }\n if (result === GT) {\n return 1;\n }\n\n return 0;\n };\n\n this.queue = new SortedQueue<LocusDeltaDto>(deltaCompareFunc);\n this.status = 'IDLE';\n this.onDeltaAction = null;\n this.workingCopy = null;\n this.syncTimer = undefined;\n }\n\n /**\n * Returns a debug string representing a locus delta - useful for logging\n *\n * @param {LocusDeltaDto} locus Locus delta\n * @returns {string}\n */\n static locus2string(locus: LocusDeltaDto) {\n if (!locus.sequence?.entries) {\n return 'invalid';\n }\n\n return locus.sequence.entries.length ? `seq=${locus.sequence.entries.at(-1)}` : 'empty';\n }\n\n /**\n * Checks if two sequences overlap in time,\n * the sequence with the higher minimum value is greater.\n * Chooses sequence with most recent data.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkSequenceOverlap(current, incoming) {\n let comparison = null;\n\n // if earliest working copy sequence is more recent than last incoming sequence\n if (current.min > incoming.max) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:SO001`;\n }\n // if last working copy sequence is before the earliest incoming sequence\n else if (current.max < incoming.min) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:SO002`;\n }\n\n // if no match above, defaults to null\n return comparison;\n }\n\n /**\n * Checks if two sequences have unequal ranges.\n * Chooses sequence with most larger range.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {object} loci comparison\n */\n static checkUnequalRanges(current, incoming) {\n let comparison = null;\n const currentIsNotUnique = current.unique.length === 0;\n const incomingIsNotUnique = incoming.unique.length === 0;\n const currentTotalRange = current.end - current.min;\n const incomingTotalRange = incoming.end - incoming.min;\n\n // no unique values for both loci\n if (currentIsNotUnique && incomingIsNotUnique) {\n // current working copy loci has a larger range\n if (currentTotalRange > incomingTotalRange) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UR001`;\n }\n // incoming delta loci has a larger range\n else if (currentTotalRange < incomingTotalRange) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UR002`;\n } else {\n // with no unique entries and with ranges either absent or\n // of the same size, the sequences are considered equal.\n comparison = `${Parser.loci.EQ}:UR003`;\n }\n }\n\n return comparison;\n }\n\n /**\n * Checks if either sequences has unique entries.\n * Entries are considered unique if they do not overlap\n * with other Loci sequences or range values.\n * Chooses sequence with the unique entries.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkForUniqueEntries(current, incoming) {\n let comparison = null;\n const currentIsUnique = current.unique.length > 0;\n const incomingIsUnique = incoming.unique.length > 0;\n\n // current has unique entries and incoming does not\n if (currentIsUnique && !incomingIsUnique) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:UE001`;\n }\n // current has no unique entries but incoming does\n else if (!currentIsUnique && incomingIsUnique) {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:UE002`;\n }\n\n return comparison;\n }\n\n /**\n * Checks both Locus Delta objects to see if they are\n * out of sync with one another. If so sends a DESYNC\n * request to the server.\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static checkIfOutOfSync(current, incoming) {\n let comparison = null;\n const currentUniqueMin = current.unique[0];\n const incomingUniqueMin = incoming.unique[0];\n\n const currentHasNoRange = !current.start && !current.end;\n const incomingHasNoRange = !incoming.start && !incoming.end;\n const neitherSeqHasRange = currentHasNoRange && incomingHasNoRange;\n\n const hasUniqOverlap = (list, min, max) => list.some((seq) => min < seq && seq < max);\n // current unique entries overlap the total range of incoming\n const currentUniqOverlap = hasUniqOverlap(current.unique, incoming.min, incoming.max);\n // vice-versa, incoming unique entries overlap the total range of current\n const incomingUniqOverlap = hasUniqOverlap(incoming.unique, current.min, current.max);\n\n if (neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap) {\n // outputs string indicating which condition occurred. ex: 0,1,0\n const debugInfo = `${+neitherSeqHasRange},${+currentUniqOverlap},${+incomingUniqOverlap}`;\n\n // send DESYNC to server\n comparison = `${Parser.loci.DESYNC}:OOS001:${debugInfo}`;\n } else if (currentUniqueMin > incomingUniqueMin) {\n // choose left side (current)\n comparison = `${Parser.loci.GT}:OOS002`;\n } else {\n // choose right side (incoming)\n comparison = `${Parser.loci.LT}:OOS003`;\n }\n\n return comparison;\n }\n\n /**\n * Compares two loci to determine which one contains the most recent state\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @returns {string} loci comparison state\n */\n static compare(current, incoming) {\n const {isSequenceEmpty} = Parser;\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n if (isSequenceEmpty(current) || isSequenceEmpty(incoming)) {\n return pack(Parser.loci.USE_INCOMING, 'C001');\n }\n\n if (incoming.baseSequence) {\n return pack(Parser.compareDelta(current, incoming), 'C002');\n }\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n const action = Parser.compareToAction(extract(result));\n\n return pack(action, result);\n }\n\n /**\n * Compares two loci sequences (with delta params) and indicates what action\n * to take.\n * @instance\n * @memberof Locus\n * @param {Types~Locus} current\n * @param {Types~Locus} incoming\n * @private\n * @returns {string} loci comparison state\n */\n private static compareDelta(current, incoming) {\n const {LT, GT, EQ, DESYNC, USE_INCOMING, WAIT, LOCUS_URL_CHANGED} = Parser.loci;\n\n const {extractComparisonState: extract} = Parser;\n const {packComparisonResult: pack} = Parser;\n\n const result = Parser.compareSequence(current.sequence, incoming.sequence);\n let comparison = extract(result);\n\n if (comparison !== LT) {\n return pack(Parser.compareToAction(comparison), result);\n }\n\n if (incoming.url !== current.url) {\n // when moving to/from a breakout session, the locus URL will change and also\n // the baseSequence, making incoming and current incomparable, so use a\n // unique comparison state\n return pack(LOCUS_URL_CHANGED, result);\n }\n\n comparison = Parser.compareSequence(current.sequence, incoming.baseSequence);\n\n switch (extract(comparison)) {\n case GT:\n case EQ:\n comparison = USE_INCOMING;\n break;\n\n case LT:\n if (extract(Parser.compareSequence(incoming.baseSequence, incoming.sequence)) === EQ) {\n // special case where Locus sends a delta with baseSequence === sequence to trigger a sync,\n // because the delta event is too large to be sent over mercury connection\n comparison = DESYNC;\n } else {\n // the incoming locus has baseSequence from the future, so it is out-of-order,\n // we are missing 1 or more locus that should be in front of it, we need to wait for it\n comparison = WAIT;\n\n Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.LOCUS_DELTA_OUT_OF_ORDER, {\n stack: new Error().stack,\n });\n }\n break;\n default:\n comparison = DESYNC;\n }\n\n return pack(comparison, result);\n }\n\n /**\n * Compares Locus sequences - it should be called only for full Locus DTOs, not deltas\n *\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incomingFullDto New Full Locus DTO\n * @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT\n */\n static compareFullDtoSequence(current, incomingFullDto) {\n if (Parser.isSequenceEmpty(current) || Parser.isSequenceEmpty(incomingFullDto)) {\n return Parser.loci.USE_INCOMING;\n }\n\n // the sequence.entries list will always contain at least 1 entry\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n return incomingFullDto.sequence.entries.slice(-1)[0] > current.sequence.entries.slice(-1)[0]\n ? Parser.loci.USE_INCOMING\n : Parser.loci.USE_CURRENT;\n }\n\n /**\n * Returns true if the incoming full locus DTO is newer than the current working copy\n *\n * @param {Types~Locus} incomingFullDto New Full Locus DTO\n * @returns {string} either Parser.loci.USE_INCOMING or Parser.loci.USE_CURRENT\n */\n isNewFullLocus(incomingFullDto) {\n if (!Parser.isLoci(incomingFullDto)) {\n LoggerProxy.logger.info('Locus-info:parser#isNewFullLocus --> Ignoring non-locus object.');\n\n return false;\n }\n\n if (!this.workingCopy) {\n // we don't have a working copy yet, so any full locus is better than nothing\n return true;\n }\n\n const comparisonResult = Parser.compareFullDtoSequence(this.workingCopy, incomingFullDto);\n\n return comparisonResult === Parser.loci.USE_INCOMING;\n }\n\n /**\n * Compares Locus sequences\n * @param {Types~Locus} current Current working copy\n * @param {Types~Locus} incoming New Locus delta\n * @returns {string}\n */\n static compareSequence(current, incoming) {\n // Locus sequence comparison rules in order of priority.\n // https://sqbu-github.cisco.com/WebExSquared/cloud-apps/wiki/Locus-Sequence-Comparison-Algorithm\n\n const local: any = Parser.getMetaData(current);\n const delta: any = Parser.getMetaData(incoming);\n\n // update loci metadata\n local.unique = Parser.getUniqueSequences(local, delta);\n delta.unique = Parser.getUniqueSequences(delta, local);\n\n // Locus sequence comparison rules\n // order matters\n const rules = [\n Parser.checkSequenceOverlap,\n Parser.checkUnequalRanges,\n Parser.checkForUniqueEntries,\n Parser.checkIfOutOfSync,\n ];\n\n for (const rule of rules) {\n // Rule only returns a value if the rule applies,\n // otherwise returns null.\n const result = rule(local, delta);\n\n if (result) {\n return result;\n }\n }\n\n // error, none of rules above applied\n // should never get here as last rule\n // should be catch all.\n return Parser.loci.ERROR;\n }\n\n /**\n * Transates the result of a sequence comparison into an intended behavior\n * @param {string} result\n * @returns {string} Locus comparison action\n */\n static compareToAction(result: string) {\n const {DESYNC, EQ, ERROR, GT, LT, USE_CURRENT, USE_INCOMING} = Parser.loci;\n\n let action = ERROR;\n\n switch (result) {\n case EQ:\n case GT:\n action = USE_CURRENT;\n break;\n case LT:\n action = USE_INCOMING;\n break;\n case DESYNC:\n action = DESYNC;\n break;\n default:\n LoggerProxy.logger.info(\n `Locus-info:parser#compareToAction --> Error: ${result} is not a recognized sequence comparison result.`\n );\n }\n\n return action;\n }\n\n /**\n * Extracts a loci comparison from a string of data.\n * @param {string} lociComparisonResult Comparison result with extra data\n * @returns {string} Comparison of EQ, LT, GT, or DESYNC.\n */\n static extractComparisonState(lociComparisonResult: string) {\n return lociComparisonResult.split(':')[0];\n }\n\n /**\n * @typedef {object} LociMetadata\n * @property {number} start - Starting sequence number\n * @property {number} end - Ending sequence number\n * @property {number} first - First sequence number\n * @property {number} last - Last sequence number\n * @property {number} min - Minimum sequence number\n * @property {number} max - Maximum sequence number\n * @property {number} entries - Loci sequence entries\n */\n\n /**\n * Metadata for Locus delta\n * @param {Array.<number>} sequence Locus delta sequence\n * @returns {LociMetadata} Locus Delta Metadata\n */\n static getMetaData(sequence: any) {\n const {entries} = sequence;\n const first = entries[0];\n const last = entries.slice(-1)[0];\n\n // rangeStart or rangeEnd is 0 if a range doesn't exist\n const start = sequence.rangeStart;\n const end = sequence.rangeEnd;\n\n // sequence data\n return {\n start,\n end,\n first,\n last,\n // Rule is: rangeStart <= rangeEnd <= min(entries)\n min: start || first,\n // Grab last entry if exist else default to rangeEnd\n max: last || end,\n // keep reference to actual sequence entries\n entries,\n };\n }\n\n /**\n * Compares two Locus delta objects and notes unique\n * values contained within baseLoci.\n * @param {LociMetadata} baseLoci\n * @param {LociMetadata} otherLoci\n * @returns {Array.<number>} List of unique sequences\n */\n static getUniqueSequences(baseLoci: any, otherLoci: any) {\n const diff: any = difference(baseLoci.entries, otherLoci.entries);\n\n const {start, end} = otherLoci;\n\n return Parser.getNumbersOutOfRange(diff, start, end);\n }\n\n /**\n * Returns an array of numbers outside of a given range.\n * @param {Array.<number>} list Array to filter\n * @param {number} rangeStart Start of range\n * @param {number} rangeEnd End of range\n * @returns {Array.<number>} Array of numbers sorted ASC\n */\n static getNumbersOutOfRange(list: Array<number>, rangeStart: number, rangeEnd: number) {\n // Collect all numbers if number is outside of specified range\n const output = list.filter((num) => num < rangeStart || num > rangeEnd);\n\n // sort ascending\n return output.sort((a, b) => a - b);\n }\n\n /**\n * Checks if newLoci or workingCopy is invalid.\n * @param {Types~Locus} newLoci\n * @returns {boolean}\n */\n isValidLocus(newLoci) {\n let isValid = false;\n const {isLoci} = Parser;\n\n // one or both objects are not locus delta events\n if (!isLoci(this.workingCopy) || !isLoci(newLoci)) {\n LoggerProxy.logger.info(\n 'Locus-info:parser#processDeltaEvent --> Ignoring non-locus object. workingCopy:',\n this.workingCopy,\n 'newLoci:',\n newLoci\n );\n } else {\n isValid = true;\n }\n\n return isValid;\n }\n\n /**\n * Determines if a paricular locus's sequence is empty\n * @param {Types~Locus} locus\n * @returns {bool}\n */\n static isSequenceEmpty(locus) {\n const {sequence} = locus;\n const hasEmptyEntries = !sequence.entries?.length;\n const hasEmptyRange = sequence.rangeStart === 0 && sequence.rangeEnd === 0;\n\n return hasEmptyEntries && hasEmptyRange;\n }\n\n /**\n * Determines if an object has basic\n * structure of a locus object.\n * @param {Types~Locus} loci\n * @returns {boolean}\n */\n static isLoci(loci) {\n if (!loci || !loci.sequence) {\n return false;\n }\n const hasProp = (prop) => Object.prototype.hasOwnProperty.call(loci.sequence, prop);\n\n if (hasProp('rangeStart') && hasProp('rangeEnd')) {\n return true;\n }\n\n return false;\n }\n\n /**\n * Processes next event in queue,\n * if queue is empty sets status to idle.\n * @returns {undefined}\n */\n nextEvent() {\n if (this.status === 'PAUSED') {\n LoggerProxy.logger.info('Locus-info:parser#nextEvent --> Locus parser paused.');\n\n return;\n }\n\n if (this.status === 'BLOCKED') {\n LoggerProxy.logger.info(\n 'Locus-info:parser#nextEvent --> Locus parser blocked by out-of-order delta.'\n );\n\n return;\n }\n\n // continue processing until queue is empty\n if (this.queue.size() > 0) {\n this.processDeltaEvent();\n } else {\n this.status = 'IDLE';\n }\n }\n\n /**\n * Function handler for delta actions,\n * is set by instance callee.\n * @param {string} action Locus delta action\n * @param {Types~Locus} locus Locus delta\n * @returns {undefined}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n onDeltaAction(action: string, locus) {}\n\n /**\n * Event handler for locus delta events\n * @param {Types~Locus} loci Locus Delta\n * @returns {undefined}\n */\n onDeltaEvent(loci) {\n // enqueue the new loci\n this.queue.enqueue(loci);\n\n if (this.onDeltaAction) {\n if (this.status === 'BLOCKED') {\n if (this.queue.size() > MAX_OOO_DELTA_COUNT) {\n this.triggerSync('queue too big, blocked on out-of-order delta');\n } else {\n this.processDeltaEvent();\n }\n } else if (this.status === 'IDLE') {\n // Update status, ensure we only process one event at a time.\n this.status = 'WORKING';\n\n this.processDeltaEvent();\n }\n }\n }\n\n /**\n * Appends new data onto a string of existing data.\n * @param {string} newData\n * @param {string} oldData\n * @returns {string}\n */\n static packComparisonResult(newData: string, oldData: string) {\n return `${newData}:${oldData}`;\n }\n\n /**\n * Pause locus processing\n * @returns {undefined}\n */\n pause() {\n this.status = 'PAUSED';\n LoggerProxy.logger.info('Locus-info:parser#pause --> Locus parser paused.');\n }\n\n /**\n * Triggers a sync with Locus\n *\n * @param {string} reason used just for logging\n * @returns {undefined}\n */\n private triggerSync(reason: string) {\n LoggerProxy.logger.info(`Locus-info:parser#triggerSync --> doing sync, reason: ${reason}`);\n this.stopSyncTimer();\n this.pause();\n this.onDeltaAction(Parser.loci.DESYNC, this.workingCopy);\n }\n\n /**\n * Starts a timer with a random delay. When that timer expires we will do a sync.\n *\n * The main purpose of this timer is to handle a case when we get some out-of-order deltas,\n * so we start waiting to receive the missing delta. If that delta never arrives, this timer\n * will trigger a sync with Locus.\n *\n * @returns {undefined}\n */\n private startSyncTimer() {\n if (this.syncTimer === undefined) {\n const timeout = OOO_DELTA_WAIT_TIME + Math.random() * OOO_DELTA_WAIT_TIME_RANDOM_DELAY;\n\n this.syncTimer = setTimeout(() => {\n this.syncTimer = undefined;\n this.triggerSync('timer expired, blocked on out-of-order delta');\n }, timeout);\n }\n }\n\n /**\n * Stops the timer for triggering a sync\n *\n * @returns {undefined}\n */\n private stopSyncTimer() {\n if (this.syncTimer !== undefined) {\n clearTimeout(this.syncTimer);\n this.syncTimer = undefined;\n }\n }\n\n /**\n * Processes next locus delta in the queue,\n * continues until the queue is empty\n * or cleared.\n * @returns {undefined}\n */\n processDeltaEvent() {\n const {DESYNC, USE_INCOMING, WAIT, LOCUS_URL_CHANGED} = Parser.loci;\n const {extractComparisonState: extract} = Parser;\n const newLoci = this.queue.dequeue();\n\n if (!this.isValidLocus(newLoci)) {\n this.nextEvent();\n\n return;\n }\n\n const result = Parser.compare(this.workingCopy, newLoci);\n const lociComparison = extract(result);\n\n // limited debugging, use chrome extension\n // for full debugging.\n LoggerProxy.logger.debug(`Locus-info:parser#processDeltaEvent --> Locus Debug: ${result}`);\n\n let needToWait = false;\n\n switch (lociComparison) {\n case DESYNC:\n // wait for desync response\n this.pause();\n break;\n\n case USE_INCOMING:\n // update working copy for future comparisons.\n // Note: The working copy of parser gets updated in .onFullLocus()\n // and here when USE_INCOMING or LOCUS_URL_CHANGED locus.\n this.workingCopy = newLoci;\n break;\n\n case LOCUS_URL_CHANGED:\n // clear the working copy completely, do a full locus sync\n this.workingCopy = null;\n break;\n\n case WAIT:\n // we've taken newLoci from the front of the queue, so put it back there as we have to wait\n // for the one that should be in front of it, before we can process it\n this.queue.enqueue(newLoci);\n needToWait = true;\n break;\n\n default:\n break;\n }\n\n if (needToWait) {\n this.status = 'BLOCKED';\n this.startSyncTimer();\n } else {\n this.stopSyncTimer();\n\n if (this.status === 'BLOCKED') {\n // we are not blocked anymore\n this.status = 'WORKING';\n\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> received delta that we were waiting for ${Parser.locus2string(\n newLoci\n )}, not blocked anymore`\n );\n }\n }\n\n if (this.onDeltaAction) {\n LoggerProxy.logger.info(\n `Locus-info:parser#processDeltaEvent --> Locus Delta ${Parser.locus2string(\n newLoci\n )}, Action: ${lociComparison}`\n );\n\n try {\n this.onDeltaAction(lociComparison, newLoci);\n } catch (error) {\n LoggerProxy.logger.error(\n 'Locus-info:parser#processDeltaEvent --> Error in onDeltaAction',\n error\n );\n }\n }\n\n this.nextEvent();\n }\n\n /**\n * Resume from a paused state\n * @returns {undefined}\n */\n resume() {\n LoggerProxy.logger.info('Locus-info:parser#resume --> Locus parser resumed.');\n this.status = 'WORKING';\n this.nextEvent();\n }\n\n /**\n * Gets related debug info for given error code\n * @param {string} debugCode Debug code\n * @param {string} comparison Locus comparison string\n * @returns {object} Debug message\n */\n static getDebugMessage(debugCode: string, comparison: string) {\n // removes extra spaces from multiline string\n const mStr = (strings) => strings.join('').replace(/\\s{2,}/g, ' ');\n\n const resolutionMap = {\n EQ: `${Parser.loci.LT}: is equal (current == incoming).`,\n LT: `${Parser.loci.LT}: choose right side (incoming).`,\n GT: `${Parser.loci.GT}: choose left side (current).`,\n };\n\n const debugMap = {\n SO001: {\n title: 'checkSequenceOverlap-001',\n description: mStr`Occurs if earliest working copy sequence is more \\\n recent than last incoming sequence.`,\n logic: 'current.min > incoming.max',\n },\n\n SO002: {\n title: 'checkSequenceOverlap-002',\n description: mStr`Occurs if last working copy sequence is before the \\\n earliest incoming sequence.`,\n logic: 'current.max < incoming.min',\n },\n\n UR001: {\n title: 'checkUnequalRanges-001',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the current working copy loci has a larger range.`,\n logic: 'currentTotalRange > incomingTotalRange',\n },\n\n UR002: {\n title: 'checkUnequalRanges-002',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and the incoming delta loci has a larger range.`,\n logic: 'currentTotalRange < incomingTotalRange',\n },\n\n UR003: {\n title: 'checkUnequalRanges-003',\n description: mStr`Occurs if there are no unique values for both loci, \\\n and with ranges either absent or of the same size, the sequences \\\n are considered equal.`,\n logic: 'currentTotalRange == incomingTotalRange',\n },\n\n UE001: {\n title: 'checkForUniqueEntries-001',\n description: mStr`Occurs if current loci has unique entries and \\\n incoming does not. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: 'currentIsUnique && !incomingIsUnique',\n },\n\n UE002: {\n title: 'checkForUniqueEntries-002',\n description: mStr`Occurs if current has no unique entries but \\\n incoming does. Entries are considered unique if they \\\n do not overlap with other Loci sequences or range values.`,\n logic: '!currentIsUnique && incomingIsUnique',\n },\n\n OOS001: {\n title: 'checkIfOutOfSync-001',\n description: mStr`Occurs if neither sequence has a range, or \\\n if the current loci unique entries overlap the total range of the \\\n incoming sequence, or if the incoming unique entries overlap \\\n the total range of current sequence.`,\n logic: 'neitherSeqHasRange || currentUniqOverlap || incomingUniqOverlap',\n },\n\n OOS002: {\n title: 'checkIfOutOfSync-002',\n description: mStr`Occurs if the minimum value from sequences that are \\\n unique to the current loci is greater than the minimum value from \\\n sequences that are unique to the incoming loci.`,\n logic: 'currentUniqueMin > incomingUniqueMin',\n },\n\n OOS003: {\n title: 'checkIfOutOfSync-003',\n description: mStr`Occurs if none of the comparison rules applied. \\\n It is a catch all.`,\n logic: 'else (catch all)',\n },\n };\n\n const debugObj = debugMap[debugCode];\n\n debugObj.title = `Debug: ${debugObj.title}`;\n debugObj.resolution = resolutionMap[comparison];\n\n return debugObj;\n }\n}\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,YAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEA,IAAAI,QAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,UAAA,GAAAH,sBAAA,CAAAF,OAAA;AAAsD,IAAAM,eAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gBAAA,EAAAC,gB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AAA,iBAAA,OAAA8K,uBAAA,CAAAxK,OAAA,2KACI;UACrByK,KAAK,EAAE;QACT;MACF,CAAC;MAED,IAAMU,QAAQ,GAAGf,QAAQ,CAACN,SAAS,CAAC;MAEpCqB,QAAQ,CAACb,KAAK,aAAAtH,MAAA,CAAamI,QAAQ,CAACb,KAAK,CAAE;MAC3Ca,QAAQ,CAACC,UAAU,GAAGjB,aAAa,CAACtF,UAAU,CAAC;MAE/C,OAAOsG,QAAQ;IACjB;EAAC;EAAA,OAAArL,MAAA;AAAA;AA91Bc;AAEf;AAAA,IAAAI,gBAAA,CAAAF,OAAA,EARmBF,MAAM,UASX;EACZyF,EAAE,EAAE,OAAO;EACX9E,EAAE,EAAE,cAAc;EAClBD,EAAE,EAAE,WAAW;EACf0C,MAAM,EAAE,QAAQ;EAChBhB,YAAY,EAAE,cAAc;EAC5BoF,WAAW,EAAE,aAAa;EAC1B3D,IAAI,EAAE,MAAM;EACZoE,KAAK,EAAE,OAAO;EACdnE,iBAAiB,EAAE;AACrB,CAAC"}
@@ -1072,10 +1072,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1072
1072
  }
1073
1073
  }
1074
1074
 
1075
- // Count members that are in the meeting.
1075
+ // Count members that are in the meeting or in the lobby.
1076
1076
  var members = _this.getMembers().membersCollection.members;
1077
1077
  event.data.intervalMetadata.meetingUserCount = (0, _values.default)(members).filter(function (member) {
1078
- return member.isInMeeting;
1078
+ return member.isInMeeting || member.isInLobby;
1079
1079
  }).length;
1080
1080
 
1081
1081
  // @ts-ignore
@@ -2601,11 +2601,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2601
2601
  key: "fetchMeetingInfoInternal",
2602
2602
  value: (function () {
2603
2603
  var _fetchMeetingInfoInternal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(_ref8) {
2604
- var destination, destinationType, _ref8$password, password, _ref8$captchaCode, captchaCode, _ref8$extraParams, extraParams, _ref8$sendCAevents, sendCAevents, _ref8$registrationId, registrationId, captchaInfo, info, _err$body, _err$body2;
2604
+ var destination, destinationType, _ref8$password, password, _ref8$captchaCode, captchaCode, _ref8$extraParams, extraParams, _ref8$sendCAevents, sendCAevents, _ref8$registrationId, registrationId, _ref8$classificationI, classificationId, captchaInfo, info, _err$body, _err$body2;
2605
2605
  return _regenerator.default.wrap(function _callee5$(_context5) {
2606
2606
  while (1) switch (_context5.prev = _context5.next) {
2607
2607
  case 0:
2608
- destination = _ref8.destination, destinationType = _ref8.destinationType, _ref8$password = _ref8.password, password = _ref8$password === void 0 ? null : _ref8$password, _ref8$captchaCode = _ref8.captchaCode, captchaCode = _ref8$captchaCode === void 0 ? null : _ref8$captchaCode, _ref8$extraParams = _ref8.extraParams, extraParams = _ref8$extraParams === void 0 ? {} : _ref8$extraParams, _ref8$sendCAevents = _ref8.sendCAevents, sendCAevents = _ref8$sendCAevents === void 0 ? false : _ref8$sendCAevents, _ref8$registrationId = _ref8.registrationId, registrationId = _ref8$registrationId === void 0 ? null : _ref8$registrationId;
2608
+ destination = _ref8.destination, destinationType = _ref8.destinationType, _ref8$password = _ref8.password, password = _ref8$password === void 0 ? null : _ref8$password, _ref8$captchaCode = _ref8.captchaCode, captchaCode = _ref8$captchaCode === void 0 ? null : _ref8$captchaCode, _ref8$extraParams = _ref8.extraParams, extraParams = _ref8$extraParams === void 0 ? {} : _ref8$extraParams, _ref8$sendCAevents = _ref8.sendCAevents, sendCAevents = _ref8$sendCAevents === void 0 ? false : _ref8$sendCAevents, _ref8$registrationId = _ref8.registrationId, registrationId = _ref8$registrationId === void 0 ? null : _ref8$registrationId, _ref8$classificationI = _ref8.classificationId, classificationId = _ref8$classificationI === void 0 ? null : _ref8$classificationI;
2609
2609
  _context5.prev = 1;
2610
2610
  captchaInfo = captchaCode ? {
2611
2611
  code: captchaCode,
@@ -2617,7 +2617,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2617
2617
  this.config.installedOrgID, this.locusId, extraParams, {
2618
2618
  meetingId: this.id,
2619
2619
  sendCAevents: sendCAevents
2620
- }, registrationId);
2620
+ }, registrationId, null, classificationId);
2621
2621
  case 5:
2622
2622
  info = _context5.sent;
2623
2623
  this.parseMeetingInfo(info === null || info === void 0 ? void 0 : info.body, this.destination, info === null || info === void 0 ? void 0 : info.errors);
@@ -3695,7 +3695,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3695
3695
  }
3696
3696
  _loggerProxy.default.logger.info("Meeting:index#setUpLocusInfoMediaInactiveListener --> this.shareStatus=".concat(_this15.shareStatus, " newShareStatus=").concat(newShareStatus));
3697
3697
  if (!(newShareStatus !== _this15.shareStatus)) {
3698
- _context8.next = 46;
3698
+ _context8.next = 48;
3699
3699
  break;
3700
3700
  }
3701
3701
  oldShareStatus = _this15.shareStatus; // update our state before we send out any notifications
@@ -3703,14 +3703,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3703
3703
 
3704
3704
  // send out "stop" notifications for the old state
3705
3705
  _context8.t0 = oldShareStatus;
3706
- _context8.next = _context8.t0 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 15 : _context8.t0 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 17 : _context8.t0 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 19 : _context8.t0 === _constants.SHARE_STATUS.NO_SHARE ? 21 : 22;
3706
+ _context8.next = _context8.t0 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 15 : _context8.t0 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 17 : _context8.t0 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 19 : _context8.t0 === _constants.SHARE_STATUS.NO_SHARE ? 23 : 24;
3707
3707
  break;
3708
3708
  case 15:
3709
3709
  _triggerProxy.default.trigger(_this15, {
3710
3710
  file: 'meetings/index',
3711
3711
  function: 'remoteShare'
3712
3712
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_REMOTE);
3713
- return _context8.abrupt("break", 23);
3713
+ return _context8.abrupt("break", 25);
3714
3714
  case 17:
3715
3715
  _triggerProxy.default.trigger(_this15, {
3716
3716
  file: 'meeting/index',
@@ -3718,22 +3718,39 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3718
3718
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_LOCAL, {
3719
3719
  reason: _constants.SHARE_STOPPED_REASON.SELF_STOPPED
3720
3720
  });
3721
- return _context8.abrupt("break", 23);
3721
+ return _context8.abrupt("break", 25);
3722
3722
  case 19:
3723
3723
  _triggerProxy.default.trigger(_this15, {
3724
3724
  file: 'meeting/index',
3725
3725
  function: 'stopWhiteboardShare'
3726
3726
  }, _constants.EVENT_TRIGGERS.MEETING_STOPPED_SHARING_WHITEBOARD);
3727
- return _context8.abrupt("break", 23);
3728
- case 21:
3729
- return _context8.abrupt("break", 23);
3730
- case 22:
3731
- return _context8.abrupt("break", 23);
3727
+ // @ts-ignore
3728
+ _this15.webex.internal.newMetrics.callDiagnosticLatencies.saveTimestamp({
3729
+ key: 'internal.client.share.stopped'
3730
+ });
3731
+ // @ts-ignore
3732
+ _this15.webex.internal.newMetrics.submitClientEvent({
3733
+ name: 'client.share.stopped',
3734
+ payload: {
3735
+ mediaType: 'whiteboard',
3736
+ shareDuration:
3737
+ // @ts-ignore
3738
+ _this15.webex.internal.newMetrics.callDiagnosticLatencies.getShareDuration()
3739
+ },
3740
+ options: {
3741
+ meetingId: _this15.id
3742
+ }
3743
+ });
3744
+ return _context8.abrupt("break", 25);
3732
3745
  case 23:
3746
+ return _context8.abrupt("break", 25);
3747
+ case 24:
3748
+ return _context8.abrupt("break", 25);
3749
+ case 25:
3733
3750
  _context8.t1 = newShareStatus;
3734
- _context8.next = _context8.t1 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 26 : _context8.t1 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 35 : _context8.t1 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 38 : _context8.t1 === _constants.SHARE_STATUS.NO_SHARE ? 41 : 42;
3751
+ _context8.next = _context8.t1 === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE ? 28 : _context8.t1 === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE ? 37 : _context8.t1 === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE ? 40 : _context8.t1 === _constants.SHARE_STATUS.NO_SHARE ? 43 : 44;
3735
3752
  break;
3736
- case 26:
3753
+ case 28:
3737
3754
  sendStartedSharingRemote = function sendStartedSharingRemote() {
3738
3755
  _this15.remoteShareInstanceId = contentShare.shareInstanceId;
3739
3756
  _this15.shareCAEventSentStatus.receiveStart = false;
@@ -3749,20 +3766,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3749
3766
  resourceType: contentShare.resourceType
3750
3767
  });
3751
3768
  };
3752
- _context8.prev = 27;
3769
+ _context8.prev = 29;
3753
3770
  if (!((_this15$mediaProperti = _this15.mediaProperties.mediaDirection) !== null && _this15$mediaProperti !== void 0 && _this15$mediaProperti.sendShare && oldShareStatus === _constants.SHARE_STATUS.LOCAL_SHARE_ACTIVE)) {
3754
- _context8.next = 31;
3771
+ _context8.next = 33;
3755
3772
  break;
3756
3773
  }
3757
- _context8.next = 31;
3774
+ _context8.next = 33;
3758
3775
  return _this15.unpublishStreams([_this15.mediaProperties.shareVideoStream, _this15.mediaProperties.shareAudioStream]);
3759
- case 31:
3760
- _context8.prev = 31;
3776
+ case 33:
3777
+ _context8.prev = 33;
3761
3778
  sendStartedSharingRemote();
3762
- return _context8.finish(31);
3763
- case 34:
3764
- return _context8.abrupt("break", 43);
3765
- case 35:
3779
+ return _context8.finish(33);
3780
+ case 36:
3781
+ return _context8.abrupt("break", 45);
3782
+ case 37:
3766
3783
  _triggerProxy.default.trigger(_this15, {
3767
3784
  file: 'meeting/index',
3768
3785
  function: 'share'
@@ -3778,8 +3795,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3778
3795
  meetingId: _this15.id
3779
3796
  }
3780
3797
  });
3781
- return _context8.abrupt("break", 43);
3782
- case 38:
3798
+ return _context8.abrupt("break", 45);
3799
+ case 40:
3783
3800
  _triggerProxy.default.trigger(_this15, {
3784
3801
  file: 'meeting/index',
3785
3802
  function: 'startWhiteboardShare'
@@ -3797,16 +3814,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3797
3814
  meetingId: _this15.id
3798
3815
  }
3799
3816
  });
3800
- return _context8.abrupt("break", 43);
3801
- case 41:
3802
- return _context8.abrupt("break", 43);
3803
- case 42:
3804
- return _context8.abrupt("break", 43);
3817
+ return _context8.abrupt("break", 45);
3805
3818
  case 43:
3819
+ return _context8.abrupt("break", 45);
3820
+ case 44:
3821
+ return _context8.abrupt("break", 45);
3822
+ case 45:
3806
3823
  _this15.members.locusMediaSharesUpdate(payload);
3807
- _context8.next = 47;
3824
+ _context8.next = 49;
3808
3825
  break;
3809
- case 46:
3826
+ case 48:
3810
3827
  if (newShareStatus === _constants.SHARE_STATUS.REMOTE_SHARE_ACTIVE) {
3811
3828
  // if we got here, then some remote participant has stolen
3812
3829
  // the presentation from another remote participant
@@ -3846,11 +3863,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3846
3863
  });
3847
3864
  _this15.members.locusMediaSharesUpdate(payload);
3848
3865
  }
3849
- case 47:
3866
+ case 49:
3850
3867
  case "end":
3851
3868
  return _context8.stop();
3852
3869
  }
3853
- }, _callee8, null, [[27,, 31, 34]]);
3870
+ }, _callee8, null, [[29,, 33, 36]]);
3854
3871
  }));
3855
3872
  return function (_x8) {
3856
3873
  return _ref31.apply(this, arguments);
@@ -7677,6 +7694,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7677
7694
  receiveVideo,
7678
7695
  sendAudio,
7679
7696
  receiveAudio,
7697
+ ipver,
7680
7698
  _this$remoteMediaMana,
7681
7699
  _yield$this$mediaProp,
7682
7700
  connectionType,
@@ -7741,14 +7759,16 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7741
7759
  receiveAudio = audioEnabled && (rawReceiveAudio !== null && rawReceiveAudio !== void 0 ? rawReceiveAudio : true);
7742
7760
  this.allowMediaInLobby = options === null || options === void 0 ? void 0 : options.allowMediaInLobby;
7743
7761
 
7762
+ // @ts-ignore
7763
+ ipver = _util2.default.getIpVersion(this.webex); // used just for metrics
7744
7764
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
7745
7765
  // @ts-ignore - isUserUnadmitted coming from SelfUtil
7746
7766
  if (!(this.isUserUnadmitted && !this.wirelessShare && !this.allowMediaInLobby)) {
7747
- _context35.next = 19;
7767
+ _context35.next = 20;
7748
7768
  break;
7749
7769
  }
7750
7770
  throw new _webexErrors.UserInLobbyError();
7751
- case 19:
7771
+ case 20:
7752
7772
  // @ts-ignore
7753
7773
  this.webex.internal.newMetrics.submitClientEvent({
7754
7774
  name: 'client.media.capabilities',
@@ -7788,63 +7808,64 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7788
7808
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
7789
7809
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
7790
7810
  this.brbState = (0, _brbState.createBrbState)(this, false);
7791
- _context35.prev = 24;
7792
- _context35.next = 27;
7811
+ _context35.prev = 25;
7812
+ _context35.next = 28;
7793
7813
  return this.setUpLocalStreamReferences(localStreams);
7794
- case 27:
7814
+ case 28:
7795
7815
  this.setMercuryListener();
7796
7816
  this.createStatsAnalyzer();
7797
- _context35.prev = 29;
7798
- _context35.next = 32;
7817
+ _context35.prev = 30;
7818
+ _context35.next = 33;
7799
7819
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, forceTurnDiscovery, turnServerInfo);
7800
- case 32:
7801
- _context35.next = 45;
7820
+ case 33:
7821
+ _context35.next = 46;
7802
7822
  break;
7803
- case 34:
7804
- _context35.prev = 34;
7805
- _context35.t0 = _context35["catch"](29);
7823
+ case 35:
7824
+ _context35.prev = 35;
7825
+ _context35.t0 = _context35["catch"](30);
7806
7826
  if (!(_context35.t0 instanceof _multistreamNotSupportedError.default)) {
7807
- _context35.next = 44;
7827
+ _context35.next = 45;
7808
7828
  break;
7809
7829
  }
7810
7830
  _loggerProxy.default.logger.warn("".concat(LOG_HEADER, " we asked for multistream backend (Homer), but got transcoded backend, recreating media connection..."));
7811
- _context35.next = 40;
7831
+ _context35.next = 41;
7812
7832
  return this.downgradeFromMultistreamToTranscoded();
7813
- case 40:
7814
- _context35.next = 42;
7833
+ case 41:
7834
+ _context35.next = 43;
7815
7835
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, true, undefined);
7816
- case 42:
7817
- _context35.next = 45;
7836
+ case 43:
7837
+ _context35.next = 46;
7818
7838
  break;
7819
- case 44:
7820
- throw _context35.t0;
7821
7839
  case 45:
7840
+ throw _context35.t0;
7841
+ case 46:
7822
7842
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " media connected, finalizing..."));
7823
7843
  if (!this.mediaProperties.hasLocalShareStream()) {
7824
- _context35.next = 49;
7844
+ _context35.next = 50;
7825
7845
  break;
7826
7846
  }
7827
- _context35.next = 49;
7847
+ _context35.next = 50;
7828
7848
  return this.enqueueScreenShareFloorRequest();
7829
- case 49:
7830
- _context35.next = 51;
7849
+ case 50:
7850
+ _context35.next = 52;
7831
7851
  return this.mediaProperties.getCurrentConnectionInfo();
7832
- case 51:
7852
+ case 52:
7833
7853
  _yield$this$mediaProp = _context35.sent;
7834
7854
  connectionType = _yield$this$mediaProp.connectionType;
7835
7855
  ipVersion = _yield$this$mediaProp.ipVersion;
7836
7856
  selectedCandidatePairChanges = _yield$this$mediaProp.selectedCandidatePairChanges;
7837
7857
  numTransports = _yield$this$mediaProp.numTransports;
7838
7858
  iceCandidateErrors = Object.fromEntries(this.iceCandidateErrors);
7839
- _context35.next = 59;
7859
+ _context35.next = 60;
7840
7860
  return this.getMediaReachabilityMetricFields();
7841
- case 59:
7861
+ case 60:
7842
7862
  reachabilityMetrics = _context35.sent;
7843
7863
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread(_objectSpread(_objectSpread({
7844
7864
  correlation_id: this.correlationId,
7845
7865
  locus_id: this.locusUrl.split('/').pop(),
7846
7866
  connectionType: connectionType,
7847
7867
  ipVersion: ipVersion,
7868
+ ipver: ipver,
7848
7869
  selectedCandidatePairChanges: selectedCandidatePairChanges,
7849
7870
  numTransports: numTransports,
7850
7871
  isMultistream: this.isMultistream,
@@ -7868,21 +7889,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7868
7889
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
7869
7890
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
7870
7891
  this.startPeriodicLogUpload();
7871
- _context35.next = 85;
7892
+ _context35.next = 86;
7872
7893
  break;
7873
- case 67:
7874
- _context35.prev = 67;
7875
- _context35.t1 = _context35["catch"](24);
7894
+ case 68:
7895
+ _context35.prev = 68;
7896
+ _context35.t1 = _context35["catch"](25);
7876
7897
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context35.t1);
7877
7898
 
7878
7899
  // @ts-ignore
7879
- _context35.next = 72;
7900
+ _context35.next = 73;
7880
7901
  return this.getMediaReachabilityMetricFields();
7881
- case 72:
7902
+ case 73:
7882
7903
  _reachabilityMetrics = _context35.sent;
7883
- _context35.next = 75;
7904
+ _context35.next = 76;
7884
7905
  return this.mediaProperties.getCurrentConnectionInfo();
7885
- case 75:
7906
+ case 76:
7886
7907
  _yield$this$mediaProp2 = _context35.sent;
7887
7908
  _selectedCandidatePairChanges = _yield$this$mediaProp2.selectedCandidatePairChanges;
7888
7909
  _numTransports = _yield$this$mediaProp2.numTransports;
@@ -7904,11 +7925,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7904
7925
  connectionState: ((_this$mediaProperties22 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties22 === void 0 ? void 0 : (_this$mediaProperties23 = _this$mediaProperties22.multistreamConnection) === null || _this$mediaProperties23 === void 0 ? void 0 : (_this$mediaProperties24 = _this$mediaProperties23.pc) === null || _this$mediaProperties24 === void 0 ? void 0 : (_this$mediaProperties25 = _this$mediaProperties24.pc) === null || _this$mediaProperties25 === void 0 ? void 0 : _this$mediaProperties25.connectionState) || ((_this$mediaProperties26 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties26 === void 0 ? void 0 : (_this$mediaProperties27 = _this$mediaProperties26.mediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.pc) === null || _this$mediaProperties28 === void 0 ? void 0 : _this$mediaProperties28.connectionState) || 'unknown',
7905
7926
  iceConnectionState: ((_this$mediaProperties29 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.multistreamConnection) === null || _this$mediaProperties30 === void 0 ? void 0 : (_this$mediaProperties31 = _this$mediaProperties30.pc) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.pc) === null || _this$mediaProperties32 === void 0 ? void 0 : _this$mediaProperties32.iceConnectionState) || ((_this$mediaProperties33 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties33 === void 0 ? void 0 : (_this$mediaProperties34 = _this$mediaProperties33.mediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.pc) === null || _this$mediaProperties35 === void 0 ? void 0 : _this$mediaProperties35.iceConnectionState) || 'unknown'
7906
7927
  }, _reachabilityMetrics), _iceCandidateErrors), {}, {
7907
- iceCandidatesCount: this.iceCandidatesCount
7928
+ iceCandidatesCount: this.iceCandidatesCount,
7929
+ ipver: ipver
7908
7930
  }));
7909
- _context35.next = 82;
7931
+ _context35.next = 83;
7910
7932
  return this.cleanUpOnAddMediaFailure();
7911
- case 82:
7933
+ case 83:
7912
7934
  // Upload logs on error while adding media
7913
7935
  _triggerProxy.default.trigger(this, {
7914
7936
  file: 'meeting/index',
@@ -7920,15 +7942,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7920
7942
  });
7921
7943
  }
7922
7944
  throw _context35.t1;
7923
- case 85:
7924
- _context35.prev = 85;
7945
+ case 86:
7946
+ _context35.prev = 86;
7925
7947
  this.addMediaData.icePhaseCallback = DEFAULT_ICE_PHASE_CALLBACK;
7926
- return _context35.finish(85);
7927
- case 88:
7948
+ return _context35.finish(86);
7949
+ case 89:
7928
7950
  case "end":
7929
7951
  return _context35.stop();
7930
7952
  }
7931
- }, _callee35, this, [[24, 67, 85, 88], [29, 34]]);
7953
+ }, _callee35, this, [[25, 68, 86, 89], [30, 35]]);
7932
7954
  }));
7933
7955
  function addMediaInternal(_x33, _x34, _x35) {
7934
7956
  return _addMediaInternal.apply(this, arguments);