'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _provinces = require('provinces');

var _provinces2 = _interopRequireDefault(_provinces);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

/**
 * Provides a list of short-code provinces (states, etc) for the country codes provided.
 */
exports.default = function (countries) {
  return countries.reduce(function (regions, countryCode) {
    return regions.concat(_provinces2.default.filter(function (province) {
      return province.country === countryCode.toUpperCase();
    }).map(function (province) {
      return province.short;
    }).sort());
  }, []);
};