<commit_before>import Ember from 'ember';

const get = Ember.get;
const set = Ember.set;
const {
  Component
} = Ember;

export default Component.extend({
  classNames: [ 'sideBar', 'sideBar__escaped' ],
  cardTypes: [
    {
      name: 'Forms',
      isExpanded: false,
      cards: [
        {
          name: 'Mailchimp',
          type: 'form',
          imageUrl: 'assets/images/card-mailchimp.png',
          showName: false
        }
      ]
    },
    {
      name: 'Video',
      isExpanded: false,
      cards: [
        {
          name: 'Vimeo',
          type: 'video',
          imageUrl: 'assets/images/card-vimeo.png',
          showName: false
        },
        {
          name: 'YouTube',
          type: 'video',
          imageUrl: 'assets/images/card-youtube.png',
          showName: false
        }
      ]
    },
    {
      name: 'Images',
      isExpanded: false,
      cards: [
        {
          name: 'Background Slideshow',
          type: 'image',
          imageUrl: 'assets/images/card-background-slideshow.png',
          showName: true
        },
        {
          name: 'Image',
          type: 'image',
          imageUrl: 'assets/images/card-image.png',
          showName: true
        }
      ]
    },
    {
      name: 'Text',
      isExpanded: false,
      cards: [
        {
          name: 'Bullet Points',
          type: 'text',
          imageUrl: 'assets/images/card-bullet-points.png',
          showName: true
        },
        {
          name: 'Plain Text',
          type: 'text',
          imageUrl: 'assets/images/card-plain-text.png',
          showName: true
        }
      ]
    },
    {
      name: 'Code',
      isExpanded: false,
      cards: [
        {
          name: 'Codepen',
          type: 'code',
          imageUrl: 'assets/images/card-codepen.png',
          showName: false
        }
      ]
    }
  ],

  actions: {
    toggleCardTypeVisibility(index) {
      const cardTypes = get(this, 'cardTypes');
      const cardType = cardTypes[index];
      const isCardTypeExpanded = get(cardType, 'isExpanded');

      cardTypes.setEach('isExpanded', false);
      set(cardType, 'isExpanded', !isCardTypeExpanded);
    },

    addCardToTemplate(card) {
      this.sendAction('addCard', card);
    },

    toggleSlotSelection(card) {
      this.sendAction('toggleSlotSelection', card);
    }
  }
});<commit_msg>Updated temp card data to include description for card.<commit_after>import Ember from 'ember';

const get = Ember.get;
const set = Ember.set;
const {
  Component
} = Ember;

export default Component.extend({
  classNames: [ 'sideBar', 'sideBar__escaped' ],
  cardTypes: [
    {
      name: 'Forms',
      isExpanded: false,
      cards: [
        {
          name: 'Mailchimp',
          description: 'Newsletter management',
          type: 'form',
          thumbnail: 'assets/images/card-mailchimp.png',
          showName: false
        }
      ]
    },
    {
      name: 'Video',
      isExpanded: false,
      cards: [
        {
          name: 'Vimeo',
          description: 'Video hosting for creators',
          type: 'video',
          thumbnail: 'assets/images/card-vimeo.png',
          showName: false
        },
        {
          name: 'YouTube',
          description: 'Hosts user-generated videos',
          type: 'video',
          thumbnail: 'assets/images/card-youtube.png',
          showName: false
        }
      ]
    },
    {
      name: 'Images',
      isExpanded: false,
      cards: [
        {
          name: 'Background Slideshow',
          description: 'Rotating hero images',
          type: 'image',
          thumbnail: 'assets/images/card-background-slideshow.png',
          showName: true
        },
        {
          name: 'Image',
          description: 'Link to and import any image',
          type: 'image',
          thumbnail: 'assets/images/card-image.png',
          showName: true
        }
      ]
    },
    {
      name: 'Text',
      isExpanded: false,
      cards: [
        {
          name: 'Bullet Points',
          description: 'Create an ordered list of images and/or text',
          type: 'text',
          thumbnail: 'assets/images/card-bullet-points.png',
          showName: true
        },
        {
          name: 'Plain Text',
          description: 'Just a plain bit of text',
          type: 'text',
          thumbnail: 'assets/images/card-plain-text.png',
          showName: true
        }
      ]
    },
    {
      name: 'Code',
      isExpanded: false,
      cards: [
        {
          name: 'Codepen',
          description: 'Front End Developer Playground & Code Editor',
          type: 'code',
          thumbnail: 'assets/images/card-codepen.png',
          showName: false
        }
      ]
    }
  ],

  actions: {
    toggleCardTypeVisibility(index) {
      const cardTypes = get(this, 'cardTypes');
      const cardType = cardTypes[index];
      const isCardTypeExpanded = get(cardType, 'isExpanded');

      cardTypes.setEach('isExpanded', false);
      set(cardType, 'isExpanded', !isCardTypeExpanded);
    },

    addCardToTemplate(card) {
      this.sendAction('addCard', card);
    },

    toggleSlotSelection(card) {
      this.sendAction('toggleSlotSelection', card);
    }
  }
});
{'fraction_non_alphanumeric': 0.12680334092634776, 'fraction_numerical': 0.0, 'mean_word_length': 1.649069884364002, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2753386', 'n_tokens_mistral': 1592, 'n_tokens_neox': 1585, 'n_words': 326}