function setBadge(ids, reset, { tab, [kFrameId]: frameId, [kTop]: isTop }) {
  const tabId = tab.id;
  const injectable = ids === SKIP_SCRIPTS || ids === 'off' ? ids : !!ids;
  /** @type {VMBadgeData} */
  const data = !(reset && isTop) && badges[tabId] || resetBadgeData(tabId, injectable);
  if (Array.isArray(ids)) {
    const {
      [IDS]: idMap,
      [kFrameId]: totalMap = data[kFrameId] = {},
    } = data;
    // uniques
    ids.forEach(idMap.add, idMap);
    data.unique = idMap.size;
    // totals
    data.total = 0;
    totalMap[frameId] = ids.length;
    for (const id in totalMap) data.total += totalMap[id];
  }
  if (isTop) {
    data[INJECT] = injectable;
  }
  updateBadgeColor(tab, data);
  updateState(tab, data);
}
@param {number[] | string} ids
@param {boolean} reset
@param {VMMessageSender} src