<commit_before>ETahi.StartEditingButtonComponent = Ember.Component.extend
  classNames: ['start-editing-button button-primary']
  classNameBindings: ['buttonColor']
  buttonStates: null

  click: ->
    @sendAction() if @get('buttonState') != 'disabled'

  buttonState: (->
    if !@get('canEdit')
      'disabled'
    else
      if @get('isEditing')
        'isEditing'
      else
        'canEdit'
  ).property('canEdit', 'isEditing')

  setButtonStates: (->
    states =
      isEditing:
        buttonColor: 'button--purple'
        prompt: 'STOP WRITING'
        iconClass: ''
      canEdit:
        buttonColor: 'button--green'
        prompt: 'START WRITING'
        iconClass: 'glyphicon-pencil'
      disabled:
        buttonColor: 'button--disabled'
        prompt: 'START WRITING'
        iconClass: 'glyphicon-pencil'
    @set('buttonStates', states)
  ).on('init')

  buttonColor: (->
    state = @get('buttonState')
    @get('buttonStates')[state].buttonColor
  ).property('buttonState')

  prompt: (->
    state = @get('buttonState')
    @get('buttonStates')[state].prompt
  ).property('buttonState')

  iconClass: (->
    state = @get('buttonState')
    @get('buttonStates')[state].iconClass
  ).property('buttonState')<commit_msg>Make buttonStates static.<commit_after>ETahi.StartEditingButtonComponent = Ember.Component.extend
  classNames: ['start-editing-button button-primary']
  classNameBindings: ['buttonColor']
  buttonStates: null

  click: ->
    @sendAction() if @get('buttonState') != 'disabled'

  buttonState: (->
    if !@get('canEdit')
      'disabled'
    else
      if @get('isEditing')
        'isEditing'
      else
        'canEdit'
  ).property('canEdit', 'isEditing')

  buttonStates:
    isEditing:
      buttonColor: 'button--purple'
      prompt: 'STOP WRITING'
      iconClass: ''
    canEdit:
      buttonColor: 'button--green'
      prompt: 'START WRITING'
      iconClass: 'glyphicon-pencil'
    disabled:
      buttonColor: 'button--disabled'
      prompt: 'START WRITING'
      iconClass: 'glyphicon-pencil'

  buttonColor: (->
    state = @get('buttonState')
    @get('buttonStates')[state].buttonColor
  ).property('buttonState')

  prompt: (->
    state = @get('buttonState')
    @get('buttonStates')[state].prompt
  ).property('buttonState')

  iconClass: (->
    state = @get('buttonState')
    @get('buttonStates')[state].iconClass
  ).property('buttonState')
{'fraction_non_alphanumeric': 0.15368682684341342, 'fraction_numerical': 0.0, 'mean_word_length': 3.13527397260274, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4643556', 'n_tokens_mistral': 776, 'n_tokens_neox': 757, 'n_words': 135}