Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

test fix

  • Loading branch information...
commit aaa0a4389ec34b3af7635ab09fd4c414a69cbfba 1 parent caa84cd
@contra contra authored
View
2  example/public/pulsar.js
@@ -3630,7 +3630,7 @@ require.alias("pulsar/dist/main.js", "pulsar/index.js");
if (typeof exports == "object") {
module.exports = require("pulsar");
} else if (typeof define == "function" && define.amd) {
- define(function(){ return require("pulsar"); });
+ define(require("pulsar"));
} else {
window["Pulsar"] = require("pulsar");
}})();
View
2  pulsar.js
@@ -3630,7 +3630,7 @@ require.alias("pulsar/dist/main.js", "pulsar/index.js");
if (typeof exports == "object") {
module.exports = require("pulsar");
} else if (typeof define == "function" && define.amd) {
- define(function(){ return require("pulsar"); });
+ define(require("pulsar"));
} else {
window["Pulsar"] = require("pulsar");
}})();
View
4 pulsar.min.js
@@ -1,2 +1,2 @@
-(function(){function t(e,n,r){var i=t.resolve(e);if(null==i){r=r||e,n=n||"root";var s=Error('Failed to require "'+r+'" from "'+n+'"');throw s.path=r,s.parent=n,s.require=!0,s}var o=t.modules[i];return o.exports||(o.exports={},o.client=o.component=!0,o.call(this,o.exports,t.relative(i),o)),o.exports}var e=Object.prototype.hasOwnProperty;t.modules={},t.aliases={},t.resolve=function(n){n.charAt(0)==="/"&&(n=n.slice(1));var r=n+"/index.js",i=[n,n+".js",n+".json",n+"/index.js",n+"/index.json"];for(var s=0;s<i.length;s++){var n=i[s];if(e.call(t.modules,n))return n}if(e.call(t.aliases,r))return t.aliases[r]},t.normalize=function(e,t){var n=[];if("."!=t.charAt(0))return t;e=e.split("/"),t=t.split("/");for(var r=0;r<t.length;++r)".."==t[r]?e.pop():"."!=t[r]&&""!=t[r]&&n.push(t[r]);return e.concat(n).join("/")},t.register=function(e,n){t.modules[e]=n},t.alias=function(n,r){if(!e.call(t.modules,n))throw Error('Failed to alias "'+n+'", it does not exist');t.aliases[r]=n},t.relative=function(n){function i(e,t){var n=e.length;while(n--)if(e[n]===t)return n;return-1}function s(e){var r=s.resolve(e);return t(r,n,e)}var r=t.normalize(n,"..");return s.resolve=function(e){var s=e.charAt(0);if("/"==s)return e.slice(1);if("."==s)return t.normalize(r,e);var o=n.split("/"),u=i(o,"deps")+1;return u||(u=0),e=o.slice(0,u+1).join("/")+"/deps/"+e,e},s.exists=function(n){return e.call(t.modules,s.resolve(n))},s},t.register("component-emitter/index.js",function(e,t,n){function r(e){if(e)return i(e)}function i(e){for(var t in r.prototype)e[t]=r.prototype[t];return e}n.exports=r,r.prototype.on=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks[e]=this._callbacks[e]||[]).push(t),this},r.prototype.once=function(e,t){function r(){n.off(e,r),t.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},t._off=r,this.on(e,r),this},r.prototype.off=r.prototype.removeListener=r.prototype.removeAllListeners=function(e,t){this._callbacks=this._callbacks||{};var n=this._callbacks[e];if(!n)return this;if(1==arguments.length)return delete this._callbacks[e],this;var r=n.indexOf(t._off||t);return~r&&n.splice(r,1),this},r.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks[e];if(n){n=n.slice(0);for(var r=0,i=n.length;r<i;++r)n[r].apply(this,t)}return this},r.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks[e]||[]},r.prototype.hasListeners=function(e){return!!this.listeners(e).length}}),t.register("LearnBoost-engine.io-protocol/lib/index.js",function(e,t,n){var r=t("./keys"),i=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},s=r(i),o={type:"error",data:"parser error"};e.encodePacket=function(e){var t=i[e.type];return undefined!==e.data&&(t+=e.data+""),""+t},e.decodePacket=function(e){var t=e.charAt(0);return Number(t)!=t||!s[t]?o:e.length>1?{type:s[t],data:e.substring(1)}:{type:s[t]}},e.encodePayload=function(t){if(!t.length)return"0:";var n="",r;for(var i=0,s=t.length;i<s;i++)r=e.encodePacket(t[i]),n+=r.length+":"+r;return n},e.decodePayload=function(t){if(t=="")return[o];var n=[],r="",i,s,u;for(var a=0,f=t.length;a<f;a++){var l=t.charAt(a);if(":"!=l)r+=l;else{if(""==r||r!=(i=Number(r)))return[o];s=t.substr(a+1,i);if(r!=s.length)return[o];if(s.length){u=e.decodePacket(s);if(o.type==u.type&&o.data==u.data)return[o];n.push(u)}a+=i,r=""}}return r!=""?[o]:n}}),t.register("LearnBoost-engine.io-protocol/lib/keys.js",function(e,t,n){n.exports=Object.keys||function(t){var n=[],r=Object.prototype.hasOwnProperty;for(var i in t)r.call(t,i)&&n.push(i);return n}}),t.register("visionmedia-debug/index.js",function(e,t,n){"undefined"==typeof window?n.exports=t("./lib/debug"):n.exports=t("./debug")}),t.register("visionmedia-debug/debug.js",function(e,t,n){function r(e){return r.enabled(e)?function(t){var n=new Date,i=n-(r[e]||n);r[e]=n,t=e+" "+t+" +"+r.humanize(i),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}n.exports=r,r.names=[],r.skips=[],r.enable=function(e){try{localStorage.debug=e}catch(t){}var n=(e||"").split(/[\s,]+/),i=n.length;for(var s=0;s<i;s++)e=n[s].replace("*",".*?"),e[0]==="-"?r.skips.push(RegExp("^"+e.substr(1)+"$")):r.names.push(RegExp("^"+e+"$"))},r.disable=function(){r.enable("")},r.humanize=function(e){var t=1e3,n=6e4,r=60*n;return e<r?e<n?e<t?e+"ms":(e/t|0)+"s":(e/n).toFixed(1)+"m":(e/r).toFixed(1)+"h"},r.enabled=function(e){for(var t=0,n=r.skips.length;t<n;t++)if(r.skips[t].test(e))return!1;for(var t=0,n=r.names.length;t<n;t++)if(r.names[t].test(e))return!0;return!1},window.localStorage&&r.enable(localStorage.debug)}),t.register("LearnBoost-engine.io-client/lib/index.js",function(e,t,n){n.exports=t("./socket"),n.exports.parser=t("engine.io-parser")}),t.register("LearnBoost-engine.io-client/lib/socket.js",function(e,t,n){function a(e,t){if(!(this instanceof a))return new a(e,t);t=t||{},"object"==typeof e&&(t=e,e=null),e&&(e=r.parseUri(e),t.host=e.host,t.secure=e.protocol=="https"||e.protocol=="wss",t.port=e.port),this.secure=null!=t.secure?t.secure:u.location&&"https:"==location.protocol;if(t.host){var n=t.host.split(":");t.hostname=n.shift(),n.length&&(t.port=n.pop())}this.hostname=t.hostname||(u.location?location.hostname:"localhost"),this.port=t.port||(u.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},this.upgrade=!1!==t.upgrade,this.path=(t.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!t.forceJSONP,this.timestampParam=t.timestampParam||"t",this.timestampRequests=!!t.timestampRequests,this.flashPath=t.flashPath||"",this.transports=t.transports||["polling","websocket","flashsocket"],this.readyState="",this.writeBuffer=[],this.policyPort=t.policyPort||843,this.open(),a.sockets.push(this),a.sockets.evs.emit("add",this)}function f(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}var r=t("./util"),i=t("./transports"),s=t("./emitter"),o=t("debug")("engine-client:socket");n.exports=a;var u=r.global();s(a.prototype),a.protocol=1,a.sockets=[],a.sockets.evs=new s,a.Socket=a,a.Transport=t("./transport"),a.Emitter=t("./emitter"),a.transports=t("./transports"),a.util=t("./util"),a.parser=t("engine.io-parser"),a.prototype.createTransport=function(e){o('creating transport "%s"',e);var t=f(this.query);t.transport=e,this.id&&(t.sid=this.id);var n=new i[e]({hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,flashPath:this.flashPath,policyPort:this.policyPort});return n},a.prototype.open=function(){this.readyState="opening";var e=this.createTransport(this.transports[0]);e.open(),this.setTransport(e)},a.prototype.setTransport=function(e){var t=this;this.transport&&(o("clearing existing transport"),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){t.flush()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})},a.prototype.probe=function(e){function i(i){if(n)return;n=!0;var s=Error("probe error: "+i);s.transport=t.name,t.close(),t=null,o('probe transport "%s" failed because of error: %s',e,i),r.emit("error",s)}o('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),n=!1,r=this;t.once("open",function(){if(n)return;o('probe transport "%s" opened',e),t.send([{type:"ping",data:"probe"}]),t.once("packet",function(s){if(n)return;if("pong"==s.type&&"probe"==s.data)o('probe transport "%s" pong',e),r.upgrading=!0,r.emit("upgrading",t),o('pausing current transport "%s"',r.transport.name),r.transport.pause(function(){if(n)return;if("closed"==r.readyState||"closing"==r.readyState)return;o("changing transport and sending upgrade packet"),t.removeListener("error",i),r.emit("upgrade",t),r.setTransport(t),t.send([{type:"upgrade"}]),t=null,r.upgrading=!1,r.flush()});else{o('probe transport "%s" failed',e);var u=Error("probe error");u.transport=t.name,r.emit("error",u)}})}),t.once("error",i),t.open(),this.once("close",function(){t&&(o("socket closed prematurely - aborting probe"),n=!0,t.close(),t=null)}),this.once("upgrading",function(e){t&&e.name!=t.name&&(o('"%s" works - aborting "%s"',e.name,t.name),t.close(),t=null)})},a.prototype.onOpen=function(){o("socket open"),this.readyState="open",this.emit("open"),this.onopen&&this.onopen.call(this),this.flush();if("open"==this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var e=0,t=this.upgrades.length;e<t;e++)this.probe(this.upgrades[e])}},a.prototype.onPacket=function(e){if("opening"==this.readyState||"open"==this.readyState){o('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat");switch(e.type){case"open":this.onHandshake(r.parseJSON(e.data));break;case"pong":this.ping();break;case"error":var t=Error("server error");t.code=e.data,this.emit("error",t);break;case"message":this.emit("data",e.data),this.emit("message",e.data);var n={data:e.data};n.toString=function(){return e.data},this.onmessage&&this.onmessage.call(this,n)}}else o('packet received with socket readyState "%s"',this.readyState)},a.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),this.ping(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat)},a.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){if("closed"==t.readyState)return;t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},a.prototype.ping=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){o("writing ping packet - expecting pong within %sms",e.pingTimeout),e.sendPacket("ping"),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},a.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(o("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.writeBuffer=[])},a.prototype.write=a.prototype.send=function(e){return this.sendPacket("message",e),this},a.prototype.sendPacket=function(e,t){var n={type:e,data:t};this.emit("packetCreate",n),this.writeBuffer.push(n),this.flush()},a.prototype.close=function(){if("opening"==this.readyState||"open"==this.readyState)this.onClose("forced close"),o("socket closing - telling transport to close"),this.transport.close(),this.transport.removeAllListeners();return this},a.prototype.onError=function(e){o("socket error %j",e),this.emit("error",e),this.onClose("transport error",e)},a.prototype.onClose=function(e,t){if("opening"==this.readyState||"open"==this.readyState)o('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.readyState="closed",this.emit("close",e,t),this.onclose&&this.onclose.call(this),this.id=null},a.prototype.filterUpgrades=function(e){var t=[];for(var n=0,r=e.length;n<r;n++)~this.transports.indexOf(e[n])&&t.push(e[n]);return t}}),t.register("LearnBoost-engine.io-client/lib/transport.js",function(e,t,n){function o(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState=""}var r=t("./util"),i=t("engine.io-parser"),s=t("./emitter");n.exports=o,s(o.prototype),o.prototype.onError=function(e,t){var n=Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},o.prototype.open=function(){if("closed"==this.readyState||""==this.readyState)this.readyState="opening",this.doOpen();return this},o.prototype.close=function(){if("opening"==this.readyState||"open"==this.readyState)this.doClose(),this.onClose();return this},o.prototype.send=function(e){if("open"!=this.readyState)throw Error("Transport not open");this.write(e)},o.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},o.prototype.onData=function(e){this.onPacket(i.decodePacket(e))},o.prototype.onPacket=function(e){this.emit("packet",e)},o.prototype.onClose=function(){this.readyState="closed",this.emit("close")}}),t.register("LearnBoost-engine.io-client/lib/emitter.js",function(e,t,n){var r;try{r=t("emitter")}catch(i){r=t("emitter-component")}n.exports=r,r.prototype.addEventListener=r.prototype.on,r.prototype.removeEventListener=r.prototype.off,r.prototype.removeListener=r.prototype.off,r.prototype.removeAllListeners=function(){this._callbacks={}}}),t.register("LearnBoost-engine.io-client/lib/util.js",function(e,t,n){var r=!1;e.global=function(){return"undefined"!=typeof window?window:global},e.inherits=function(t,n){function r(){}r.prototype=n.prototype,t.prototype=new r},e.keys=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},e.on=function(e,t,n,r){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,r)},e.load=function(t){var n=e.global();if(n.document&&document.readyState==="complete"||r)return t();e.on(n,"load",t,!1)},"undefined"!=typeof window&&e.load(function(){r=!0}),e.defer=function(t){if(!e.ua.webkit||"undefined"!=typeof importScripts)return t();e.load(function(){setTimeout(t,100)})};var i=/^[\],:{}\s]*$/,s=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,o=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,u=/(?:^|:|,)(?:\s*\[)+/g,a=/^\s+/,f=/\s+$/;e.parseJSON=function(t){var n=e.global();if("string"!=typeof t||!t)return null;t=t.replace(a,"").replace(f,"");if(n.JSON&&JSON.parse)return JSON.parse(t);if(i.test(t.replace(s,"@").replace(o,"]").replace(u,"")))return Function("return "+t)()},e.ua={},e.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(t){return!1}return e.withCredentials!=undefined}(),e.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),e.ua.gecko="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent),e.ua.android="undefined"!=typeof navigator&&/android/i.test(navigator.userAgent),e.ua.ios="undefined"!=typeof navigator&&/^(iPad|iPhone|iPod)$/.test(navigator.platform),e.ua.ios6=e.ua.ios&&/OS 6_/.test(navigator.userAgent),e.request=function(r){if("undefined"==typeof window){var i=t("xmlhttprequest").XMLHttpRequest;return new i}if(r&&"undefined"!=typeof XDomainRequest&&!e.ua.hasCORS)return new XDomainRequest;try{if("undefined"!=typeof XMLHttpRequest&&(!r||e.ua.hasCORS))return new XMLHttpRequest}catch(s){}if(!r)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(s){}};var l=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,c=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.parseUri=function(e){var t=l.exec(e||""),n={},r=14;while(r--)n[c[r]]=t[r]||"";return n},e.qs=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]));return t}}),t.register("LearnBoost-engine.io-client/lib/transports/index.js",function(e,t,n){function f(e){var t,n=!1,s=!1;if(a.location){var o="https:"==location.protocol,f=location.port;Number(f)!=f&&(f=o?443:80),n=e.host!=location.hostname||f!=e.port,s=e.secure!=o}return t=u.request(n),s&&a.XDomainRequest&&t instanceof a.XDomainRequest?new i(e):t&&!e.forceJSONP?new r(e):new i(e)}var r=t("./polling-xhr"),i=t("./polling-jsonp"),s=t("./websocket"),o=t("./flashsocket"),u=t("../util");e.polling=f,e.websocket=s,e.flashsocket=o;var a=u.global()}),t.register("LearnBoost-engine.io-client/lib/transports/polling.js",function(e,t,n){function a(e){r.call(this,e)}var r=t("../transport"),i=t("../util"),s=t("engine.io-parser"),o=t("debug")("engine.io-client:polling");n.exports=a;var u=i.global();i.inherits(a,r),a.prototype.name="polling",a.prototype.doOpen=function(){this.poll()},a.prototype.pause=function(e){function r(){o("paused"),n.readyState="paused",e()}var t=0,n=this;this.readyState="pausing";if(this.polling||!this.writable){var i=0;this.polling&&(o("we are currently polling - waiting to pause"),i++,this.once("pollComplete",function(){o("pre-pause polling complete"),--i||r()})),this.writable||(o("we are currently writing - waiting to pause"),i++,this.once("drain",function(){o("pre-pause writing complete"),--i||r()}))}else r()},a.prototype.poll=function(){o("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},a.prototype.onData=function(e){o("polling got data %s",e);var t=s.decodePayload(e);for(var n=0,r=t.length;n<r;n++){"opening"==this.readyState&&this.onOpen();if("close"==t[n].type){this.onClose();return}this.onPacket(t[n])}this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():o('ignoring poll - transport state "%s"',this.readyState)},a.prototype.doClose=function(){o("sending close packet"),this.send([{type:"close"}])},a.prototype.write=function(e){var t=this;this.writable=!1,this.doWrite(s.encodePayload(e),function(){t.writable=!0,t.emit("drain")})},a.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";if(u.ActiveXObject||i.ua.android||i.ua.ios6||this.timestampRequests)e[this.timestampParam]=+(new Date);return e=i.qs(e),this.port&&("https"==t&&this.port!=443||"http"==t&&this.port!=80)&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e}}),t.register("LearnBoost-engine.io-client/lib/transports/polling-xhr.js",function(e,t,n){function f(){}function l(e){r.call(this,e),u.location&&(this.xd=e.host!=u.location.hostname||u.location.port!=e.port)}function c(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.async=!1!==e.async,this.data=undefined!=e.data?e.data:null,this.create()}var r=t("./polling"),i=t("../util"),s=t("../emitter"),o=t("debug")("engine.io-client:polling-xhr");n.exports=l,n.exports.Request=c;var u=i.global(),a=u[["Active"].concat("Object").join("X")];i.inherits(l,r),l.prototype.doOpen=function(){var e=this;i.defer(function(){r.prototype.doOpen.call(e)})},l.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,new c(e)},l.prototype.doWrite=function(e,t){var n=this.request({method:"POST",data:e}),r=this;n.on("success",t),n.on("error",function(e){r.onError("xhr post error",e)}),this.sendXhr=n},l.prototype.doPoll=function(){o("xhr poll");var e=this.request(),t=this;e.on("data",function(e){t.onData(e)}),e.on("error",function(e){t.onError("xhr poll error",e)}),this.pollXhr=e},s(c.prototype),c.prototype.create=function(){var e=this.xhr=i.request(this.xd),t=this;e.open(this.method,this.uri,this.async);if("POST"==this.method)try{e.setRequestHeader?e.setRequestHeader("Content-type","text/plain;charset=UTF-8"):e.contentType="text/plain"}catch(n){}this.xd&&u.XDomainRequest&&e instanceof XDomainRequest?(e.onerror=function(e){t.onError(e)},e.onload=function(){t.onData(e.responseText)},e.onprogress=f):("withCredentials"in e&&(e.withCredentials=!0),e.onreadystatechange=function(){var n;try{if(4!=e.readyState)return;200==e.status||1223==e.status?n=e.responseText:t.onError(e.status)}catch(r){t.onError(r)}undefined!==n&&t.onData(n)}),o("sending xhr with url %s | data %s",this.uri,this.data),e.send(this.data),a&&(this.index=c.requestsCount++,c.requests[this.index]=this)},c.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},c.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},c.prototype.onError=function(e){this.emit("error",e),this.cleanup()},c.prototype.cleanup=function(){this.xhr.onreadystatechange=f,this.xhr.onload=this.xhr.onerror=f;try{this.xhr.abort()}catch(e){}a&&delete c.requests[this.index],this.xhr=null},c.prototype.abort=function(){this.cleanup()},a&&(c.requestsCount=0,c.requests={},u.attachEvent("onunload",function(){for(var e in c.requests)c.requests.hasOwnProperty(e)&&c.requests[e].abort()}))}),t.register("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js",function(e,t,n){function f(){}function l(e){r.call(this,e),u||(s.___eio||(s.___eio=[]),u=s.___eio),this.index=u.length;var t=this;u.push(function(e){t.onData(e)}),this.query.j=this.index}var r=t("./polling"),i=t("../util");n.exports=l;var s=i.global(),o=/\n/g,u,a=0;i.inherits(l,r),l.prototype.doOpen=function(){var e=this;i.defer(function(){r.prototype.doOpen.call(e)})},l.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null),r.prototype.doClose.call(this)},l.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n.parentNode.insertBefore(t,n),this.script=t,i.ua.gecko&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},l.prototype.doWrite=function(e,t){function a(){f(),t()}function f(){if(n.iframe)try{n.form.removeChild(n.iframe)}catch(e){n.onError("jsonp polling iframe removal error",e)}try{var t='<iframe src="javascript:0" name="'+n.iframeId+'">';u=document.createElement(t)}catch(e){u=document.createElement("iframe"),u.name=n.iframeId,u.src="javascript:0"}u.id=n.iframeId,n.form.appendChild(u),n.iframe=u}var n=this;if(!this.form){var r=document.createElement("form"),i=document.createElement("textarea"),s=this.iframeId="eio_iframe_"+this.index,u;r.className="socketio",r.style.position="absolute",r.style.top="-1000px",r.style.left="-1000px",r.target=s,r.method="POST",r.setAttribute("accept-charset","utf-8"),i.name="d",r.appendChild(i),document.body.appendChild(r),this.form=r,this.area=i}this.form.action=this.uri(),f(),this.area.value=e.replace(o,"\\n");try{this.form.submit()}catch(l){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){n.iframe.readyState=="complete"&&a()}:this.iframe.onload=a}}),t.register("LearnBoost-engine.io-client/lib/transports/websocket.js",function(e,t,n){function a(e){r.call(this,e)}function f(){return"undefined"==typeof window?t("ws"):u.WebSocket||u.MozWebSocket}var r=t("../transport"),i=t("engine.io-parser"),s=t("../util"),o=t("debug")("engine.io-client:websocket");n.exports=a;var u=s.global();s.inherits(a,r),a.prototype.name="websocket",a.prototype.doOpen=function(){if(!this.check())return;var e=this;this.socket=new(f())(this.uri()),this.socket.onopen=function(){e.onOpen()},this.socket.onclose=function(){e.onClose()},this.socket.onmessage=function(t){e.onData(t.data)},this.socket.onerror=function(t){e.onError("websocket error",t)}},a.prototype.write=function(e){for(var t=0,n=e.length;t<n;t++)this.socket.send(i.encodePacket(e[t]))},a.prototype.doClose=function(){typeof this.socket!="undefined"&&this.socket.close()},a.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"==t&&this.port!=443||"ws"==t&&this.port!=80)&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=+(new Date)),e=s.qs(e),e.length&&(e="?"+e),t+"://"+this.hostname+n+this.path+e},a.prototype.check=function(){var e=f();return!!e&&!("__initialize"in e&&this.name===a.prototype.name)}}),t.register("LearnBoost-engine.io-client/lib/transports/flashsocket.js",function(e,t,n){function a(e){r.call(this,e),this.flashPath=e.flashPath,this.policyPort=e.policyPort}function l(e,t){if(f[e])return t();var n=document.createElement("script"),r=!1;s('loading "%s"',e),n.onload=n.onreadystatechange=function(){if(r||f[e])return;var i=n.readyState;if(!i||"loaded"==i||"complete"==i)s('loaded "%s"',e),n.onload=n.onreadystatechange=null,r=!0,f[e]=!0,t()},n.async=1,n.src=e;var i=document.getElementsByTagName("head")[0];i.insertBefore(n,i.firstChild)}function c(e,t){function n(r){if(!e[r])return t();l(e[r],function(){n(++r)})}n(0)}var r=t("./websocket"),i=t("../util"),s=t("debug")("engine.io-client:flashsocket");n.exports=a;var o=i.global(),u=o[["Active"].concat("Object").join("X")];i.inherits(a,r),a.prototype.name="flashsocket",a.prototype.doOpen=function(){function e(e){return function(){var t=Array.prototype.join.call(arguments," ");s("[websocketjs %s] %s",e,t)}}if(!this.check())return;WEB_SOCKET_LOGGER={log:e("debug"),error:e("error")},WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR=!0,WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0,"undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=this.flashPath+"WebSocketMainInsecure.swf");var t=[this.flashPath+"web_socket.js"];"undefined"==typeof swfobject&&t.unshift(this.flashPath+"swfobject.js");var n=this;c(t,function(){n.ready(function(){WebSocket.__addTask(function(){r.prototype.doOpen.call(n)})})})},a.prototype.doClose=function(){if(!this.socket)return;var e=this;WebSocket.__addTask(function(){r.prototype.doClose.call(e)})},a.prototype.write=function(){var e=this,t=arguments;WebSocket.__addTask(function(){r.prototype.write.apply(e,t)})},a.prototype.ready=function(e){function t(){a.loaded||(843!=n.policyPort&&WebSocket.loadFlashPolicyFile("xmlsocket://"+n.host+":"+n.policyPort),WebSocket.__initialize(),a.loaded=!0),e.call(n)}if(!(typeof WebSocket!="undefined"&&"__initialize"in WebSocket)||!swfobject)return;if(swfobject.getFlashPlayerVersion().major<10)return;var n=this;if(document.body)return t();i.load(t)},a.prototype.check=function(){if("undefined"==typeof window)return!1;if(typeof WebSocket=="undefined"||"__initialize"in WebSocket){if(u){var e=null;try{e=new u("ShockwaveFlash.ShockwaveFlash")}catch(t){}if(e)return!0}else for(var n=0,r=navigator.plugins.length;n<r;n++)for(var i=0,s=navigator.plugins[n].length;i<s;i++)if(navigator.plugins[n][i].description=="Shockwave Flash")return!0;return!1}return!1};var f={}}),t.register("wearefractal-protosock/dist/main.js",function(e,t,n){(function(){var e,r,i,s,o,u;u=t("./util"),e=t("./Client"),i=t("./defaultClient"),o={createClientWrapper:function(e){return function(t){return o.createClient(e,t)}},createClient:function(t,n){var r;return r=u.mergePlugins(i,t),new e(r,n)}};if(typeof window=="undefined"||window===null)r=t("./Server"),s=t("./defaultServer"),t("http").globalAgent.maxSockets=999,o.createServer=function(e,t,n){var i;return i=u.mergePlugins(s,t),new r(e,i,n)},o.createServerWrapper=function(e){return function(t,n){return o.createServer(t,e,n)}};n.exports=o}).call(this)}),t.register("wearefractal-protosock/dist/Socket.js",function(e,t,n){(function(){var e;e={write:function(e){var t=this;return this.parent.outbound(this,e,function(e){return t.send(e)}),this},disconnect:function(e){return this.close(e),this}},n.exports=e}).call(this)}),t.register("wearefractal-protosock/dist/util.js",function(e,t,n){(function(){var e,r,i={}.hasOwnProperty,s=function(e,t){function r(){this.constructor=e}for(var n in t)i.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e},o=[].slice;e=t("./Socket"),r={extendSocket:function(t){return s(t.prototype,e)},mergePlugins:function(){var e,t,n,i,s,u,a;e=1>arguments.length?[]:o.call(arguments,0),n={};for(u=0,a=e.length;u<a;u++){i=e[u];for(t in i)s=i[t],typeof s=="object"&&t!=="server"?n[t]=r.mergePlugins(n[t],s):n[t]=s}return n}},n.exports=r}).call(this)}),t.register("wearefractal-protosock/dist/defaultClient.js",function(e,t,n){(function(){var e;e={options:{},start:function(){},inbound:function(e,t,n){var r;try{r=JSON.parse(t)}catch(i){this.error(e,i)}n(r)},outbound:function(e,t,n){var r;try{r=JSON.stringify(t)}catch(i){this.error(e,i)}n(r)},validate:function(e,t,n){return n(!0)},invalid:function(){},connect:function(){},message:function(){},error:function(){},close:function(){}},typeof window!="undefined"&&window!==null&&(e.options={host:window.location.hostname,port:window.location.port.length>0?parseInt(window.location.port):80,secure:window.location.protocol==="https:"},e.options.secure&&(e.options.port=443)),n.exports=e}).call(this)}),t.register("wearefractal-protosock/dist/Client.js",function(e,t,n){(function(){var e,r,i,s,o,u=function(e,t){return function(){return e.apply(t,arguments)}},a={}.hasOwnProperty,f=function(e,t){function r(){this.constructor=e}for(var n in t)a.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};o=t("./util"),typeof window!="undefined"&&window!==null?(i=t("engine.io"),r=t("emitter")):(i=t("engine.io-client"),r=t("events").EventEmitter),o.extendSocket(i.Socket),s=function(e){return e>10?15e3:e>5?5e3:e>3?1e3:1e3},e=function(e){function t(e,t){var n,r,s,o,a,f,l,c,h;t==null&&(t={}),this.reconnect=u(this.reconnect,this),this.handleClose=u(this.handleClose,this),this.handleError=u(this.handleError,this),this.handleMessage=u(this.handleMessage,this),this.handleConnection=u(this.handleConnection,this);for(r in e)s=e[r],this[r]=s;for(r in t)s=t[r],this.options[r]=s;(l=(o=this.options).reconnect)==null&&(o.reconnect=!0),(c=(a=this.options).reconnectLimit)==null&&(a.reconnectLimit=Infinity),(h=(f=this.options).reconnectTimeout)==null&&(f.reconnectTimeout=Infinity),this.isServer=!1,this.isClient=!0,this.isBrowser=typeof window!="undefined"&&window!==null,n={host:this.options.host,port:this.options.port,secure:this.options.secure,path:"/"+this.options.namespace,resource:this.options.resource,transports:this.options.transports,upgrade:this.options.upgrade,flashPath:this.options.flashPath,policyPort:this.options.policyPort,forceJSONP:this.options.forceJSONP,forceBust:this.options.forceBust,debug:this.options.debug},this.ssocket=new i(n),this.ssocket.parent=this,this.ssocket.once("open",this.handleConnection),this.ssocket.on("error",this.handleError),this.ssocket.on("message",this.handleMessage),this.ssocket.on("close",this.handleClose),this.start();return}return f(t,e),t.prototype.disconnect=function(){return this.ssocket.disconnect(),this},t.prototype.destroy=function(){return this.options.reconnect=!1,this.ssocket.disconnect(),this.emit("destroyed"),this},t.prototype.handleConnection=function(){return this.emit("connected"),this.connect(this.ssocket)},t.prototype.handleMessage=function(e){var t=this;return this.emit("inbound",this.ssocket,e),this.inbound(this.ssocket,e,function(e){return t.validate(t.ssocket,e,function(n){return n?(t.emit("message",t.ssocket,e),t.message(t.ssocket,e)):(t.emit("invalid",t.ssocket,e),t.invalid(t.ssocket,e))})})},t.prototype.handleError=function(e){return typeof e=="string"&&(e=Error(e)),this.error(this.ssocket,e)},t.prototype.handleClose=function(e){var t=this;if(this.ssocket.reconnecting)return;return this.options.reconnect?this.reconnect(function(n){if(n==null)return;return t.emit("close",t.ssocket,e),t.close(t.ssocket,e)}):(this.emit("close",this.ssocket,e),this.close(this.ssocket,e))},t.prototype.reconnect=function(e){var t,n,r,i,o,u,a,f=this;return this.ssocket.reconnecting?e("Already reconnecting"):(this.ssocket.reconnecting=!0,this.ssocket.readyState==="open"&&this.ssocket.disconnect(),u=Date.now(),o=this.options.reconnectLimit,a=this.options.reconnectTimeout,t=0,r=function(){return f.ssocket.reconnecting=!1,f.emit("reconnected"),e()},i=function(t){return f.ssocket.reconnecting=!1,e(t)},this.ssocket.once("open",r),n=function(){if(!f.ssocket.reconnecting)return;return t<o?Date.now()-u>a?i("Timeout on reconnect"):(t++,f.ssocket.open(),setTimeout(n,s(t))):i("Exceeded max attempts")},setTimeout(n,s(t)))},t}(r),n.exports=e}).call(this)}),t.register("pulsar/dist/main.js",function(e,t,n){(function(){var e,r,i;e=t("protosock"),r=t("./Client"),n.exports={createClient:e.createClientWrapper(r)};if(typeof window=="undefined"||window===null)i=t("./Server"),n.exports.createServer=e.createServerWrapper(i)}).call(this)}),t.register("pulsar/dist/Client.js",function(e,t,n){(function(){var e,r,i=[].slice;e=t("./Channel"),r={options:{namespace:"Pulsar",resource:"default"},start:function(){var e=this;return this.channels={},this.on("reconnected",function(){var t,n,r,i;r=e.channels,i=[];for(n in r)t=r[n],i.push(t.joinChannel());return i})},channel:function(t){var n,r;return(r=(n=this.channels)[t])!=null?r:n[t]=new e(t,this.ssocket)},validate:function(e,t,n){if(typeof t!="object")return n(!1);if(typeof t.type!="string")return n(!1);switch(t.type){case"emit":if(typeof t.channel!="string")return n(!1);if(!typeof (this.channels[t.channel]!=null))return n(!1);if(typeof t.event!="string")return n(!1);if(!Array.isArray(t.args))return n(!1);break;
-case"joined":if(typeof t.channel!="string")return n(!1);if(!typeof (this.channels[t.channel]!=null))return n(!1);break;default:return n(!1)}return n(!0)},error:function(e,t){return this.emit("error",t,e)},message:function(e,t){var n;n=this.channels[t.channel];switch(t.type){case"emit":return n.realEmit.apply(n,[t.event].concat(i.call(t.args)));case"joined":return n.joined=!0,n.realEmit("join")}}},n.exports=r}).call(this)}),t.register("pulsar/dist/Channel.js",function(e,t,n){(function(){var e,t=function(e,t){return function(){return e.apply(t,arguments)}},r=[].slice;e=function(){function e(e,n){this.name=e,this.socket=n,this.runStack=t(this.runStack,this),this.use=t(this.use,this),this.ready=t(this.ready,this),this.removeAllListeners=t(this.removeAllListeners,this),this.removeListener=t(this.removeListener,this),this.once=t(this.once,this),this.addListener=t(this.addListener,this),this.emit=t(this.emit,this),this.realEmit=t(this.realEmit,this),this.events={},this.stack=[],this.joinChannel()}return e.prototype.joinChannel=function(){var e=this;return this.socket?(this.socket.write({type:"join",channel:this.name}),this.socket.once("close",function(){return e.joined=!1})):(this.joined=!0,this.listeners=[])},e.prototype.realEmit=function(){var e,t,n=this;return t=arguments[0],e=2>arguments.length?[]:r.call(arguments,1),this.runStack(t,e,function(e){var r,i,s,o;if(!n.events[t])return!1;o=n.events[t];for(i=0,s=o.length;i<s;i++)r=o[i],r.apply(null,e);return!0})},e.prototype.emit=function(){var e,t,n,i,s,o,u;t=arguments[0],e=2>arguments.length?[]:r.call(arguments,1),n={type:"emit",channel:this.name,event:t,args:e};if(this.listeners){u=this.listeners;for(s=0,o=u.length;s<o;s++)i=u[s],i.write(n);return!0}return this.socket?(this.socket.write(n),!0):!1},e.prototype.addListener=function(e,t){var n,r;return this.realEmit("newListener",e,t),((r=(n=this.events)[e])!=null?r:n[e]=[]).push(t),this},e.prototype.on=e.prototype.addListener,e.prototype.once=function(e,t){var n,r=this;return n=function(){return r.removeListener(e,n),t.apply(null,arguments)},this.on(e,n),this},e.prototype.removeSocketListener=function(e){var t;return this.listeners?(this.listeners=function(){var n,r,i,s;i=this.listeners,s=[];for(n=0,r=i.length;n<r;n++)t=i[n],t!==e&&s.push(t);return s}.call(this),this.emit("unjoin",e),this.realEmit("unjoin",e),this):this},e.prototype.removeListener=function(e,t){var n;return this.events[e]?(this.events[e]=function(){var r,i,s,o;s=this.events[e],o=[];for(r=0,i=s.length;r<i;r++)n=s[r],n!==t&&o.push(n);return o}.call(this),this):this},e.prototype.removeAllListeners=function(e){return delete this.events[e],this},e.prototype.ready=function(e){var t=this;return this.joined?e(this):this.once("join",function(){return e(t)})},e.prototype.use=function(e){return this.stack.push(e),this},e.prototype.runStack=function(e,t,n){var i,s,o=this;if(this.stack.length===0)return n(t);if(e==="newListener")return n(t);s=-1,i=function(){var u,a;return u=1>arguments.length?[]:r.call(arguments,0),u.length!==0&&(t=u),a=o.stack[++s],a==null?n(t):a.apply(null,[i,e].concat(r.call(t)))},i.apply(null,t)},e}(),n.exports=e}).call(this)}),t.alias("wearefractal-protosock/dist/main.js","pulsar/deps/protosock/dist/main.js"),t.alias("wearefractal-protosock/dist/Socket.js","pulsar/deps/protosock/dist/Socket.js"),t.alias("wearefractal-protosock/dist/util.js","pulsar/deps/protosock/dist/util.js"),t.alias("wearefractal-protosock/dist/defaultClient.js","pulsar/deps/protosock/dist/defaultClient.js"),t.alias("wearefractal-protosock/dist/Client.js","pulsar/deps/protosock/dist/Client.js"),t.alias("wearefractal-protosock/dist/main.js","pulsar/deps/protosock/index.js"),t.alias("component-emitter/index.js","wearefractal-protosock/deps/emitter/index.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/lib/index.js"),t.alias("LearnBoost-engine.io-client/lib/socket.js","wearefractal-protosock/deps/engine.io/lib/socket.js"),t.alias("LearnBoost-engine.io-client/lib/transport.js","wearefractal-protosock/deps/engine.io/lib/transport.js"),t.alias("LearnBoost-engine.io-client/lib/emitter.js","wearefractal-protosock/deps/engine.io/lib/emitter.js"),t.alias("LearnBoost-engine.io-client/lib/util.js","wearefractal-protosock/deps/engine.io/lib/util.js"),t.alias("LearnBoost-engine.io-client/lib/transports/index.js","wearefractal-protosock/deps/engine.io/lib/transports/index.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling.js","wearefractal-protosock/deps/engine.io/lib/transports/polling.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-xhr.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-xhr.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-jsonp.js"),t.alias("LearnBoost-engine.io-client/lib/transports/websocket.js","wearefractal-protosock/deps/engine.io/lib/transports/websocket.js"),t.alias("LearnBoost-engine.io-client/lib/transports/flashsocket.js","wearefractal-protosock/deps/engine.io/lib/transports/flashsocket.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/index.js"),t.alias("component-emitter/index.js","LearnBoost-engine.io-client/deps/emitter/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/keys.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/keys.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-protocol/index.js"),t.alias("visionmedia-debug/index.js","LearnBoost-engine.io-client/deps/debug/index.js"),t.alias("visionmedia-debug/debug.js","LearnBoost-engine.io-client/deps/debug/debug.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","LearnBoost-engine.io-client/index.js"),t.alias("wearefractal-protosock/dist/main.js","wearefractal-protosock/index.js"),t.alias("pulsar/dist/main.js","pulsar/index.js"),typeof exports=="object"?module.exports=t("pulsar"):typeof define=="function"&&define.amd?define(function(){return t("pulsar")}):window.Pulsar=t("pulsar")})();
+(function(){function t(e,o,n){var r=t.resolve(e);if(null==r){n=n||e,o=o||"root";var i=Error('Failed to require "'+n+'" from "'+o+'"');throw i.path=n,i.parent=o,i.require=!0,i}var s=t.modules[r];return s.exports||(s.exports={},s.client=s.component=!0,s.call(this,s.exports,t.relative(r),s)),s.exports}var e=Object.prototype.hasOwnProperty;t.modules={},t.aliases={},t.resolve=function(o){"/"===o.charAt(0)&&(o=o.slice(1));for(var n=o+"/index.js",r=[o,o+".js",o+".json",o+"/index.js",o+"/index.json"],i=0;r.length>i;i++){var o=r[i];if(e.call(t.modules,o))return o}return e.call(t.aliases,n)?t.aliases[n]:void 0},t.normalize=function(t,e){var o=[];if("."!=e.charAt(0))return e;t=t.split("/"),e=e.split("/");for(var n=0;e.length>n;++n)".."==e[n]?t.pop():"."!=e[n]&&""!=e[n]&&o.push(e[n]);return t.concat(o).join("/")},t.register=function(e,o){t.modules[e]=o},t.alias=function(o,n){if(!e.call(t.modules,o))throw Error('Failed to alias "'+o+'", it does not exist');t.aliases[n]=o},t.relative=function(o){function n(t,e){for(var o=t.length;o--;)if(t[o]===e)return o;return-1}function r(e){var n=r.resolve(e);return t(n,o,e)}var i=t.normalize(o,"..");return r.resolve=function(e){var r=e.charAt(0);if("/"==r)return e.slice(1);if("."==r)return t.normalize(i,e);var s=o.split("/"),a=n(s,"deps")+1;return a||(a=0),e=s.slice(0,a+1).join("/")+"/deps/"+e},r.exists=function(o){return e.call(t.modules,r.resolve(o))},r},t.register("component-emitter/index.js",function(t,e,o){function n(t){return t?r(t):void 0}function r(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}o.exports=n,n.prototype.on=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks[t]=this._callbacks[t]||[]).push(e),this},n.prototype.once=function(t,e){function o(){n.off(t,o),e.apply(this,arguments)}var n=this;return this._callbacks=this._callbacks||{},e._off=o,this.on(t,o),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=function(t,e){this._callbacks=this._callbacks||{};var o=this._callbacks[t];if(!o)return this;if(1==arguments.length)return delete this._callbacks[t],this;var n=o.indexOf(e._off||e);return~n&&o.splice(n,1),this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};var e=[].slice.call(arguments,1),o=this._callbacks[t];if(o){o=o.slice(0);for(var n=0,r=o.length;r>n;++n)o[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks[t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}}),t.register("LearnBoost-engine.io-protocol/lib/index.js",function(t,e){var o=e("./keys"),n=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},r=o(n),i={type:"error",data:"parser error"};t.encodePacket=function(t){var e=n[t.type];return void 0!==t.data&&(e+=t.data+""),""+e},t.decodePacket=function(t){var e=t.charAt(0);return Number(e)==e&&r[e]?t.length>1?{type:r[e],data:t.substring(1)}:{type:r[e]}:i},t.encodePayload=function(e){if(!e.length)return"0:";for(var o,n="",r=0,i=e.length;i>r;r++)o=t.encodePacket(e[r]),n+=o.length+":"+o;return n},t.decodePayload=function(e){if(""==e)return[i];for(var o,n,r,s=[],a="",c=0,p=e.length;p>c;c++){var l=e.charAt(c);if(":"!=l)a+=l;else{if(""==a||a!=(o=Number(a)))return[i];if(n=e.substr(c+1,o),a!=n.length)return[i];if(n.length){if(r=t.decodePacket(n),i.type==r.type&&i.data==r.data)return[i];s.push(r)}c+=o,a=""}}return""!=a?[i]:s}}),t.register("LearnBoost-engine.io-protocol/lib/keys.js",function(t,e,o){o.exports=Object.keys||function(t){var e=[],o=Object.prototype.hasOwnProperty;for(var n in t)o.call(t,n)&&e.push(n);return e}}),t.register("visionmedia-debug/index.js",function(t,e,o){o.exports="undefined"==typeof window?e("./lib/debug"):e("./debug")}),t.register("visionmedia-debug/debug.js",function(t,e,o){function n(t){return n.enabled(t)?function(e){var o=new Date,r=o-(n[t]||o);n[t]=o,e=t+" "+e+" +"+n.humanize(r),window.console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}:function(){}}o.exports=n,n.names=[],n.skips=[],n.enable=function(t){try{localStorage.debug=t}catch(e){}for(var o=(t||"").split(/[\s,]+/),r=o.length,i=0;r>i;i++)t=o[i].replace("*",".*?"),"-"===t[0]?n.skips.push(RegExp("^"+t.substr(1)+"$")):n.names.push(RegExp("^"+t+"$"))},n.disable=function(){n.enable("")},n.humanize=function(t){var e=1e3,o=6e4,n=60*o;return t>=n?(t/n).toFixed(1)+"h":t>=o?(t/o).toFixed(1)+"m":t>=e?(0|t/e)+"s":t+"ms"},n.enabled=function(t){for(var e=0,o=n.skips.length;o>e;e++)if(n.skips[e].test(t))return!1;for(var e=0,o=n.names.length;o>e;e++)if(n.names[e].test(t))return!0;return!1},window.localStorage&&n.enable(localStorage.debug)}),t.register("LearnBoost-engine.io-client/lib/index.js",function(t,e,o){o.exports=e("./socket"),o.exports.parser=e("engine.io-parser")}),t.register("LearnBoost-engine.io-client/lib/socket.js",function(t,e,o){function n(t,e){if(!(this instanceof n))return new n(t,e);if(e=e||{},"object"==typeof t&&(e=t,t=null),t&&(t=i.parseUri(t),e.host=t.host,e.secure="https"==t.protocol||"wss"==t.protocol,e.port=t.port),this.secure=null!=e.secure?e.secure:p.location&&"https:"==location.protocol,e.host){var o=e.host.split(":");e.hostname=o.shift(),o.length&&(e.port=o.pop())}this.hostname=e.hostname||(p.location?location.hostname:"localhost"),this.port=e.port||(p.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},this.upgrade=!1!==e.upgrade,this.path=(e.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!e.forceJSONP,this.timestampParam=e.timestampParam||"t",this.timestampRequests=!!e.timestampRequests,this.flashPath=e.flashPath||"",this.transports=e.transports||["polling","websocket","flashsocket"],this.readyState="",this.writeBuffer=[],this.policyPort=e.policyPort||843,this.open(),n.sockets.push(this),n.sockets.evs.emit("add",this)}function r(t){var e={};for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}var i=e("./util"),s=e("./transports"),a=e("./emitter"),c=e("debug")("engine-client:socket");o.exports=n;var p=i.global();a(n.prototype),n.protocol=1,n.sockets=[],n.sockets.evs=new a,n.Socket=n,n.Transport=e("./transport"),n.Emitter=e("./emitter"),n.transports=e("./transports"),n.util=e("./util"),n.parser=e("engine.io-parser"),n.prototype.createTransport=function(t){c('creating transport "%s"',t);var e=r(this.query);e.transport=t,this.id&&(e.sid=this.id);var o=new s[t]({hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:e,forceJSONP:this.forceJSONP,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,flashPath:this.flashPath,policyPort:this.policyPort});return o},n.prototype.open=function(){this.readyState="opening";var t=this.createTransport(this.transports[0]);t.open(),this.setTransport(t)},n.prototype.setTransport=function(t){var e=this;this.transport&&(c("clearing existing transport"),this.transport.removeAllListeners()),this.transport=t,t.on("drain",function(){e.flush()}).on("packet",function(t){e.onPacket(t)}).on("error",function(t){e.onError(t)}).on("close",function(){e.onClose("transport close")})},n.prototype.probe=function(t){function e(e){if(!n){n=!0;var i=Error("probe error: "+e);i.transport=o.name,o.close(),o=null,c('probe transport "%s" failed because of error: %s',t,e),r.emit("error",i)}}c('probing transport "%s"',t);var o=this.createTransport(t,{probe:1}),n=!1,r=this;o.once("open",function(){n||(c('probe transport "%s" opened',t),o.send([{type:"ping",data:"probe"}]),o.once("packet",function(i){if(!n)if("pong"==i.type&&"probe"==i.data)c('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",o),c('pausing current transport "%s"',r.transport.name),r.transport.pause(function(){n||"closed"!=r.readyState&&"closing"!=r.readyState&&(c("changing transport and sending upgrade packet"),o.removeListener("error",e),r.emit("upgrade",o),r.setTransport(o),o.send([{type:"upgrade"}]),o=null,r.upgrading=!1,r.flush())});else{c('probe transport "%s" failed',t);var s=Error("probe error");s.transport=o.name,r.emit("error",s)}}))}),o.once("error",e),o.open(),this.once("close",function(){o&&(c("socket closed prematurely - aborting probe"),n=!0,o.close(),o=null)}),this.once("upgrading",function(t){o&&t.name!=o.name&&(c('"%s" works - aborting "%s"',t.name,o.name),o.close(),o=null)})},n.prototype.onOpen=function(){if(c("socket open"),this.readyState="open",this.emit("open"),this.onopen&&this.onopen.call(this),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){c("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},n.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(c('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(i.parseJSON(t.data));break;case"pong":this.ping();break;case"error":var e=Error("server error");e.code=t.data,this.emit("error",e);break;case"message":this.emit("data",t.data),this.emit("message",t.data);var o={data:t.data};o.toString=function(){return t.data},this.onmessage&&this.onmessage.call(this,o)}else c('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=this.filterUpgrades(t.upgrades),this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),this.ping(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat)},n.prototype.onHeartbeat=function(t){clearTimeout(this.pingTimeoutTimer);var e=this;e.pingTimeoutTimer=setTimeout(function(){"closed"!=e.readyState&&e.onClose("ping timeout")},t||e.pingInterval+e.pingTimeout)},n.prototype.ping=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){c("writing ping packet - expecting pong within %sms",t.pingTimeout),t.sendPacket("ping"),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},n.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(c("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.writeBuffer=[])},n.prototype.write=n.prototype.send=function(t){return this.sendPacket("message",t),this},n.prototype.sendPacket=function(t,e){var o={type:t,data:e};this.emit("packetCreate",o),this.writeBuffer.push(o),this.flush()},n.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.onClose("forced close"),c("socket closing - telling transport to close"),this.transport.close(),this.transport.removeAllListeners()),this},n.prototype.onError=function(t){c("socket error %j",t),this.emit("error",t),this.onClose("transport error",t)},n.prototype.onClose=function(t,e){("opening"==this.readyState||"open"==this.readyState)&&(c('socket close with reason: "%s"',t),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.readyState="closed",this.emit("close",t,e),this.onclose&&this.onclose.call(this),this.id=null)},n.prototype.filterUpgrades=function(t){for(var e=[],o=0,n=t.length;n>o;o++)~this.transports.indexOf(t[o])&&e.push(t[o]);return e}}),t.register("LearnBoost-engine.io-client/lib/transport.js",function(t,e,o){function n(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState=""}var r=(e("./util"),e("engine.io-parser")),i=e("./emitter");o.exports=n,i(n.prototype),n.prototype.onError=function(t,e){var o=Error(t);return o.type="TransportError",o.description=e,this.emit("error",o),this},n.prototype.open=function(){return("closed"==this.readyState||""==this.readyState)&&(this.readyState="opening",this.doOpen()),this},n.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.doClose(),this.onClose()),this},n.prototype.send=function(t){if("open"!=this.readyState)throw Error("Transport not open");this.write(t)},n.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},n.prototype.onData=function(t){this.onPacket(r.decodePacket(t))},n.prototype.onPacket=function(t){this.emit("packet",t)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}}),t.register("LearnBoost-engine.io-client/lib/emitter.js",function(t,e,o){var n;try{n=e("emitter")}catch(r){n=e("emitter-component")}o.exports=n,n.prototype.addEventListener=n.prototype.on,n.prototype.removeEventListener=n.prototype.off,n.prototype.removeListener=n.prototype.off,n.prototype.removeAllListeners=function(){this._callbacks={}}}),t.register("LearnBoost-engine.io-client/lib/util.js",function(t,e){var o=!1;t.global=function(){return"undefined"!=typeof window?window:global},t.inherits=function(t,e){function o(){}o.prototype=e.prototype,t.prototype=new o},t.keys=Object.keys||function(t){var e=[],o=Object.prototype.hasOwnProperty;for(var n in t)o.call(t,n)&&e.push(n);return e},t.on=function(t,e,o,n){t.attachEvent?t.attachEvent("on"+e,o):t.addEventListener&&t.addEventListener(e,o,n)},t.load=function(e){var n=t.global();return n.document&&"complete"===document.readyState||o?e():(t.on(n,"load",e,!1),void 0)},"undefined"!=typeof window&&t.load(function(){o=!0}),t.defer=function(e){return t.ua.webkit&&"undefined"==typeof importScripts?(t.load(function(){setTimeout(e,100)}),void 0):e()};var n=/^[\],:{}\s]*$/,r=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,i=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,s=/(?:^|:|,)(?:\s*\[)+/g,a=/^\s+/,c=/\s+$/;t.parseJSON=function(e){var o=t.global();return"string"==typeof e&&e?(e=e.replace(a,"").replace(c,""),o.JSON&&JSON.parse?JSON.parse(e):n.test(e.replace(r,"@").replace(i,"]").replace(s,""))?Function("return "+e)():void 0):null},t.ua={},t.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var t=new XMLHttpRequest}catch(e){return!1}return void 0!=t.withCredentials}(),t.ua.webkit="undefined"!=typeof navigator&&/webkit/i.test(navigator.userAgent),t.ua.gecko="undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent),t.ua.android="undefined"!=typeof navigator&&/android/i.test(navigator.userAgent),t.ua.ios="undefined"!=typeof navigator&&/^(iPad|iPhone|iPod)$/.test(navigator.platform),t.ua.ios6=t.ua.ios&&/OS 6_/.test(navigator.userAgent),t.request=function(o){if("undefined"==typeof window){var n=e("xmlhttprequest").XMLHttpRequest;return new n}if(o&&"undefined"!=typeof XDomainRequest&&!t.ua.hasCORS)return new XDomainRequest;try{if("undefined"!=typeof XMLHttpRequest&&(!o||t.ua.hasCORS))return new XMLHttpRequest}catch(r){}if(!o)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(r){}};var p=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,l=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parseUri=function(t){for(var e=p.exec(t||""),o={},n=14;n--;)o[l[n]]=e[n]||"";return o},t.qs=function(t){var e="";for(var o in t)t.hasOwnProperty(o)&&(e.length&&(e+="&"),e+=o+"="+encodeURIComponent(t[o]));return e}}),t.register("LearnBoost-engine.io-client/lib/transports/index.js",function(t,e){function o(t){var e,o=!1,i=!1;if(c.location){var s="https:"==location.protocol,p=location.port;Number(p)!=p&&(p=s?443:80),o=t.host!=location.hostname||p!=t.port,i=t.secure!=s}return e=a.request(o),i&&c.XDomainRequest&&e instanceof c.XDomainRequest?new r(t):e&&!t.forceJSONP?new n(t):new r(t)}var n=e("./polling-xhr"),r=e("./polling-jsonp"),i=e("./websocket"),s=e("./flashsocket"),a=e("../util");t.polling=o,t.websocket=i,t.flashsocket=s;var c=a.global()}),t.register("LearnBoost-engine.io-client/lib/transports/polling.js",function(t,e,o){function n(t){r.call(this,t)}var r=e("../transport"),i=e("../util"),s=e("engine.io-parser"),a=e("debug")("engine.io-client:polling");o.exports=n;var c=i.global();i.inherits(n,r),n.prototype.name="polling",n.prototype.doOpen=function(){this.poll()},n.prototype.pause=function(t){function e(){a("paused"),o.readyState="paused",t()}var o=this;if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(a("we are currently polling - waiting to pause"),n++,this.once("pollComplete",function(){a("pre-pause polling complete"),--n||e()})),this.writable||(a("we are currently writing - waiting to pause"),n++,this.once("drain",function(){a("pre-pause writing complete"),--n||e()}))}else e()},n.prototype.poll=function(){a("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},n.prototype.onData=function(t){a("polling got data %s",t);for(var e=s.decodePayload(t),o=0,n=e.length;n>o;o++){if("opening"==this.readyState&&this.onOpen(),"close"==e[o].type)return this.onClose(),void 0;this.onPacket(e[o])}this.polling=!1,this.emit("pollComplete"),"open"==this.readyState?this.poll():a('ignoring poll - transport state "%s"',this.readyState)},n.prototype.doClose=function(){a("sending close packet"),this.send([{type:"close"}])},n.prototype.write=function(t){var e=this;this.writable=!1,this.doWrite(s.encodePayload(t),function(){e.writable=!0,e.emit("drain")})},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",o="";return(c.ActiveXObject||i.ua.android||i.ua.ios6||this.timestampRequests)&&(t[this.timestampParam]=+new Date),t=i.qs(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(o=":"+this.port),t.length&&(t="?"+t),e+"://"+this.hostname+o+this.path+t}}),t.register("LearnBoost-engine.io-client/lib/transports/polling-xhr.js",function(t,e,o){function n(){}function r(t){s.call(this,t),l.location&&(this.xd=t.host!=l.location.hostname||l.location.port!=t.port)}function i(t){this.method=t.method||"GET",this.uri=t.uri,this.xd=!!t.xd,this.async=!1!==t.async,this.data=void 0!=t.data?t.data:null,this.create()}var s=e("./polling"),a=e("../util"),c=e("../emitter"),p=e("debug")("engine.io-client:polling-xhr");o.exports=r,o.exports.Request=i;var l=a.global(),u=l[["Active"].concat("Object").join("X")];a.inherits(r,s),r.prototype.doOpen=function(){var t=this;a.defer(function(){s.prototype.doOpen.call(t)})},r.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,new i(t)},r.prototype.doWrite=function(t,e){var o=this.request({method:"POST",data:t}),n=this;o.on("success",e),o.on("error",function(t){n.onError("xhr post error",t)}),this.sendXhr=o},r.prototype.doPoll=function(){p("xhr poll");var t=this.request(),e=this;t.on("data",function(t){e.onData(t)}),t.on("error",function(t){e.onError("xhr poll error",t)}),this.pollXhr=t},c(i.prototype),i.prototype.create=function(){var t=this.xhr=a.request(this.xd),e=this;if(t.open(this.method,this.uri,this.async),"POST"==this.method)try{t.setRequestHeader?t.setRequestHeader("Content-type","text/plain;charset=UTF-8"):t.contentType="text/plain"}catch(o){}this.xd&&l.XDomainRequest&&t instanceof XDomainRequest?(t.onerror=function(t){e.onError(t)},t.onload=function(){e.onData(t.responseText)},t.onprogress=n):("withCredentials"in t&&(t.withCredentials=!0),t.onreadystatechange=function(){var o;try{if(4!=t.readyState)return;200==t.status||1223==t.status?o=t.responseText:e.onError(t.status)}catch(n){e.onError(n)}void 0!==o&&e.onData(o)}),p("sending xhr with url %s | data %s",this.uri,this.data),t.send(this.data),u&&(this.index=i.requestsCount++,i.requests[this.index]=this)},i.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},i.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},i.prototype.onError=function(t){this.emit("error",t),this.cleanup()},i.prototype.cleanup=function(){this.xhr.onreadystatechange=n,this.xhr.onload=this.xhr.onerror=n;try{this.xhr.abort()}catch(t){}u&&delete i.requests[this.index],this.xhr=null},i.prototype.abort=function(){this.cleanup()},u&&(i.requestsCount=0,i.requests={},l.attachEvent("onunload",function(){for(var t in i.requests)i.requests.hasOwnProperty(t)&&i.requests[t].abort()}))}),t.register("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js",function(t,e,o){function n(t){r.call(this,t),s||(a.___eio||(a.___eio=[]),s=a.___eio),this.index=s.length;var e=this;s.push(function(t){e.onData(t)}),this.query.j=this.index}var r=e("./polling"),i=e("../util");o.exports=n;var s,a=i.global(),c=/\n/g;i.inherits(n,r),n.prototype.doOpen=function(){var t=this;i.defer(function(){r.prototype.doOpen.call(t)})},n.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null),r.prototype.doClose.call(this)},n.prototype.doPoll=function(){var t=this,e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri(),e.onerror=function(e){t.onError("jsonp poll error",e)};var o=document.getElementsByTagName("script")[0];o.parentNode.insertBefore(e,o),this.script=e,i.ua.gecko&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},n.prototype.doWrite=function(t,e){function o(){n(),e()}function n(){if(r.iframe)try{r.form.removeChild(r.iframe)}catch(t){r.onError("jsonp polling iframe removal error",t)}try{var e='<iframe src="javascript:0" name="'+r.iframeId+'">';i=document.createElement(e)}catch(t){i=document.createElement("iframe"),i.name=r.iframeId,i.src="javascript:0"}i.id=r.iframeId,r.form.appendChild(i),r.iframe=i}var r=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),p=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=p,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}this.form.action=this.uri(),n(),this.area.value=t.replace(c,"\\n");try{this.form.submit()}catch(l){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==r.iframe.readyState&&o()}:this.iframe.onload=o}}),t.register("LearnBoost-engine.io-client/lib/transports/websocket.js",function(t,e,o){function n(t){i.call(this,t)}function r(){return"undefined"==typeof window?e("ws"):c.WebSocket||c.MozWebSocket}var i=e("../transport"),s=e("engine.io-parser"),a=e("../util");e("debug")("engine.io-client:websocket"),o.exports=n;var c=a.global();a.inherits(n,i),n.prototype.name="websocket",n.prototype.doOpen=function(){if(this.check()){var t=this;this.socket=new(r())(this.uri()),this.socket.onopen=function(){t.onOpen()},this.socket.onclose=function(){t.onClose()},this.socket.onmessage=function(e){t.onData(e.data)},this.socket.onerror=function(e){t.onError("websocket error",e)}}},n.prototype.write=function(t){for(var e=0,o=t.length;o>e;e++)this.socket.send(s.encodePacket(t[e]))},n.prototype.doClose=function(){this.socket!==void 0&&this.socket.close()},n.prototype.uri=function(){var t=this.query||{},e=this.secure?"wss":"ws",o="";return this.port&&("wss"==e&&443!=this.port||"ws"==e&&80!=this.port)&&(o=":"+this.port),this.timestampRequests&&(t[this.timestampParam]=+new Date),t=a.qs(t),t.length&&(t="?"+t),e+"://"+this.hostname+o+this.path+t},n.prototype.check=function(){var t=r();return!(!t||"__initialize"in t&&this.name===n.prototype.name)}}),t.register("LearnBoost-engine.io-client/lib/transports/flashsocket.js",function(t,e,o){function n(t){s.call(this,t),this.flashPath=t.flashPath,this.policyPort=t.policyPort}function r(t,e){if(u[t])return e();var o=document.createElement("script"),n=!1;c('loading "%s"',t),o.onload=o.onreadystatechange=function(){if(!n&&!u[t]){var r=o.readyState;r&&"loaded"!=r&&"complete"!=r||(c('loaded "%s"',t),o.onload=o.onreadystatechange=null,n=!0,u[t]=!0,e())}},o.async=1,o.src=t;var r=document.getElementsByTagName("head")[0];r.insertBefore(o,r.firstChild)}function i(t,e){function o(n){return t[n]?(r(t[n],function(){o(++n)}),void 0):e()}o(0)}var s=e("./websocket"),a=e("../util"),c=e("debug")("engine.io-client:flashsocket");o.exports=n;var p=a.global(),l=p[["Active"].concat("Object").join("X")];a.inherits(n,s),n.prototype.name="flashsocket",n.prototype.doOpen=function(){function t(t){return function(){var e=Array.prototype.join.call(arguments," ");c("[websocketjs %s] %s",t,e)}}if(this.check()){WEB_SOCKET_LOGGER={log:t("debug"),error:t("error")},WEB_SOCKET_SUPPRESS_CROSS_DOMAIN_SWF_ERROR=!0,WEB_SOCKET_DISABLE_AUTO_INITIALIZATION=!0,"undefined"==typeof WEB_SOCKET_SWF_LOCATION&&(WEB_SOCKET_SWF_LOCATION=this.flashPath+"WebSocketMainInsecure.swf");var e=[this.flashPath+"web_socket.js"];"undefined"==typeof swfobject&&e.unshift(this.flashPath+"swfobject.js");var o=this;i(e,function(){o.ready(function(){WebSocket.__addTask(function(){s.prototype.doOpen.call(o)})})})}},n.prototype.doClose=function(){if(this.socket){var t=this;WebSocket.__addTask(function(){s.prototype.doClose.call(t)})}},n.prototype.write=function(){var t=this,e=arguments;WebSocket.__addTask(function(){s.prototype.write.apply(t,e)})},n.prototype.ready=function(t){function e(){n.loaded||(843!=o.policyPort&&WebSocket.loadFlashPolicyFile("xmlsocket://"+o.host+":"+o.policyPort),WebSocket.__initialize(),n.loaded=!0),t.call(o)}if("undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject&&!(10>swfobject.getFlashPlayerVersion().major)){var o=this;return document.body?e():(a.load(e),void 0)}},n.prototype.check=function(){if("undefined"==typeof window)return!1;if("undefined"!=typeof WebSocket&&!("__initialize"in WebSocket))return!1;if(l){var t=null;try{t=new l("ShockwaveFlash.ShockwaveFlash")}catch(e){}if(t)return!0}else for(var o=0,n=navigator.plugins.length;n>o;o++)for(var r=0,i=navigator.plugins[o].length;i>r;r++)if("Shockwave Flash"==navigator.plugins[o][r].description)return!0;return!1};var u={}}),t.register("wearefractal-protosock/dist/main.js",function(t,e,o){(function(){var t,n,r,i,s,a;a=e("./util"),t=e("./Client"),r=e("./defaultClient"),s={createClientWrapper:function(t){return function(e){return s.createClient(t,e)}},createClient:function(e,o){var n;return n=a.mergePlugins(r,e),new t(n,o)}},("undefined"==typeof window||null===window)&&(n=e("./Server"),i=e("./defaultServer"),e("http").globalAgent.maxSockets=999,s.createServer=function(t,e,o){var r;return r=a.mergePlugins(i,e),new n(t,r,o)},s.createServerWrapper=function(t){return function(e,o){return s.createServer(e,t,o)}}),o.exports=s}).call(this)}),t.register("wearefractal-protosock/dist/Socket.js",function(t,e,o){(function(){var t;t={write:function(t){var e=this;return this.parent.outbound(this,t,function(t){return e.send(t)}),this},disconnect:function(t){return this.close(t),this}},o.exports=t}).call(this)}),t.register("wearefractal-protosock/dist/util.js",function(t,e,o){(function(){var t,n,r={}.hasOwnProperty,i=function(t,e){function o(){this.constructor=t}for(var n in e)r.call(e,n)&&(t[n]=e[n]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},s=[].slice;t=e("./Socket"),n={extendSocket:function(e){return i(e.prototype,t)},mergePlugins:function(){var t,e,o,r,i,a,c;for(t=arguments.length>=1?s.call(arguments,0):[],o={},a=0,c=t.length;c>a;a++){r=t[a];for(e in r)i=r[e],o[e]="object"==typeof i&&"server"!==e?n.mergePlugins(o[e],i):i}return o}},o.exports=n}).call(this)}),t.register("wearefractal-protosock/dist/defaultClient.js",function(t,e,o){(function(){var t;t={options:{},start:function(){},inbound:function(t,e,o){var n;try{n=JSON.parse(e)}catch(r){this.error(t,r)}o(n)},outbound:function(t,e,o){var n;try{n=JSON.stringify(e)}catch(r){this.error(t,r)}o(n)},validate:function(t,e,o){return o(!0)},invalid:function(){},connect:function(){},message:function(){},error:function(){},close:function(){}},"undefined"!=typeof window&&null!==window&&(t.options={host:window.location.hostname,port:window.location.port.length>0?parseInt(window.location.port):80,secure:"https:"===window.location.protocol},t.options.secure&&(t.options.port=443)),o.exports=t}).call(this)}),t.register("wearefractal-protosock/dist/Client.js",function(t,e,o){(function(){var t,n,r,i,s,a=function(t,e){return function(){return t.apply(e,arguments)}},c={}.hasOwnProperty,p=function(t,e){function o(){this.constructor=t}for(var n in e)c.call(e,n)&&(t[n]=e[n]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t};s=e("./util"),"undefined"!=typeof window&&null!==window?(r=e("engine.io"),n=e("emitter")):(r=e("engine.io-client"),n=e("events").EventEmitter),s.extendSocket(r.Socket),i=function(t){return t>10?15e3:t>5?5e3:t>3?1e3:1e3},t=function(t){function e(t,e){var o,n,i,s,c,p,l,u,h;null==e&&(e={}),this.reconnect=a(this.reconnect,this),this.handleClose=a(this.handleClose,this),this.handleError=a(this.handleError,this),this.handleMessage=a(this.handleMessage,this),this.handleConnection=a(this.handleConnection,this);for(n in t)i=t[n],this[n]=i;for(n in e)i=e[n],this.options[n]=i;null==(l=(s=this.options).reconnect)&&(s.reconnect=!0),null==(u=(c=this.options).reconnectLimit)&&(c.reconnectLimit=1/0),null==(h=(p=this.options).reconnectTimeout)&&(p.reconnectTimeout=1/0),this.isServer=!1,this.isClient=!0,this.isBrowser="undefined"!=typeof window&&null!==window,o={host:this.options.host,port:this.options.port,secure:this.options.secure,path:"/"+this.options.namespace,resource:this.options.resource,transports:this.options.transports,upgrade:this.options.upgrade,flashPath:this.options.flashPath,policyPort:this.options.policyPort,forceJSONP:this.options.forceJSONP,forceBust:this.options.forceBust,debug:this.options.debug},this.ssocket=new r(o),this.ssocket.parent=this,this.ssocket.once("open",this.handleConnection),this.ssocket.on("error",this.handleError),this.ssocket.on("message",this.handleMessage),this.ssocket.on("close",this.handleClose),this.start()}return p(e,t),e.prototype.disconnect=function(){return this.ssocket.disconnect(),this},e.prototype.destroy=function(){return this.options.reconnect=!1,this.ssocket.disconnect(),this.emit("destroyed"),this},e.prototype.handleConnection=function(){return this.emit("connected"),this.connect(this.ssocket)},e.prototype.handleMessage=function(t){var e=this;return this.emit("inbound",this.ssocket,t),this.inbound(this.ssocket,t,function(t){return e.validate(e.ssocket,t,function(o){return o?(e.emit("message",e.ssocket,t),e.message(e.ssocket,t)):(e.emit("invalid",e.ssocket,t),e.invalid(e.ssocket,t))})})},e.prototype.handleError=function(t){return"string"==typeof t&&(t=Error(t)),this.error(this.ssocket,t)},e.prototype.handleClose=function(t){var e=this;if(!this.ssocket.reconnecting)return this.options.reconnect?this.reconnect(function(o){return null!=o?(e.emit("close",e.ssocket,t),e.close(e.ssocket,t)):void 0}):(this.emit("close",this.ssocket,t),this.close(this.ssocket,t))},e.prototype.reconnect=function(t){var e,o,n,r,s,a,c,p=this;return this.ssocket.reconnecting?t("Already reconnecting"):(this.ssocket.reconnecting=!0,"open"===this.ssocket.readyState&&this.ssocket.disconnect(),a=Date.now(),s=this.options.reconnectLimit,c=this.options.reconnectTimeout,e=0,n=function(){return p.ssocket.reconnecting=!1,p.emit("reconnected"),t()},r=function(e){return p.ssocket.reconnecting=!1,t(e)},this.ssocket.once("open",n),o=function(){return p.ssocket.reconnecting?e>=s?r("Exceeded max attempts"):Date.now()-a>c?r("Timeout on reconnect"):(e++,p.ssocket.open(),setTimeout(o,i(e))):void 0},setTimeout(o,i(e)))},e}(n),o.exports=t}).call(this)}),t.register("pulsar/dist/main.js",function(t,e,o){(function(){var t,n,r;t=e("protosock"),n=e("./Client"),o.exports={createClient:t.createClientWrapper(n)},("undefined"==typeof window||null===window)&&(r=e("./Server"),o.exports.createServer=t.createServerWrapper(r))}).call(this)}),t.register("pulsar/dist/Client.js",function(t,e,o){(function(){var t,n,r=[].slice;t=e("./Channel"),n={options:{namespace:"Pulsar",resource:"default"},start:function(){var t=this;
+return this.channels={},this.on("reconnected",function(){var e,o,n,r;n=t.channels,r=[];for(o in n)e=n[o],r.push(e.joinChannel());return r})},channel:function(e){var o,n;return null!=(n=(o=this.channels)[e])?n:o[e]=new t(e,this.ssocket)},validate:function(t,e,o){if("object"!=typeof e)return o(!1);if("string"!=typeof e.type)return o(!1);switch(e.type){case"emit":if("string"!=typeof e.channel)return o(!1);if("string"!=typeof e.event)return o(!1);if(!Array.isArray(e.args))return o(!1);break;case"joined":if("string"!=typeof e.channel)return o(!1);break;default:return o(!1)}return o(!0)},error:function(t,e){return this.emit("error",e,t)},message:function(t,e){var o;switch(o=this.channels[e.channel],e.type){case"emit":return o.realEmit.apply(o,[e.event].concat(r.call(e.args)));case"joined":return o.joined=!0,o.realEmit("join")}}},o.exports=n}).call(this)}),t.register("pulsar/dist/Channel.js",function(t,e,o){(function(){var t,e=function(t,e){return function(){return t.apply(e,arguments)}},n=[].slice;t=function(){function t(t,o){this.name=t,this.socket=o,this.runStack=e(this.runStack,this),this.use=e(this.use,this),this.ready=e(this.ready,this),this.removeAllListeners=e(this.removeAllListeners,this),this.removeListener=e(this.removeListener,this),this.once=e(this.once,this),this.addListener=e(this.addListener,this),this.emit=e(this.emit,this),this.realEmit=e(this.realEmit,this),this.events={},this.stack=[],this.joinChannel()}return t.prototype.joinChannel=function(){var t=this;return this.socket?(this.socket.write({type:"join",channel:this.name}),this.socket.once("close",function(){return t.joined=!1})):(this.joined=!0,this.listeners=[])},t.prototype.realEmit=function(){var t,e,o=this;return e=arguments[0],t=arguments.length>=2?n.call(arguments,1):[],this.runStack(e,t,function(t){var n,r,i,s;if(!o.events[e])return!1;for(s=o.events[e],r=0,i=s.length;i>r;r++)n=s[r],n.apply(null,t);return!0})},t.prototype.emit=function(){var t,e,o,r,i,s,a;if(e=arguments[0],t=arguments.length>=2?n.call(arguments,1):[],o={type:"emit",channel:this.name,event:e,args:t},this.listeners){for(a=this.listeners,i=0,s=a.length;s>i;i++)r=a[i],r.write(o);return!0}return this.socket?(this.socket.write(o),!0):!1},t.prototype.addListener=function(t,e){var o,n;return this.realEmit("newListener",t,e),(null!=(n=(o=this.events)[t])?n:o[t]=[]).push(e),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(t,e){var o,n=this;return o=function(){return n.removeListener(t,o),e.apply(null,arguments)},this.on(t,o),this},t.prototype.removeSocketListener=function(t){var e;return this.listeners?(this.listeners=function(){var o,n,r,i;for(r=this.listeners,i=[],o=0,n=r.length;n>o;o++)e=r[o],e!==t&&i.push(e);return i}.call(this),this.emit("unjoin",t),this.realEmit("unjoin",t),this):this},t.prototype.removeListener=function(t,e){var o;return this.events[t]?(this.events[t]=function(){var n,r,i,s;for(i=this.events[t],s=[],n=0,r=i.length;r>n;n++)o=i[n],o!==e&&s.push(o);return s}.call(this),this):this},t.prototype.removeAllListeners=function(t){return delete this.events[t],this},t.prototype.ready=function(t){var e=this;return this.joined?t(this):this.once("join",function(){return t(e)})},t.prototype.use=function(t){return this.stack.push(t),this},t.prototype.runStack=function(t,e,o){var r,i,s=this;return 0===this.stack.length?o(e):"newListener"===t?o(e):(i=-1,r=function(){var a,c;return a=arguments.length>=1?n.call(arguments,0):[],0!==a.length&&(e=a),c=s.stack[++i],null==c?o(e):c.apply(null,[r,t].concat(n.call(e)))},r.apply(null,e),void 0)},t}(),o.exports=t}).call(this)}),t.alias("wearefractal-protosock/dist/main.js","pulsar/deps/protosock/dist/main.js"),t.alias("wearefractal-protosock/dist/Socket.js","pulsar/deps/protosock/dist/Socket.js"),t.alias("wearefractal-protosock/dist/util.js","pulsar/deps/protosock/dist/util.js"),t.alias("wearefractal-protosock/dist/defaultClient.js","pulsar/deps/protosock/dist/defaultClient.js"),t.alias("wearefractal-protosock/dist/Client.js","pulsar/deps/protosock/dist/Client.js"),t.alias("wearefractal-protosock/dist/main.js","pulsar/deps/protosock/index.js"),t.alias("component-emitter/index.js","wearefractal-protosock/deps/emitter/index.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/lib/index.js"),t.alias("LearnBoost-engine.io-client/lib/socket.js","wearefractal-protosock/deps/engine.io/lib/socket.js"),t.alias("LearnBoost-engine.io-client/lib/transport.js","wearefractal-protosock/deps/engine.io/lib/transport.js"),t.alias("LearnBoost-engine.io-client/lib/emitter.js","wearefractal-protosock/deps/engine.io/lib/emitter.js"),t.alias("LearnBoost-engine.io-client/lib/util.js","wearefractal-protosock/deps/engine.io/lib/util.js"),t.alias("LearnBoost-engine.io-client/lib/transports/index.js","wearefractal-protosock/deps/engine.io/lib/transports/index.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling.js","wearefractal-protosock/deps/engine.io/lib/transports/polling.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-xhr.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-xhr.js"),t.alias("LearnBoost-engine.io-client/lib/transports/polling-jsonp.js","wearefractal-protosock/deps/engine.io/lib/transports/polling-jsonp.js"),t.alias("LearnBoost-engine.io-client/lib/transports/websocket.js","wearefractal-protosock/deps/engine.io/lib/transports/websocket.js"),t.alias("LearnBoost-engine.io-client/lib/transports/flashsocket.js","wearefractal-protosock/deps/engine.io/lib/transports/flashsocket.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","wearefractal-protosock/deps/engine.io/index.js"),t.alias("component-emitter/index.js","LearnBoost-engine.io-client/deps/emitter/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/keys.js","LearnBoost-engine.io-client/deps/engine.io-parser/lib/keys.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-client/deps/engine.io-parser/index.js"),t.alias("LearnBoost-engine.io-protocol/lib/index.js","LearnBoost-engine.io-protocol/index.js"),t.alias("visionmedia-debug/index.js","LearnBoost-engine.io-client/deps/debug/index.js"),t.alias("visionmedia-debug/debug.js","LearnBoost-engine.io-client/deps/debug/debug.js"),t.alias("LearnBoost-engine.io-client/lib/index.js","LearnBoost-engine.io-client/index.js"),t.alias("wearefractal-protosock/dist/main.js","wearefractal-protosock/index.js"),t.alias("pulsar/dist/main.js","pulsar/index.js"),"object"==typeof exports?module.exports=t("pulsar"):"function"==typeof define&&define.amd?define(t("pulsar")):window.Pulsar=t("pulsar")})();
View
3  test/server.coffee
@@ -126,9 +126,8 @@ describe 'Pulsar', ->
channel.listeners[0].once 'close', ->
channel.listeners.length.should.equal 0
serv.destroy()
- client.destroy()
done()
- client.disconnect()
+ client.destroy()
describe 'multiple channels', ->
it 'should add', (done) ->
Please sign in to comment.
Something went wrong with that request. Please try again.