// Generated by CoffeeScript 1.10.0
(function() {
  var values;

  values = {};

  $(document).ready(function() {
    $("script[type='application/init']").each(function() {
      var e, error, k, results, tmp;
      try {
        tmp = JSON.parse($(this).text());
        results = [];
        for (k in tmp) {
          results.push(values[k] = tmp[k]);
        }
        return results;
      } catch (error) {
        e = error;
        return console.log('Parsing error', e);
      }
    });
    return window.addEventListener("message", receiveMessage, false);
  });

  receiveMessage(function(e) {
    var client_id, message, salt, session_state, ss, stat;
    message = e.data;
    client_id = decodeURIComponent(message.split(' ')[0]);
    session_state = decodeURIComponent(message.split(' ')[1]);
    salt = decodeURIComponent(session_state.split('.')[1]);
    ss = hash.toString(CryptoJS.enc.Base64) + '.' + salt;
    if (session_state === ss) {
      stat = 'unchanged';
    } else {
      stat = 'changed';
    }
    return e.source.postMessage(stat, e.origin);
  });

}).call(this);
