     @queuedMessages = []
     @endpoint = '/interaction_web_tools/events'
     @chatUI = $('#chat-ui')
+    if window.location.href.indexOf('debug=1') > -1
+      @debug = true
 
   open: =>
     @chatUI.toggleClass('active')

      @renderMessages data.events

  queueMessage: (message) ->
    @queuedMessages.push(message)

  dismissWelcome: ->


  dequeueMessages: ->
    $.each @queuedMessages, (i,message) =>
    console.log "dequeue messages " + @queuedMessages if @debug
      @sendMessage(message)
    @queuedMessages = []

  renderMessages: (messages) ->
    typing = $.grep messages, (el) -> el.type == 'typingIndicator' && el.content == true
    console.log "messages recieved for render", messages if @debug
    @displayIndicator("agent") if typing.length

    messages = $.grep messages, (el) -> el.type == 'text'
