text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.classifyInstallations = classifyInstallations;
  /**g
     * Classify the device token of installations based on its device type.
     * @param {Object} installations An array of installations
     * @param {Array} validPushTypes An array of valid push types(string)
     * @returns {Object} A map whose key is device type and value is an array of device
     */
  function classifyInstallations(installations, validPushTypes) {
    // Init deviceTokenMap, create a empty array for each valid pushType
    var deviceMap = {};
    var _iteratorNormalCompletion = true;
    var _didIteratorError = false;
    var _iteratorError = undefined;
  
    try {
      for (var _iterator = validPushTypes[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
        var validPushType = _step.value;
  
        deviceMap[validPushType] = [];
      }
    } catch (err) {
      _didIteratorError = true;
      _iteratorError = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion && _iterator.return) {
          _iterator.return();
        }
      } finally {
        if (_didIteratorError) {
          throw _iteratorError;
        }
      }
    }
  
    var _iteratorNormalCompletion2 = true;
    var _didIteratorError2 = false;
    var _iteratorError2 = undefined;
  
    try {
      for (var _iterator2 = installations[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
        var installation = _step2.value;
  
        // No deviceToken, ignore
        if (!installation.deviceToken) {
          continue;
        }
        var pushType = installation.deviceType;
        if (deviceMap[pushType]) {
          deviceMap[pushType].push({
            deviceToken: installation.deviceToken,
            appIdentifier: installation.appIdentifier
          });
        } else {
          console.log('Unknown push type from installation %j', installation);
        }
      }
    } catch (err) {
      _didIteratorError2 = true;
      _iteratorError2 = err;
    } finally {
      try {
        if (!_iteratorNormalCompletion2 && _iterator2.return) {
          _iterator2.return();
        }
      } finally {
        if (_didIteratorError2) {
          throw _iteratorError2;
        }
      }
    }
  
    return deviceMap;
  }