Skip to content
Browse files

built

  • Loading branch information...
1 parent 879e956 commit 5ac986474f3fe8129b3faf438e8f287d959bb68f bitmage committed Dec 21, 2012
Showing with 1,442 additions and 1,476 deletions.
  1. +1,441 −1,475 protosock.js
  2. +1 −1 protosock.min.js
View
2,916 protosock.js
1,441 additions, 1,475 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
View
2 protosock.min.js
@@ -1 +1 @@
-(function(){function t(){return t}function n(t,r){var i=n.resolve(t),s=n.modules[i];if(!s)throw Error('failed to require "'+t+'" from '+r);return s.exports||(s.exports={},s.call(s.exports,s,s.exports,n.relative(i),e)),s.exports}var e=this;n.modules={},n.resolve=function(e){var t=e,r=e+".js",i=e+"/index.js";return n.modules[r]&&r||n.modules[i]&&i||t},n.register=function(e,t){n.modules[e]=t},n.relative=function(e){return function(r){if("debug"==r)return t;if("."!=r.charAt(0))return n(r);var i=e.split("/"),s=r.split("/");i.pop();for(var o=0;o<s.length;o++){var u=s[o];".."==u?i.pop():"."!=u&&i.push(u)}return n(i.join("/"),e)}},n.register("node_modules/engine.io-client/lib/engine.io-client.js",function(e,t,n,r){t.version="0.3.10",t.protocol=1,t.util=n("./util"),t.parser=n("./parser"),t.Socket=n("./socket"),t.EventEmitter=n("./event-emitter"),t.Transport=n("./transport"),t.transports=n("./transports")}),n.register("node_modules/engine.io-client/lib/event-emitter.js",function(e,t,n,r){function i(){}function s(e){return"[object Array]"==Object.prototype.toString.call(e)}e.exports=i,i.prototype.on=function(e,t){return this.$events||(this.$events={}),this.$events[e]?s(this.$events[e])?this.$events[e].push(t):this.$events[e]=[this.$events[e],t]:this.$events[e]=t,this},i.prototype.addListener=i.prototype.on,i.prototype.once=function(e,t){function r(){n.removeListener(e,r),t.apply(this,arguments)}var n=this;return r.listener=t,this.on(e,r),this},i.prototype.removeListener=function(e,t){if(this.$events&&this.$events[e]){var n=this.$events[e];if(s(n)){var r=-1;for(var i=0,o=n.length;i<o;i++)if(n[i]===t||n[i].listener&&n[i].listener===t){r=i;break}if(r<0)return this;n.splice(r,1),n.length||delete this.$events[e]}else(n===t||n.listener&&n.listener===t)&&delete this.$events[e]}return this},i.prototype.removeAllListeners=function(e){return e===undefined?(this.$events={},this):(this.$events&&this.$events[e]&&(this.$events[e]=null),this)},i.prototype.listeners=function(e){return this.$events||(this.$events={}),this.$events[e]||(this.$events[e]=[]),s(this.$events[e])||(this.$events[e]=[this.$events[e]]),this.$events[e]},i.prototype.emit=function(e){if(!this.$events)return!1;var t=this.$events[e];if(!t)return!1;var n=Array.prototype.slice.call(arguments,1);if("function"==typeof t)t.apply(this,n);else{if(!s(t))return!1;var r=t.slice();for(var i=0,o=r.length;i<o;i++)r[i].apply(this,n)}return!0},i.prototype.addEventListener=i.prototype.on,i.prototype.removeEventListener=i.prototype.removeListener,i.prototype.dispatchEvent=i.prototype.emit}),n.register("node_modules/engine.io-client/lib/parser.js",function(e,t,n,r){var i=n("./util"),s=t.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},o=i.keys(s),u={type:"error",data:"parser error"};t.encodePacket=function(e){var t=s[e.type];return undefined!==e.data&&(t+=e.data+""),""+t},t.decodePacket=function(e){var t=e.charAt(0);return Number(t)!=t||!o[t]?u:e.length>1?{type:o[t],data:e.substring(1)}:{type:o[t]}},t.encodePayload=function(e){if(!e.length)return"0:";var n="",r;for(var i=0,s=e.length;i<s;i++)r=t.encodePacket(e[i]),n+=r.length+":"+r;return n},t.decodePayload=function(e){if(e=="")return[u];var n=[],r="",i,s,o;for(var a=0,f=e.length;a<f;a++){var l=e.charAt(a);if(":"!=l)r+=l;else{if(""==r||r!=(i=Number(r)))return[u];s=e.substr(a+1,i);if(r!=s.length)return[u];if(s.length){o=t.decodePacket(s);if(u.type==o.type&&u.data==o.data)return[u];n.push(o)}a+=i,r=""}}return r!=""?[u]:n}}),n.register("node_modules/engine.io-client/lib/socket.js",function(e,t,n,r){function a(e){if("string"==typeof e){var t=i.parseUri(e);e=arguments[1]||{},e.host=t.host,e.secure=t.protocol=="https"||t.protocol=="wss",e.port=t.port}e=e||{},this.secure=null!=e.secure?e.secure:r.location&&"https:"==location.protocol,this.host=e.host||e.hostname||(r.location?location.hostname:"localhost"),this.port=e.port||(r.location&&location.port?location.port:this.secure?443:80),this.query=e.query||{},this.query.uid=l(),this.upgrade=!1!==e.upgrade,this.resource=e.resource||"default",this.path=(e.path||"/engine.io").replace(/\/$/,""),this.path+="/"+this.resource+"/",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(),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}function l(){return(Math.random()+"").substr(5)+(Math.random()+"").substr(5)}var i=n("./util"),s=n("./transports"),o=n("debug")("engine-client:socket"),u=n("./event-emitter");e.exports=a,i.inherits(a,u),a.sockets=[],a.sockets.evs=new u,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 s[e]({host:this.host,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(i.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("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=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){this.emit("error",e),this.onClose("transport error",e)},a.prototype.onClose=function(e,t){"closed"!=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)}}),n.register("node_modules/engine.io-client/lib/transport.js",function(e,t,n,r){function u(e){this.path=e.path,this.host=e.host,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState=""}var i=n("./util"),s=n("./parser"),o=n("./event-emitter");e.exports=u,i.inherits(u,o),u.prototype.onError=function(e,t){var n=Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},u.prototype.open=function(){if("closed"==this.readyState||""==this.readyState)this.readyState="opening",this.doOpen();return this},u.prototype.close=function(){if("opening"==this.readyState||"open"==this.readyState)this.doClose(),this.onClose();return this},u.prototype.send=function(e){if("open"!=this.readyState)throw Error("Transport not open");this.write(e)},u.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},u.prototype.onData=function(e){this.onPacket(s.decodePacket(e))},u.prototype.onPacket=function(e){this.emit("packet",e)},u.prototype.onClose=function(){this.readyState="closed",this.emit("close")}}),n.register("node_modules/engine.io-client/lib/transports/flashsocket.js",function(e,t,n,r){function u(e){i.call(this,e),this.flashPath=e.flashPath,this.policyPort=e.policyPort}function f(e,t){if(a[e])return t();var n=document.createElement("script"),r=!1;n.onload=n.onreadystatechange=function(){if(r||a[e])return;var i=n.readyState;if(!i||"loaded"==i||"complete"==i)n.onload=n.onreadystatechange=null,r=!0,a[e]=!0,t()},n.async=1,n.src=e;var i=document.getElementsByTagName("head")[0];i.insertBefore(n,i.firstChild)}function l(e,t){function n(r){if(!e[r])return t();f(e[r],function(){n(++r)})}n(0)}var i=n("./websocket"),s=n("../util");e.exports=u;var o=r[["Active"].concat("Object").join("X")];s.inherits(u,i),u.prototype.name="flashsocket",u.prototype.doOpen=function(){function e(e){return function(){var e=Array.prototype.join.call(arguments," ")}}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;l(t,function(){n.ready(function(){WebSocket.__addTask(function(){i.prototype.doOpen.call(n)})})})},u.prototype.doClose=function(){if(!this.socket)return;var e=this;WebSocket.__addTask(function(){i.prototype.doClose.call(e)})},u.prototype.write=function(){var e=this,t=arguments;WebSocket.__addTask(function(){i.prototype.write.apply(e,t)})},u.prototype.ready=function(e){function t(){u.loaded||(843!=n.policyPort&&WebSocket.loadFlashPolicyFile("xmlsocket://"+n.host+":"+n.policyPort),WebSocket.__initialize(),u.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();s.load(t)},u.prototype.check=function(){if(typeof WebSocket=="undefined"||"__initialize"in WebSocket){if(o){var e=null;try{e=new o("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 a={}}),n.register("node_modules/engine.io-client/lib/transports/index.js",function(e,t,n,r){function f(e){var t,n=!1,o=!1;if(r.location){var u="https:"==location.protocol,f=location.port;Number(f)!=f&&(f=u?443:80),n=e.host!=location.hostname||f!=e.port,o=e.secure!=u}return t=a.request(n),o&&r.XDomainRequest&&t instanceof r.XDomainRequest?new s(e):t&&!e.forceJSONP?new i(e):new s(e)}var i=n("./polling-xhr"),s=n("./polling-jsonp"),o=n("./websocket"),u=n("./flashsocket"),a=n("../util");t.polling=f,t.websocket=o,t.flashsocket=u}),n.register("node_modules/engine.io-client/lib/transports/polling-jsonp.js",function(e,t,n,r){function f(){}function l(e){i.call(this,e),u||(r.___eio||(r.___eio=[]),u=r.___eio),this.index=u.length;var t=this;u.push(function(e){t.onData(e)}),this.query.j=this.index}var i=n("./polling"),s=n("../util");e.exports=l;var o=/\n/g,u,a=0;s.inherits(l,i),l.prototype.doOpen=function(){var e=this;s.defer(function(){i.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),i.prototype.doClose.call(this)},l.prototype.doPoll=function(){var e=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),e.async=!0,e.src=this.uri();var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t),this.script=e,s.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(){n.iframe&&n.form.removeChild(n.iframe);try{u=document.createElement('<iframe name="'+n.iframeId+'">')}catch(e){u=document.createElement("iframe"),u.name=n.iframeId}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}}),n.register("node_modules/engine.io-client/lib/transports/polling-xhr.js",function(e,t,n,r){function a(){}function f(e){i.call(this,e),r.location&&(this.xd=e.host!=r.location.hostname||r.location.port!=e.port)}function l(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 i=n("./polling"),s=n("../event-emitter"),o=n("../util");e.exports=f,e.exports.Request=l;var u=r[["Active"].concat("Object").join("X")];o.inherits(f,i),f.prototype.doOpen=function(){var e=this;o.defer(function(){i.prototype.doOpen.call(e)})},f.prototype.request=function(e){return e=e||{},e.uri=this.uri(),e.xd=this.xd,new l(e)},f.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},f.prototype.doPoll=function(){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},o.inherits(l,s),l.prototype.create=function(){var e=this.xhr=o.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&&r.XDomainRequest&&e instanceof XDomainRequest?(e.onerror=function(e){t.onError(e)},e.onload=function(){t.onData(e.responseText)},e.onprogress=a):("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)}),e.send(this.data),u&&(this.index=l.requestsCount++,l.requests[this.index]=this)},l.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},l.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},l.prototype.onError=function(e){this.emit("error",e),this.cleanup()},l.prototype.cleanup=function(){this.xhr.onreadystatechange=a,this.xhr.onload=this.xhr.onerror=a;try{this.xhr.abort()}catch(e){}u&&delete l.requests[this.index],this.xhr=null},l.prototype.abort=function(){this.cleanup()},u&&(l.requestsCount=0,l.requests={},r.attachEvent("onunload",function(){for(var e in l.requests)l.requests.hasOwnProperty(e)&&l.requests[e].abort()}))}),n.register("node_modules/engine.io-client/lib/transports/polling.js",function(e,t,n,r){function u(e){i.call(this,e)}var i=n("../transport"),s=n("../util"),o=n("../parser");e.exports=u,s.inherits(u,i),u.prototype.name="polling",u.prototype.doOpen=function(){this.poll()},u.prototype.pause=function(e){function r(){n.readyState="paused",e()}var t=0,n=this;this.readyState="pausing";if(this.polling||!this.writable){var i=0;this.polling&&(i++,this.once("pollComplete",function(){--i||r()})),this.writable||(i++,this.once("drain",function(){--i||r()}))}else r()},u.prototype.poll=function(){this.polling=!0,this.doPoll(),this.emit("poll")},u.prototype.onData=function(e){var t=o.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()},u.prototype.doClose=function(){this.send([{type:"close"}])},u.prototype.write=function(e){var t=this;this.writable=!1,this.doWrite(o.encodePayload(e),function(){t.writable=!0,t.emit("drain")})},u.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";if(r.ActiveXObject||s.ua.android||s.ua.ios6||this.timestampRequests)e[this.timestampParam]=+(new Date);return e=s.qs(e),this.port&&("https"==t&&this.port!=443||"http"==t&&this.port!=80)&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+this.host+n+this.path+e}}),n.register("node_modules/engine.io-client/lib/transports/websocket.js",function(e,t,n,r){function u(e){i.call(this,e)}function a(){return r.WebSocket||r.MozWebSocket}var i=n("../transport"),s=n("../parser"),o=n("../util");e.exports=u,o.inherits(u,i),u.prototype.name="websocket",u.prototype.doOpen=function(){if(!this.check())return;var e=this;this.socket=new(a())(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)}},u.prototype.write=function(e){for(var t=0,n=e.length;t<n;t++)this.socket.send(s.encodePacket(e[t]))},u.prototype.doClose=function(){typeof this.socket!="undefined"&&this.socket.close()},u.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=o.qs(e),e.length&&(e="?"+e),t+"://"+this.host+n+this.path+e},u.prototype.check=function(){var e=a();return!!e&&!("__initialize"in e&&this.name===u.prototype.name)}}),n.register("node_modules/engine.io-client/lib/util.js",function(e,t,n,r){var i=!1;t.inherits=function(t,n){function r(){}r.prototype=n.prototype,t.prototype=new r},t.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},t.on=function(e,t,n,r){e.attachEvent?e.attachEvent("on"+t,n):e.addEventListener&&e.addEventListener(t,n,r)},t.load=function(e){if(r.document&&document.readyState==="complete"||i)return e();t.on(r,"load",e,!1)},"undefined"!=typeof window&&t.load(function(){i=!0}),t.defer=function(e){if(!t.ua.webkit||"undefined"!=typeof importScripts)return e();t.load(function(){setTimeout(e,100)})};var s=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,u=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,a=/(?:^|:|,)(?:\s*\[)+/g,f=/^\s+/,l=/\s+$/;t.parseJSON=function(e){if("string"!=typeof e||!e)return null;e=e.replace(f,"").replace(l,"");if(r.JSON&&JSON.parse)return JSON.parse(e);if(s.test(e.replace(o,"@").replace(u,"]").replace(a,"")))return Function("return "+e)()},t.ua={},t.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var e=new XMLHttpRequest}catch(t){return!1}return e.withCredentials!=undefined}(),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(n){if(n&&"undefined"!=typeof XDomainRequest&&!t.ua.hasCORS)return new XDomainRequest;try{if("undefined"!=typeof XMLHttpRequest&&(!n||t.ua.hasCORS))return new XMLHttpRequest}catch(r){}if(!n)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(r){}};var c=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,h=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];t.parseUri=function(e){var t=c.exec(e||""),n={},r=14;while(r--)n[h[r]]=t[r]||"";return n},t.qs=function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=n+"="+encodeURIComponent(e[n]));return t}}),n.register("Client.js",function(e,t,n,r){(function(){var t,r,i,s,o,u,a=function(e,t){return function(){return e.apply(t,arguments)}},f={}.hasOwnProperty,l=function(e,t){function r(){this.constructor=e}for(var n in t)f.call(t,n)&&(e[n]=t[n]);return r.prototype=t.prototype,e.prototype=new r,e.__super__=t.prototype,e};u=n("./util"),o=u.isBrowser(),o?(i=n("node_modules/engine.io-client/lib/engine.io-client"),r=i.EventEmitter):(i=n("engine.io-client"),r=n("events").EventEmitter),u.extendSocket(i.Socket),s=function(e){return e>10?15e3:e>5?5e3:e>3?1e3:1e3},t=function(e){function t(e,t){var n,r,s,u,f,l,c;t==null&&(t={}),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(r in e)s=e[r],this[r]=s;for(r in t)s=t[r],this.options[r]=s;(l=(u=this.options).reconnect)==null&&(u.reconnect=!0),(c=(f=this.options).reconnectLimit)==null&&(f.reconnectLimit=Infinity),this.isServer=!1,this.isClient=!0,this.isBrowser=o,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.Socket(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 l(t,e),t.prototype.disconnect=function(){return this.ssocket.disconnect(),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=this;return this.ssocket.reconnecting?e("Already reconnecting"):(this.ssocket.reconnecting=!0,this.ssocket.readyState==="open"&&this.ssocket.disconnect(),o=this.options.reconnectLimit,t=0,r=function(){return u.ssocket.reconnecting=!1,e()},i=function(t){return u.ssocket.reconnecting=!1,e(t)},this.ssocket.once("open",r),n=function(){if(!u.ssocket.reconnecting)return;return t<o?(t++,u.ssocket.open(),setTimeout(n,s(t))):i("Exceeded max attempts")},setTimeout(n,s(t)))},t}(r),e.exports=t}).call(this)}),n.register("defaultClient.js",function(e,t,n,r){(function(){var t;t={options:{},start:function(){},inbound:function(e,t,n){var r;try{r=JSON.parse(t)}catch(i){this.error(e,i)}return n(r),n},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(){}},t.options={host:window.location.hostname,port:window.location.port.length>0?parseInt(window.location.port):80,secure:window.location.protocol==="https:"},t.options.secure&&(t.options.port=443),e.exports=t}).call(this)}),n.register("main.js",function(e,t,n,r){(function(){var e,t;t=n("./util"),e={createClientWrapper:function(t){return function(n){return e.createClient(t,n)}},createClient:function(e,r){var i,s,o;return i=n("./Client"),s=n("./defaultClient"),o=t.mergePlugins(s,e),new i(o,r)}},window.ProtoSock=e}).call(this)}),n.register("Socket.js",function(e,t,n,r){(function(){e.exports={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}}}).call(this)}),n.register("util.js",function(e,t,n,r){(function(){var t,r={}.hasOwnProperty,i=function(e,t){function i(){this.constructor=e}for(var n in t)r.call(t,n)&&(e[n]=t[n]);return i.prototype=t.prototype,e.prototype=new i,e.__super__=t.prototype,e},s=[].slice;e.exports=t={extendSocket:function(e){var t;return t=n("./Socket"),i(e.prototype,t)},mergePlugins:function(){var e,n,r,i,o,u,a;e=1>arguments.length?[]:s.call(arguments,0),r={};for(u=0,a=e.length;u<a;u++){i=e[u];for(n in i)o=i[n],typeof o=="object"&&n!=="server"?r[n]=t.mergePlugins(r[n],o):r[n]=o}return r},isBrowser:function(){return!0}}}).call(this)}),main=n("main")})();
+(function(){function t(){return t}function e(t,n){var r=e.resolve(t),i=e.modules[r];if(!i)throw Error('failed to require "'+t+'" from '+n);return i.exports||(i.exports={},i.call(i.exports,i,i.exports,e.relative(r),o)),i.exports}var o=this;e.modules={},e.resolve=function(t){var o=t,n=t+".js",r=t+"/index.js";return e.modules[n]&&n||e.modules[r]&&r||o},e.register=function(t,o){e.modules[t]=o},e.relative=function(o){return function(n){if("debug"==n)return t;if("."!=n.charAt(0))return e(n);var r=o.split("/"),i=n.split("/");r.pop();for(var s=0;i.length>s;s++){var a=i[s];".."==a?r.pop():"."!=a&&r.push(a)}return e(r.join("/"),o)}},e.register("Client.js",function(t,e,o){(function(){var e,n,r,i,s,a,c=function(t,e){return function(){return t.apply(e,arguments)}},p=Object.prototype.hasOwnProperty,h=function(t,e){function o(){this.constructor=t}for(var n in e)p.call(e,n)&&(t[n]=e[n]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t};a=o("./util"),s=a.isBrowser(),s?(r=o("node_modules/engine.io-client/lib/engine.io-client"),n=r.EventEmitter):(r=o("engine.io-client"),n=o("events").EventEmitter),a.extendSocket(r.Socket),i=function(t){return t>10?15e3:t>5?5e3:t>3?1e3:1e3},e=function(t){function e(t,e){var o,n,i,a,p;null==e&&(e={}),this.reconnect=c(this.reconnect,this),this.handleClose=c(this.handleClose,this),this.handleError=c(this.handleError,this),this.handleMessage=c(this.handleMessage,this),this.handleConnection=c(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==(a=this.options).reconnect&&(a.reconnect=!0),null==(p=this.options).reconnectLimit&&(p.reconnectLimit=1/0),this.isServer=!1,this.isClient=!0,this.isBrowser=s,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.Socket(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 h(e,t),e.prototype.disconnect=function(){return this.ssocket.disconnect(),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=this;return t||(t=function(){}),this.ssocket.reconnecting?t("Already reconnecting"):(this.ssocket.reconnecting=!0,"open"===this.ssocket.readyState&&this.ssocket.disconnect(),s=this.options.reconnectLimit,e=0,n=function(){return a.ssocket.reconnecting=!1,a.handleConnection(a.ssocket),t()},r=function(e){return a.ssocket.reconnecting=!1,t(e)},this.ssocket.once("open",n),o=function(){return a.ssocket.reconnecting?e>=s?r("Exceeded max attempts"):(e++,a.ssocket.open(),setTimeout(o,i(e))):void 0},setTimeout(o,i(e)))},e}(n),t.exports=e}).call(this)}),e.register("Socket.js",function(t){(function(){t.exports={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}}}).call(this)}),e.register("defaultClient.js",function(t){(function(){var e;e={options:{},start:function(){},inbound:function(t,e,o){var n;try{n=JSON.parse(e)}catch(r){this.error(t,r)}return o(n),o},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(){}},e.options={host:window.location.hostname,port:window.location.port.length>0?parseInt(window.location.port):80,secure:"https:"===window.location.protocol},e.options.secure&&(e.options.port=443),t.exports=e}).call(this)}),e.register("main.js",function(t,e,o){(function(){var t,e;e=o("./util"),t={createClientWrapper:function(e){return function(o){return t.createClient(e,o)}},createClient:function(t,n){var r,i,s;return r=o("./Client"),i=o("./defaultClient"),s=e.mergePlugins(i,t),new r(s,n)}},window.ProtoSock=t}).call(this)}),e.register("util.js",function(t,e,o){(function(){var e,n=Object.prototype.hasOwnProperty,r=function(t,e){function o(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return o.prototype=e.prototype,t.prototype=new o,t.__super__=e.prototype,t},i=Array.prototype.slice;t.exports=e={extendSocket:function(t){var e;return e=o("./Socket"),r(t.prototype,e)},mergePlugins:function(){var t,o,n,r,s,a,c;for(t=arguments.length>=1?i.call(arguments,0):[],n={},a=0,c=t.length;c>a;a++){r=t[a];for(o in r)s=r[o],n[o]="object"==typeof s&&"server"!==o?e.mergePlugins(n[o],s):s}return n},isBrowser:function(){return!0}}}).call(this)}),e.register("node_modules/engine.io-client/lib/engine.io-client.js",function(t,e,o){e.version="0.3.10",e.protocol=1,e.util=o("./util"),e.parser=o("./parser"),e.Socket=o("./socket"),e.EventEmitter=o("./event-emitter"),e.Transport=o("./transport"),e.transports=o("./transports")}),e.register("node_modules/engine.io-client/lib/event-emitter.js",function(t){function e(){}function o(t){return"[object Array]"==Object.prototype.toString.call(t)}t.exports=e,e.prototype.on=function(t,e){return this.$events||(this.$events={}),this.$events[t]?o(this.$events[t])?this.$events[t].push(e):this.$events[t]=[this.$events[t],e]:this.$events[t]=e,this},e.prototype.addListener=e.prototype.on,e.prototype.once=function(t,e){function o(){n.removeListener(t,o),e.apply(this,arguments)}var n=this;return o.listener=e,this.on(t,o),this},e.prototype.removeListener=function(t,e){if(this.$events&&this.$events[t]){var n=this.$events[t];if(o(n)){for(var r=-1,i=0,s=n.length;s>i;i++)if(n[i]===e||n[i].listener&&n[i].listener===e){r=i;break}if(0>r)return this;n.splice(r,1),n.length||delete this.$events[t]}else(n===e||n.listener&&n.listener===e)&&delete this.$events[t]}return this},e.prototype.removeAllListeners=function(t){return void 0===t?(this.$events={},this):(this.$events&&this.$events[t]&&(this.$events[t]=null),this)},e.prototype.listeners=function(t){return this.$events||(this.$events={}),this.$events[t]||(this.$events[t]=[]),o(this.$events[t])||(this.$events[t]=[this.$events[t]]),this.$events[t]},e.prototype.emit=function(t){if(!this.$events)return!1;var e=this.$events[t];if(!e)return!1;var n=Array.prototype.slice.call(arguments,1);if("function"==typeof e)e.apply(this,n);else{if(!o(e))return!1;for(var r=e.slice(),i=0,s=r.length;s>i;i++)r[i].apply(this,n)}return!0},e.prototype.addEventListener=e.prototype.on,e.prototype.removeEventListener=e.prototype.removeListener,e.prototype.dispatchEvent=e.prototype.emit}),e.register("node_modules/engine.io-client/lib/parser.js",function(t,e,o){var n=o("./util"),r=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},i=n.keys(r),s={type:"error",data:"parser error"};e.encodePacket=function(t){var e=r[t.type];return void 0!==t.data&&(e+=t.data+""),""+e},e.decodePacket=function(t){var e=t.charAt(0);return Number(e)==e&&i[e]?t.length>1?{type:i[e],data:t.substring(1)}:{type:i[e]}:s},e.encodePayload=function(t){if(!t.length)return"0:";for(var o,n="",r=0,i=t.length;i>r;r++)o=e.encodePacket(t[r]),n+=o.length+":"+o;return n},e.decodePayload=function(t){if(""==t)return[s];for(var o,n,r,i=[],a="",c=0,p=t.length;p>c;c++){var h=t.charAt(c);if(":"!=h)a+=h;else{if(""==a||a!=(o=Number(a)))return[s];if(n=t.substr(c+1,o),a!=n.length)return[s];if(n.length){if(r=e.decodePacket(n),s.type==r.type&&s.data==r.data)return[s];i.push(r)}c+=o,a=""}}return""!=a?[s]:i}}),e.register("node_modules/engine.io-client/lib/socket.js",function(t,e,o,n){function r(t){if("string"==typeof t){var e=a.parseUri(t);t=arguments[1]||{},t.host=e.host,t.secure="https"==e.protocol||"wss"==e.protocol,t.port=e.port}t=t||{},this.secure=null!=t.secure?t.secure:n.location&&"https:"==location.protocol,this.host=t.host||t.hostname||(n.location?location.hostname:"localhost"),this.port=t.port||(n.location&&location.port?location.port:this.secure?443:80),this.query=t.query||{},this.query.uid=s(),this.upgrade=!1!==t.upgrade,this.resource=t.resource||"default",this.path=(t.path||"/engine.io").replace(/\/$/,""),this.path+="/"+this.resource+"/",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(),r.sockets.push(this),r.sockets.evs.emit("add",this)}function i(t){var e={};for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o]);return e}function s(){return(Math.random()+"").substr(5)+(Math.random()+"").substr(5)}var a=o("./util"),c=o("./transports"),p=o("debug")("engine-client:socket"),h=o("./event-emitter");t.exports=r,a.inherits(r,h),r.sockets=[],r.sockets.evs=new h,r.prototype.createTransport=function(t){p('creating transport "%s"',t);var e=i(this.query);e.transport=t,this.id&&(e.sid=this.id);var o=new c[t]({host:this.host,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},r.prototype.open=function(){this.readyState="opening";var t=this.createTransport(this.transports[0]);t.open(),this.setTransport(t)},r.prototype.setTransport=function(t){var e=this;this.transport&&(p("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")})},r.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,p('probe transport "%s" failed because of error: %s',t,e),r.emit("error",i)}}p('probing transport "%s"',t);var o=this.createTransport(t,{probe:1}),n=!1,r=this;o.once("open",function(){n||(p('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)p('probe transport "%s" pong',t),r.upgrading=!0,r.emit("upgrading",o),p('pausing current transport "%s"',r.transport.name),r.transport.pause(function(){n||"closed"!=r.readyState&&"closing"!=r.readyState&&(p("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{p('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&&(p("socket closed prematurely - aborting probe"),n=!0,o.close(),o=null)}),this.once("upgrading",function(t){o&&t.name!=o.name&&(p('"%s" works - aborting "%s"',t.name,o.name),o.close(),o=null)})},r.prototype.onOpen=function(){if(p("socket open"),this.readyState="open",this.emit("open"),this.onopen&&this.onopen.call(this),this.flush(),"open"==this.readyState&&this.upgrade&&this.transport.pause){p("starting upgrade probes");for(var t=0,e=this.upgrades.length;e>t;t++)this.probe(this.upgrades[t])}},r.prototype.onPacket=function(t){if("opening"==this.readyState||"open"==this.readyState)switch(p('socket receive: type "%s", data "%s"',t.type,t.data),this.emit("packet",t),this.emit("heartbeat"),t.type){case"open":this.onHandshake(a.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("message",t.data);var o={data:t.data};o.toString=function(){return t.data},this.onmessage&&this.onmessage.call(this,o)}else p('packet received with socket readyState "%s"',this.readyState)},r.prototype.onHandshake=function(t){this.emit("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this.upgrades=t.upgrades,this.pingInterval=t.pingInterval,this.pingTimeout=t.pingTimeout,this.onOpen(),this.ping(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat)},r.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)},r.prototype.ping=function(){var t=this;clearTimeout(t.pingIntervalTimer),t.pingIntervalTimer=setTimeout(function(){p("writing ping packet - expecting pong within %sms",t.pingTimeout),t.sendPacket("ping"),t.onHeartbeat(t.pingTimeout)},t.pingInterval)},r.prototype.flush=function(){"closed"!=this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(p("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.writeBuffer=[])},r.prototype.write=r.prototype.send=function(t){return this.sendPacket("message",t),this},r.prototype.sendPacket=function(t,e){var o={type:t,data:e};this.emit("packetCreate",o),this.writeBuffer.push(o),this.flush()},r.prototype.close=function(){return("opening"==this.readyState||"open"==this.readyState)&&(this.onClose("forced close"),p("socket closing - telling transport to close"),this.transport.close(),this.transport.removeAllListeners()),this},r.prototype.onError=function(t){this.emit("error",t),this.onClose("transport error",t)},r.prototype.onClose=function(t,e){"closed"!=this.readyState&&(p('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)}}),e.register("node_modules/engine.io-client/lib/transport.js",function(t,e,o){function n(t){this.path=t.path,this.host=t.host,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState=""}var r=o("./util"),i=o("./parser"),s=o("./event-emitter");t.exports=n,r.inherits(n,s),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(i.decodePacket(t))},n.prototype.onPacket=function(t){this.emit("packet",t)},n.prototype.onClose=function(){this.readyState="closed",this.emit("close")}}),e.register("node_modules/engine.io-client/lib/transports/flashsocket.js",function(t,e,o,n){function r(t){a.call(this,t),this.flashPath=t.flashPath,this.policyPort=t.policyPort}function i(t,e){if(h[t])return e();var o=document.createElement("script"),n=!1;o.onload=o.onreadystatechange=function(){if(!n&&!h[t]){var r=o.readyState;r&&"loaded"!=r&&"complete"!=r||(o.onload=o.onreadystatechange=null,n=!0,h[t]=!0,e())}},o.async=1,o.src=t;var r=document.getElementsByTagName("head")[0];r.insertBefore(o,r.firstChild)}function s(t,e){function o(n){return t[n]?(i(t[n],function(){o(++n)}),void 0):e()}o(0)}var a=o("./websocket"),c=o("../util");t.exports=r;var p=n[["Active"].concat("Object").join("X")];c.inherits(r,a),r.prototype.name="flashsocket",r.prototype.doOpen=function(){function t(){return function(){Array.prototype.join.call(arguments," ")}}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;s(e,function(){o.ready(function(){WebSocket.__addTask(function(){a.prototype.doOpen.call(o)})})})}},r.prototype.doClose=function(){if(this.socket){var t=this;WebSocket.__addTask(function(){a.prototype.doClose.call(t)})}},r.prototype.write=function(){var t=this,e=arguments;WebSocket.__addTask(function(){a.prototype.write.apply(t,e)})},r.prototype.ready=function(t){function e(){r.loaded||(843!=o.policyPort&&WebSocket.loadFlashPolicyFile("xmlsocket://"+o.host+":"+o.policyPort),WebSocket.__initialize(),r.loaded=!0),t.call(o)}if("undefined"!=typeof WebSocket&&"__initialize"in WebSocket&&swfobject&&!(10>swfobject.getFlashPlayerVersion().major)){var o=this;return document.body?e():(c.load(e),void 0)}},r.prototype.check=function(){if("undefined"!=typeof WebSocket&&!("__initialize"in WebSocket))return!1;if(p){var t=null;try{t=new p("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 h={}}),e.register("node_modules/engine.io-client/lib/transports/index.js",function(t,e,o,n){function r(t){var e,o=!1,r=!1;if(n.location){var a="https:"==location.protocol,c=location.port;Number(c)!=c&&(c=a?443:80),o=t.host!=location.hostname||c!=t.port,r=t.secure!=a}return e=p.request(o),r&&n.XDomainRequest&&e instanceof n.XDomainRequest?new s(t):e&&!t.forceJSONP?new i(t):new s(t)}var i=o("./polling-xhr"),s=o("./polling-jsonp"),a=o("./websocket"),c=o("./flashsocket"),p=o("../util");e.polling=r,e.websocket=a,e.flashsocket=c}),e.register("node_modules/engine.io-client/lib/transports/polling-jsonp.js",function(t,e,o,n){function r(t){i.call(this,t),a||(n.___eio||(n.___eio=[]),a=n.___eio),this.index=a.length;var e=this;a.push(function(t){e.onData(t)}),this.query.j=this.index}var i=o("./polling"),s=o("../util");t.exports=r;var a,c=/\n/g;s.inherits(r,i),r.prototype.doOpen=function(){var t=this;s.defer(function(){i.prototype.doOpen.call(t)})},r.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),i.prototype.doClose.call(this)},r.prototype.doPoll=function(){var t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri();var e=document.getElementsByTagName("script")[0];e.parentNode.insertBefore(t,e),this.script=t,s.ua.gecko&&setTimeout(function(){var t=document.createElement("iframe");document.body.appendChild(t),document.body.removeChild(t)},100)},r.prototype.doWrite=function(t,e){function o(){n(),e()}function n(){r.iframe&&r.form.removeChild(r.iframe);try{i=document.createElement('<iframe name="'+r.iframeId+'">')}catch(t){i=document.createElement("iframe"),i.name=r.iframeId}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(h){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"==r.iframe.readyState&&o()}:this.iframe.onload=o}}),e.register("node_modules/engine.io-client/lib/transports/polling-xhr.js",function(t,e,o,n){function r(){}function i(t){a.call(this,t),n.location&&(this.xd=t.host!=n.location.hostname||n.location.port!=t.port)}function s(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 a=o("./polling"),c=o("../event-emitter"),p=o("../util");t.exports=i,t.exports.Request=s;var h=n[["Active"].concat("Object").join("X")];p.inherits(i,a),i.prototype.doOpen=function(){var t=this;p.defer(function(){a.prototype.doOpen.call(t)})},i.prototype.request=function(t){return t=t||{},t.uri=this.uri(),t.xd=this.xd,new s(t)},i.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},i.prototype.doPoll=function(){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},p.inherits(s,c),s.prototype.create=function(){var t=this.xhr=p.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&&n.XDomainRequest&&t instanceof XDomainRequest?(t.onerror=function(t){e.onError(t)},t.onload=function(){e.onData(t.responseText)},t.onprogress=r):("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)}),t.send(this.data),h&&(this.index=s.requestsCount++,s.requests[this.index]=this)},s.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},s.prototype.onData=function(t){this.emit("data",t),this.onSuccess()},s.prototype.onError=function(t){this.emit("error",t),this.cleanup()},s.prototype.cleanup=function(){this.xhr.onreadystatechange=r,this.xhr.onload=this.xhr.onerror=r;try{this.xhr.abort()}catch(t){}h&&delete s.requests[this.index],this.xhr=null},s.prototype.abort=function(){this.cleanup()},h&&(s.requestsCount=0,s.requests={},n.attachEvent("onunload",function(){for(var t in s.requests)s.requests.hasOwnProperty(t)&&s.requests[t].abort()}))}),e.register("node_modules/engine.io-client/lib/transports/polling.js",function(t,e,o,n){function r(t){i.call(this,t)}var i=o("../transport"),s=o("../util"),a=o("../parser");t.exports=r,s.inherits(r,i),r.prototype.name="polling",r.prototype.doOpen=function(){this.poll()},r.prototype.pause=function(t){function e(){o.readyState="paused",t()}var o=this;if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(n++,this.once("pollComplete",function(){--n||e()})),this.writable||(n++,this.once("drain",function(){--n||e()}))}else e()},r.prototype.poll=function(){this.polling=!0,this.doPoll(),this.emit("poll")},r.prototype.onData=function(t){for(var e=a.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()},r.prototype.doClose=function(){this.send([{type:"close"}])},r.prototype.write=function(t){var e=this;this.writable=!1,this.doWrite(a.encodePayload(t),function(){e.writable=!0,e.emit("drain")})},r.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",o="";return(n.ActiveXObject||s.ua.android||s.ua.ios6||this.timestampRequests)&&(t[this.timestampParam]=+new Date),t=s.qs(t),this.port&&("https"==e&&443!=this.port||"http"==e&&80!=this.port)&&(o=":"+this.port),t.length&&(t="?"+t),e+"://"+this.host+o+this.path+t}}),e.register("node_modules/engine.io-client/lib/transports/websocket.js",function(t,e,o,n){function r(t){s.call(this,t)}function i(){return n.WebSocket||n.MozWebSocket}var s=o("../transport"),a=o("../parser"),c=o("../util");t.exports=r,c.inherits(r,s),r.prototype.name="websocket",r.prototype.doOpen=function(){if(this.check()){var t=this;this.socket=new(i())(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)}}},r.prototype.write=function(t){for(var e=0,o=t.length;o>e;e++)this.socket.send(a.encodePacket(t[e]))},r.prototype.doClose=function(){this.socket!==void 0&&this.socket.close()},r.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=c.qs(t),t.length&&(t="?"+t),e+"://"+this.host+o+this.path+t},r.prototype.check=function(){var t=i();return!(!t||"__initialize"in t&&this.name===r.prototype.name)}}),e.register("node_modules/engine.io-client/lib/util.js",function(t,e,o,n){var r=!1;e.inherits=function(t,e){function o(){}o.prototype=e.prototype,t.prototype=new o},e.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},e.on=function(t,e,o,n){t.attachEvent?t.attachEvent("on"+e,o):t.addEventListener&&t.addEventListener(e,o,n)},e.load=function(t){return n.document&&"complete"===document.readyState||r?t():(e.on(n,"load",t,!1),void 0)},"undefined"!=typeof window&&e.load(function(){r=!0}),e.defer=function(t){return e.ua.webkit&&"undefined"==typeof importScripts?(e.load(function(){setTimeout(t,100)}),void 0):t()};var i=/^[\],:{}\s]*$/,s=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,a=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,c=/(?:^|:|,)(?:\s*\[)+/g,p=/^\s+/,h=/\s+$/;e.parseJSON=function(t){return"string"==typeof t&&t?(t=t.replace(p,"").replace(h,""),n.JSON&&JSON.parse?JSON.parse(t):i.test(t.replace(s,"@").replace(a,"]").replace(c,""))?Function("return "+t)():void 0):null},e.ua={},e.ua.hasCORS="undefined"!=typeof XMLHttpRequest&&function(){try{var t=new XMLHttpRequest}catch(e){return!1}return void 0!=t.withCredentials}(),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(t){if(t&&"undefined"!=typeof XDomainRequest&&!e.ua.hasCORS)return new XDomainRequest;try{if("undefined"!=typeof XMLHttpRequest&&(!t||e.ua.hasCORS))return new XMLHttpRequest}catch(o){}if(!t)try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(o){}};var u=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,l=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];e.parseUri=function(t){for(var e=u.exec(t||""),o={},n=14;n--;)o[l[n]]=e[n]||"";return o},e.qs=function(t){var e="";for(var o in t)t.hasOwnProperty(o)&&(e.length&&(e+="&"),e+=o+"="+encodeURIComponent(t[o]));return e}});var n=e("main");"undefined"!=typeof module?module.exports=n:main=n})();

0 comments on commit 5ac9864

Please sign in to comment.
Something went wrong with that request. Please try again.