define('@cardstack/rendering/components/cs-field-group', ['exports', '@cardstack/rendering/templates/components/cs-field-group', '@cardstack/rendering/helpers/cs-humanize'], function (exports, _csFieldGroup, _csHumanize) {
  'use strict';

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


  var limit = 7;

  exports.default = Ember.Component.extend({
    layout: _csFieldGroup.default,
    tagName: '',

    id: Ember.computed('content', 'name', function () {
      return Ember.guidFor(this.get('content')) + '/cs-field-group/' + this.get('name');
    }),

    groupCaption: Ember.computed('caption', 'name', function () {
      return this.get('caption') || (0, _csHumanize.humanize)(this.get('name'));
    }),

    fieldNames: Ember.computed('fields', function () {
      var fields = this.get('fields');
      if (!Array.isArray(fields)) {
        fields = fields.split(/\s*,\s*/g);
      }
      if (fields.length > limit) {
        throw new Error('can\'t handle more than ' + limit + ' fields in a group at the moment, see cs-field-group\'s template');
      }
      return fields;
    }),

    fieldInfo: Ember.computed('content', 'fieldName', function () {
      return {
        name: this.get('name'),
        content: this.get('content'),
        grouped: this.get('fieldNames'),
        caption: this.get('groupCaption')
      };
    })

  }).reopenClass({
    positionalParams: ['content']
  });
});