function statefulSelectors(states, template, stateMap) {
    if (!template) throw new PolishedError(67);
    if (states.length === 0) return generateSelectors(template, null);
    var selectors = [];
    for (var i = 0; i < states.length; i += 1) {
      if (stateMap && stateMap.indexOf(states[i]) < 0) {
        throw new PolishedError(68);
      }
      selectors.push(generateSelectors(template, states[i]));
    }
    selectors = selectors.join(',');
    return selectors;
  }
Function helper that adds an array of states to a template of selectors. Used in textInputs and buttons.
@private