 require './readymade/overrides.coffee'
 Group = require 'zooniverse/models/project-group'
 SubjectViewer = require 'zooniverse-readymade/lib/subject-viewer'
+DecisionTree = require 'zooniverse-decision-tree'
 
 SubjectViewer::template = require './templates/subject-viewer'
 

ClassifyPage = require 'zooniverse-readymade/lib/classify-page'

ClassifyPage::template = require './templates/classify-page'

currentProject = require 'zooniverse-readymade/current-project'
classify_page = currentProject.classifyPages[0]

classify_page.el.on decisionTree.CHANGE, ({originalEvent: {detail}})->
  {key, value} = detail

  label = 'Finish' unless decisionTree.currentTask.getNext()
    
  decisionTree.currentTask.confirmButton.innerHTML = label if label?
  
  current_tool?.mark.details = value if key is 'details'
