(function(e){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=e()}else if(typeof define==="function"&&define.amd){define([],e)}else{var t;if(typeof window!=="undefined"){t=window}else if(typeof global!=="undefined"){t=global}else if(typeof self!=="undefined"){t=self}else{t=this}t.io=e()}})(function(){var e,t,r;return function n(e,t,r){function i(s,a){if(!t[s]){if(!e[s]){var c=typeof require=="function"&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var f=new Error("Cannot find module '"+s+"'");throw f.code="MODULE_NOT_FOUND",f}var u=t[s]={exports:{}};e[s][0].call(u.exports,function(t){var r=e[s][1][t];return i(r?r:t)},u,u.exports,n,e,t,r)}return t[s].exports}var o=typeof require=="function"&&require;for(var s=0;s0){this.extraHeaders=t.extraHeaders}}this.open()}l.priorWebsocketSuccess=false;i(l.prototype);l.protocol=a.protocol;l.Socket=l;l.Transport=e("./transport");l.transports=e("./transports");l.parser=e("engine.io-parser");l.prototype.createTransport=function(e){o('creating transport "%s"',e);var t=h(this.query);t.EIO=a.protocol;t.transport=e;if(this.id)t.sid=this.id;var r=new n[e]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:t,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return r};function h(e){var t={};for(var r in e){if(e.hasOwnProperty(r)){t[r]=e[r]}}return t}l.prototype.open=function(){var e;if(this.rememberUpgrade&&l.priorWebsocketSuccess&&this.transports.indexOf("websocket")!=-1){e="websocket"}else if(0===this.transports.length){var t=this;setTimeout(function(){t.emit("error","No transports available")},0);return}else{e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(r){this.transports.shift();this.open();return}e.open();this.setTransport(e)};l.prototype.setTransport=function(e){o("setting transport %s",e.name);var t=this;if(this.transport){o("clearing existing transport %s",this.transport.name);this.transport.removeAllListeners()}this.transport=e;e.on("drain",function(){t.onDrain()}).on("packet",function(e){t.onPacket(e)}).on("error",function(e){t.onError(e)}).on("close",function(){t.onClose("transport close")})};l.prototype.probe=function(e){o('probing transport "%s"',e);var t=this.createTransport(e,{probe:1}),r=false,n=this;l.priorWebsocketSuccess=false;function i(){if(n.onlyBinaryUpgrades){var i=!this.supportsBinary&&n.transport.supportsBinary;r=r||i}if(r)return;o('probe transport "%s" opened',e);t.send([{type:"ping",data:"probe"}]);t.once("packet",function(i){if(r)return;if("pong"==i.type&&"probe"==i.data){o('probe transport "%s" pong',e);n.upgrading=true;n.emit("upgrading",t);if(!t)return;l.priorWebsocketSuccess="websocket"==t.name;o('pausing current transport "%s"',n.transport.name);n.transport.pause(function(){if(r)return;if("closed"==n.readyState)return;o("changing transport and sending upgrade packet");p();n.setTransport(t);t.send([{type:"upgrade"}]);n.emit("upgrade",t);t=null;n.upgrading=false;n.flush()})}else{o('probe transport "%s" failed',e);var s=new Error("probe error");s.transport=t.name;n.emit("upgradeError",s)}})}function s(){if(r)return;r=true;p();t.close();t=null}function a(r){var i=new Error("probe error: "+r);i.transport=t.name;s();o('probe transport "%s" failed because of error: %s',e,r);n.emit("upgradeError",i)}function c(){a("transport closed")}function f(){a("socket closed")}function u(e){if(t&&e.name!=t.name){o('"%s" works - aborting "%s"',e.name,t.name);s()}}function p(){t.removeListener("open",i);t.removeListener("error",a);t.removeListener("close",c);n.removeListener("close",f);n.removeListener("upgrading",u)}t.once("open",i);t.once("error",a);t.once("close",c);this.once("close",f);this.once("upgrading",u);t.open()};l.prototype.onOpen=function(){o("socket open");this.readyState="open";l.priorWebsocketSuccess="websocket"==this.transport.name;this.emit("open");this.flush();if("open"==this.readyState&&this.upgrade&&this.transport.pause){o("starting upgrade probes");for(var e=0,t=this.upgrades.length;e';c=document.createElement(t)}catch(e){c=document.createElement("iframe");c.name=r.iframeId;c.src="javascript:0"}c.id=r.iframeId;r.form.appendChild(c);r.iframe=c}u();e=e.replace(s,"\\\n");this.area.value=e.replace(o,"\\n");try{this.form.submit()}catch(p){}if(this.iframe.attachEvent){this.iframe.onreadystatechange=function(){if(r.iframe.readyState=="complete"){f()}}}else{this.iframe.onload=f}}}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{})},{"./polling":8,"component-inherit":16}],7:[function(e,t,r){(function(r){var n=e("xmlhttprequest-ssl");var i=e("./polling");var o=e("component-emitter");var s=e("component-inherit");var a=e("debug")("engine.io-client:polling-xhr");t.exports=f;t.exports.Request=u;function c(){}function f(e){i.call(this,e);if(r.location){var t="https:"==location.protocol;var n=location.port;if(!n){n=t?443:80}this.xd=e.hostname!=r.location.hostname||n!=e.port;this.xs=e.secure!=t}else{this.extraHeaders=e.extraHeaders}}s(f,i);f.prototype.supportsBinary=true;f.prototype.request=function(e){e=e||{};e.uri=this.uri();e.xd=this.xd;e.xs=this.xs;e.agent=this.agent||false;e.supportsBinary=this.supportsBinary;e.enablesXDR=this.enablesXDR;e.pfx=this.pfx;e.key=this.key;e.passphrase=this.passphrase;e.cert=this.cert;e.ca=this.ca;e.ciphers=this.ciphers;e.rejectUnauthorized=this.rejectUnauthorized;e.extraHeaders=this.extraHeaders;return new u(e)};f.prototype.doWrite=function(e,t){var r=typeof e!=="string"&&e!==undefined;var n=this.request({method:"POST",data:e,isBinary:r});var i=this;n.on("success",t);n.on("error",function(e){i.onError("xhr post error",e)});this.sendXhr=n};f.prototype.doPoll=function(){a("xhr poll");var e=this.request();var t=this;e.on("data",function(e){t.onData(e)});e.on("error",function(e){t.onError("xhr poll error",e)});this.pollXhr=e};function u(e){this.method=e.method||"GET";this.uri=e.uri;this.xd=!!e.xd;this.xs=!!e.xs;this.async=false!==e.async;this.data=undefined!=e.data?e.data:null;this.agent=e.agent;this.isBinary=e.isBinary;this.supportsBinary=e.supportsBinary;this.enablesXDR=e.enablesXDR;this.pfx=e.pfx;this.key=e.key;this.passphrase=e.passphrase;this.cert=e.cert;this.ca=e.ca;this.ciphers=e.ciphers;this.rejectUnauthorized=e.rejectUnauthorized;this.extraHeaders=e.extraHeaders;this.create()}o(u.prototype);u.prototype.create=function(){var e={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};e.pfx=this.pfx;e.key=this.key;e.passphrase=this.passphrase;e.cert=this.cert;e.ca=this.ca;e.ciphers=this.ciphers;e.rejectUnauthorized=this.rejectUnauthorized;var t=this.xhr=new n(e);var i=this;try{a("xhr open %s: %s",this.method,this.uri);t.open(this.method,this.uri,this.async);try{if(this.extraHeaders){t.setDisableHeaderCheck(true);for(var o in this.extraHeaders){if(this.extraHeaders.hasOwnProperty(o)){t.setRequestHeader(o,this.extraHeaders[o])}}}}catch(s){}if(this.supportsBinary){t.responseType="arraybuffer"}if("POST"==this.method){try{if(this.isBinary){t.setRequestHeader("Content-type","application/octet-stream")}else{t.setRequestHeader("Content-type","text/plain;charset=UTF-8")}}catch(s){}}if("withCredentials"in t){t.withCredentials=true}if(this.hasXDR()){t.onload=function(){i.onLoad()};t.onerror=function(){i.onError(t.responseText)}}else{t.onreadystatechange=function(){if(4!=t.readyState)return;if(200==t.status||1223==t.status){i.onLoad()}else{setTimeout(function(){i.onError(t.status)},0)}}}a("xhr data %s",this.data);t.send(this.data)}catch(s){setTimeout(function(){i.onError(s)},0);return}if(r.document){this.index=u.requestsCount++;u.requests[this.index]=this}};u.prototype.onSuccess=function(){this.emit("success");this.cleanup()};u.prototype.onData=function(e){this.emit("data",e);this.onSuccess()};u.prototype.onError=function(e){this.emit("error",e);this.cleanup(true)};u.prototype.cleanup=function(e){if("undefined"==typeof this.xhr||null===this.xhr){return}if(this.hasXDR()){this.xhr.onload=this.xhr.onerror=c}else{this.xhr.onreadystatechange=c}if(e){try{this.xhr.abort()}catch(t){}}if(r.document){delete u.requests[this.index]}this.xhr=null};u.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type").split(";")[0]}catch(r){}if(t==="application/octet-stream"){e=this.xhr.response}else{if(!this.supportsBinary){e=this.xhr.responseText}else{try{e=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(r){var n=new Uint8Array(this.xhr.response);var i=[];for(var o=0,s=n.length;on){r=n}if(t>=n||t>=r||n===0){return new ArrayBuffer(0)}var i=new Uint8Array(e);var o=new Uint8Array(r-t);for(var s=t,a=0;s>2];o+=e[(r[n]&3)<<4|r[n+1]>>4];o+=e[(r[n+1]&15)<<2|r[n+2]>>6];o+=e[r[n+2]&63]}if(i%3===2){o=o.substring(0,o.length-1)+"="}else if(i%3===1){o=o.substring(0,o.length-2)+"=="}return o};r.decode=function(t){var r=t.length*.75,n=t.length,i,o=0,s,a,c,f;if(t[t.length-1]==="="){r--;if(t[t.length-2]==="="){r--}}var u=new ArrayBuffer(r),p=new Uint8Array(u);for(i=0;i>4;p[o++]=(a&15)<<4|c>>2;p[o++]=(c&3)<<6|f&63}return u}})("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/")},{}],14:[function(e,t,r){(function(e){var r=e.BlobBuilder||e.WebKitBlobBuilder||e.MSBlobBuilder||e.MozBlobBuilder;var n=function(){try{var e=new Blob(["hi"]);return e.size===2}catch(t){return false}}();var i=n&&function(){try{var e=new Blob([new Uint8Array([1,2])]);return e.size===2}catch(t){return false}}();var o=r&&r.prototype.append&&r.prototype.getBlob;function s(e){for(var t=0;t=31}r.formatters.j=function(e){return JSON.stringify(e)};function i(){var e=arguments;var t=this.useColors;e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+r.humanize(this.diff);if(!t)return e;var n="color: "+this.color;e=[e[0],n,"color: inherit"].concat(Array.prototype.slice.call(e,1));var i=0;var o=0;e[0].replace(/%[a-z%]/g,function(e){if("%%"===e)return;i++;if("%c"===e){o=i}});e.splice(o,0,n);return e}function o(){return"object"===typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)}function s(e){try{if(null==e){r.storage.removeItem("debug")}else{r.storage.debug=e}}catch(t){}}function a(){var e;try{e=r.storage.debug}catch(t){}return e}r.enable(a());function c(){try{return window.localStorage}catch(e){}}},{"./debug":18}],18:[function(e,t,r){r=t.exports=s;r.coerce=u;r.disable=c;r.enable=a;r.enabled=f;r.humanize=e("ms");r.names=[];r.skips=[];r.formatters={};var n=0;var i;function o(){return r.colors[n++%r.colors.length]}function s(e){function t(){}t.enabled=false;function n(){var e=n;var t=+new Date;var s=t-(i||t);e.diff=s;e.prev=i;e.curr=t;i=t;if(null==e.useColors)e.useColors=r.useColors();if(null==e.color&&e.useColors)e.color=o();var a=Array.prototype.slice.call(arguments);a[0]=r.coerce(a[0]);if("string"!==typeof a[0]){a=["%o"].concat(a)}var c=0;a[0]=a[0].replace(/%([a-z%])/g,function(t,n){if(t==="%%")return t;c++;var i=r.formatters[n];if("function"===typeof i){var o=a[c];t=i.call(e,o);a.splice(c,1);c--}return t});if("function"===typeof r.formatArgs){a=r.formatArgs.apply(e,a)}var f=n.log||r.log||console.log.bind(console);f.apply(e,a)}n.enabled=true;var s=r.enabled(e)?n:t;s.namespace=e;return s}function a(e){r.save(e);var t=(e||"").split(/[\s,]+/);var n=t.length;for(var i=0;i1){return{type:h[s],data:e.substring(1)}}else{return{type:h[s]}}}var a=new Uint8Array(e);var s=a[0];var f=o(e,1);if(y&&t==="blob"){f=new y([f])}return{type:h[s],data:f}};r.decodeBase64Packet=function(e,r){var n=h[e.charAt(0)];if(!t.ArrayBuffer){return{type:n,data:{base64:true,data:e.substr(1)}}}var i=s.decode(e.substr(1));if(r==="blob"&&y){i=new y([i])}return{type:n,data:i}};r.encodePayload=function(e,t,n){if(typeof t=="function"){n=t;t=null}var o=i(e);if(t&&o){if(y&&!p){return r.encodePayloadAsBlob(e,n)}return r.encodePayloadAsArrayBuffer(e,n)}if(!e.length){return n("0:")}function s(e){return e.length+":"+e}function a(e,n){r.encodePacket(e,!o?false:t,true,function(e){n(null,s(e))})}w(e,a,function(e,t){return n(t.join(""))})};function w(e,t,r){var n=new Array(e.length);var i=a(e.length,r);var o=function(e,r,i){t(r,function(t,r){n[e]=r;i(t,n)})};for(var s=0;s0){var c=new Uint8Array(i);var f=c[0]===0;var u="";for(var p=1;;p++){if(c[p]==255)break;if(u.length>310){a=true;break}u+=c[p]}if(a)return n(d,0,1);i=o(i,2+u.length);u=parseInt(u);var l=o(i,0,u);if(f){try{l=String.fromCharCode.apply(null,new Uint8Array(l))}catch(h){var y=new Uint8Array(l);l="";for(var p=0;p1e4)return;var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(!t)return;var r=parseFloat(t[1]);var c=(t[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return r*a;case"days":case"day":case"d":return r*s;case"hours":case"hour":case"hrs":case"hr":case"h":return r*o;case"minutes":case"minute":case"mins":case"min":case"m":return r*i;case"seconds":case"second":case"secs":case"sec":case"s":return r*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return r}}function f(e){if(e>=s)return Math.round(e/s)+"d";if(e>=o)return Math.round(e/o)+"h";if(e>=i)return Math.round(e/i)+"m";if(e>=n)return Math.round(e/n)+"s";return e+"ms"}function u(e){return p(e,s,"day")||p(e,o,"hour")||p(e,i,"minute")||p(e,n,"second")||e+" ms"}function p(e,t,r){if(e=55296&&i<=56319&&r65535){n-=65536;i+=c(n>>>10&1023|55296);n=56320|n&1023}i+=c(n)}return i}function p(e){if(e>=55296&&e<=57343){throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}}function l(e,t){return c(e>>t&63|128)}function h(e){if((e&4294967168)==0){return c(e)}var t="";if((e&4294965248)==0){t=c(e>>6&31|192)}else if((e&4294901760)==0){p(e);t=c(e>>12&15|224);t+=l(e,6)}else if((e&4292870144)==0){t=c(e>>18&7|240);t+=l(e,12);t+=l(e,6)}t+=c(e&63|128);return t}function d(e){var t=f(e);var r=t.length;var n=-1;var i;var o="";while(++n=m){throw Error("Invalid byte index")}var e=v[b]&255;b++;if((e&192)==128){return e&63}throw Error("Invalid continuation byte")}function g(){var e;var t;var r;var n;var i;if(b>m){throw Error("Invalid byte index")}if(b==m){return false}e=v[b]&255;b++;if((e&128)==0){return e}if((e&224)==192){var t=y();i=(e&31)<<6|t;if(i>=128){return i}else{throw Error("Invalid continuation byte")}}if((e&240)==224){t=y();r=y();i=(e&15)<<12|t<<6|r;if(i>=2048){p(i);return i}else{throw Error("Invalid continuation byte")}}if((e&248)==240){t=y();r=y();n=y();i=(e&15)<<18|t<<12|r<<6|n;if(i>=65536&&i<=1114111){return i}}throw Error("Invalid UTF-8 detected")}var v;var m;var b;function w(e){v=f(e);m=v.length;b=0;var t=[];var r;while((r=g())!==false){t.push(r)}return u(t)}var k={version:"2.0.0",encode:d,decode:w};if(typeof e=="function"&&typeof e.amd=="object"&&e.amd){e(function(){return k})}else if(o&&!o.nodeType){if(s){s.exports=k}else{var x={};var A=x.hasOwnProperty;for(var B in k){A.call(k,B)&&(o[B]=k[B])}}}else{i.utf8=k}})(this)}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{})},{}],30:[function(e,t,r){"use strict";var n="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),i=64,o={},s=0,a=0,c;function f(e){var t="";do{t=n[e%i]+t;e=Math.floor(e/i)}while(e>0);return t}function u(e){var t=0;for(a=0;a0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}};h.prototype.cleanup=function(){f("cleanup");var e;while(e=this.subs.shift())e.destroy();this.packetBuffer=[];this.encoding=false;this.lastPing=null;this.decoder.destroy()};h.prototype.close=h.prototype.disconnect=function(){f("disconnect");this.skipReconnect=true;this.reconnecting=false;if("opening"==this.readyState){this.cleanup()}this.backoff.reset();this.readyState="closed";if(this.engine)this.engine.close()};h.prototype.onclose=function(e){f("onclose");this.cleanup();this.backoff.reset();this.readyState="closed";this.emit("close",e);if(this._reconnection&&!this.skipReconnect){this.reconnect()}};h.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts){f("reconnect failed");this.backoff.reset();this.emitAll("reconnect_failed");this.reconnecting=false}else{var t=this.backoff.duration();f("will wait %dms before reconnect attempt",t);this.reconnecting=true;var r=setTimeout(function(){if(e.skipReconnect)return;f("attempting reconnect");e.emitAll("reconnect_attempt",e.backoff.attempts);e.emitAll("reconnecting",e.backoff.attempts);if(e.skipReconnect)return;e.open(function(t){if(t){f("reconnect attempt error");e.reconnecting=false;e.reconnect();e.emitAll("reconnect_error",t.data)}else{f("reconnect success");e.onreconnect()}})},t);this.subs.push({destroy:function(){clearTimeout(r)}})}};h.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=false;this.backoff.reset();this.updateSocketIds();this.emitAll("reconnect",e)}},{"./on":33,"./socket":34,backo2:36,"component-bind":37,"component-emitter":38,debug:39,"engine.io-client":1,indexof:42,"socket.io-parser":47}],33:[function(e,t,r){t.exports=n;function n(e,t,r){e.on(t,r);return{destroy:function(){e.removeListener(t,r)}}}},{}],34:[function(e,t,r){var n=e("socket.io-parser");var i=e("component-emitter");var o=e("to-array");var s=e("./on");var a=e("component-bind");var c=e("debug")("socket.io-client:socket");var f=e("has-binary");t.exports=r=l;var u={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1};var p=i.prototype.emit;function l(e,t){this.io=e;this.nsp=t;this.json=this;this.ids=0;this.acks={};this.receiveBuffer=[];this.sendBuffer=[];this.connected=false;this.disconnected=true;if(this.io.autoConnect)this.open()}i(l.prototype);l.prototype.subEvents=function(){if(this.subs)return;var e=this.io;this.subs=[s(e,"open",a(this,"onopen")),s(e,"packet",a(this,"onpacket")),s(e,"close",a(this,"onclose"))]};l.prototype.open=l.prototype.connect=function(){if(this.connected)return this;this.subEvents();this.io.open();if("open"==this.io.readyState)this.onopen();this.emit("connecting");return this};l.prototype.send=function(){var e=o(arguments);e.unshift("message");this.emit.apply(this,e);return this};l.prototype.emit=function(e){if(u.hasOwnProperty(e)){p.apply(this,arguments);return this}var t=o(arguments);var r=n.EVENT;if(f(t)){r=n.BINARY_EVENT}var i={type:r,data:t};i.options={};i.options.compress=!this.flags||false!==this.flags.compress;if("function"==typeof t[t.length-1]){c("emitting packet with ack id %d",this.ids);this.acks[this.ids]=t.pop();i.id=this.ids++}if(this.connected){this.packet(i)}else{this.sendBuffer.push(i)}delete this.flags;return this};l.prototype.packet=function(e){e.nsp=this.nsp;this.io.packet(e)};l.prototype.onopen=function(){c("transport is open - connecting");if("/"!=this.nsp){this.packet({type:n.CONNECT})}};l.prototype.onclose=function(e){c("close (%s)",e);this.connected=false;this.disconnected=true;delete this.id;this.emit("disconnect",e)};l.prototype.onpacket=function(e){if(e.nsp!=this.nsp)return;switch(e.type){case n.CONNECT:this.onconnect();break;case n.EVENT:this.onevent(e);break;case n.BINARY_EVENT:this.onevent(e);break;case n.ACK:this.onack(e);break;case n.BINARY_ACK:this.onack(e);break;case n.DISCONNECT:this.ondisconnect();break;case n.ERROR:this.emit("error",e.data);break}};l.prototype.onevent=function(e){var t=e.data||[];c("emitting event %j",t);if(null!=e.id){c("attaching ack callback to event");t.push(this.ack(e.id))}if(this.connected){p.apply(this,t)}else{this.receiveBuffer.push(t)}};l.prototype.ack=function(e){var t=this;var r=false;return function(){if(r)return;r=true;var i=o(arguments);c("sending ack %j",i);var s=f(i)?n.BINARY_ACK:n.ACK;t.packet({type:s,id:e,data:i})}};l.prototype.onack=function(e){var t=this.acks[e.id];if("function"==typeof t){c("calling ack %s with %j",e.id,e.data);t.apply(this,e.data);delete this.acks[e.id]}else{c("bad ack %s",e.id)}};l.prototype.onconnect=function(){this.connected=true;this.disconnected=false;this.emit("connect");this.emitBuffered()};l.prototype.emitBuffered=function(){var e;for(e=0;e0&&e.jitter<=1?e.jitter:0;this.attempts=0}n.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random();var r=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-r:e+r}return Math.min(e,this.max)|0};n.prototype.reset=function(){this.attempts=0};n.prototype.setMin=function(e){this.ms=e};n.prototype.setMax=function(e){this.max=e};n.prototype.setJitter=function(e){this.jitter=e}},{}],37:[function(e,t,r){var n=[].slice;t.exports=function(e,t){if("string"==typeof t)t=e[t];if("function"!=typeof t)throw new Error("bind() requires a function");var r=n.call(arguments,2);return function(){return t.apply(e,r.concat(n.call(arguments)))}}},{}],38:[function(e,t,r){t.exports=n;function n(e){if(e)return i(e)}function i(e){for(var t in n.prototype){e[t]=n.prototype[t]}return e}n.prototype.on=n.prototype.addEventListener=function(e,t){this._callbacks=this._callbacks||{};(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t);return this};n.prototype.once=function(e,t){function r(){this.off(e,r);t.apply(this,arguments)}r.fn=t;this.on(e,r);return this};n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){this._callbacks=this._callbacks||{};if(0==arguments.length){this._callbacks={};return this}var r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length){delete this._callbacks["$"+e];return this}var n;for(var i=0;i1)))/4)-_((e-1901+t)/100)+_((e-1601+t)/400)}}if(!(y=h.hasOwnProperty)){y=function(e){var t={},r;if((t.__proto__=null,t.__proto__={toString:1},t).toString!=d){y=function(e){var t=this.__proto__,r=e in(this.__proto__=null,this);this.__proto__=t;return r}}else{r=t.constructor;y=function(e){var t=(this.constructor||r).prototype;return e in this&&!(e in t&&this[e]===t[e])}}t=null;return y.call(this,e)}}g=function(e,t){var r=0,n,i,s;(n=function(){this.valueOf=0}).prototype.valueOf=0;i=new n;for(s in i){if(y.call(i,s)){r++}}n=i=null;if(!r){i=["valueOf","toString","toLocaleString","propertyIsEnumerable","isPrototypeOf","hasOwnProperty","constructor"];g=function(e,t){var r=d.call(e)==k,n,s;var a=!r&&typeof e.constructor!="function"&&o[typeof e.hasOwnProperty]&&e.hasOwnProperty||y;for(n in e){if(!(r&&n=="prototype")&&a.call(e,n)){t(n)}}for(s=i.length;n=i[--s];a.call(e,n)&&t(n));}}else if(r==2){g=function(e,t){var r={},n=d.call(e)==k,i;for(i in e){if(!(n&&i=="prototype")&&!y.call(r,i)&&(r[i]=1)&&y.call(e,i)){t(i)}}}}else{g=function(e,t){var r=d.call(e)==k,n,i;for(n in e){if(!(r&&n=="prototype")&&y.call(e,n)&&!(i=n==="constructor")){t(n)}}if(i||y.call(e,n="constructor")){t(n)}}}return g(e,t)};if(!w("json-stringify")){var j={92:"\\\\",34:'\\"',8:"\\b",12:"\\f",10:"\\n",13:"\\r",9:"\\t"};var P="000000";var N=function(e,t){return(P+(t||0)).slice(-e)};var R="\\u00";var D=function(e){var t='"',r=0,n=e.length,i=!E||n>10;var o=i&&(E?e.split(""):e);for(;r-1/0&&a<1/0){if(O){l=_(a/864e5);for(f=_(l/365.2425)+1970-1;O(f+1,0)<=l;f++);for(p=_((l-O(f,0))/30.42);O(f,p+1)<=l;p++);l=1+l-O(f,p);h=(a%864e5+864e5)%864e5;m=_(h/36e5)%24;b=_(h/6e4)%60;w=_(h/1e3)%60;k=h%1e3}else{f=a.getUTCFullYear();p=a.getUTCMonth();l=a.getUTCDate();m=a.getUTCHours();b=a.getUTCMinutes();w=a.getUTCSeconds();k=a.getUTCMilliseconds()}a=(f<=0||f>=1e4?(f<0?"-":"+")+N(6,f<0?-f:f):N(4,f))+"-"+N(2,p+1)+"-"+N(2,l)+"T"+N(2,m)+":"+N(2,b)+":"+N(2,w)+"."+N(3,k)+"Z"}else{a=null}}else if(typeof a.toJSON=="function"&&(c!=A&&c!=B&&c!=C||y.call(a,"toJSON"))){a=a.toJSON(e)}}if(r){a=r.call(t,e,a)}if(a===null){return"null"}c=d.call(a);if(c==S){return""+a}else if(c==A){return a>-1/0&&a<1/0?""+a:"null"}else if(c==B){return D(""+a)}if(typeof a=="object"){for(P=s.length;P--;){if(s[P]===a){throw u()}}s.push(a);E=[];R=o;o+=i;if(c==C){for(j=0,P=a.length;j0){for(n="",r>10&&(r=10);n.length=48&&s<=57||s>=97&&s<=102||s>=65&&s<=70)){H()}}r+=q("0x"+e.slice(n,M));break;default:H()}}else{if(s==34){break}s=e.charCodeAt(M);n=M;while(s>=32&&s!=92&&s!=34){s=e.charCodeAt(++M)}r+=e.slice(n,M)}}if(e.charCodeAt(M)==34){M++;return r}H();default:n=M;if(s==45){o=true;s=e.charCodeAt(++M)}if(s>=48&&s<=57){if(s==48&&(s=e.charCodeAt(M+1),s>=48&&s<=57)){H()}o=false;for(;M=48&&s<=57);M++);if(e.charCodeAt(M)==46){i=++M;for(;i=48&&s<=57);i++);if(i==M){H()}M=i}s=e.charCodeAt(M);if(s==101||s==69){s=e.charCodeAt(++M);if(s==43||s==45){M++}for(i=M;i=48&&s<=57);i++);if(i==M){H()}M=i}return+e.slice(n,M)}if(o){H()}if(e.slice(M,M+4)=="true"){M+=4;return true}else if(e.slice(M,M+5)=="false"){M+=5;return false}else if(e.slice(M,M+4)=="null"){M+=4;return null}H()}}return"$"};var J=function(e){var t,r;if(e=="$"){H()}if(typeof e=="string"){if((E?e.charAt(0):e[0])=="@"){return e.slice(1)}if(e=="["){t=[];for(;;r||(r=true)){e=z();if(e=="]"){break}if(r){if(e==","){e=z();if(e=="]"){H()}}else{H()}}if(e==","){H()}t.push(J(e))}return t}else if(e=="{"){t={};for(;;r||(r=true)){e=z();if(e=="}"){break}if(r){if(e==","){e=z();if(e=="}"){H()}}else{H()}}if(e==","||typeof e!="string"||(E?e.charAt(0):e[0])!="@"||z()!=":"){H()}t[e.slice(1)]=J(z())}return t}H()}return e};var X=function(e,t,r){var n=F(e,t,r);if(n===v){delete e[t]}else{e[t]=n}};var F=function(e,t,r){var n=e[t],i;if(typeof n=="object"&&n){if(d.call(n)==C){for(i=n.length;i--;){X(n,i,r)}}else{g(n,function(e){X(n,e,r)})}}return r.call(e,t,n)};t.parse=function(e,t){var r,n;M=0;I=""+e;r=J(z());if(z()!="$"){H()}M=I=null;return t&&d.call(t)==k?F((n={},n[""]=r,n),"",t):r}}}t["runInContext"]=f;return t}if(s&&!i){f(a,s)}else{var u=a.JSON,p=a["JSON3"],l=false;var h=f(a,a["JSON3"]={noConflict:function(){if(!l){l=true;a.JSON=u;a["JSON3"]=p;u=p=null}return h}});a.JSON={parse:h.parse,stringify:h.stringify}}if(i){e(function(){return h})}}).call(this)}).call(this,typeof self!=="undefined"?self:typeof window!=="undefined"?window:typeof global!=="undefined"?global:{})},{}],51:[function(e,t,r){t.exports=n;function n(e,t){var r=[];t=t||0;for(var n=t||0;n