{"version":3,"sources":["app/app.coffee","app/controllers/attract.coffee","app/controllers/credits.coffee","app/controllers/game.coffee","app/controllers/intro.coffee","app/controllers/leaderboard.coffee","app/controllers/loading.coffee","app/controllers/nav.coffee","app/controllers/socket.coffee","app/models/config.coffee","app/models/leaderboard.coffee","app/models/question.coffee","app/views/attract.hbs","app/views/credits.hbs","app/views/credits_entries.hbs","app/views/game.hbs","app/views/game_answer.hbs","app/views/game_answers.hbs","app/views/game_conclusion.hbs","app/views/game_conclusion_leaderboard.hbs","app/views/intro.hbs","app/views/leaderboard.hbs","app/views/leaderboard_entries.hbs","app/views/loading.hbs","app/views/nav.hbs","app/views/quote.hbs","app/views/quote_full.hbs","app/views/socket.hbs"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAjYA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1GA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzEA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1lBA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArOA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA1HA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtCA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/GA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAzKA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAvBA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA/EA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArCA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAZA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAxJA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3CA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAtBA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AA3CA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AArCA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAdA;AAAA;ACAA;AAAA;AACA;AACA;AACA;AACA;AACA;AALA;AAAA","file":"../srv/public/media/js/app.js","sourcesContent":["var App, Attract, Config, Credits, Game, Intro, Leaderboard, Loading, Nav, Question, Socket,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\nAttract = require(\"controllers/attract\");\n\nGame = require(\"controllers/game\");\n\nIntro = require(\"controllers/intro\");\n\nCredits = require(\"controllers/credits\");\n\nLeaderboard = require(\"controllers/leaderboard\");\n\nLoading = require(\"controllers/loading\");\n\nNav = require(\"controllers/nav\");\n\nSocket = require(\"controllers/socket\");\n\nConfig = require(\"models/config\");\n\nQuestion = require(\"models/question\");\n\nApp = (function(_super) {\n var modelsLoaded, modelsTotal;\n\n __extends(App, _super);\n\n \"# POI Application Controller\";\n\n\n App.prototype.language = \"\";\n\n App.prototype.current = \"loading\";\n\n App.prototype.Attract = \"attract\";\n\n App.prototype.Game = \"game\";\n\n App.prototype.Intro = \"intro\";\n\n App.prototype.Credits = \"credits\";\n\n App.prototype.Leaderboard = \"leaderboard\";\n\n App.prototype.Loading = \"loading\";\n\n App.prototype.station = -1;\n\n App.prototype.gallery = false;\n\n modelsTotal = 2;\n\n modelsLoaded = 0;\n\n App.prototype.host = {\n en: \"humanrights.ca\",\n fr: \"droitsdelapersonne.ca\"\n };\n\n App.prototype.path = {\n en: \"quotequiz\",\n fr: \"quiz-citations\"\n };\n\n function App(cfg) {\n this.ariaShowAll = __bind(this.ariaShowAll, this);\n\n this.ariaHideAll = __bind(this.ariaHideAll, this);\n\n this.translate = __bind(this.translate, this);\n\n this.triggerTranslation = __bind(this.triggerTranslation, this);\n\n this.onWindowUnload = __bind(this.onWindowUnload, this);\n\n this.onWindowLocation = __bind(this.onWindowLocation, this);\n\n this.onSocketGameStart = __bind(this.onSocketGameStart, this);\n\n this.terminate = __bind(this.terminate, this);\n\n this.error = __bind(this.error, this);\n\n this.loaded = __bind(this.loaded, this);\n\n this.stateCredits = __bind(this.stateCredits, this);\n\n this.stateLeaderboard = __bind(this.stateLeaderboard, this);\n\n this.stateGame = __bind(this.stateGame, this);\n\n this.stateIntro = __bind(this.stateIntro, this);\n\n this.stateAttract = __bind(this.stateAttract, this);\n this.log(\"App::init\");\n this.routes({\n \"/\": this.stateAttract,\n \"/:lang/intro/\": this.stateIntro,\n \"/:lang/game/\": this.stateGame,\n \"/:lang/leaderboard/\": this.stateLeaderboard,\n \"/:lang/credits/\": this.stateCredits\n });\n App.__super__.constructor.apply(this, arguments);\n if (\"station\" in cfg) {\n this.station = cfg.station;\n }\n if (\"gallery\" in cfg) {\n this.gallery = cfg.gallery;\n }\n this.loading = new Loading();\n Spine.bind(\"translate\", this.triggerTranslation);\n Spine.bind(\"socket.game.start\", this.onSocketGameStart);\n Spine.bind(\"window.location\", this.onWindowLocation);\n Spine.bind(\"ariaHide\", this.ariaHideAll);\n Spine.bind(\"ariaShow\", this.ariaShowAll);\n Question.bind(\"refresh change update destroy\", this.loaded);\n Question.bind(\"ajaxError\", this.error);\n Config.bind(\"refresh change update destroy\", this.loaded);\n Config.bind(\"ajaxError\", this.error);\n if (this.gallery) {\n window.onbeforeunload = this.onWindowUnload;\n }\n Question.fetch();\n Config.fetch();\n }\n\n App.prototype.stateAttract = function() {\n \"Set Application State to Attract Mode\";\n\n var _this = this;\n if (this.current !== this.Attract) {\n ga('set', {\n page: \"/\" + this.language + \"/\",\n title: \"UDHR: Attract (\" + this.language + \")\"\n });\n this.nav.state(this.nav.Closed);\n this.game.state(this.game.Closed);\n this.intro.state(this.intro.Closed);\n this.credits.state(this.credits.Closed);\n this.leaderboard.state(this.leaderboard.Closed);\n setTimeout(function() {\n return _this.attract.state(_this.attract.Open);\n }, 1000);\n return this.current = this.Attract;\n }\n };\n\n App.prototype.stateIntro = function(path) {\n \"Set Application State to Intro\";\n\n var _this = this;\n if (this.current !== this.Intro) {\n ga('set', {\n page: \"/\" + this.language + \"/intro/\",\n title: \"UDHR: Intro (\" + this.intro + \")\"\n });\n ga('send', 'pageview', '/intro/');\n this.attract.state(this.attract.Closed);\n this.game.state(this.game.Closed);\n this.nav.state(this.nav.Open);\n this.credits.state(this.credits.Closed);\n this.leaderboard.state(this.leaderboard.Closed);\n setTimeout(function() {\n return _this.intro.state(_this.intro.Open);\n }, 1000);\n this.translate(path.lang);\n return this.current = this.Intro;\n }\n };\n\n App.prototype.stateGame = function(path) {\n \"Set Application State to Game\";\n\n var _this = this;\n if (this.current !== this.Game) {\n ga('set', {\n page: \"/\" + this.language + \"/game/\",\n title: \"UDHR: Game (\" + this.language + \")\"\n });\n this.attract.state(this.attract.Closed);\n this.intro.state(this.intro.Closed);\n this.nav.state(this.nav.Open);\n this.credits.state(this.credits.Closed);\n this.leaderboard.state(this.leaderboard.Closed);\n setTimeout(function() {\n return _this.game.state(_this.game.Open);\n }, 1000);\n this.translate(path.lang);\n return this.current = this.Game;\n }\n };\n\n App.prototype.stateLeaderboard = function(path) {\n \"Set Application State to Leaderboard\";\n\n var _this = this;\n if (this.current !== this.Leaderboard) {\n ga('set', {\n page: \"/\" + this.language + \"/leaderboard/\",\n title: \"UDHR: Leaderboard (\" + this.language + \")\"\n });\n ga('send', 'pageview', '/leaderboard/');\n this.attract.state(this.attract.Closed);\n this.game.state(this.game.Closed);\n this.intro.state(this.intro.Closed);\n this.credits.state(this.credits.Closed);\n this.nav.state(this.nav.Open);\n setTimeout(function() {\n return _this.leaderboard.state(_this.leaderboard.Open);\n }, 1000);\n this.translate(path.lang);\n return this.current = this.Leaderboard;\n }\n };\n\n App.prototype.stateCredits = function(path) {\n \"Set Application State to Credits\";\n\n var _this = this;\n if (this.current !== this.Credits) {\n this.attract.state(this.attract.Closed);\n this.game.state(this.game.Closed);\n this.intro.state(this.intro.Closed);\n this.nav.state(this.nav.OpenWithBack);\n this.leaderboard.state(this.leaderboard.Closed);\n setTimeout(function() {\n return _this.credits.state(_this.credits.Open);\n }, 1000);\n this.translate(path.lang);\n return this.current = this.Credits;\n }\n };\n\n App.prototype.loaded = function() {\n \"Event Handler for All Content Loaded and App Ready to Init\";\n\n var l,\n _this = this;\n modelsLoaded++;\n if (modelsLoaded === modelsTotal) {\n this.attract = new Attract(this.station);\n this.game = new Game(this.station);\n this.intro = new Intro(this.station, this.gallery);\n this.leaderboard = new Leaderboard(this.station);\n this.credits = new Credits(this.station);\n this.nav = new Nav(this.station);\n if (this.gallery) {\n this.socket = new Socket();\n }\n l = $(\"html\").attr(\"lang\") ? $(\"html\").attr(\"lang\") : \"en\";\n this.translate(l);\n return setTimeout(function() {\n Spine.Route.setup();\n if (!window.location.hash) {\n _this.navigate(\"/\");\n }\n return _this.loading.inactive();\n }, 1000);\n }\n };\n\n App.prototype.error = function(msg) {\n \"Event Handler for Content Loading Error\";\n return this.log(\"Error\");\n };\n\n App.prototype.terminate = function() {\n \"Clean-up on Termination\";\n return Spine.trigger(\"game.multiplayer.leave\", this.station);\n };\n\n App.prototype.onSocketGameStart = function(msg) {\n var _ref;\n if (_ref = this.station, __indexOf.call(msg.queue, _ref) >= 0) {\n return this.navigate(\"/\" + this.language + \"/game/\");\n }\n };\n\n App.prototype.onWindowLocation = function(path) {\n \"Change the Window Location\";\n return window.location.hash = \"/\" + this.language + \"/\" + path;\n };\n\n App.prototype.onWindowUnload = function(e) {\n this.terminate();\n return null;\n };\n\n App.prototype.triggerTranslation = function(lang) {\n var current, hash, host, new_url, path, port, to;\n if (lang == null) {\n lang = null;\n }\n \"Event Handler to Manually `trigger` content translation.\";\n\n current = lang === \"en\" ? \"fr\" : \"en\";\n to = lang ? lang : this.language;\n this.translate(to);\n port = window.location.port;\n host = window.location.hostname.replace(this.host[current], this.host[to]);\n path = window.location.pathname.replace(this.path[current], this.path[to]);\n hash = window.location.hash.replace(current, to);\n new_url = window.location.protocol + '//' + host + path + hash;\n return window.location.href = new_url;\n };\n\n App.prototype.translate = function(lang) {\n \"Update Language Strings on all i18n Strings and update links\";\n\n var current, k, key, lng, msg, txt, v, vars, _i, _len, _ref,\n _this = this;\n this.language = lang;\n current = lang === \"en\" ? \"fr\" : \"en\";\n lng = lang === \"en\" ? \"eng\" : \"fra\";\n $(\"html\").attr(\"lang\", lang);\n $(\"#cmhr-mc-logo\").attr(\"href\", \"//\" + this.host[lang]);\n _ref = Config.all()[0].messages;\n for (key in _ref) {\n msg = _ref[key];\n txt = msg[lng];\n if (txt) {\n vars = msg[lng].match(/<(.*?)>/g);\n }\n if (vars) {\n for (_i = 0, _len = vars.length; _i < _len; _i++) {\n v = vars[_i];\n k = v.replace(\"<\", \"\").replace(\">\", \"\");\n txt = txt.replace(v, $(\"[data-msg='\" + key + \"']\").attr(\"data-\" + k));\n }\n }\n if ($(\"[data-msg='\" + key + \"']\").hasClass('i18n-social')) {\n $(\"[data-msg='\" + key + \"']\").attr(\"href\", txt);\n } else if ($(\"[data-msg='\" + key + \"']\").hasClass('bg-img-alt')) {\n $(\"[data-msg='\" + key + \"']\").attr(\"aria-label\", txt);\n } else {\n $(\"[data-msg='\" + key + \"']\").html(txt);\n }\n }\n _.each($(\"[data-en],[data-fr]\"), function(str) {\n var e;\n e = $(str);\n if (e.is(\"img\")) {\n return e.attr(\"alt\", $(str).attr(\"data-\" + lang));\n } else {\n return e.html($(str).attr(\"data-\" + lang));\n }\n });\n return _.each($(\"a.i18n\"), function(a) {\n var href;\n href = $(a).attr(\"href\");\n return $(a).attr(\"href\", href.replace(current, lang));\n });\n };\n\n App.prototype.ariaHideAll = function(el) {\n \"Given element, attach aria-hidden=\\\"true\\\" to element and all interactive elements with it\";\n\n var $links,\n _this = this;\n $links = $(el).find('a');\n return _.each($links, function(a) {\n return $(a).attr(\"tabindex\", -1);\n });\n };\n\n App.prototype.ariaShowAll = function(el) {\n \"Given element, attach aria-hidden=\\\"false\\\" to element and all interactive elements with it\";\n\n var $links,\n _this = this;\n $links = $(el).find('a');\n return _.each($links, function(a) {\n return $(a).attr(\"tabindex\", 0);\n });\n };\n\n return App;\n\n})(Spine.Controller);\n\nmodule.exports = App;\n","var Attract, Question,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nQuestion = require(\"models/question\");\n\nAttract = (function(_super) {\n\n __extends(Attract, _super);\n\n Attract.prototype.el = $(\"#cmhr-mc-attract\");\n\n Attract.prototype.elements = {\n \"#cmhr-mc-attract-slideshow .slideshow-wrapper\": \"slideshow\"\n };\n\n Attract.prototype.events = {\n \"click .language-selector\": \"onStartButtonClick\"\n };\n\n Attract.prototype.station = -1;\n\n Attract.prototype.Open = \"open\";\n\n Attract.prototype.Closed = \"closed\";\n\n function Attract(station) {\n this.onStartButtonClick = __bind(this.onStartButtonClick, this);\n\n this.stopSlideshow = __bind(this.stopSlideshow, this);\n\n this.startSlideshow = __bind(this.startSlideshow, this);\n\n this.state = __bind(this.state, this);\n\n \"Render View and Init Elements/Events\";\n this.station = station;\n this.el.html(require('views/attract')({\n \"questions\": Question.all(),\n \"hosts\": Spine.trigger(\"getHostDict\")\n }));\n Attract.__super__.constructor.apply(this, arguments);\n }\n\n Attract.prototype.state = function(to) {\n \"Set the Components State (CSS Transitions)\";\n\n var _this = this;\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n this.el.show();\n this.el.attr(\"aria-hidden\", \"false\");\n Spine.trigger(\"ariaShow\", this.el);\n if (this.station !== -1) {\n return Spine.trigger(\"game.multiplayer.leave\", this.station);\n }\n break;\n case this.Closed:\n setTimeout(function() {\n return _this.el.hide();\n }, 1000);\n this.el.attr(\"aria-hidden\", \"true\");\n Spine.trigger(\"ariaHide\", this.el);\n return this.stopSlideshow();\n }\n };\n\n Attract.prototype.startSlideshow = function() {\n return this.slideshow.slick({\n arrows: false,\n autoplay: true,\n autoplaySpeed: 3000,\n draggable: false,\n fade: true,\n responsive: true,\n swipe: false,\n speed: 1000\n });\n };\n\n Attract.prototype.stopSlideshow = function() {\n var _this = this;\n return setTimeout(function() {\n try {\n return _this.slideshow.slick('unslick');\n } catch (e) {\n\n } finally {\n\n }\n }, 1000);\n };\n\n Attract.prototype.onStartButtonClick = function(e) {\n var elem;\n elem = $(e.currentTarget);\n return ga('send', 'event', 'button', 'click', 'attract-' + elem.attr('lang'));\n };\n\n return Attract;\n\n})(Spine.Controller);\n\nmodule.exports = Attract;\n","var Credits,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nCredits = (function(_super) {\n\n __extends(Credits, _super);\n\n \"Application Loading Controller\";\n\n\n Credits.prototype.el = $(\"#cmhr-mc-credits\");\n\n Credits.prototype.Open = \"open\";\n\n Credits.prototype.Closed = \"closed\";\n\n Credits.prototype.station = -1;\n\n Credits.prototype.elements = {\n \"#cmhr-mc-credits-entries\": \"entries\",\n \"#cmhr-mc-credits-frame\": \"frame\",\n \"#credits-label\": \"heading\"\n };\n\n function Credits(station) {\n this.error = __bind(this.error, this);\n\n this.resize = __bind(this.resize, this);\n\n this.render = __bind(this.render, this);\n\n this.state = __bind(this.state, this);\n\n \"Render View and Init Elements and Events\";\n this.station = station;\n this.el.html(require('views/credits'));\n Credits.__super__.constructor.apply(this, arguments);\n $(window).resize(this.resize);\n }\n\n Credits.prototype.state = function(to) {\n \"Set Component State\";\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n console.log(\"CREDITS OPEN\");\n this.el.attr(\"aria-hidden\", \"false\");\n return this.heading.focus();\n case this.Closed:\n return this.el.attr(\"aria-hidden\", \"true\");\n }\n };\n\n Credits.prototype.render = function() {\n return this.resize();\n };\n\n Credits.prototype.resize = function(e) {\n return this.frame.height($(window).height() - this.frame.position().top - $(\"#cmhr-desktop-header\").height());\n };\n\n Credits.prototype.error = function(e) {\n this.log(\"credits::error\");\n return this.log(\"Error: \" + e);\n };\n\n return Credits;\n\n})(Spine.Controller);\n\nmodule.exports = Credits;\n","var Game, Leaderboard, Question,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };\n\nQuestion = require(\"models/question\");\n\nLeaderboard = require(\"models/leaderboard\");\n\nGame = (function(_super) {\n\n __extends(Game, _super);\n\n \"Application Loading Controller\";\n\n\n Game.prototype.el = $(\"#cmhr-mc-game\");\n\n Game.prototype.elements = {\n \"#cmhr-mc-game-question\": \"gameQuestion\",\n \"#cmhr-mc-game-question-image-full\": \"gameQuoteFull\",\n \"#cmhr-mc-game-quote-text\": \"gameQuote\",\n \"#cmhr-mc-game-answer-overlay\": \"answerOverlay\",\n \"#cmhr-mc-game-answers\": \"answers\",\n \"#cmhr-mc-game-instructions\": \"instructions\",\n \"#cmhr-mc-game-conclusion\": \"conclusion\",\n \"#cmhr-mc-game-cell-left\": \"cellLeft\",\n \"#cmhr-mc-game-leaderboard-single\": \"leaderboardSingle\",\n \".leaderboard-name\": \"leaderboardName\",\n \".leaderboard-submit\": \"leaderboardSubmit\",\n \".submit-form\": \"form\",\n \"#cmhr-mc-game-q-current\": \"current\",\n \"#cmhr-mc-game-next\": \"btnNext\",\n \"#cmhr-mc-game-results\": \"btnResults\",\n \"#cmhr-mc-game-q-total\": \"total\",\n \"#cmhr-mc-game-question-timer\": \"timer\",\n \"#cmhr-mc-game-question-countdown\": \"countdown\"\n };\n\n Game.prototype.events = {\n \"click #cmhr-mc-game-answers li\": \"onClickAnswer\",\n \"click #cmhr-mc-game-next\": \"onClickNext\",\n \"click #cmhr-mc-game-results\": \"onClickResults\",\n \"mouseup .leaderboard-submit\": \"onLeaderboardSubmit\",\n \"touchend .leaderboard-submit\": \"onLeaderboardSubmit\",\n \"focus .leaderboard-name\": \"onFocusLeaderboardName\",\n \"blur .leaderboard-name\": \"onBlurLeaderboardName\",\n \"keyup .leaderboard-name\": \"onChangeLeaderboardName\"\n };\n\n Game.prototype.questionOffset = 0;\n\n Game.prototype.currentQ = 0;\n\n Game.prototype.score = 0;\n\n Game.prototype.startTime = 0;\n\n Game.prototype.totalTime = -1;\n\n Game.prototype.answerInterval = null;\n\n Game.prototype.answerTimeout = null;\n\n Game.prototype.stateTimeout = null;\n\n Game.prototype.intervalIntro = 8000;\n\n Game.prototype.intervalViewImage = 6000;\n\n Game.prototype.intervalQuestion = 22000;\n\n Game.prototype.intervalResults = 10000;\n\n Game.prototype.scoreIncrement = 30;\n\n Game.prototype.scoreTimeWeight = 10;\n\n Game.prototype.scoreMaxQuestionPoints = 100;\n\n Game.prototype.answerSeconds = 22;\n\n Game.prototype.answerSecondsDefault = 22;\n\n Game.prototype.station = -1;\n\n Game.prototype.socketControlled = false;\n\n Game.prototype.isIpad = navigator.platform.indexOf(\"iPad\") !== -1;\n\n Game.prototype.Answer = \"answer\";\n\n Game.prototype.AnswerLast = \"answerLast\";\n\n Game.prototype.Closed = \"closed\";\n\n Game.prototype.Instructions = \"instructions\";\n\n Game.prototype.Open = \"open\";\n\n Game.prototype.Question = \"question\";\n\n Game.prototype.Results = \"results\";\n\n Game.prototype.ResultsOpen = \"open\";\n\n Game.prototype.ResultsSaving = \"save\";\n\n Game.prototype.ResultsOpen = \"error\";\n\n function Game(station) {\n this.resize = __bind(this.resize, this);\n\n this.stop = __bind(this.stop, this);\n\n this.scoreAnswer = __bind(this.scoreAnswer, this);\n\n this.runTimer = __bind(this.runTimer, this);\n\n this.setConclusion = __bind(this.setConclusion, this);\n\n this.setAnswer = __bind(this.setAnswer, this);\n\n this.reset = __bind(this.reset, this);\n\n this.loadQuestion = __bind(this.loadQuestion, this);\n\n this.handleAnswer = __bind(this.handleAnswer, this);\n\n this.getTotalQuestions = __bind(this.getTotalQuestions, this);\n\n this.getQuestion = __bind(this.getQuestion, this);\n\n this.onSocketUpdateQueuedClients = __bind(this.onSocketUpdateQueuedClients, this);\n\n this.onSocketScores = __bind(this.onSocketScores, this);\n\n this.onSocketNext = __bind(this.onSocketNext, this);\n\n this.onSocketAnswered = __bind(this.onSocketAnswered, this);\n\n this.onSocketControlStateChange = __bind(this.onSocketControlStateChange, this);\n\n this.onLeaderboardError = __bind(this.onLeaderboardError, this);\n\n this.onLeaderboardSave = __bind(this.onLeaderboardSave, this);\n\n this.onLeaderboardSubmit = __bind(this.onLeaderboardSubmit, this);\n\n this.onChangeLeaderboardName = __bind(this.onChangeLeaderboardName, this);\n\n this.onBlurLeaderboardName = __bind(this.onBlurLeaderboardName, this);\n\n this.onFocusLeaderboardName = __bind(this.onFocusLeaderboardName, this);\n\n this.onClickResults = __bind(this.onClickResults, this);\n\n this.onClickNext = __bind(this.onClickNext, this);\n\n this.onClickAnswer = __bind(this.onClickAnswer, this);\n\n this.state = __bind(this.state, this);\n this.station = station;\n this.el.html(require('views/game'));\n Game.__super__.constructor.apply(this, arguments);\n $(\"#mc-game-score-\" + this.station).parent().addClass(\"this-player\");\n Spine.bind(\"socket.controlled\", this.onSocketControlStateChange);\n Spine.bind(\"socket.game.question.answered\", this.onSocketAnswered);\n Spine.bind(\"socket.game.scores\", this.onSocketScores);\n Spine.bind(\"socket.game.client-queue\", this.onSocketUpdateQueuedClients);\n Leaderboard.bind(\"save\", this.onLeaderboardSave);\n Leaderboard.bind(\"ajaxError\", this.onLeaderboardError);\n $(window).resize(this.resize);\n }\n\n Game.prototype.state = function(to) {\n \"Set the Components State (CSS Transitions)\";\n\n var li, _i, _j, _len, _len1, _ref, _ref1,\n _this = this;\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n \"(1) Start Quiz and Open Instructions\";\n\n this.reset();\n this.questionOffset = this.questionOffset === 1 ? 0 : 1;\n this.loadQuestion(0);\n return this.state(this.Instructions);\n case this.Instructions:\n \"(2) Display Questions\";\n\n $(\"#cmhr-mc-intro-single-aria\").blur();\n this.instructions.attr(\"aria-hidden\", \"false\");\n this.gameQuestion.attr(\"aria-hidden\", \"true\");\n this.instructions.find('button').focus();\n this.resize();\n this.stateTimeout = setTimeout(function() {\n return _this.state(_this.Question);\n }, this.intervalIntro);\n return this.startTime = Date.now() / 1000;\n case this.Question:\n \"(3) Display Question: Start Question After (n) Seconds\";\n\n this.gameQuestion.attr(\"aria-hidden\", \"false\");\n this.instructions.attr(\"aria-hidden\", \"true\");\n this.answerOverlay.attr(\"aria-hidden\", \"true\");\n this.stateTimeout = setTimeout(function() {\n return _this.runTimer(true);\n }, this.intervalViewImage);\n if (this.el.data('aria') === false) {\n this.answerTimeout = setTimeout(function() {\n return _this.handleAnswer(-1, true);\n }, this.intervalViewImage + this.intervalQuestion);\n }\n return this.resize();\n case this.Answer:\n \"(4/1) Display Answer Panel\";\n\n $('#cmhr-mc-game-next').attr(\"aria-hidden\", \"false\");\n $('#cmhr-mc-game-results').attr(\"aria-hidden\", \"true\");\n this.answerOverlay.attr(\"aria-hidden\", \"false\");\n this.instructions.attr(\"aria-hidden\", \"true\");\n this.gameQuestion.attr(\"aria-hidden\", \"true\");\n _ref = $(\"#cmhr-mc-game-answers li\");\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n li = _ref[_i];\n li.blur();\n }\n return this.answerOverlay.find('h1').focus();\n case this.AnswerLast:\n \"(4/2) Handle the Last Question Answer Panel\";\n\n $('#cmhr-mc-game-next').attr(\"aria-hidden\", \"true\");\n $('#cmhr-mc-game-results').attr(\"aria-hidden\", \"false\");\n this.answerOverlay.attr(\"aria-hidden\", \"false\");\n this.instructions.attr(\"aria-hidden\", \"true\");\n this.gameQuestion.attr(\"aria-hidden\", \"true\");\n _ref1 = $(\"#cmhr-mc-game-answers li\");\n for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {\n li = _ref1[_j];\n li.blur();\n }\n this.answerOverlay.find('h1').focus();\n return this.totalTime = Math.round((Date.now() / 1000) - this.startTime);\n case this.Results:\n \"(5) Show Quiz Results\";\n\n this.runTimer(false);\n this.setConclusion();\n Spine.trigger(\"nav.caption.hide\");\n return this.answerOverlay.find('h1').focus();\n case this.Closed:\n \"Close the Game\";\n\n Spine.trigger(\"game.multiplayer.leave\", this.station);\n Spine.trigger(\"nav.caption.hide\");\n return this.stop();\n }\n };\n\n Game.prototype.onClickAnswer = function(el) {\n \"When an Answer is Selected Score and/or Show Final Results\";\n\n var rank;\n rank = parseInt($(el.currentTarget).attr(\"data-rank\"));\n return this.handleAnswer(rank, false);\n };\n\n Game.prototype.onClickNext = function(el) {\n this.loadQuestion(this.currentQ + 1);\n this.state(this.Question);\n return ga('send', 'event', 'button', 'click', 'next-question-' + this.currentQ + 1);\n };\n\n Game.prototype.onClickResults = function(el) {\n return this.state(this.Results);\n };\n\n Game.prototype.onFocusLeaderboardName = function(el) {\n if (this.isIpad) {\n return this.answerOverlay.attr(\"data-keyboard\", \"true\");\n }\n };\n\n Game.prototype.onBlurLeaderboardName = function(el) {\n return this.answerOverlay.attr(\"data-keyboard\", \"false\");\n };\n\n Game.prototype.onChangeLeaderboardName = function(el) {\n var v;\n v = $(el.currentTarget).val();\n if (v !== \"\") {\n return $(\".leaderboard-submit\").removeClass(\"disabled\");\n } else {\n return $(\".leaderboard-submit\").addClass(\"disabled\");\n }\n };\n\n Game.prototype.onLeaderboardSubmit = function(el) {\n var e, l, name;\n ga('send', 'event', 'button', 'click', 'leaderboard-submit');\n e = $(el.currentTarget).parent().find(\".leaderboard-name\");\n name = e.val();\n if (name) {\n $(\"#cmhr-mc-game-conclusion\").attr(\"data-state\", this.ResultsSaving);\n l = new Leaderboard({\n name: name,\n score: this.score,\n time: this.totalTime\n });\n return l.save();\n } else {\n return el.preventDefault();\n }\n };\n\n Game.prototype.onLeaderboardSave = function(e) {\n var _this = this;\n Spine.trigger(\"window.location\", \"leaderboard/\");\n return setTimeout(function() {\n return $(\"#cmhr-mc-game-conclusion\").attr(\"data-state\", _this.ResultsOpen);\n }, 2000);\n };\n\n Game.prototype.onLeaderboardError = function(e) {\n var _this = this;\n Spine.trigger(\"window.location\", \"leaderboard/\");\n return setTimeout(function() {\n return $(\"#cmhr-mc-game-conclusion\").attr(\"data-state\", _this.ResultsError);\n }, 2000);\n };\n\n Game.prototype.onSocketControlStateChange = function(state) {\n if (state.station === this.station || state.station) {\n this.el.attr(\"data-multiplayer\", state.controlled);\n return this.socketControlled = state.controlled;\n }\n };\n\n Game.prototype.onSocketAnswered = function(data) {\n var max, progress, score, station;\n this.log(\"onSocketAnswered :: \" + data[0]['station']);\n station = data[0]['station'];\n score = data[0]['score'];\n max = this.getTotalQuestions() * this.scoreMaxQuestionPoints;\n progress = Math.round((score / max) * 100);\n $(\"#mc-game-score-\" + station).html(\"\" + score);\n return $(\"#mc-game-progress-\" + station + \" .bar\").css(\"width\", \"\" + progress + \"%\");\n };\n\n Game.prototype.onSocketNext = function(state) {\n this.loadQuestion(this.currentQ + 1);\n return this.state(this.Question);\n };\n\n Game.prototype.onSocketScores = function(scores) {\n \"Render game_conclusion_entries.coffee here.\";\n\n var i, ranked, s, sorted, _i, _len;\n i = 1;\n ranked = [];\n for (_i = 0, _len = scores.length; _i < _len; _i++) {\n s = scores[_i];\n ranked.push({\n rank: \"\",\n me: this.station === i,\n station: i,\n score: s,\n progress: Math.round((s / (this.getTotalQuestions() * this.scoreMaxQuestionPoints)) * 100)\n });\n i++;\n }\n sorted = _.sortBy(ranked, function(o) {\n return -o.score;\n });\n sorted[0]['rank'] = \"1st\";\n sorted[1]['rank'] = \"2nd\";\n sorted[2]['rank'] = \"3rd\";\n sorted[3]['rank'] = \"4th\";\n sorted[4]['rank'] = \"5th\";\n sorted[5]['rank'] = \"6th\";\n $(\"#cmhr-mc-conclusion-leaderboard\").html(require('views/game_conclusion_leaderboard')({\n sorted: sorted,\n station: this.station\n }));\n return Spine.trigger(\"translate\");\n };\n\n Game.prototype.onSocketUpdateQueuedClients = function(clients) {\n \"Update List of Active Stations\";\n\n var i, _i, _results;\n _results = [];\n for (i = _i = 1; _i < 7; i = ++_i) {\n if (__indexOf.call(clients.stations, i) >= 0) {\n if (i !== this.station) {\n _results.push($(\"#mc-game-player-\" + i).addClass(\"other-player\"));\n } else {\n _results.push($(\"#mc-game-player-\" + i).removeClass(\"other-player\"));\n }\n } else {\n _results.push($(\"#mc-game-player-\" + i).removeClass(\"other-player\"));\n }\n }\n return _results;\n };\n\n Game.prototype.getQuestion = function(i) {\n var o;\n o = this.getTotalQuestions() * this.questionOffset;\n return Question.all()[i + o];\n };\n\n Game.prototype.getTotalQuestions = function() {\n return Math.round(Question.count() / 2);\n };\n\n Game.prototype.handleAnswer = function(rank, skipped) {\n var max, points, progress;\n clearTimeout(this.answerTimeout);\n points = this.scoreAnswer(rank);\n max = this.getTotalQuestions() * this.scoreMaxQuestionPoints;\n progress = Math.round((this.score / max) * 100);\n progress = progress > 100 ? 100 : progress;\n this.setAnswer(rank, points);\n this.runTimer(false);\n $(\"#mc-game-score-single\").html(\"\" + this.score);\n $(\"#mc-game-progress-single .bar\").css(\"width\", \"\" + progress + \"%\");\n Spine.trigger(\"game.update.score\", this.score);\n if (this.socketControlled) {\n this.log(\"@socketControlled: \" + this.socketControlled);\n Spine.trigger(\"game.multiplayer.answer\", [\n {\n question: this.currentQ,\n last: this.currentQ + 1 === this.getTotalQuestions(),\n station: this.station,\n points: points,\n score: this.score\n }\n ]);\n }\n if (this.currentQ + 1 < this.getTotalQuestions()) {\n return this.state(this.Answer);\n } else {\n return this.state(this.AnswerLast);\n }\n };\n\n Game.prototype.loadQuestion = function(i) {\n \"Load the Question with Index `i`\";\n\n var question;\n ga('send', 'pageview', \"/question/\" + (i + 1));\n question = this.getQuestion(i);\n this.answers.html(require(\"views/game_answers\")(question));\n this.gameQuoteFull.html(require(\"views/quote_full\")(question));\n this.gameQuote.html(require(\"views/quote\")(question));\n Spine.trigger(\"nav.caption.update\", question.media.creditLine);\n Spine.trigger(\"translate\");\n this.answerSeconds = this.answerSecondsDefault;\n this.countdown.html(this.answerSecondsDefault);\n this.currentQ = i;\n return this.current.html(i + 1);\n };\n\n Game.prototype.reset = function() {\n \"Reset Game for New Round\";\n\n var i, _i;\n this.answers.empty();\n this.answerSeconds = this.answerSecondsDefault;\n this.currentQ = 0;\n this.score = 0;\n this.startTime = 0;\n this.totalTime = 0;\n this.current.html(0 + 1);\n this.countdown.html(this.answerSecondsDefault);\n this.total.html(this.getTotalQuestions());\n this.leaderboardSubmit.addClass(\"disabled\");\n this.leaderboardName.val(\"\");\n this.conclusion.attr(\"data-state\", this.ResultsOpen);\n for (i = _i = 1; _i < 7; i = ++_i) {\n $(\"#mc-game-score-\" + i).html(\"0\");\n $(\"#mc-game-progress-\" + i + \" .bar\").css(\"width\", \"0%\");\n }\n $(\"#mc-game-score-single\").html(\"0\");\n return $(\"#mc-game-progress-single .bar\").css(\"width\", \"0%\");\n };\n\n Game.prototype.setAnswer = function(rank, points) {\n \"Show the Answer Panel\";\n\n var answer, best, graphic_list, graphic_score, i, img_path, l, question, yours, _i, _j, _len, _len1, _ref;\n question = this.getQuestion(this.currentQ);\n best = null;\n yours = null;\n _ref = question.answers;\n for (_i = 0, _len = _ref.length; _i < _len; _i++) {\n answer = _ref[_i];\n if (answer.rank === question.answers.length - 1) {\n best = answer;\n }\n if (answer.rank === rank) {\n yours = answer;\n }\n }\n graphic_score = parseInt(points / 20);\n graphic_list = [1, 2, 3, 4, 5];\n img_path = \"/quotequiz/media/img/score-\";\n for (i = _j = 0, _len1 = graphic_list.length; _j < _len1; i = ++_j) {\n l = graphic_list[i];\n if (graphic_score >= l) {\n graphic_list[i] = img_path + \"checked.png\";\n } else {\n graphic_list[i] = img_path + \"disabled.png\";\n }\n }\n this.answerOverlay.html(require(\"views/game_answer\")({\n \"best\": best,\n \"message\": rank,\n \"points\": points,\n \"your\": yours,\n \"graphic_list\": graphic_list\n }));\n return Spine.trigger(\"translate\");\n };\n\n Game.prototype.setConclusion = function() {\n \"Set the Contents of the Conclusion Panel\";\n this.answerOverlay.html(require(\"views/game_conclusion\")({\n \"score\": this.score\n }));\n Spine.trigger(\"translate\");\n return Spine.trigger(\"game.get-scores\");\n };\n\n Game.prototype.runTimer = function(state) {\n \"Manage Question Timer\";\n\n var _this = this;\n if (state) {\n this.timer.addClass(\"run\");\n return this.answerInterval = setInterval(function() {\n _this.answerSeconds = _this.answerSeconds - 1;\n return _this.countdown.html(_this.answerSeconds);\n }, 1000);\n } else {\n clearInterval(this.answerInterval);\n return this.stop();\n }\n };\n\n Game.prototype.scoreAnswer = function(rank) {\n \"Score the Selected Answer - modified to only score for a 'correct' answer (rank of 2) \";\n\n var points;\n if (rank === 2) {\n points = this.scoreIncrement * (rank + 1);\n points = points + Math.round(this.scoreTimeWeight * (this.answerSeconds / this.answerSecondsDefault));\n this.score = this.score + points;\n return points;\n } else {\n return 0;\n }\n };\n\n Game.prototype.stop = function() {\n \"Kill the Timer on Game Stop\";\n if (this.answerInterval !== null) {\n clearInterval(this.answerInterval);\n }\n if (this.answerTimeout !== null) {\n clearTimeout(this.answerTimeout);\n }\n if (this.stateTimeout !== null) {\n clearTimeout(this.stateTimeout);\n }\n return this.timer.removeClass(\"run\");\n };\n\n Game.prototype.resize = function() {\n \"On Resize, adjust position of single player score\";\n\n var ih, wh, ww;\n wh = $(window).height();\n ww = $(window).width();\n if ($(\"#cmhr-mc\").hasClass(\"header-offset\")) {\n wh = wh - 250;\n }\n ih = wh - $(\"#cmhr-desktop-header\").height() - $(\"#cmhr-mc-nav\").height();\n if (ww > 750) {\n return this.instructions.find('.pad').css(\"padding-top\", (wh / 2) - (this.instructions.find('.pad').height() / 2));\n }\n };\n\n return Game;\n\n})(Spine.Controller);\n\nmodule.exports = Game;\n","var Intro,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nIntro = (function(_super) {\n\n __extends(Intro, _super);\n\n \"Application Loading Controller\";\n\n\n Intro.prototype.el = $(\"#cmhr-mc-intro\");\n\n Intro.prototype.elGame = $(\"#cmhr-mc-game\");\n\n Intro.prototype.elLeaderboard = $(\"#cmhr-mc-leaderboard\");\n\n Intro.prototype.elements = {\n \"#cmhr-mc-intro-aria-buttons\": \"ariaButtons\",\n \"#cmhr-mc-intro-countdown\": \"countdown\",\n \"#cmhr-mc-intro-text\": \"intro\",\n \"#cmhr-mc-game-countdown-animation\": \"countdownAnimation\",\n \"#cmhr-mc-game-modes\": \"modes\",\n \"#cmhr-mc-intro-multi\": \"multi\",\n \"#cmhr-mc-intro-single\": \"single\",\n \"#cmhr-mc-intro-multi-cta\": \"multiCta\",\n \"#cmhr-mc-intro-multi-inprogress\": \"multiInProgress\",\n \"#cmhr-mc-intro-multi-join\": \"multiJoin\",\n \"#cmhr-mc-intro-multi-aria\": \"multiAria\",\n \"#cmhr-mc-intro-single-aria\": \"singleAria\",\n \"#cmhr-mc-intro-multi-cta-aria\": \"multiCtaAria\",\n \"#cmhr-mc-intro-multi-inprogress-aria\": \"multiInProgressAria\",\n \"#cmhr-mc-intro-multi-join-aria\": \"multiJoinAria\"\n };\n\n Intro.prototype.events = {\n \"click .btn\": \"onButtonClick\",\n \"click #cmhr-mc-intro-multi\": \"onMultiplayerClick\",\n \"click #cmhr-mc-intro-single\": \"onSingleClick\",\n \"click .btn-share\": \"onShareButtonClick\",\n \"click #cmhr-mc-intro-multi-aria\": \"onMultiplayerClick\",\n \"click #cmhr-mc-intro-single-aria\": \"onSingleClick\"\n };\n\n Intro.prototype.gallery = false;\n\n Intro.prototype.station = -1;\n\n Intro.prototype.queued = false;\n\n Intro.prototype.Open = \"open\";\n\n Intro.prototype.Closed = \"closed\";\n\n function Intro(station, gallery) {\n this.isAria = __bind(this.isAria, this);\n\n this.onSocketGameStart = __bind(this.onSocketGameStart, this);\n\n this.onSocketGameQueue = __bind(this.onSocketGameQueue, this);\n\n this.onSocketGameEnd = __bind(this.onSocketGameEnd, this);\n\n this.onSocketCountdown = __bind(this.onSocketCountdown, this);\n\n this.onSocketStatus = __bind(this.onSocketStatus, this);\n\n this.onSocketConnection = __bind(this.onSocketConnection, this);\n\n this.onResize = __bind(this.onResize, this);\n\n this.onShareButtonClick = __bind(this.onShareButtonClick, this);\n\n this.onSingleClick = __bind(this.onSingleClick, this);\n\n this.onMultiplayerClick = __bind(this.onMultiplayerClick, this);\n\n this.onButtonClick = __bind(this.onButtonClick, this);\n\n this.state = __bind(this.state, this);\n\n \"Render View and Init Elements/Events\";\n this.station = station;\n this.gallery = gallery;\n this.el.html(require('views/intro')({\n 'gallery': this.gallery,\n 'station': this.station\n }));\n Intro.__super__.constructor.apply(this, arguments);\n Spine.bind(\"socket.connection\", this.onSocketConnection);\n Spine.bind(\"socket.game.status\", this.onSocketStatus);\n Spine.bind(\"socket.game.countdown\", this.onSocketCountdown);\n Spine.bind(\"socket.game.queue\", this.onSocketGameQueue);\n Spine.bind(\"socket.game.end\", this.onSocketGameEnd);\n Spine.bind(\"socket.game.start\", this.onSocketGameStart);\n $(window).resize(this.onResize);\n this.onSocketGameEnd();\n this.state(this.Closed);\n }\n\n Intro.prototype.state = function(to) {\n \"Set the Components State (CSS Transitions)\";\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n Spine.trigger(\"game.multiplayer.status\");\n this.el.attr(\"aria-hidden\", \"false\");\n this.el.find('#intro-label').focus();\n return this.onResize(null);\n case this.Closed:\n return this.el.attr(\"aria-hidden\", \"true\");\n }\n };\n\n Intro.prototype.onButtonClick = function(e) {\n if ($(e.currentTarget).hasClass(\"disabled\")) {\n return e.preventDefault();\n } else if ($(e.currentTarget).parent('#cmhr-mc-intro-aria-buttons').length) {\n this.elGame.attr(\"data-aria\", \"true\");\n return this.elLeaderboard.attr(\"data-aria\", \"true\");\n }\n };\n\n Intro.prototype.onMultiplayerClick = function(e) {\n e.preventDefault();\n if (!this.queued) {\n this.queued = true;\n this.multi.addClass(\"disabled\");\n if ($(e.currentTarget).parent('#cmhr-mc-intro-aria-buttons').length) {\n this.elGame.attr(\"data-aria\", \"true\");\n this.elLeaderboard.attr(\"data-aria\", \"true\");\n }\n Spine.trigger(\"game.multiplayer.join\", this.station);\n }\n return ga('send', 'event', 'button', 'click', 'start-multiplayer' + this.isAria(e));\n };\n\n Intro.prototype.onSingleClick = function(e) {\n \"If queued for multiplayer, remove from queue before entering single player\";\n if (this.queued) {\n Spine.trigger(\"game.multiplayer.leave\", this.station);\n }\n return ga('send', 'event', 'button', 'click', 'start-singleplayer' + this.isAria(e));\n };\n\n Intro.prototype.onShareButtonClick = function(e) {\n \"Handle social sharing\";\n\n var height, left, opts, top, url, width;\n e.preventDefault();\n width = 575;\n height = 400;\n left = ($(window).width() - width) / 2;\n top = ($(window).height() - height) / 2;\n url = e.currentTarget.href;\n opts = 'status=1' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;\n return window.open(url, '', opts);\n };\n\n Intro.prototype.onResize = function(el) {\n var h, rh;\n if ($(window).width() > 550) {\n h = $(window).height() - $(\"#cmhr-desktop-header\").height() - $(\"#cmhr-mc-nav\").height();\n return rh = h - this.el.find(\".flag\").height();\n }\n };\n\n Intro.prototype.onSocketConnection = function(msg) {\n \"Set Socket Connection State\";\n this.el.attr(\"data-connected\", msg);\n if (msg) {\n return Spine.trigger(\"game.multiplayer.status\");\n }\n };\n\n Intro.prototype.onSocketStatus = function(data) {\n \"Update Panel State on Staus Request\";\n this.el.attr(\"data-socket-state\", data[\"status\"]);\n if (data[\"status\"] === \"inactive\") {\n this.queued = false;\n this.multi.removeClass(\"disabled\");\n this.countdownAnimation.removeClass(\"run\");\n this.multiCtaAria.attr(\"aria-hidden\", \"false\");\n this.multiInProgressAria.attr(\"aria-hidden\", \"true\");\n return this.multiJoinAria.attr(\"aria-hidden\", \"true\");\n }\n };\n\n Intro.prototype.onSocketCountdown = function(msg) {\n \"Update Countdown from IO Message\";\n this.countdown.html(msg.countdown);\n this.multiCtaAria.attr(\"aria-hidden\", \"true\");\n this.multiInProgressAria.attr(\"aria-hidden\", \"true\");\n return this.multiJoinAria.attr(\"aria-hidden\", \"false\");\n };\n\n Intro.prototype.onSocketGameEnd = function() {\n \"On Game End: Set to Inactive\";\n return this.el.attr(\"data-socket-state\", \"inactive\");\n };\n\n Intro.prototype.onSocketGameQueue = function(msg) {\n \"On Game Queue: Set to Queued\";\n this.el.attr(\"data-socket-state\", \"queued\");\n return this.countdownAnimation.addClass(\"run\");\n };\n\n Intro.prototype.onSocketGameStart = function() {\n this.el.attr(\"data-socket-state\", \"active\");\n return this.countdownAnimation.removeClass(\"run\");\n };\n\n Intro.prototype.isAria = function(e) {\n var aria, elem, id;\n aria = '';\n elem = $(e.currentTarget);\n id = elem.attr(\"id\");\n if (id.indexOf(\"aria\") > -1) {\n aria = '-aria';\n }\n return aria;\n };\n\n return Intro;\n\n})(Spine.Controller);\n\nmodule.exports = Intro;\n","var Leaderboard, Leaders,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nLeaders = require(\"models/leaderboard\");\n\nLeaderboard = (function(_super) {\n\n __extends(Leaderboard, _super);\n\n \"Application Loading Controller\";\n\n\n Leaderboard.prototype.el = $(\"#cmhr-mc-leaderboard\");\n\n Leaderboard.prototype.Open = \"open\";\n\n Leaderboard.prototype.Closed = \"closed\";\n\n Leaderboard.prototype.LeaderboardLoading = \"loading\";\n\n Leaderboard.prototype.LeaderboardLoaded = \"loaded\";\n\n Leaderboard.prototype.station = -1;\n\n Leaderboard.prototype.elements = {\n \"#cmhr-mc-leaderboard-entries tbody\": \"entries\",\n \"#cmhr-mc-leaderboard-frame\": \"frame\",\n \"#leaderboard-label\": \"heading\"\n };\n\n Leaderboard.prototype.events = {\n \"click .btn-share\": \"onShareButtonClick\"\n };\n\n function Leaderboard(station) {\n this.onUpdateScore = __bind(this.onUpdateScore, this);\n\n this.onShareButtonClick = __bind(this.onShareButtonClick, this);\n\n this.error = __bind(this.error, this);\n\n this.resize = __bind(this.resize, this);\n\n this.render = __bind(this.render, this);\n\n this.state = __bind(this.state, this);\n\n \"Render View and Init Elements and Events\";\n this.station = station;\n this.el.html(require('views/leaderboard'));\n Leaderboard.__super__.constructor.apply(this, arguments);\n Leaders.bind(\"refresh change update destroy\", this.render);\n Leaders.bind(\"ajaxError\", this.error);\n Spine.bind(\"game.update.score\", this.onUpdateScore);\n $(window).resize(this.resize);\n }\n\n Leaderboard.prototype.state = function(to) {\n \"Set Component State\";\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n console.log(\"LEADER BOARD OPEN\");\n Leaders.fetch({\n clear: true\n });\n this.frame.attr(\"data-state\", this.LeaderboardLoading);\n this.el.attr(\"aria-hidden\", \"false\");\n return this.heading.focus();\n case this.Closed:\n this.frame.attr(\"data-state\", this.LeaderboardLoading);\n return this.el.attr(\"aria-hidden\", \"true\");\n }\n };\n\n Leaderboard.prototype.render = function() {\n var l;\n this.log(\"leaderboard::render\");\n try {\n l = Leaders.dbOnly().sort(Leaders.sorted);\n this.entries.html(require('views/leaderboard_entries')(l));\n } catch (e) {\n this.log(e);\n }\n this.frame.attr(\"data-state\", this.LeaderboardLoaded);\n return this.resize();\n };\n\n Leaderboard.prototype.resize = function(e) {\n return this.frame.height($(window).height() - this.frame.position().top - $(\"#cmhr-desktop-header\").height());\n };\n\n Leaderboard.prototype.error = function(e) {\n this.log(\"leaderboard::error\");\n return this.log(\"Error: \" + e);\n };\n\n Leaderboard.prototype.onShareButtonClick = function(e) {\n \"Handle social sharing\";\n\n var height, left, opts, top, url, width;\n e.preventDefault();\n width = 575;\n height = 400;\n left = ($(window).width() - width) / 2;\n top = ($(window).height() - height) / 2;\n url = e.currentTarget.href;\n opts = 'status=1' + ',width=' + width + ',height=' + height + ',top=' + top + ',left=' + left;\n return window.open(url, '', opts);\n };\n\n Leaderboard.prototype.onUpdateScore = function(score) {\n return $(\".i18n-social\").attr(\"data-points\", score);\n };\n\n return Leaderboard;\n\n})(Spine.Controller);\n\nmodule.exports = Leaderboard;\n","var Loading,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nLoading = (function(_super) {\n\n __extends(Loading, _super);\n\n \"Application Loading Controller\";\n\n\n Loading.prototype.el = $(\"#cmhr-mc-loading\");\n\n function Loading() {\n this.inactive = __bind(this.inactive, this);\n\n this.active = __bind(this.active, this);\n this.el.html(require('views/loading'));\n Loading.__super__.constructor.apply(this, arguments);\n this.active();\n }\n\n Loading.prototype.active = function() {\n \"Start Loading State\";\n return this.el.show();\n };\n\n Loading.prototype.inactive = function() {\n \"End Loading State\";\n return this.el.hide();\n };\n\n return Loading;\n\n})(Spine.Controller);\n\nmodule.exports = Loading;\n","var Nav,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nNav = (function(_super) {\n\n __extends(Nav, _super);\n\n \"Application Loading Controller\";\n\n\n Nav.prototype.el = $(\"#cmhr-mc-nav\");\n\n Nav.prototype.elements = {\n \"#cmhr-mc-nav-attribution\": \"attribution\",\n \"#cmhr-mc-back-btns\": \"back\"\n };\n\n Nav.prototype.events = {\n \"click .language-select\": \"onLanguageSelect\",\n \"click #cmhr-mc-restart\": \"onRestart\",\n \"click #cmhr-mc-restart-small\": \"onRestart\"\n };\n\n Nav.prototype.station = -1;\n\n Nav.prototype.Open = \"open\";\n\n Nav.prototype.OpenWithBack = \"openWithBack\";\n\n Nav.prototype.Closed = \"closed\";\n\n function Nav(station) {\n this.resize = __bind(this.resize, this);\n\n this.onUpdateHide = __bind(this.onUpdateHide, this);\n\n this.onUpdateCaption = __bind(this.onUpdateCaption, this);\n\n this.onRestart = __bind(this.onRestart, this);\n\n this.onLanguageSelect = __bind(this.onLanguageSelect, this);\n\n this.state = __bind(this.state, this);\n\n \"Render View and Init Elements and Events\";\n this.station = station;\n this.el.html(require('views/nav'));\n Nav.__super__.constructor.apply(this, arguments);\n this.attribution.hide();\n Spine.bind(\"nav.caption.update\", this.onUpdateCaption);\n Spine.bind(\"nav.caption.hide\", this.onUpdateHide);\n }\n\n Nav.prototype.state = function(to) {\n \"Set Component State\";\n this.el.attr(\"data-state\", to);\n switch (to) {\n case this.Open:\n this.el.attr(\"aria-hidden\", \"false\");\n return this.back.hide();\n case this.OpenWithBack:\n this.el.attr(\"aria-hidden\", \"false\");\n return this.back.show();\n case this.Closed:\n this.el.attr(\"aria-hidden\", \"true\");\n return this.back.hide();\n }\n };\n\n Nav.prototype.onLanguageSelect = function(e) {\n var elem;\n elem = $(e.currentTarget);\n Spine.trigger(\"translate\", elem.attr(\"data-lang\"));\n return ga('send', 'event', 'button', 'click', 'lang-selector-' + elem.attr(\"data-lang\"));\n };\n\n Nav.prototype.onRestart = function() {\n return ga('send', 'event', 'button', 'click', 'restart');\n };\n\n Nav.prototype.onUpdateCaption = function(caption) {\n this.attribution.show();\n this.attribution.attr(\"data-en\", caption.eng);\n this.attribution.attr(\"data-fr\", caption.fra);\n $(\"#cmhr-mc-nav-mobile-attribution\").show();\n $(\"#cmhr-mc-nav-mobile-attribution\").attr(\"data-en\", caption.eng);\n return $(\"#cmhr-mc-nav-mobile-attribution\").attr(\"data-fr\", caption.fra);\n };\n\n Nav.prototype.onUpdateHide = function(caption) {\n $(\"#cmhr-mc-nav-mobile-attribution\").hide();\n return this.attribution.hide();\n };\n\n Nav.prototype.resize = function() {\n var ww;\n ww = $(window).width();\n if (ww > 750) {\n return this.attribution.show();\n } else {\n return $(\"#cmhr-mc-nav-mobile-attribution\").show();\n }\n };\n\n return Nav;\n\n})(Spine.Controller);\n\nmodule.exports = Nav;\n","var Socket,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nSocket = (function(_super) {\n\n __extends(Socket, _super);\n\n \"Application Loading Controller\";\n\n\n Socket.prototype.el = $(\"#cmhr-mc-socket\");\n\n Socket.prototype.elements = {\n \"#cmhr-mc-socket-msg\": \"msg\",\n \"#cmhr-mc-socket-status\": \"status\"\n };\n\n Socket.prototype.socket = null;\n\n function Socket() {\n this.onSocketGameEnd = __bind(this.onSocketGameEnd, this);\n\n this.onSocketGameQuestionAnswered = __bind(this.onSocketGameQuestionAnswered, this);\n\n this.onSocketGameStart = __bind(this.onSocketGameStart, this);\n\n this.onSocketGameCountdown = __bind(this.onSocketGameCountdown, this);\n\n this.onSocketGameStatus = __bind(this.onSocketGameStatus, this);\n\n this.onSocketGameScores = __bind(this.onSocketGameScores, this);\n\n this.onSocketClientQueue = __bind(this.onSocketClientQueue, this);\n\n this.onSocketGameQueue = __bind(this.onSocketGameQueue, this);\n\n this.onSocketDisconnected = __bind(this.onSocketDisconnected, this);\n\n this.onSocketConnected = __bind(this.onSocketConnected, this);\n\n this.onMultiplayerRequestStatus = __bind(this.onMultiplayerRequestStatus, this);\n\n this.onMultiplayerAnswer = __bind(this.onMultiplayerAnswer, this);\n\n this.onMultiplayerLeave = __bind(this.onMultiplayerLeave, this);\n\n this.onMultiplayerJoin = __bind(this.onMultiplayerJoin, this);\n\n this.onGetScores = __bind(this.onGetScores, this);\n\n \"Render View and Init Elements and Events\";\n this.socket = io.connect(\"10.64.127.16:3000\");\n this.el.html(require('views/socket'));\n Socket.__super__.constructor.apply(this, arguments);\n this.socket.on('io.connected', this.onSocketConnected);\n this.socket.on('disconnect', this.onSocketDisconnected);\n this.socket.on('io.game.status', this.onSocketGameStatus);\n this.socket.on('io.game.queue', this.onSocketGameQueue);\n this.socket.on('io.game.client-queue', this.onSocketClientQueue);\n this.socket.on('io.game.countdown', this.onSocketGameCountdown);\n this.socket.on('io.game.start', this.onSocketGameStart);\n this.socket.on('io.game.question.answered', this.onSocketGameQuestionAnswered);\n this.socket.on('io.game.scores', this.onSocketGameScores);\n this.socket.on('io.game.end', this.onSocketGameEnd);\n Spine.bind(\"game.get-scores\", this.onGetScores);\n Spine.bind(\"game.multiplayer.answer\", this.onMultiplayerAnswer);\n Spine.bind(\"game.multiplayer.join\", this.onMultiplayerJoin);\n Spine.bind(\"game.multiplayer.leave\", this.onMultiplayerLeave);\n Spine.bind(\"game.multiplayer.status\", this.onMultiplayerRequestStatus);\n }\n\n Socket.prototype.onGetScores = function(station) {\n this.log(\"onGetScores\");\n return this.socket.emit(\"game.scores\");\n };\n\n Socket.prototype.onMultiplayerJoin = function(station) {\n this.log(\"onMultiplayerJoin\");\n Spine.trigger(\"socket.controlled\", {\n controlled: true,\n station: station\n });\n return this.socket.emit(\"game.join\", station);\n };\n\n Socket.prototype.onMultiplayerLeave = function(station) {\n this.log(\"onMultiplayerLeave\");\n Spine.trigger(\"socket.controlled\", {\n controlled: false,\n station: station\n });\n return this.socket.emit(\"game.leave\", station);\n };\n\n Socket.prototype.onMultiplayerAnswer = function(answer) {\n this.log(\"onMultiplayerAnswer\");\n return this.socket.emit(\"game.answer\", answer);\n };\n\n Socket.prototype.onMultiplayerRequestStatus = function(msg) {\n this.log(\"onMultiplayerRequestStatus\");\n return this.socket.emit(\"game.status\");\n };\n\n Socket.prototype.onSocketConnected = function(data) {\n this.log(\"onSocketConnected\");\n Spine.trigger(\"socket.connection\", true);\n this.status.attr(\"data-status\", \"true\");\n return this.msg.html(\"Connected - v2\");\n };\n\n Socket.prototype.onSocketDisconnected = function(data) {\n this.log(\"onSocketDisconnected\");\n Spine.trigger(\"socket.connection\", false);\n this.status.attr(\"data-status\", \"false\");\n return this.msg.html(\"Reestablishing Connection...\");\n };\n\n Socket.prototype.onSocketGameQueue = function(data) {\n return Spine.trigger(\"socket.game.queue\", data);\n };\n\n Socket.prototype.onSocketClientQueue = function(data) {\n \"Handle Array of Connected Clients\";\n this.log(\"onSocketClientQueue\");\n return Spine.trigger(\"socket.game.client-queue\", data);\n };\n\n Socket.prototype.onSocketGameScores = function(data) {\n this.log(\"onSocketGameScore\");\n return Spine.trigger(\"socket.game.scores\", data);\n };\n\n Socket.prototype.onSocketGameStatus = function(data) {\n this.log(\"onSocketGameStatus :: \" + data['status']);\n return Spine.trigger(\"socket.game.status\", data);\n };\n\n Socket.prototype.onSocketGameCountdown = function(data) {\n this.log(\"onSocketGameCountdown\");\n return Spine.trigger(\"socket.game.countdown\", data);\n };\n\n Socket.prototype.onSocketGameStart = function(data) {\n this.log(\"onSocketGameStart\");\n return Spine.trigger(\"socket.game.start\", data);\n };\n\n Socket.prototype.onSocketGameQuestionAnswered = function(data) {\n this.log(\"onSocketGameQuestionAnswered\");\n return Spine.trigger(\"socket.game.question.answered\", data);\n };\n\n Socket.prototype.onSocketGameEnd = function(data) {\n this.log(\"onSocketGameEnd\");\n Spine.trigger(\"socket.controlled\", {\n controlled: false,\n station: null\n });\n return Spine.trigger(\"socket.game.end\", data);\n };\n\n return Socket;\n\n})(Spine.Controller);\n\nmodule.exports = Socket;\n","var Config,\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nConfig = (function(_super) {\n\n __extends(Config, _super);\n\n function Config() {\n return Config.__super__.constructor.apply(this, arguments);\n }\n\n Config.configure(\"Config\", \"id\");\n\n Config.extend(Spine.Model.Ajax);\n\n Config.url = \"/quotequiz/api/config.json\";\n\n return Config;\n\n})(Spine.Model);\n\nmodule.exports = Config;\n","var Leaderboard,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };\n\nLeaderboard = (function(_super) {\n\n __extends(Leaderboard, _super);\n\n function Leaderboard() {\n this.pk = __bind(this.pk, this);\n\n this.percent = __bind(this.percent, this);\n\n this.minutes = __bind(this.minutes, this);\n return Leaderboard.__super__.constructor.apply(this, arguments);\n }\n\n Leaderboard.configure(\"Config\", \"id\", \"name\", \"score\", \"time\");\n\n Leaderboard.extend(Spine.Model.Ajax);\n\n Leaderboard.url = \"/quotequiz/api/leaderboard.json\";\n\n Leaderboard.prototype.minutes = function() {\n var m, s;\n m = Math.floor(this.time / 60);\n s = this.time - (m * 60);\n s = s < 10 ? \"0\" + s : s;\n return \"\" + m + \":\" + s;\n };\n\n Leaderboard.prototype.percent = function() {\n var p;\n if (this.score === 0) {\n return this.score;\n } else {\n p = Math.floor((this.score / 500) * 100);\n if (p <= 100) {\n return p;\n } else {\n return 100;\n }\n }\n };\n\n Leaderboard.prototype.pk = function() {\n return this.id;\n };\n\n Leaderboard.dbOnly = function() {\n return this.select(function(c) {\n return Number.isInteger(c.id);\n });\n };\n\n Leaderboard.sorted = function(a, b) {\n if (a.score > b.score) {\n return -1;\n } else {\n return 1;\n }\n };\n\n Leaderboard.fromJSON = function(objects) {\n objects = objects.leaderboard;\n objects = objects ? objects : [];\n return Leaderboard.__super__.constructor.fromJSON.call(this, objects);\n };\n\n return Leaderboard;\n\n})(Spine.Model);\n\nHandlebars.registerHelper('oneIndex', function(i) {\n return i + 1;\n});\n\nmodule.exports = Leaderboard;\n","var Question,\n __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },\n __hasProp = {}.hasOwnProperty,\n __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },\n __slice = [].slice;\n\nQuestion = (function(_super) {\n\n __extends(Question, _super);\n\n function Question() {\n this.img = __bind(this.img, this);\n return Question.__super__.constructor.apply(this, arguments);\n }\n\n Question.configure(\"Question\", \"id\");\n\n Question.extend(Spine.Model.Ajax);\n\n Question.url = \"/quotequiz/api/questions.json\";\n\n Question.prototype.img = function() {\n var first, last, rest, _i, _ref;\n _ref = this.media.fullImage.url.split('/'), first = _ref[0], rest = 3 <= _ref.length ? __slice.call(_ref, 1, _i = _ref.length - 1) : (_i = 1, []), last = _ref[_i++];\n return \"/quotequiz/media/content/\" + last;\n };\n\n Question.fromJSON = function(objects) {\n objects = objects.questions;\n return Question.__super__.constructor.fromJSON.call(this, objects);\n };\n\n return Question;\n\n})(Spine.Model);\n\nmodule.exports = Question;\n","module.exports = Handlebars.template(function (Handlebars,depth0,helpers,partials,data) {\n helpers = helpers || Handlebars.helpers;\n \n\n\n return \"
\\n\\n ,\\n \\n
\\n \";\n return buffer;}\n\nfunction program9(depth0,data) {\n \n \n return \"\\n \\n \\n \";}\n\nfunction program11(depth0,data) {\n \n var buffer = \"\", stack1;\n buffer += \"\\n \\n \\n \";\n return buffer;}\n\nfunction program13(depth0,data) {\n \n \n return \"\\n \\n \\n \";}\n\n buffer += \"\\n\\n , \\n \\n
\\n \\nRank | \\nName | \\nMinutes | \\n\\n | Score | \\n
---|