text: (function(e,b){e.version="0.8.7";e.protocol=1;e.transports=[];e.j=[];e.sockets={};e.connect=function(c,a){var g=e.util.parseUri(c),f,d;b&&b.location&&(g.protocol=g.protocol||b.location.protocol.slice(0,-1),g.host=g.host||(b.document?b.document.domain:b.location.hostname),g.port=g.port||b.location.port);f=e.util.uniqueUri(g);var h={host:g.host,secure:"https"==g.protocol,port:g.port||("https"==g.protocol?443:80),query:g.query||""};e.util.merge(h,a);if(h["force new connection"]||!e.sockets[f])d=new e.Socket(h);
  !h["force new connection"]&&d&&(e.sockets[f]=d);d=d||e.sockets[f];return d.of(1<g.path.length?g.path:"")}})("object"===typeof module?module.exports:this.io={},this);
  (function(e,b){var c=e.util={},a=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,g="source,protocol,authority,userInfo,user,password,host,port,relative,path,directory,file,query,anchor".split(",");c.parseUri=function(d){for(var d=a.exec(d||""),h={},f=14;f--;)h[g[f]]=d[f]||"";return h};c.uniqueUri=function(d){var h=d.protocol,a=d.host,d=d.port;"document"in
  b?(a=a||document.domain,d=d||("https"==h&&"https:"!==document.location.protocol?443:document.location.port)):(a=a||"localhost",!d&&"https"==h&&(d=443));return(h||"http")+"://"+a+":"+(d||80)};c.query=function(d,h){var a=c.chunkQuery(d||""),f=[];c.merge(a,c.chunkQuery(h||""));for(var b in a)a.hasOwnProperty(b)&&f.push(b+"="+a[b]);return f.length?"?"+f.join("&"):""};c.chunkQuery=function(d){for(var a={},d=d.split("&"),f=0,b=d.length,c;f<b;++f)c=d[f].split("="),c[0]&&(a[c[0]]=decodeURIComponent(c[1]));
  return a};var f=!1;c.load=function(d){if("document"in b&&"complete"===document.readyState||f)return d();c.on(b,"load",d,!1)};c.on=function(d,a,f,b){d.attachEvent?d.attachEvent("on"+a,f):d.addEventListener&&d.addEventListener(a,f,b)};c.request=function(d){if(d&&"undefined"!=typeof XDomainRequest)return new XDomainRequest;if("undefined"!=typeof XMLHttpRequest&&(!d||c.ua.hasCORS))return new XMLHttpRequest;if(!d)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(a){}return null};"undefined"!=typeof window&&
  c.load(function(){f=!0});c.defer=function(d){if(!c.ua.webkit||"undefined"!=typeof importScripts)return d();c.load(function(){setTimeout(d,100)})};c.merge=function(d,a,f,b){var b=b||[],f="undefined"==typeof f?2:f,g;for(g in a)a.hasOwnProperty(g)&&0>c.indexOf(b,g)&&("object"!==typeof d[g]||!f?(d[g]=a[g],b.push(a[g])):c.merge(d[g],a[g],f-1,b));return d};c.mixin=function(d,a){c.merge(d.prototype,a.prototype)};c.inherit=function(d,a){function f(){}f.prototype=a.prototype;d.prototype=new f};c.isArray=Array.isArray||
  function(d){return"[object Array]"===Object.prototype.toString.call(d)};c.intersect=function(d,a){for(var f=[],b=d.length>a.length?d:a,g=d.length>a.length?a:d,e=0,r=g.length;e<r;e++)~c.indexOf(b,g[e])&&f.push(g[e]);return f};c.indexOf=function(d,a,f){if(Array.prototype.indexOf)return Array.prototype.indexOf.call(d,a,f);for(var b=d.length,f=0>f?0>f+b?0:f+b:f||0;f<b&&d[f]!==a;f++);return b<=f?-1:f};c.toArray=function(d){for(var a=[],f=0,b=d.length;f<b;f++)a.push(d[f]);return a};c.ua={};c.ua.hasCORS=
  "undefined"!=typeof XMLHttpRequest&&function(){try{var d=new XMLHttpRequest}catch(a){return!1}return void 0!=d.withCredentials}();c.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent)})("undefined"!=typeof io?io:module.exports,this);
  (function(e,b){function c(){}e.EventEmitter=c;c.prototype.on=function(a,c){this.$events||(this.$events={});this.$events[a]?b.util.isArray(this.$events[a])?this.$events[a].push(c):this.$events[a]=[this.$events[a],c]:this.$events[a]=c;return this};c.prototype.addListener=c.prototype.on;c.prototype.once=function(a,b){function f(){d.removeListener(a,f);b.apply(this,arguments)}var d=this;f.listener=b;this.on(a,f);return this};c.prototype.removeListener=function(a,c){if(this.$events&&this.$events[a]){var f=
  this.$events[a];if(b.util.isArray(f)){for(var d=-1,h=0,e=f.length;h<e;h++)if(f[h]===c||f[h].listener&&f[h].listener===c){d=h;break}if(0>d)return this;f.splice(d,1);f.length||delete this.$events[a]}else(f===c||f.listener&&f.listener===c)&&delete this.$events[a]}return this};c.prototype.removeAllListeners=function(a){this.$events&&this.$events[a]&&(this.$events[a]=null);return this};c.prototype.listeners=function(a){this.$events||(this.$events={});this.$events[a]||(this.$events[a]=[]);b.util.isArray(this.$events[a])||
  (this.$events[a]=[this.$events[a]]);return this.$events[a]};c.prototype.emit=function(a){if(!this.$events)return!1;var c=this.$events[a];if(!c)return!1;var f=Array.prototype.slice.call(arguments,1);if("function"==typeof c)c.apply(this,f);else if(b.util.isArray(c))for(var c=c.slice(),d=0,h=c.length;d<h;d++)c[d].apply(this,f);else return!1;return!0}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);
  (function(e,b){function c(d){return 10>d?"0"+d:d}function a(d){h.lastIndex=0;return h.test(d)?'"'+d.replace(h,function(d){var a=i[d];return"string"===typeof a?a:"\\u"+("0000"+d.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+d+'"'}function g(d,f){var b,h,e,i,q=k,o,l=f[d];l instanceof Date&&(l=isFinite(d.valueOf())?d.getUTCFullYear()+"-"+c(d.getUTCMonth()+1)+"-"+c(d.getUTCDate())+"T"+c(d.getUTCHours())+":"+c(d.getUTCMinutes())+":"+c(d.getUTCSeconds())+"Z":null);"function"===typeof j&&(l=j.call(f,d,
  l));switch(typeof l){case "string":return a(l);case "number":return isFinite(l)?""+l:"null";case "boolean":case "null":return""+l;case "object":if(!l)return"null";k+=p;o=[];if("[object Array]"===Object.prototype.toString.apply(l)){i=l.length;for(b=0;b<i;b+=1)o[b]=g(b,l)||"null";e=0===o.length?"[]":k?"[\n"+k+o.join(",\n"+k)+"\n"+q+"]":"["+o.join(",")+"]";k=q;return e}if(j&&"object"===typeof j){i=j.length;for(b=0;b<i;b+=1)"string"===typeof j[b]&&(h=j[b],(e=g(h,l))&&o.push(a(h)+(k?": ":":")+e))}else for(h in l)Object.prototype.hasOwnProperty.call(l,
  h)&&(e=g(h,l))&&o.push(a(h)+(k?": ":":")+e);e=0===o.length?"{}":k?"{\n"+k+o.join(",\n"+k)+"\n"+q+"}":"{"+o.join(",")+"}";k=q;return e}}if(b&&b.parse)return e.JSON={parse:b.parse,stringify:b.stringify};var f=e.JSON={},d=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,h=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,k,p,i={"\u0008":"\\b","\t":"\\t","\n":"\\n","\u000c":"\\f",
  "\r":"\\r",'"':'\\"',"\\":"\\\\"},j;f.stringify=function(d,a,f){var b;p=k="";if("number"===typeof f)for(b=0;b<f;b+=1)p+=" ";else"string"===typeof f&&(p=f);if((j=a)&&"function"!==typeof a&&("object"!==typeof a||"number"!==typeof a.length))throw Error("JSON.stringify");return g("",{"":d})};f.parse=function(a,f){function b(d,a){var c,h,g=d[a];if(g&&"object"===typeof g)for(c in g)Object.prototype.hasOwnProperty.call(g,c)&&(h=b(g,c),void 0!==h?g[c]=h:delete g[c]);return f.call(d,a,g)}var c,a=""+a;d.lastIndex=
  0;d.test(a)&&(a=a.replace(d,function(d){return"\\u"+("0000"+d.charCodeAt(0).toString(16)).slice(-4)}));if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return c=eval("("+a+")"),"function"===typeof f?b({"":c},""):c;throw new SyntaxError("JSON.parse");}})("undefined"!=typeof io?io:module.exports,"undefined"!==typeof JSON?JSON:void 0);
  (function(e,b){var c=e.parser={},a=c.packets="disconnect,connect,heartbeat,message,json,event,ack,error,noop".split(","),g=c.reasons=["transport not supported","client not handshaken","unauthorized"],f=c.advice=["reconnect"],d=b.JSON,h=b.util.indexOf;c.encodePacket=function(b){var c=h(a,b.type),e=b.id||"",k=b.endpoint||"",n=b.ack,m=null;switch(b.type){case "error":var s=b.reason?h(g,b.reason):"",b=b.advice?h(f,b.advice):"";if(""!==s||""!==b)m=s+(""!==b?"+"+b:"");break;case "message":""!==b.data&&
  (m=b.data);break;case "event":m={name:b.name};b.args&&b.args.length&&(m.args=b.args);m=d.stringify(m);break;case "json":m=d.stringify(b.data);break;case "connect":b.qs&&(m=b.qs);break;case "ack":m=b.ackId+(b.args&&b.args.length?"+"+d.stringify(b.args):"")}c=[c,e+("data"==n?"+":""),k];null!==m&&void 0!==m&&c.push(m);return c.join(":")};c.encodePayload=function(d){var a="";if(1==d.length)return d[0];for(var b=0,f=d.length;b<f;b++)a+="\ufffd"+d[b].length+"\ufffd"+d[b];return a};var k=/([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;
  c.decodePacket=function(b){var c=b.match(k);if(!c)return{};var h=c[2]||"",b=c[5]||"",e={type:a[c[1]],endpoint:c[4]||""};h&&(e.id=h,e.ack=c[3]?"data":!0);switch(e.type){case "error":c=b.split("+");e.reason=g[c[0]]||"";e.advice=f[c[1]]||"";break;case "message":e.data=b||"";break;case "event":try{var n=d.parse(b);e.name=n.name;e.args=n.args}catch(m){}e.args=e.args||[];break;case "json":try{e.data=d.parse(b)}catch(s){}break;case "connect":e.qs=b||"";break;case "ack":if(c=b.match(/^([0-9]+)(\+)?(.*)/))if(e.ackId=
  c[1],e.args=[],c[3])try{e.args=c[3]?d.parse(c[3]):[]}catch(t){}}return e};c.decodePayload=function(d){if("\ufffd"==d.charAt(0)){for(var b=[],a=1,f="";a<d.length;a++)"\ufffd"==d.charAt(a)?(b.push(c.decodePacket(d.substr(a+1).substr(0,f))),a+=Number(f)+1,f=""):f+=d.charAt(a);return b}return[c.decodePacket(d)]}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);
  (function(e,b){function c(b,c){this.socket=b;this.sessid=c}e.Transport=c;b.util.mixin(c,b.EventEmitter);c.prototype.onData=function(a){this.clearCloseTimeout();(this.connected||this.connecting||this.reconnecting)&&this.setCloseTimeout();if(""!==a&&(a=b.parser.decodePayload(a))&&a.length)for(var c=0,f=a.length;c<f;c++)this.onPacket(a[c]);return this};c.prototype.onPacket=function(b){if("heartbeat"==b.type)return this.onHeartbeat();if("connect"==b.type&&""==b.endpoint)this.onConnect();this.socket.onPacket(b);
  return this};c.prototype.setCloseTimeout=function(){if(!this.closeTimeout){var b=this;this.closeTimeout=setTimeout(function(){b.onDisconnect()},this.socket.closeTimeout)}};c.prototype.onDisconnect=function(){this.close&&this.open&&this.close();this.clearTimeouts();this.socket.onDisconnect();return this};c.prototype.onConnect=function(){this.socket.onConnect();return this};c.prototype.clearCloseTimeout=function(){this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=null)};c.prototype.clearTimeouts=
  function(){this.clearCloseTimeout();this.reopenTimeout&&clearTimeout(this.reopenTimeout)};c.prototype.packet=function(a){this.send(b.parser.encodePacket(a))};c.prototype.onHeartbeat=function(){this.packet({type:"heartbeat"})};c.prototype.onOpen=function(){this.open=!0;this.clearCloseTimeout();this.socket.onOpen()};c.prototype.onClose=function(){this.open=!1;this.socket.onClose();this.onDisconnect()};c.prototype.prepareUrl=function(){var a=this.socket.options;return this.scheme()+"://"+a.host+":"+
  a.port+"/"+a.resource+"/"+b.protocol+"/"+this.name+"/"+this.sessid};c.prototype.ready=function(b,c){c.call(this)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);
  (function(e,b,c){function a(a){this.options={port:80,secure:!1,document:"document"in c?document:!1,resource:"socket.io",transports:b.transports,"connect timeout":1E4,"try multiple transports":!0,reconnect:!0,"reconnection delay":500,"reconnection limit":Infinity,"reopen delay":3E3,"max reconnection attempts":10,"sync disconnect on unload":!0,"auto connect":!0,"flash policy port":10843};b.util.merge(this.options,a);this.reconnecting=this.connecting=this.open=this.connected=!1;this.namespaces={};this.buffer=
  [];this.doBuffer=!1;if(this.options["sync disconnect on unload"]&&(!this.isXDomain()||b.util.ua.hasCORS)){var d=this;b.util.on(c,"beforeunload",function(){d.disconnectSync()},!1)}this.options["auto connect"]&&this.connect()}function g(){}e.Socket=a;b.util.mixin(a,b.EventEmitter);a.prototype.of=function(a){this.namespaces[a]||(this.namespaces[a]=new b.SocketNamespace(this,a),""!==a&&this.namespaces[a].packet({type:"connect"}));return this.namespaces[a]};a.prototype.publish=function(){this.emit.apply(this,
  arguments);var b,d;for(d in this.namespaces)this.namespaces.hasOwnProperty(d)&&(b=this.of(d),b.$emit.apply(b,arguments))};a.prototype.handshake=function(a){function d(b){if(b instanceof Error)c.onError(b.message);else a.apply(null,b.split(":"))}var c=this,e=this.options,e=["http"+(e.secure?"s":"")+":/",e.host+":"+e.port,e.resource,b.protocol,b.util.query(this.options.query,"t="+ +new Date)].join("/");if(this.isXDomain()&&!b.util.ua.hasCORS){var p=document.getElementsByTagName("script")[0],i=document.createElement("script");
  i.src=e+"&jsonp="+b.j.length;p.parentNode.insertBefore(i,p);b.j.push(function(b){d(b);i.parentNode.removeChild(i)})}else{var j=b.util.request();j.open("GET",e,!0);j.onreadystatechange=function(){4==j.readyState&&(j.onreadystatechange=g,200==j.status?d(j.responseText):!c.reconnecting&&c.onError(j.responseText))};j.send(null)}};a.prototype.getTransport=function(a){for(var a=a||this.transports,d=0,c;c=a[d];d++)if(b.Transport[c]&&b.Transport[c].check(this)&&(!this.isXDomain()||b.Transport[c].xdomainCheck()))return new b.Transport[c](this,
  this.sessionid);return null};a.prototype.connect=function(a){if(this.connecting)return this;var d=this;this.handshake(function(c,e,g,i){function j(b){d.transport&&d.transport.clearTimeouts();d.transport=d.getTransport(b);if(!d.transport)return d.publish("connect_failed");d.transport.ready(d,function(){d.connecting=!0;d.publish("connecting",d.transport.name);d.transport.open();d.options["connect timeout"]&&(d.connectTimeoutTimer=setTimeout(function(){if(!d.connected&&(d.connecting=!1,d.options["try multiple transports"])){d.remainingTransports||
  (d.remainingTransports=d.transports.slice(0));for(var b=d.remainingTransports;0<b.length&&b.splice(0,1)[0]!=d.transport.name;);b.length?j(b):d.publish("connect_failed")}},d.options["connect timeout"]))})}d.sessionid=c;d.closeTimeout=1E3*g;d.heartbeatTimeout=1E3*e;d.transports=b.util.intersect(i.split(","),d.options.transports);j();d.once("connect",function(){clearTimeout(d.connectTimeoutTimer);a&&"function"==typeof a&&a()})});return this};a.prototype.packet=function(b){this.connected&&!this.doBuffer?
  this.transport.packet(b):this.buffer.push(b);return this};a.prototype.setBuffer=function(b){this.doBuffer=b;!b&&this.connected&&this.buffer.length&&(this.transport.payload(this.buffer),this.buffer=[])};a.prototype.disconnect=function(){this.connected&&(this.open&&this.of("").packet({type:"disconnect"}),this.onDisconnect("booted"));return this};a.prototype.disconnectSync=function(){b.util.request().open("GET",this.resource+"/"+b.protocol+"/"+this.sessionid,!0);this.onDisconnect("booted")};a.prototype.isXDomain=
  function(){var b=c.location.port||("https:"==c.location.protocol?443:80);return this.options.host!==c.location.hostname||this.options.port!=b};a.prototype.onConnect=function(){this.connected||(this.connected=!0,this.connecting=!1,this.doBuffer||this.setBuffer(!1),this.emit("connect"))};a.prototype.onOpen=function(){this.open=!0};a.prototype.onClose=function(){this.open=!1};a.prototype.onPacket=function(b){this.of(b.endpoint).onPacket(b)};a.prototype.onError=function(b){b&&b.advice&&"reconnect"===
  b.advice&&this.connected&&(this.disconnect(),this.reconnect());this.publish("error",b&&b.reason?b.reason:b)};a.prototype.onDisconnect=function(b){var d=this.connected;this.open=this.connecting=this.connected=!1;d&&(this.transport.close(),this.transport.clearTimeouts(),this.publish("disconnect",b),"booted"!=b&&this.options.reconnect&&!this.reconnecting&&this.reconnect())};a.prototype.reconnect=function(){function b(){if(a.connected){for(var c in a.namespaces)a.namespaces.hasOwnProperty(c)&&""!==c&&
  a.namespaces[c].packet({type:"connect"});a.publish("reconnect",a.transport.name,a.reconnectionAttempts)}a.removeListener("connect_failed",d);a.removeListener("connect",d);a.reconnecting=!1;delete a.reconnectionAttempts;delete a.reconnectionDelay;delete a.reconnectionTimer;delete a.redoTransports;a.options["try multiple transports"]=e}function d(){if(a.reconnecting){if(a.connected)return b();if(a.connecting&&a.reconnecting)return a.reconnectionTimer=setTimeout(d,1E3);a.reconnectionAttempts++>=c?a.redoTransports?
  (a.publish("reconnect_failed"),b()):(a.on("connect_failed",d),a.options["try multiple transports"]=!0,a.transport=a.getTransport(),a.redoTransports=!0,a.connect()):(a.reconnectionDelay<g&&(a.reconnectionDelay*=2),a.connect(),a.publish("reconnecting",a.reconnectionDelay,a.reconnectionAttempts),a.reconnectionTimer=setTimeout(d,a.reconnectionDelay))}}this.reconnecting=!0;this.reconnectionAttempts=0;this.reconnectionDelay=this.options["reconnection delay"];var a=this,c=this.options["max reconnection attempts"],
  e=this.options["try multiple transports"],g=this.options["reconnection limit"];this.options["try multiple transports"]=!1;this.reconnectionTimer=setTimeout(d,this.reconnectionDelay);this.on("connect",d)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);
  (function(e,b){function c(b,c){this.socket=b;this.name=c||"";this.flags={};this.json=new a(this,"json");this.ackPackets=0;this.acks={}}function a(b,a){this.namespace=b;this.name=a}e.SocketNamespace=c;b.util.mixin(c,b.EventEmitter);c.prototype.$emit=b.EventEmitter.prototype.emit;c.prototype.of=function(){return this.socket.of.apply(this.socket,arguments)};c.prototype.packet=function(b){b.endpoint=this.name;this.socket.packet(b);this.flags={};return this};c.prototype.send=function(b,a){var d={type:this.flags.json?
  "json":"message",data:b};"function"==typeof a&&(d.id=++this.ackPackets,d.ack=!0,this.acks[d.id]=a);return this.packet(d)};c.prototype.emit=function(b){var a=Array.prototype.slice.call(arguments,1),d=a[a.length-1],c={type:"event",name:b};"function"==typeof d&&(c.id=++this.ackPackets,c.ack="data",this.acks[c.id]=d,a=a.slice(0,a.length-1));c.args=a;return this.packet(c)};c.prototype.disconnect=function(){""===this.name?this.socket.disconnect():(this.packet({type:"disconnect"}),this.$emit("disconnect"));
  return this};c.prototype.onPacket=function(a){function c(){d.packet({type:"ack",args:b.util.toArray(arguments),ackId:a.id})}var d=this;switch(a.type){case "connect":this.$emit("connect");break;case "disconnect":if(""===this.name)this.socket.onDisconnect(a.reason||"booted");else this.$emit("disconnect",a.reason);break;case "message":case "json":var e=["message",a.data];"data"==a.ack?e.push(c):a.ack&&this.packet({type:"ack",ackId:a.id});this.$emit.apply(this,e);break;case "event":e=[a.name].concat(a.args);
  "data"==a.ack&&e.push(c);this.$emit.apply(this,e);break;case "ack":this.acks[a.ackId]&&(this.acks[a.ackId].apply(this,a.args),delete this.acks[a.ackId]);break;case "error":if(a.advice)this.socket.onError(a);else"unauthorized"==a.reason?this.$emit("connect_failed",a.reason):this.$emit("error",a.reason)}};a.prototype.send=function(){this.namespace.flags[this.name]=!0;this.namespace.send.apply(this.namespace,arguments)};a.prototype.emit=function(){this.namespace.flags[this.name]=!0;this.namespace.emit.apply(this.namespace,
  arguments)}})("undefined"!=typeof io?io:module.exports,"undefined"!=typeof io?io:module.parent.exports);
  (function(e,b,c){function a(a){b.Transport.apply(this,arguments)}e.websocket=a;b.util.inherit(a,b.Transport);a.prototype.name="websocket";a.prototype.open=function(){var a=b.util.query(this.socket.options.query),e=this,d;d||(d=c.MozWebSocket||c.WebSocket);this.websocket=new d(this.prepareUrl()+a);this.websocket.onopen=function(){e.onOpen();e.socket.setBuffer(!1)};this.websocket.onmessage=function(a){e.onData(a.data)};this.websocket.onclose=function(){e.onClose();e.socket.setBuffer(!0)};this.websocket.onerror=
  function(a){e.onError(a)};return this};a.prototype.send=function(a){this.websocket.send(a);return this};a.prototype.payload=function(a){for(var b=0,d=a.length;b<d;b++)this.packet(a[b]);return this};a.prototype.close=function(){this.websocket.close();return this};a.prototype.onError=function(a){this.socket.onError(a)};a.prototype.scheme=function(){return this.socket.options.secure?"wss":"ws"};a.check=function(){return"WebSocket"in c&&!("__addTask"in WebSocket)||"MozWebSocket"in c};a.xdomainCheck=function(){return!0};
  b.transports.push("websocket")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);
  (function(e,b,c){function a(a){a&&(b.Transport.apply(this,arguments),this.sendBuffer=[])}function g(){}e.XHR=a;b.util.inherit(a,b.Transport);a.prototype.open=function(){this.socket.setBuffer(!1);this.onOpen();this.get();this.setCloseTimeout();return this};a.prototype.payload=function(a){for(var d=[],c=0,e=a.length;c<e;c++)d.push(b.parser.encodePacket(a[c]));this.send(b.parser.encodePayload(d))};a.prototype.send=function(a){this.post(a);return this};a.prototype.post=function(a){function b(){if(4==
  this.readyState)if(this.onreadystatechange=g,k.posting=!1,200==this.status)k.socket.setBuffer(!1);else k.onClose()}function e(){this.onload=g;k.socket.setBuffer(!1)}var k=this;this.socket.setBuffer(!0);this.sendXHR=this.request("POST");c.XDomainRequest&&this.sendXHR instanceof XDomainRequest?this.sendXHR.onload=this.sendXHR.onerror=e:this.sendXHR.onreadystatechange=b;this.sendXHR.send(a)};a.prototype.close=function(){this.onClose();return this};a.prototype.request=function(a){var d=b.util.request(this.socket.isXDomain()),
  c=b.util.query(this.socket.options.query,"t="+ +new Date);d.open(a||"GET",this.prepareUrl()+c,!0);if("POST"==a)try{d.setRequestHeader?d.setRequestHeader("Content-type","text/plain;charset=UTF-8"):d.contentType="text/plain"}catch(e){}return d};a.prototype.scheme=function(){return this.socket.options.secure?"https":"http"};a.check=function(a,d){try{if(b.util.request(d))return!0}catch(c){}return!1};a.xdomainCheck=function(){return a.check(null,!0)}})("undefined"!=typeof io?io.Transport:module.exports,
  "undefined"!=typeof io?io:module.parent.exports,this);
  (function(e,b){function c(a){b.Transport.XHR.apply(this,arguments)}e.htmlfile=c;b.util.inherit(c,b.Transport.XHR);c.prototype.name="htmlfile";c.prototype.get=function(){this.doc=new ActiveXObject("htmlfile");this.doc.open();this.doc.write("<html></html>");this.doc.close();this.doc.parentWindow.s=this;var a=this.doc.createElement("div");a.className="socketio";this.doc.body.appendChild(a);this.iframe=this.doc.createElement("iframe");a.appendChild(this.iframe);var c=this,a=b.util.query(this.socket.options.query,
  "t="+ +new Date);this.iframe.src=this.prepareUrl()+a;b.util.on(window,"unload",function(){c.destroy()})};c.prototype._=function(a,b){this.onData(a);try{var c=b.getElementsByTagName("script")[0];c.parentNode.removeChild(c)}catch(d){}};c.prototype.destroy=function(){if(this.iframe){try{this.iframe.src="about:blank"}catch(a){}this.doc=null;this.iframe.parentNode.removeChild(this.iframe);this.iframe=null;CollectGarbage()}};c.prototype.close=function(){this.destroy();return b.Transport.XHR.prototype.close.call(this)};
  c.check=function(){if("ActiveXObject"in window)try{return new ActiveXObject("htmlfile")&&b.Transport.XHR.check()}catch(a){}return!1};c.xdomainCheck=function(){return!1};b.transports.push("htmlfile")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports);
  (function(e,b,c){function a(){b.Transport.XHR.apply(this,arguments)}function g(){}e["xhr-polling"]=a;b.util.inherit(a,b.Transport.XHR);b.util.merge(a,b.Transport.XHR);a.prototype.name="xhr-polling";a.prototype.open=function(){b.Transport.XHR.prototype.open.call(this);return!1};a.prototype.get=function(){function a(){if(4==this.readyState)if(this.onreadystatechange=g,200==this.status)e.onData(this.responseText),e.get();else e.onClose()}function b(){this.onload=g;e.onData(this.responseText);e.get()}
  if(this.open){var e=this;this.xhr=this.request();c.XDomainRequest&&this.xhr instanceof XDomainRequest?this.xhr.onload=this.xhr.onerror=b:this.xhr.onreadystatechange=a;this.xhr.send(null)}};a.prototype.onClose=function(){b.Transport.XHR.prototype.onClose.call(this);if(this.xhr){this.xhr.onreadystatechange=this.xhr.onload=g;try{this.xhr.abort()}catch(a){}this.xhr=null}};a.prototype.ready=function(a,d){var c=this;b.util.defer(function(){d.call(c)})};b.transports.push("xhr-polling")})("undefined"!=typeof io?
  io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);
  (function(e,b,c){function a(a){b.Transport["xhr-polling"].apply(this,arguments);this.index=b.j.length;var d=this;b.j.push(function(a){d._(a)})}var g=c.document&&"MozAppearance"in c.document.documentElement.style;e["jsonp-polling"]=a;b.util.inherit(a,b.Transport["xhr-polling"]);a.prototype.name="jsonp-polling";a.prototype.post=function(a){function d(){c();e.socket.setBuffer(!1)}function c(){e.iframe&&e.form.removeChild(e.iframe);try{n=document.createElement('<iframe name="'+e.iframeId+'">')}catch(a){n=
  document.createElement("iframe"),n.name=e.iframeId}n.id=e.iframeId;e.form.appendChild(n);e.iframe=n}var e=this,g=b.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);if(!this.form){var i=document.createElement("form"),j=document.createElement("textarea"),r=this.iframeId="socketio_iframe_"+this.index,n;i.className="socketio";i.style.position="absolute";i.style.top="-1000px";i.style.left="-1000px";i.target=r;i.method="POST";i.setAttribute("accept-charset","utf-8");j.name="d";i.appendChild(j);
  document.body.appendChild(i);this.form=i;this.area=j}this.form.action=this.prepareUrl()+g;c();this.area.value=b.JSON.stringify(a);try{this.form.submit()}catch(m){}this.iframe.attachEvent?n.onreadystatechange=function(){"complete"==e.iframe.readyState&&d()}:this.iframe.onload=d;this.socket.setBuffer(!0)};a.prototype.get=function(){var a=this,c=document.createElement("script"),e=b.util.query(this.socket.options.query,"t="+ +new Date+"&i="+this.index);this.script&&(this.script.parentNode.removeChild(this.script),
  this.script=null);c.async=!0;c.src=this.prepareUrl()+e;c.onerror=function(){a.onClose()};e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(c,e);this.script=c;g&&setTimeout(function(){var a=document.createElement("iframe");document.body.appendChild(a);document.body.removeChild(a)},100)};a.prototype._=function(a){this.onData(a);this.open&&this.get();return this};a.prototype.ready=function(a,c){var e=this;if(!g)return c.call(this);b.util.load(function(){c.call(e)})};a.check=function(){return"document"in
  c};a.xdomainCheck=function(){return!0};b.transports.push("jsonp-polling")})("undefined"!=typeof io?io.Transport:module.exports,"undefined"!=typeof io?io:module.parent.exports,this);
  var Juggernaut=function(e){this.options=e||{};this.options.host=this.options.host||window.location.hostname;this.options.port=this.options.port||8080;this.handlers={};this.meta=this.options.meta;this.io=io.connect(this.options.host,this.options);this.io.on("connect",this.proxy(this.onconnect));this.io.on("message",this.proxy(this.onmessage));this.io.on("disconnect",this.proxy(this.ondisconnect));this.on("connect",this.proxy(this.writeMeta))};Juggernaut.fn=Juggernaut.prototype;
  Juggernaut.fn.proxy=function(e){var b=this;return function(){return e.apply(b,arguments)}};Juggernaut.fn.on=function(e,b){e&&b&&(this.handlers[e]||(this.handlers[e]=[]),this.handlers[e].push(b))};Juggernaut.fn.bind=Juggernaut.fn.on;Juggernaut.fn.unbind=function(e){this.handlers&&delete this.handlers[e]};Juggernaut.fn.write=function(e){"function"==typeof e.toJSON&&(e=e.toJSON());this.io.send(e)};
  Juggernaut.fn.subscribe=function(e,b){if(!e)throw"Must provide a channel";this.on(e+":data",b);var c=this.proxy(function(){var a=new Juggernaut.Message;a.type="subscribe";a.channel=e;this.write(a)});if(this.io.socket.connected)c();else this.on("connect",c)};Juggernaut.fn.unsubscribe=function(e){if(!e)throw"Must provide a channel";this.unbind(e+":data");var b=new Juggernaut.Message;b.type="unsubscribe";b.channel=e;this.write(b)};
  Juggernaut.fn.trigger=function(){for(var e=[],b=0;b<arguments.length;b++)e.push(arguments[b]);if(b=this.handlers[e.shift()])for(var c=0,a=b.length;c<a;c++)b[c].apply(this,e)};Juggernaut.fn.writeMeta=function(){if(this.meta){var e=new Juggernaut.Message;e.type="meta";e.data=this.meta;this.write(e)}};Juggernaut.fn.onconnect=function(){this.sessionID=this.io.socket.sessionid;this.trigger("connect")};Juggernaut.fn.ondisconnect=function(){this.trigger("disconnect")};
  Juggernaut.fn.onmessage=function(e){e=Juggernaut.Message.fromJSON(e);this.trigger("message",e);this.trigger("data",e.channel,e.data);this.trigger(e.channel+":data",e.data)};Juggernaut.Message=function(e){for(var b in e)this[b]=e[b]};Juggernaut.Message.fromJSON=function(e){return new this(JSON.parse(e))};Juggernaut.Message.prototype.toJSON=function(){var e={},b;for(b in this)"function"!=typeof this[b]&&(e[b]=this[b]);return JSON.stringify(e)};
  "undefined"!=typeof module?module.exports=Juggernaut:window.Juggernaut=Juggernaut;