Socket
Socket
Sign inDemoInstall

faye

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

faye - npm Package Compare versions

Comparing version 1.3.0 to 1.4.0

9

CHANGELOG.md

@@ -0,1 +1,10 @@

### 1.4.0 / 2020-07-31
- Implement TLS certificate verification and enable it by default in the Ruby
client class `Faye::Client`
- Add a `:tls` option to the Ruby client with sub-field `:verify_peer` for
configuring TLS verification
- Officially support the `tls` option in the Node.js client, whose contents are
forward to the `https` and `tls` modules as appropriate
### 1.3.0 / 2020-06-08

@@ -2,0 +11,0 @@

2

client/faye-browser-min.js

@@ -1,2 +0,2 @@

var Faye=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";var i=Array.prototype.forEach,s=Object.prototype.hasOwnProperty;t.exports=function(t){return i.call(arguments,(function(e,n){if(0!==n)for(var i in e)s.call(e,i)&&(t[i]=e[i])})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports={isURI:function(t){return t&&t.protocol&&t.host&&t.path},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t){if("string"!=typeof t)return t;var e,n,i,s,r,o,c={},a=function(e,n){t=t.replace(n,(function(t){return c[e]=t,""})),c[e]=c[e]||""};for(a("protocol",/^[a-z]+\:/i),a("host",/^\/\/[^\/\?#]+/),/^\//.test(t)||c.host||(t=location.pathname.replace(/[^\/]*$/,"")+t),a("pathname",/^[^\?#]*/),a("search",/^\?[^#]*/),a("hash",/^#.*/),c.protocol=c.protocol||location.protocol,c.host?(c.host=c.host.substr(2),/@/.test(c.host)&&(c.auth=c.host.split("@")[0],c.host=c.host.split("@")[1]),e=c.host.match(/^\[([^\]]+)\]|^[^:]+/),c.hostname=e[1]||e[0],c.port=(c.host.match(/:(\d+)$/)||[])[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,o={},s=0,r=(i=(n=c.search.replace(/^\?/,""))?n.split("&"):[]).length;s<r;s++)e=i[s].split("="),o[decodeURIComponent(e[0]||"")]=decodeURIComponent(e[1]||"");return c.query=o,c.href=this.stringify(c),c},stringify:function(t){var e=t.auth?t.auth+"@":"",n=t.protocol+"//"+e+t.host;return n+=t.pathname+this.queryString(t.query)+(t.hash||"")},queryString:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return 0===e.length?"":"?"+e.join("&")}}},function(t,e,n){"use strict";var i=n(1),s=n(18).Cookie,r=n(6),o=n(11),c=n(0),a=n(8),h=n(29),u=n(15),l=c(i({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},MAX_DELAY:0,batching:!0,initialize:function(t,e){this._dispatcher=t,this.endpoint=e,this._outbox=[],this._proxy=c({},this._dispatcher.proxy),this._proxy.origin||(this._proxy.origin=this._findProxy())},close:function(){},encode:function(t){return""},sendMessage:function(t){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,this.endpoint.href,t),this.batching?(this._outbox.push(t),this._flushLargeBatch(),t.channel===u.HANDSHAKE?this._publish(.01):(t.channel===u.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):r.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new r((function(e){t._resolvePromise=e}))},_publish:function(t){return this._makePromise(),this.addTimeout("publish",t,(function(){this._flush(),delete this._requestPromise}),this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length<this._dispatcher.maxRequestSize)){var t=this._outbox.pop();this._makePromise(),this._flush(),t&&this._outbox.push(t)}},_receive:function(t){if(t){t=[].concat(t),this.debug("Client ? received from ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var e=0,n=t.length;e<n;e++)this._dispatcher.handleResponse(t[e])}},_handleError:function(t,e){t=[].concat(t),this.debug("Client ? failed to send to ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var n=0,i=t.length;n<i;n++)this._dispatcher.handleError(t[n])},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?o.map(t.getCookiesSync(e),(function(t){return t.cookieString()})).join("; "):""},_storeCookies:function(t){var e,n=this._dispatcher.cookies,i=this.endpoint.href;if(t&&n)for(var r=0,o=(t=[].concat(t)).length;r<o;r++)e=s.parse(t[r]),n.setCookieSync(e,i)},_findProxy:function(){if("undefined"!=typeof process){var t=this.endpoint.protocol;if(t){var e,n,i=t.replace(/:$/,"").toLowerCase()+"_proxy",s=i.toUpperCase(),r=process.env;return"http_proxy"===i&&r.REQUEST_METHOD?(1===(e=Object.keys(r).filter((function(t){return/^http_proxy$/i.test(t)}))).length?e[0]===i&&void 0===r[s]&&(n=r[i]):e.length>1&&(n=r[i]),n=n||r["CGI_"+s]):(n=r[i]||r[s])&&!r[i]&&console.warn("The environment variable "+s+" is discouraged. Use "+i+"."),n}}}}),{get:function(t,e,n,i,s){var r=t.endpoint;o.asyncEach(this._transports,(function(r,c){var a=r[0],h=r[1],u=t.endpointFor(a);return o.indexOf(n,a)>=0?c():o.indexOf(e,a)<0?(h.isUsable(t,u,(function(){})),c()):void h.isUsable(t,u,(function(e){if(!e)return c();var n=h.hasOwnProperty("create")?h.create(t,u):new h(t,u);i.call(s,n)}))}),(function(){throw new Error("Could not find a usable connection type for "+r.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return o.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(var e=0;e<this._transports.length;e++)this._transports[e][1]._unloaded=!1},_transports:[]});c(l.prototype,a),c(l.prototype,h),t.exports=l},function(t,e,n){"use strict";t.exports=function(t){return JSON.stringify(t,(function(t,e){return this[t]instanceof Array?this[t]:e}))}},function(t,e,n){"use strict";var i=n(13),s=function(t){this._state=-1,this._value=null,this._defer=[],r(this,t)};s.prototype.then=function(t,e){var n=new s,i={promise:n,onFulfilled:t,onRejected:e};return-1===this._state?this._defer.push(i):o(this,i),n},s.prototype.catch=function(t){return this.then(null,t)};var r=function(t,e){if("function"==typeof e){var n=0,i=function(e){0==n++&&u(t,e)};try{e((function(e){0==n++&&c(t,e)}),i)}catch(t){i(t)}}},o=function(t,e){var n=t._state,s=t._value,r=e.promise,o=[e.onFulfilled,e.onRejected][n];if("function"!=typeof o)return(0,[c,u][n])(r,s);i((function(){try{c(r,o(s))}catch(t){u(r,t)}}))},c=function(t,e){if(t===e)return u(t,new TypeError("Recursive promise chain detected"));var n;try{n=a(e)}catch(e){return u(t,e)}if(!n)return h(t,e);r(t,(function(t,i){n.call(e,t,i)}))},a=function(t){var e=typeof t,n=("object"===e||"function"===e)&&t&&t.then;return"function"==typeof n?n:null},h=function(t,e){l(t,0,e)},u=function(t,e){l(t,1,e)},l=function(t,e,n){var i=t._defer,s=0;if(t._state=e,t._value=n,t._defer=null,0!==i.length)for(;s<i.length;)o(t,i[s++])};s.resolve=function(t){try{if(a(t))return t}catch(t){return s.reject(t)}return new s((function(e,n){e(t)}))},s.reject=function(t){return new s((function(e,n){n(t)}))},s.all=function(t){return new s((function(e,n){var i,r=[],o=t.length;if(0===o)return e(r);var c=function(t,i){s.resolve(t).then((function(t){r[i]=t,0==--o&&e(r)}),n)};for(i=0;i<o;i++)c(t[i],i)}))},s.race=function(t){return new s((function(e,n){for(var i=0,r=t.length;i<r;i++)s.resolve(t[i]).then(e,n)}))},s.deferred=function(){var t={};return t.promise=new s((function(e,n){t.resolve=e,t.reject=n})),t},t.exports=s},function(t,e,n){"use strict";(function(e){var i=n(6);t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new i((function(t,e){n._resolve=t,n._reject=e}))),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){return this.then((function(n){t.call(e,n)}))},errback:function(t,e){return this.then(null,(function(n){t.call(e,n)}))},timeout:function(t,n){this.then();var i=this;this._timer=e.setTimeout((function(){i._reject(n)}),1e3*t)},setDeferredStatus:function(t,n){this._timer&&e.clearTimeout(this._timer),this.then(),"succeeded"===t?this._resolve(n):"failed"===t?this._reject(n):delete this._promise}}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(5),s={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(t,e){var n=s.logger||(s.wrapper||s).logger;if(n){var r=Array.prototype.slice.apply(t),o="[Faye",c=this.className,a=r.shift().replace(/\?/g,(function(){try{return i(r.shift())}catch(t){return"[Object]"}}));c&&(o+="."+c),o+="] ","function"==typeof n[e]?n[e](o+a):"function"==typeof n&&n(o+a)}}};for(var r in s.LOG_LEVELS)!function(t){s[t]=function(){this.writeLog(arguments,t)}}(r);t.exports=s},function(t,e,n){"use strict";var i={countListeners:function(t){return this.listeners(t).length},bind:function(t,e,n){var i=Array.prototype.slice,s=function(){e.apply(n,i.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([t,e,n,s]),this.on(t,s)},unbind:function(t,e,n){this._listeners=this._listeners||[];for(var i,s=this._listeners.length;s--;)(i=this._listeners[s])[0]===t&&(!e||i[1]===e&&i[2]===n)&&(this._listeners.splice(s,1),this.removeListener(t,i[3]))}};n(0)(i,n(28).prototype),i.trigger=i.emit,t.exports=i},,function(t,e,n){"use strict";t.exports={commonElement:function(t,e){for(var n=0,i=t.length;n<i;n++)if(-1!==this.indexOf(e,t[n]))return t[n];return null},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},map:function(t,e,n){if(t.map)return t.map(e,n);var i=[];if(t instanceof Array)for(var s=0,r=t.length;s<r;s++)i.push(e.call(n||null,t[s],s));else for(var o in t)t.hasOwnProperty(o)&&i.push(e.call(n||null,o,t[o]));return i},filter:function(t,e,n){if(t.filter)return t.filter(e,n);for(var i=[],s=0,r=t.length;s<r;s++)e.call(n||null,t[s],s)&&i.push(t[s]);return i},asyncEach:function(t,e,n,i){var s=t.length,r=-1,o=0,c=!1,a=function(){if(o-=1,(r+=1)===s)return n&&n.call(i);e(t[r],h)},h=function(){o+=1,function(){if(!c){for(c=!0;o>0;)a();c=!1}}()};h()}}},function(t,e,n){"use strict";var i=function(t){var e,n,s;if(t instanceof Array){for(e=[],n=t.length;n--;)e[n]=i(t[n]);return e}if("object"==typeof t){for(s in e=null===t?null:{},t)e[s]=i(t[s]);return e}return t};t.exports=i},function(t,e,n){"use strict";var i=n(26),s=[],r=[],o=i.makeRequestCallFromTimer((function(){if(r.length)throw r.shift()}));function c(t){var e;(e=s.length?s.pop():new a).task=t,i(e)}function a(){this.task=null}t.exports=c,a.prototype.call=function(){try{this.task.call()}catch(t){c.onerror?c.onerror(t):(r.push(t),o())}finally{this.task=null,s[s.length]=this}}},function(t,e,n){"use strict";(function(e){var n={_registry:[],on:function(t,e,n,i){var s=function(){n.call(i)};t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s),this._registry.push({_element:t,_type:e,_callback:n,_context:i,_handler:s})},detach:function(t,e,n,i){for(var s,r=this._registry.length;r--;)s=this._registry[r],t&&t!==s._element||e&&e!==s._type||n&&n!==s._callback||i&&i!==s._context||(s._element.removeEventListener?s._element.removeEventListener(s._type,s._handler,!1):s._element.detachEvent("on"+s._type,s._handler),this._registry.splice(r,1),s=null)}};void 0!==e.onunload&&n.on(e,"unload",n.detach,n),t.exports={Event:n}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(9),o=n(16),c=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});s(c.prototype,r),s(c,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(t){var e=this.parse(t),n=["/**",t],i=e.slice();i[i.length-1]="*",n.push(this.unparse(i));for(var s=1,r=e.length;s<r;s++)(i=e.slice(0,s)).push("**"),n.push(this.unparse(i));return n},isValid:function(t){return o.CHANNEL_NAME.test(t)||o.CHANNEL_PATTERN.test(t)},parse:function(t){return this.isValid(t)?t.split("/").slice(1):null},unparse:function(t){return"/"+t.join("/")},isMeta:function(t){var e=this.parse(t);return e?e[0]===this.META:null},isService:function(t){var e=this.parse(t);return e?e[0]===this.SERVICE:null},isSubscribable:function(t){return this.isValid(t)?!this.isMeta(t)&&!this.isService(t):null},Set:i({initialize:function(){this._channels={}},getKeys:function(){var t=[];for(var e in this._channels)t.push(e);return t},remove:function(t){delete this._channels[t]},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(var n,i=0,s=t.length;i<s;i++){n=t[i],(this._channels[n]=this._channels[n]||new c(n)).bind("message",e)}},unsubscribe:function(t,e){var n=this._channels[t];return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){for(var e=c.expand(t.channel),n=0,i=e.length;n<i;n++){var s=this._channels[e[n]];s&&s.trigger("message",t)}}})}),t.exports=c},function(t,e,n){"use strict";t.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(18),o=n(0),c=n(8),a=n(9),h=n(19),u=n(22),l=i({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(t,e,n){this._client=t,this.endpoint=s.parse(e),this._alternates=n.endpoints||{},this.cookies=r.CookieJar&&new r.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||u,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var i=n.websocketExtensions;if(i)for(var o=0,c=(i=[].concat(i)).length;o<c;o++)this.addWebsocketExtension(i[o]);for(var a in this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca,this._alternates)this._alternates[a]=s.parse(this._alternates[a]);this.maxRequestSize=this.MAX_REQUEST_SIZE},endpointFor:function(t){return this._alternates[t]||this.endpoint},addWebsocketExtension:function(t){this.wsExtensions.push(t)},disable:function(t){this._disabled.push(t),h.disable(t)},setHeader:function(t,e){this.headers[t]=e},close:function(){var t=this._transport;delete this._transport,t&&t.close()},getConnectionTypes:function(){return h.getConnectionTypes()},selectTransport:function(t){h.get(this,t,this._disabled,(function(t){this.debug("Selected ? transport for ?",t.connectionType,t.endpoint.href),t!==this._transport&&(this._transport&&this._transport.close(),this._transport=t,this.connectionType=t.connectionType)}),this)},sendMessage:function(t,e,n){n=n||{};var i,s=t.id,r=n.attempts,o=n.deadline&&(new Date).getTime()+1e3*n.deadline,c=this._envelopes[s];c||(i=new this._scheduler(t,{timeout:e,interval:this.retry,attempts:r,deadline:o}),c=this._envelopes[s]={message:t,scheduler:i}),this._sendEnvelope(c)},_sendEnvelope:function(t){if(this._transport&&!t.request&&!t.timer){var n=t.message,i=t.scheduler,s=this;if(!i.isDeliverable())return i.abort(),void delete this._envelopes[n.id];t.timer=e.setTimeout((function(){s.handleError(n)}),1e3*i.getTimeout()),i.send(),t.request=this._transport.sendMessage(n)}},handleResponse:function(t){var n=this._envelopes[t.id];void 0!==t.successful&&n&&(n.scheduler.succeed(),delete this._envelopes[t.id],e.clearTimeout(n.timer)),this.trigger("message",t),this._state!==this.UP&&(this._state=this.UP,this._client.trigger("transport:up"))},handleError:function(t,n){var i=this._envelopes[t.id],s=i&&i.request,r=this;if(s){s.then((function(t){t&&t.abort&&t.abort()}));var o=i.scheduler;o.fail(),e.clearTimeout(i.timer),i.request=i.timer=null,n?this._sendEnvelope(i):i.timer=e.setTimeout((function(){i.timer=null,r._sendEnvelope(i)}),1e3*o.getInterval()),this._state!==this.DOWN&&(this._state=this.DOWN,this._client.trigger("transport:down"))}}});l.create=function(t,e,n){return new l(t,e,n)},o(l.prototype,a),o(l.prototype,c),t.exports=l}).call(this,n(2))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(4);i.register("websocket",n(30)),i.register("eventsource",n(32)),i.register("long-polling",n(21)),i.register("cross-origin-long-polling",n(33)),i.register("callback-polling",n(34)),t.exports=i},function(t,e,n){"use strict";var i=n(1);t.exports=i({initialize:function(){this._index={}},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.hasOwnProperty(e)&&(this._index[e]=t,!0)},forEach:function(t,e){for(var n in this._index)this._index.hasOwnProperty(n)&&t.call(e,this._index[n])},isEmpty:function(){for(var t in this._index)if(this._index.hasOwnProperty(t))return!1;return!0},member:function(t){for(var e in this._index)if(this._index[e]===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index[e];return delete this._index[e],n},toArray:function(){var t=[];return this.forEach((function(e){t.push(e)})),t}})},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(14),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return c(t)},request:function(t){var n,i=this.endpoint.href,s=this;if(e.XMLHttpRequest)n=new XMLHttpRequest;else{if(!e.ActiveXObject)return this._handleError(t);n=new ActiveXObject("Microsoft.XMLHTTP")}n.open("POST",i,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Pragma","no-cache"),n.setRequestHeader("X-Requested-With","XMLHttpRequest");var o=this._dispatcher.headers;for(var c in o)o.hasOwnProperty(c)&&n.setRequestHeader(c,o[c]);var a=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",a),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,c=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",a),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(c)}catch(t){}i?s._receive(i):s._handleError(t)}},n.send(this.encode(t)),n}}),{isUsable:function(t,e,n,i){var r="ReactNative"===navigator.product||s.isSameOrigin(e);n.call(i,r)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};n(0)(i.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var t=this.options.attempts,e=this.attempts,n=this.options.deadline,i=(new Date).getTime();return!(void 0!==t&&e>=t)&&!(void 0!==n&&i>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=i},function(t,e){t.exports={VERSION:"1.3.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(7),o=i({initialize:function(t,e,n,i){this._client=t,this._channels=e,this._callback=n,this._context=i,this._cancelled=!1},withChannel:function(t,e){return this._withChannel=[t,e],this},apply:function(t,e){var n=e[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});s(o.prototype,r),t.exports=o},function(t,e,n){"use strict";(function(e){var i=n(13),s=n(1),r=(n(6),n(11)),o=n(14),c=n(23),a=n(0),h=n(27),u=n(7),l=n(8),f=n(9),d=n(15),p=n(17),_=n(35),v=n(36),g=n(37),m=n(24),y=s({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(t,n){this.info("New client created for ?",t),h(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(n.interval||this.INTERVAL),timeout:1e3*(n.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){r.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()}),this)},addWebsocketExtension:function(t){return this._dispatcher.addWebsocketExtension(t)},disable:function(t){return this._dispatcher.disable(t)},setHeader:function(t,e){return this._dispatcher.setHeader(t,e)},handshake:function(t,n){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var s=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(c.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:c.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(r){r.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=r.clientId,this._dispatcher.selectTransport(r.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&i((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){s.handshake(t,n)}),1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)}),this)}},connect:function(t,e){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake((function(){this.connect(t,e)}),this);this.callback(t,e),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var t=new g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",_.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return r.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new m(this,t,e,n),s=!0===e;return this._channels.hasSubscription(t)&&!s?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),s||this._channels.subscribe([t],i),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",_.parse(e.error)),this._channels.unsubscribe(t,i);var n=[].concat(e.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),i.setDeferredStatus("succeeded")}),this)}),this),i)},unsubscribe:function(t,e){if(t instanceof Array)return r.map(t,(function(t){return this.unsubscribe(t,e)}),this);this._channels.unsubscribe(t,e)&&this.connect((function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,t),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(t){if(t.successful){var e=[].concat(t.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,e)}}),this)}),this)},publish:function(t,e,n){h(n||{},["attempts","deadline"]);var i=new g;return this.connect((function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,t,e),this._sendMessage({channel:t,data:e,clientId:this._dispatcher.clientId},n,(function(t){t.successful?i.setDeferredStatus("succeeded"):i.setDeferredStatus("failed",_.parse(t.error))}),this)}),this),i},_sendMessage:function(t,e,n,i){t.id=this._generateMessageId();var s=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",t,null,(function(t){t&&(n&&(this._responseCallbacks[t.id]=[n,i]),this._dispatcher.sendMessage(t,s,e||{}))}),this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(t){var e,n=t.id;void 0!==t.successful&&(e=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",t,null,(function(t){t&&(t.advice&&this._handleAdvice(t.advice),this._deliverMessage(t),e&&e[0].call(e[1],t))}),this)},_handleAdvice:function(t){a(this._advice,t),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(t){t.channel&&void 0!==t.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,t.channel,t.data),this._channels.distributeMessage(t))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var t=this;e.setTimeout((function(){t.connect()}),this._advice.interval)}});a(y.prototype,u),a(y.prototype,f),a(y.prototype,l),a(y.prototype,v),t.exports=y}).call(this,n(2))},function(t,e,n){"use strict";(function(e){function n(t){s.length||(i(),!0),s[s.length]=t}t.exports=n;var i,s=[],r=0;function o(){for(;r<s.length;){var t=r;if(r+=1,s[t].call(),r>1024){for(var e=0,n=s.length-r;e<n;e++)s[e]=s[e+r];s.length-=r,r=0}}s.length=0,r=0,!1}var c,a,h,u=void 0!==e?e:self,l=u.MutationObserver||u.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof l?(c=1,a=new l(o),h=document.createTextNode(""),a.observe(h,{characterData:!0}),i=function(){c=-c,h.data=c}):i=f(o),n.requestFlush=i,n.makeRequestCallFromTimer=f}).call(this,n(2))},function(t,e,n){"use strict";var i=n(11);t.exports=function(t,e){for(var n in t)if(i.indexOf(e,n)<0)throw new Error("Unrecognized option: "+n)}},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(){}t.exports=i,i.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||n(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var i=Array.prototype.slice.call(arguments,1);e.apply(this,i)}return!0}if(n(e)){i=Array.prototype.slice.call(arguments,1);for(var s=e.slice(),r=0,o=s.length;r<o;r++)s[r].apply(this,i);return!0}return!1},i.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");return this._events||(this._events={}),this.emit("newListener",t,e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){var n=this;return n.on(t,(function i(){n.removeListener(t,i),e.apply(this,arguments)})),this},i.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var i=this._events[t];if(n(i)){var s=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}(i,e);if(s<0)return this;i.splice(s,1),0==i.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},i.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},i.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),n(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}},function(t,e,n){"use strict";(function(e){t.exports={addTimeout:function(t,n,i,s){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(t)){var r=this;this._timeouts[t]=e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n)}},removeTimeout:function(t){this._timeouts=this._timeouts||{};var n=this._timeouts[t];n&&(e.clearTimeout(n),delete this._timeouts[t])},removeAllTimeouts:function(){for(var t in this._timeouts=this._timeouts||{},this._timeouts)this.removeTimeout(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(6),r=n(20),o=n(3),c=n(14),a=n(12),h=n(0),u=n(5),l=n(31),f=n(7),d=h(i(n(4),{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)})),this.connect()},request:function(t){this._pending=this._pending||new r;for(var e=0,n=t.length;e<n;e++)this._pending.add(t[e]);var i=this,o=new s((function(e,n){i.callback((function(n){n&&1===n.readyState&&(n.send(u(t)),e(n))})),i.connect()}));return{abort:function(){o.then((function(t){t.close()}))}}},connect:function(){if(!d._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var t=this._createSocket();if(!t)return this.setDeferredStatus("failed");var e=this;t.onopen=function(){t.headers&&e._storeCookies(t.headers["set-cookie"]),e._socket=t,e._state=e.CONNECTED,e._everConnected=!0,e.setDeferredStatus("succeeded",t)};var n=!1;t.onclose=t.onerror=function(){if(!n){n=!0;var i=e._state===e.CONNECTED;t.onopen=t.onclose=t.onerror=t.onmessage=null,delete e._socket,e._state=e.UNCONNECTED;var s=e._pending?e._pending.toArray():[];delete e._pending,i||e._everConnected?(e.setDeferredStatus("unknown"),e._handleError(s,i)):e.setDeferredStatus("failed")}},t.onmessage=function(t){var n;try{n=JSON.parse(t.data)}catch(t){}if(n){for(var i=0,s=(n=[].concat(n)).length;i<s;i++)void 0!==n[i].successful&&e._pending.remove(n[i]);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=d.getSocketUrl(this.endpoint),e=this._dispatcher.headers,n=this._dispatcher.wsExtensions,i=this._getCookies(),s=this._dispatcher.tls,r={extensions:n,headers:e,proxy:this._proxy,tls:s};""!==i&&(r.headers.Cookie=i);try{return l.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports.websocket=t.transports.websocket||{};return n[e.href]=n[e.href]||new this(t,e),n[e.href]},getSocketUrl:function(t){return(t=a(t)).protocol=this.PROTOCOLS[t.protocol],o.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});h(d.prototype,f),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",(function(){void 0===d._unloaded&&(d._unloaded=!0)})),t.exports=d}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var n=e.MozWebSocket||e.WebSocket;t.exports={create:function(t,e,i){return"function"!=typeof n?null:new n(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(7),a=n(4),h=n(21),u=o(i(a,{initialize:function(t,n){if(a.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new h(t,n),(n=r(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),o=this;i.onopen=function(){o._everConnected=!0,o.setDeferredStatus("succeeded")},i.onerror=function(){o._everConnected?o._handleError([]):(o.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?o._receive(e):o._handleError([])},this._socket=i},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)}))},encode:function(t){return this._xhr.encode(t)},request:function(t){return this._xhr.request(t)}}),{isUsable:function(t,e,n,i){if(!t.clientId)return n.call(i,!1);h.isUsable(t,e,(function(s){if(!s)return n.call(i,!1);this.create(t,e).isUsable(n,i)}),this)},create:function(t,e){var n=t.transports.eventsource=t.transports.eventsource||{},i=t.clientId,o=r(e);return o.pathname+="/"+(i||""),n[o=s.stringify(o)]=n[o]||new this(t,e),n[o]}});o(u.prototype,c),t.exports=u}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(20),r=n(3),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return"message="+encodeURIComponent(c(t))},request:function(t){var n,i=e.XDomainRequest?XDomainRequest:XMLHttpRequest,s=new i,r=++a._id,o=this._dispatcher.headers,c=this;if(s.open("POST",this.endpoint.href,!0),s.withCredentials=!0,s.setRequestHeader)for(n in s.setRequestHeader("Pragma","no-cache"),o)o.hasOwnProperty(n)&&s.setRequestHeader(n,o[n]);var h=function(){if(!s)return!1;a._pending.remove(r),s.onload=s.onerror=s.ontimeout=s.onprogress=null,s=null};return s.onload=function(){var e;try{e=JSON.parse(s.responseText)}catch(t){}h(),e?c._receive(e):c._handleError(t)},s.onerror=s.ontimeout=function(){h(),c._handleError(t)},s.onprogress=function(){},i===e.XDomainRequest&&a._pending.add({id:r,xhr:s}),s.send(this.encode(t)),s}}),{_id:0,_pending:new s,isUsable:function(t,n,i,s){if(r.isSameOrigin(n))return i.call(s,!1);if(e.XDomainRequest)return i.call(s,n.protocol===location.protocol);if(e.XMLHttpRequest){var o=new XMLHttpRequest;return i.call(s,void 0!==o.withCredentials)}return i.call(s,!1)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){var e=r(this.endpoint);return e.query.message=c(t),e.query.jsonp="__jsonp"+a._cbCount+"__",s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=a.getCallbackName(),h=r(this.endpoint),u=this;h.query.message=c(t),h.query.jsonp=o;var l=function(){if(!e[o])return!1;e[o]=void 0;try{delete e[o]}catch(t){}i.parentNode.removeChild(i)};return e[o]=function(t){l(),u._receive(t)},i.type="text/javascript",i.src=s.stringify(h),n.appendChild(i),i.onerror=function(){l(),u._handleError(t)},{abort:l}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(16),r=i({initialize:function(t,e,n){this.code=t,this.params=Array.prototype.slice.call(e),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});r.parse=function(t){if(t=t||"",!s.ERROR.test(t))return new r(null,[],t);var e=t.split(":"),n=parseInt(e[0]),i=e[1].split(",");t=e[2];return new r(n,i,t)};var o={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var c in o)!function(t){r[t]=function(){return new r(o[t][0],arguments,o[t][1]).toString()}}(c);t.exports=r},function(t,e,n){"use strict";var i={addExtension:function(t){this._extensions=this._extensions||[],this._extensions.push(t),t.added&&t.added(this)},removeExtension:function(t){if(this._extensions)for(var e=this._extensions.length;e--;)this._extensions[e]===t&&(this._extensions.splice(e,1),t.removed&&t.removed(this))},pipeThroughExtensions:function(t,e,n,i,s){if(this.debug("Passing through ? extensions: ?",t,e),!this._extensions)return i.call(s,e);var r=this._extensions.slice(),o=function(e){if(!e)return i.call(s,e);var c=r.shift();if(!c)return i.call(s,e);var a=c[t];if(!a)return o(e);a.length>=3?c[t](e,n,o):c[t](e,o)};o(e)}};n(0)(i,n(8)),t.exports=i},function(t,e,n){"use strict";var i=n(1),s=n(7);t.exports=i(s)},function(t,e,n){"use strict";var i=n(23),s=n(8),r={VERSION:i.VERSION,Client:n(25),Scheduler:n(22)};s.wrapper=r,t.exports=r}]);
var Faye=function(t){var e={};function n(i){if(e[i])return e[i].exports;var s=e[i]={i:i,l:!1,exports:{}};return t[i].call(s.exports,s,s.exports,n),s.l=!0,s.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)n.d(i,s,function(e){return t[e]}.bind(null,s));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=38)}([function(t,e,n){"use strict";var i=Array.prototype.forEach,s=Object.prototype.hasOwnProperty;t.exports=function(t){return i.call(arguments,(function(e,n){if(0!==n)for(var i in e)s.call(e,i)&&(t[i]=e[i])})),t}},function(t,e,n){"use strict";var i=n(0);t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},s=function(){};return s.prototype=t.prototype,n.prototype=new s,i(n.prototype,e),n}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";t.exports={isURI:function(t){return t&&t.protocol&&t.host&&t.path},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t){if("string"!=typeof t)return t;var e,n,i,s,r,o,c={},a=function(e,n){t=t.replace(n,(function(t){return c[e]=t,""})),c[e]=c[e]||""};for(a("protocol",/^[a-z]+\:/i),a("host",/^\/\/[^\/\?#]+/),/^\//.test(t)||c.host||(t=location.pathname.replace(/[^\/]*$/,"")+t),a("pathname",/^[^\?#]*/),a("search",/^\?[^#]*/),a("hash",/^#.*/),c.protocol=c.protocol||location.protocol,c.host?(c.host=c.host.substr(2),/@/.test(c.host)&&(c.auth=c.host.split("@")[0],c.host=c.host.split("@")[1]),e=c.host.match(/^\[([^\]]+)\]|^[^:]+/),c.hostname=e[1]||e[0],c.port=(c.host.match(/:(\d+)$/)||[])[1]||""):(c.host=location.host,c.hostname=location.hostname,c.port=location.port),c.pathname=c.pathname||"/",c.path=c.pathname+c.search,o={},s=0,r=(i=(n=c.search.replace(/^\?/,""))?n.split("&"):[]).length;s<r;s++)e=i[s].split("="),o[decodeURIComponent(e[0]||"")]=decodeURIComponent(e[1]||"");return c.query=o,c.href=this.stringify(c),c},stringify:function(t){var e=t.auth?t.auth+"@":"",n=t.protocol+"//"+e+t.host;return n+=t.pathname+this.queryString(t.query)+(t.hash||"")},queryString:function(t){var e=[];for(var n in t)t.hasOwnProperty(n)&&e.push(encodeURIComponent(n)+"="+encodeURIComponent(t[n]));return 0===e.length?"":"?"+e.join("&")}}},function(t,e,n){"use strict";var i=n(1),s=n(18).Cookie,r=n(6),o=n(11),c=n(0),a=n(8),h=n(29),u=n(15),l=c(i({className:"Transport",DEFAULT_PORTS:{"http:":80,"https:":443,"ws:":80,"wss:":443},MAX_DELAY:0,batching:!0,initialize:function(t,e){this._dispatcher=t,this.endpoint=e,this._outbox=[],this._proxy=c({},this._dispatcher.proxy),this._proxy.origin||(this._proxy.origin=this._findProxy())},close:function(){},encode:function(t){return""},sendMessage:function(t){return this.debug("Client ? sending message to ?: ?",this._dispatcher.clientId,this.endpoint.href,t),this.batching?(this._outbox.push(t),this._flushLargeBatch(),t.channel===u.HANDSHAKE?this._publish(.01):(t.channel===u.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):r.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new r((function(e){t._resolvePromise=e}))},_publish:function(t){return this._makePromise(),this.addTimeout("publish",t,(function(){this._flush(),delete this._requestPromise}),this),this._requestPromise},_flush:function(){this.removeTimeout("publish"),this._outbox.length>1&&this._connectMessage&&(this._connectMessage.advice={timeout:0}),this._resolvePromise(this.request(this._outbox)),this._connectMessage=null,this._outbox=[]},_flushLargeBatch:function(){if(!(this.encode(this._outbox).length<this._dispatcher.maxRequestSize)){var t=this._outbox.pop();this._makePromise(),this._flush(),t&&this._outbox.push(t)}},_receive:function(t){if(t){t=[].concat(t),this.debug("Client ? received from ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var e=0,n=t.length;e<n;e++)this._dispatcher.handleResponse(t[e])}},_handleError:function(t,e){t=[].concat(t),this.debug("Client ? failed to send to ? via ?: ?",this._dispatcher.clientId,this.endpoint.href,this.connectionType,t);for(var n=0,i=t.length;n<i;n++)this._dispatcher.handleError(t[n])},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?o.map(t.getCookiesSync(e),(function(t){return t.cookieString()})).join("; "):""},_storeCookies:function(t){var e,n=this._dispatcher.cookies,i=this.endpoint.href;if(t&&n)for(var r=0,o=(t=[].concat(t)).length;r<o;r++)e=s.parse(t[r]),n.setCookieSync(e,i)},_findProxy:function(){if("undefined"!=typeof process){var t=this.endpoint.protocol;if(t){var e,n,i=t.replace(/:$/,"").toLowerCase()+"_proxy",s=i.toUpperCase(),r=process.env;return"http_proxy"===i&&r.REQUEST_METHOD?(1===(e=Object.keys(r).filter((function(t){return/^http_proxy$/i.test(t)}))).length?e[0]===i&&void 0===r[s]&&(n=r[i]):e.length>1&&(n=r[i]),n=n||r["CGI_"+s]):(n=r[i]||r[s])&&!r[i]&&console.warn("The environment variable "+s+" is discouraged. Use "+i+"."),n}}}}),{get:function(t,e,n,i,s){var r=t.endpoint;o.asyncEach(this._transports,(function(r,c){var a=r[0],h=r[1],u=t.endpointFor(a);return o.indexOf(n,a)>=0?c():o.indexOf(e,a)<0?(h.isUsable(t,u,(function(){})),c()):void h.isUsable(t,u,(function(e){if(!e)return c();var n=h.hasOwnProperty("create")?h.create(t,u):new h(t,u);i.call(s,n)}))}),(function(){throw new Error("Could not find a usable connection type for "+r.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return o.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(var e=0;e<this._transports.length;e++)this._transports[e][1]._unloaded=!1},_transports:[]});c(l.prototype,a),c(l.prototype,h),t.exports=l},function(t,e,n){"use strict";t.exports=function(t){return JSON.stringify(t,(function(t,e){return this[t]instanceof Array?this[t]:e}))}},function(t,e,n){"use strict";var i=n(13),s=function(t){this._state=-1,this._value=null,this._defer=[],r(this,t)};s.prototype.then=function(t,e){var n=new s,i={promise:n,onFulfilled:t,onRejected:e};return-1===this._state?this._defer.push(i):o(this,i),n},s.prototype.catch=function(t){return this.then(null,t)};var r=function(t,e){if("function"==typeof e){var n=0,i=function(e){0==n++&&u(t,e)};try{e((function(e){0==n++&&c(t,e)}),i)}catch(t){i(t)}}},o=function(t,e){var n=t._state,s=t._value,r=e.promise,o=[e.onFulfilled,e.onRejected][n];if("function"!=typeof o)return(0,[c,u][n])(r,s);i((function(){try{c(r,o(s))}catch(t){u(r,t)}}))},c=function(t,e){if(t===e)return u(t,new TypeError("Recursive promise chain detected"));var n;try{n=a(e)}catch(e){return u(t,e)}if(!n)return h(t,e);r(t,(function(t,i){n.call(e,t,i)}))},a=function(t){var e=typeof t,n=("object"===e||"function"===e)&&t&&t.then;return"function"==typeof n?n:null},h=function(t,e){l(t,0,e)},u=function(t,e){l(t,1,e)},l=function(t,e,n){var i=t._defer,s=0;if(t._state=e,t._value=n,t._defer=null,0!==i.length)for(;s<i.length;)o(t,i[s++])};s.resolve=function(t){try{if(a(t))return t}catch(t){return s.reject(t)}return new s((function(e,n){e(t)}))},s.reject=function(t){return new s((function(e,n){n(t)}))},s.all=function(t){return new s((function(e,n){var i,r=[],o=t.length;if(0===o)return e(r);var c=function(t,i){s.resolve(t).then((function(t){r[i]=t,0==--o&&e(r)}),n)};for(i=0;i<o;i++)c(t[i],i)}))},s.race=function(t){return new s((function(e,n){for(var i=0,r=t.length;i<r;i++)s.resolve(t[i]).then(e,n)}))},s.deferred=function(){var t={};return t.promise=new s((function(e,n){t.resolve=e,t.reject=n})),t},t.exports=s},function(t,e,n){"use strict";(function(e){var i=n(6);t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new i((function(t,e){n._resolve=t,n._reject=e}))),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){return this.then((function(n){t.call(e,n)}))},errback:function(t,e){return this.then(null,(function(n){t.call(e,n)}))},timeout:function(t,n){this.then();var i=this;this._timer=e.setTimeout((function(){i._reject(n)}),1e3*t)},setDeferredStatus:function(t,n){this._timer&&e.clearTimeout(this._timer),this.then(),"succeeded"===t?this._resolve(n):"failed"===t?this._reject(n):delete this._promise}}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(5),s={LOG_LEVELS:{fatal:4,error:3,warn:2,info:1,debug:0},writeLog:function(t,e){var n=s.logger||(s.wrapper||s).logger;if(n){var r=Array.prototype.slice.apply(t),o="[Faye",c=this.className,a=r.shift().replace(/\?/g,(function(){try{return i(r.shift())}catch(t){return"[Object]"}}));c&&(o+="."+c),o+="] ","function"==typeof n[e]?n[e](o+a):"function"==typeof n&&n(o+a)}}};for(var r in s.LOG_LEVELS)!function(t){s[t]=function(){this.writeLog(arguments,t)}}(r);t.exports=s},function(t,e,n){"use strict";var i={countListeners:function(t){return this.listeners(t).length},bind:function(t,e,n){var i=Array.prototype.slice,s=function(){e.apply(n,i.call(arguments))};return this._listeners=this._listeners||[],this._listeners.push([t,e,n,s]),this.on(t,s)},unbind:function(t,e,n){this._listeners=this._listeners||[];for(var i,s=this._listeners.length;s--;)(i=this._listeners[s])[0]===t&&(!e||i[1]===e&&i[2]===n)&&(this._listeners.splice(s,1),this.removeListener(t,i[3]))}};n(0)(i,n(28).prototype),i.trigger=i.emit,t.exports=i},,function(t,e,n){"use strict";t.exports={commonElement:function(t,e){for(var n=0,i=t.length;n<i;n++)if(-1!==this.indexOf(e,t[n]))return t[n];return null},indexOf:function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1},map:function(t,e,n){if(t.map)return t.map(e,n);var i=[];if(t instanceof Array)for(var s=0,r=t.length;s<r;s++)i.push(e.call(n||null,t[s],s));else for(var o in t)t.hasOwnProperty(o)&&i.push(e.call(n||null,o,t[o]));return i},filter:function(t,e,n){if(t.filter)return t.filter(e,n);for(var i=[],s=0,r=t.length;s<r;s++)e.call(n||null,t[s],s)&&i.push(t[s]);return i},asyncEach:function(t,e,n,i){var s=t.length,r=-1,o=0,c=!1,a=function(){if(o-=1,(r+=1)===s)return n&&n.call(i);e(t[r],h)},h=function(){o+=1,function(){if(!c){for(c=!0;o>0;)a();c=!1}}()};h()}}},function(t,e,n){"use strict";var i=function(t){var e,n,s;if(t instanceof Array){for(e=[],n=t.length;n--;)e[n]=i(t[n]);return e}if("object"==typeof t){for(s in e=null===t?null:{},t)e[s]=i(t[s]);return e}return t};t.exports=i},function(t,e,n){"use strict";var i=n(26),s=[],r=[],o=i.makeRequestCallFromTimer((function(){if(r.length)throw r.shift()}));function c(t){var e;(e=s.length?s.pop():new a).task=t,i(e)}function a(){this.task=null}t.exports=c,a.prototype.call=function(){try{this.task.call()}catch(t){c.onerror?c.onerror(t):(r.push(t),o())}finally{this.task=null,s[s.length]=this}}},function(t,e,n){"use strict";(function(e){var n={_registry:[],on:function(t,e,n,i){var s=function(){n.call(i)};t.addEventListener?t.addEventListener(e,s,!1):t.attachEvent("on"+e,s),this._registry.push({_element:t,_type:e,_callback:n,_context:i,_handler:s})},detach:function(t,e,n,i){for(var s,r=this._registry.length;r--;)s=this._registry[r],t&&t!==s._element||e&&e!==s._type||n&&n!==s._callback||i&&i!==s._context||(s._element.removeEventListener?s._element.removeEventListener(s._type,s._handler,!1):s._element.detachEvent("on"+s._type,s._handler),this._registry.splice(r,1),s=null)}};void 0!==e.onunload&&n.on(e,"unload",n.detach,n),t.exports={Event:n}}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(9),o=n(16),c=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});s(c.prototype,r),s(c,{HANDSHAKE:"/meta/handshake",CONNECT:"/meta/connect",SUBSCRIBE:"/meta/subscribe",UNSUBSCRIBE:"/meta/unsubscribe",DISCONNECT:"/meta/disconnect",META:"meta",SERVICE:"service",expand:function(t){var e=this.parse(t),n=["/**",t],i=e.slice();i[i.length-1]="*",n.push(this.unparse(i));for(var s=1,r=e.length;s<r;s++)(i=e.slice(0,s)).push("**"),n.push(this.unparse(i));return n},isValid:function(t){return o.CHANNEL_NAME.test(t)||o.CHANNEL_PATTERN.test(t)},parse:function(t){return this.isValid(t)?t.split("/").slice(1):null},unparse:function(t){return"/"+t.join("/")},isMeta:function(t){var e=this.parse(t);return e?e[0]===this.META:null},isService:function(t){var e=this.parse(t);return e?e[0]===this.SERVICE:null},isSubscribable:function(t){return this.isValid(t)?!this.isMeta(t)&&!this.isService(t):null},Set:i({initialize:function(){this._channels={}},getKeys:function(){var t=[];for(var e in this._channels)t.push(e);return t},remove:function(t){delete this._channels[t]},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(var n,i=0,s=t.length;i<s;i++){n=t[i],(this._channels[n]=this._channels[n]||new c(n)).bind("message",e)}},unsubscribe:function(t,e){var n=this._channels[t];return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){for(var e=c.expand(t.channel),n=0,i=e.length;n<i;n++){var s=this._channels[e[n]];s&&s.trigger("message",t)}}})}),t.exports=c},function(t,e,n){"use strict";t.exports={CHANNEL_NAME:/^\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*$/,CHANNEL_PATTERN:/^(\/(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)))+)*\/\*{1,2}$/,ERROR:/^([0-9][0-9][0-9]:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*(,(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)*:(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*|[0-9][0-9][0-9]::(((([a-z]|[A-Z])|[0-9])|(\-|\_|\!|\~|\(|\)|\$|\@)| |\/|\*|\.))*)$/,VERSION:/^([0-9])+(\.(([a-z]|[A-Z])|[0-9])(((([a-z]|[A-Z])|[0-9])|\-|\_))*)*$/}},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(18),o=n(0),c=n(8),a=n(9),h=n(19),u=n(22),l=i({className:"Dispatcher",MAX_REQUEST_SIZE:2048,DEFAULT_RETRY:5,UP:1,DOWN:2,initialize:function(t,e,n){this._client=t,this.endpoint=s.parse(e),this._alternates=n.endpoints||{},this.cookies=r.CookieJar&&new r.CookieJar,this._disabled=[],this._envelopes={},this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||u,this._state=0,this.transports={},this.wsExtensions=[],this.proxy=n.proxy||{},"string"==typeof this._proxy&&(this._proxy={origin:this._proxy});var i=n.websocketExtensions;if(i)for(var o=0,c=(i=[].concat(i)).length;o<c;o++)this.addWebsocketExtension(i[o]);for(var a in this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca,this._alternates)this._alternates[a]=s.parse(this._alternates[a]);this.maxRequestSize=this.MAX_REQUEST_SIZE},endpointFor:function(t){return this._alternates[t]||this.endpoint},addWebsocketExtension:function(t){this.wsExtensions.push(t)},disable:function(t){this._disabled.push(t),h.disable(t)},setHeader:function(t,e){this.headers[t]=e},close:function(){var t=this._transport;delete this._transport,t&&t.close()},getConnectionTypes:function(){return h.getConnectionTypes()},selectTransport:function(t){h.get(this,t,this._disabled,(function(t){this.debug("Selected ? transport for ?",t.connectionType,t.endpoint.href),t!==this._transport&&(this._transport&&this._transport.close(),this._transport=t,this.connectionType=t.connectionType)}),this)},sendMessage:function(t,e,n){n=n||{};var i,s=t.id,r=n.attempts,o=n.deadline&&(new Date).getTime()+1e3*n.deadline,c=this._envelopes[s];c||(i=new this._scheduler(t,{timeout:e,interval:this.retry,attempts:r,deadline:o}),c=this._envelopes[s]={message:t,scheduler:i}),this._sendEnvelope(c)},_sendEnvelope:function(t){if(this._transport&&!t.request&&!t.timer){var n=t.message,i=t.scheduler,s=this;if(!i.isDeliverable())return i.abort(),void delete this._envelopes[n.id];t.timer=e.setTimeout((function(){s.handleError(n)}),1e3*i.getTimeout()),i.send(),t.request=this._transport.sendMessage(n)}},handleResponse:function(t){var n=this._envelopes[t.id];void 0!==t.successful&&n&&(n.scheduler.succeed(),delete this._envelopes[t.id],e.clearTimeout(n.timer)),this.trigger("message",t),this._state!==this.UP&&(this._state=this.UP,this._client.trigger("transport:up"))},handleError:function(t,n){var i=this._envelopes[t.id],s=i&&i.request,r=this;if(s){s.then((function(t){t&&t.abort&&t.abort()}));var o=i.scheduler;o.fail(),e.clearTimeout(i.timer),i.request=i.timer=null,n?this._sendEnvelope(i):i.timer=e.setTimeout((function(){i.timer=null,r._sendEnvelope(i)}),1e3*o.getInterval()),this._state!==this.DOWN&&(this._state=this.DOWN,this._client.trigger("transport:down"))}}});l.create=function(t,e,n){return new l(t,e,n)},o(l.prototype,a),o(l.prototype,c),t.exports=l}).call(this,n(2))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(4);i.register("websocket",n(30)),i.register("eventsource",n(32)),i.register("long-polling",n(21)),i.register("cross-origin-long-polling",n(33)),i.register("callback-polling",n(34)),t.exports=i},function(t,e,n){"use strict";var i=n(1);t.exports=i({initialize:function(){this._index={}},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.hasOwnProperty(e)&&(this._index[e]=t,!0)},forEach:function(t,e){for(var n in this._index)this._index.hasOwnProperty(n)&&t.call(e,this._index[n])},isEmpty:function(){for(var t in this._index)if(this._index.hasOwnProperty(t))return!1;return!0},member:function(t){for(var e in this._index)if(this._index[e]===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index[e];return delete this._index[e],n},toArray:function(){var t=[];return this.forEach((function(e){t.push(e)})),t}})},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(14),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return c(t)},request:function(t){var n,i=this.endpoint.href,s=this;if(e.XMLHttpRequest)n=new XMLHttpRequest;else{if(!e.ActiveXObject)return this._handleError(t);n=new ActiveXObject("Microsoft.XMLHTTP")}n.open("POST",i,!0),n.setRequestHeader("Content-Type","application/json"),n.setRequestHeader("Pragma","no-cache"),n.setRequestHeader("X-Requested-With","XMLHttpRequest");var o=this._dispatcher.headers;for(var c in o)o.hasOwnProperty(c)&&n.setRequestHeader(c,o[c]);var a=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",a),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,c=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",a),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(c)}catch(t){}i?s._receive(i):s._handleError(t)}},n.send(this.encode(t)),n}}),{isUsable:function(t,e,n,i){var r="ReactNative"===navigator.product||s.isSameOrigin(e);n.call(i,r)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};n(0)(i.prototype,{getTimeout:function(){return this.options.timeout},getInterval:function(){return this.options.interval},isDeliverable:function(){var t=this.options.attempts,e=this.attempts,n=this.options.deadline,i=(new Date).getTime();return!(void 0!==t&&e>=t)&&!(void 0!==n&&i>n)},send:function(){this.attempts+=1},succeed:function(){},fail:function(){},abort:function(){}}),t.exports=i},function(t,e){t.exports={VERSION:"1.4.0",BAYEUX_VERSION:"1.0",ID_LENGTH:160,JSONP_CALLBACK:"jsonpcallback",CONNECTION_TYPES:["long-polling","cross-origin-long-polling","callback-polling","websocket","eventsource","in-process"],MANDATORY_CONNECTION_TYPES:["long-polling","callback-polling","in-process"]}},function(t,e,n){"use strict";var i=n(1),s=n(0),r=n(7),o=i({initialize:function(t,e,n,i){this._client=t,this._channels=e,this._callback=n,this._context=i,this._cancelled=!1},withChannel:function(t,e){return this._withChannel=[t,e],this},apply:function(t,e){var n=e[0];this._callback&&this._callback.call(this._context,n.data),this._withChannel&&this._withChannel[0].call(this._withChannel[1],n.channel,n.data)},cancel:function(){this._cancelled||(this._client.unsubscribe(this._channels,this),this._cancelled=!0)},unsubscribe:function(){this.cancel()}});s(o.prototype,r),t.exports=o},function(t,e,n){"use strict";(function(e){var i=n(13),s=n(1),r=(n(6),n(11)),o=n(14),c=n(23),a=n(0),h=n(27),u=n(7),l=n(8),f=n(9),d=n(15),p=n(17),_=n(35),v=n(36),g=n(37),m=n(24),y=s({className:"Client",UNCONNECTED:1,CONNECTING:2,CONNECTED:3,DISCONNECTED:4,HANDSHAKE:"handshake",RETRY:"retry",NONE:"none",CONNECTION_TIMEOUT:60,DEFAULT_ENDPOINT:"/bayeux",INTERVAL:0,initialize:function(t,n){this.info("New client created for ?",t),h(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new d.Set,this._dispatcher=p.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks={},this._advice={reconnect:this.RETRY,interval:1e3*(n.interval||this.INTERVAL),timeout:1e3*(n.timeout||this.CONNECTION_TIMEOUT)},this._dispatcher.timeout=this._advice.timeout/1e3,this._dispatcher.bind("message",this._receiveMessage,this),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){r.indexOf(this._dispatcher._disabled,"autodisconnect")<0&&this.disconnect()}),this)},addWebsocketExtension:function(t){return this._dispatcher.addWebsocketExtension(t)},disable:function(t){return this._dispatcher.disable(t)},setHeader:function(t,e){return this._dispatcher.setHeader(t,e)},handshake:function(t,n){if(this._advice.reconnect!==this.NONE&&this._state===this.UNCONNECTED){this._state=this.CONNECTING;var s=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(c.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:d.HANDSHAKE,version:c.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(r){r.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=r.clientId,this._dispatcher.selectTransport(r.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&i((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){s.handshake(t,n)}),1e3*this._dispatcher.retry),this._state=this.UNCONNECTED)}),this)}},connect:function(t,e){if(this._advice.reconnect!==this.NONE&&this._state!==this.DISCONNECTED){if(this._state===this.UNCONNECTED)return this.handshake((function(){this.connect(t,e)}),this);this.callback(t,e),this._state===this.CONNECTED&&(this.info("Calling deferred actions for ?",this._dispatcher.clientId),this.setDeferredStatus("succeeded"),this.setDeferredStatus("unknown"),this._connectRequest||(this._connectRequest=!0,this.info("Initiating connection for ?",this._dispatcher.clientId),this._sendMessage({channel:d.CONNECT,clientId:this._dispatcher.clientId,connectionType:this._dispatcher.connectionType},{},this._cycleConnection,this)))}},disconnect:function(){if(this._state===this.CONNECTED){this._state=this.DISCONNECTED,this.info("Disconnecting ?",this._dispatcher.clientId);var t=new g;return this._sendMessage({channel:d.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",_.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new d.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return r.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new m(this,t,e,n),s=!0===e;return this._channels.hasSubscription(t)&&!s?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),s||this._channels.subscribe([t],i),this._sendMessage({channel:d.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",_.parse(e.error)),this._channels.unsubscribe(t,i);var n=[].concat(e.subscription);this.info("Subscription acknowledged for ? to ?",this._dispatcher.clientId,n),i.setDeferredStatus("succeeded")}),this)}),this),i)},unsubscribe:function(t,e){if(t instanceof Array)return r.map(t,(function(t){return this.unsubscribe(t,e)}),this);this._channels.unsubscribe(t,e)&&this.connect((function(){this.info("Client ? attempting to unsubscribe from ?",this._dispatcher.clientId,t),this._sendMessage({channel:d.UNSUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(t){if(t.successful){var e=[].concat(t.subscription);this.info("Unsubscription acknowledged for ? from ?",this._dispatcher.clientId,e)}}),this)}),this)},publish:function(t,e,n){h(n||{},["attempts","deadline"]);var i=new g;return this.connect((function(){this.info("Client ? queueing published message to ?: ?",this._dispatcher.clientId,t,e),this._sendMessage({channel:t,data:e,clientId:this._dispatcher.clientId},n,(function(t){t.successful?i.setDeferredStatus("succeeded"):i.setDeferredStatus("failed",_.parse(t.error))}),this)}),this),i},_sendMessage:function(t,e,n,i){t.id=this._generateMessageId();var s=this._advice.timeout?1.2*this._advice.timeout/1e3:1.2*this._dispatcher.retry;this.pipeThroughExtensions("outgoing",t,null,(function(t){t&&(n&&(this._responseCallbacks[t.id]=[n,i]),this._dispatcher.sendMessage(t,s,e||{}))}),this)},_generateMessageId:function(){return this._messageId+=1,this._messageId>=Math.pow(2,32)&&(this._messageId=0),this._messageId.toString(36)},_receiveMessage:function(t){var e,n=t.id;void 0!==t.successful&&(e=this._responseCallbacks[n],delete this._responseCallbacks[n]),this.pipeThroughExtensions("incoming",t,null,(function(t){t&&(t.advice&&this._handleAdvice(t.advice),this._deliverMessage(t),e&&e[0].call(e[1],t))}),this)},_handleAdvice:function(t){a(this._advice,t),this._dispatcher.timeout=this._advice.timeout/1e3,this._advice.reconnect===this.HANDSHAKE&&this._state!==this.DISCONNECTED&&(this._state=this.UNCONNECTED,this._dispatcher.clientId=null,this._cycleConnection())},_deliverMessage:function(t){t.channel&&void 0!==t.data&&(this.info("Client ? calling listeners for ? with ?",this._dispatcher.clientId,t.channel,t.data),this._channels.distributeMessage(t))},_cycleConnection:function(){this._connectRequest&&(this._connectRequest=null,this.info("Closed connection for ?",this._dispatcher.clientId));var t=this;e.setTimeout((function(){t.connect()}),this._advice.interval)}});a(y.prototype,u),a(y.prototype,f),a(y.prototype,l),a(y.prototype,v),t.exports=y}).call(this,n(2))},function(t,e,n){"use strict";(function(e){function n(t){s.length||(i(),!0),s[s.length]=t}t.exports=n;var i,s=[],r=0;function o(){for(;r<s.length;){var t=r;if(r+=1,s[t].call(),r>1024){for(var e=0,n=s.length-r;e<n;e++)s[e]=s[e+r];s.length-=r,r=0}}s.length=0,r=0,!1}var c,a,h,u=void 0!==e?e:self,l=u.MutationObserver||u.WebKitMutationObserver;function f(t){return function(){var e=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(e),clearInterval(n),t()}}}"function"==typeof l?(c=1,a=new l(o),h=document.createTextNode(""),a.observe(h,{characterData:!0}),i=function(){c=-c,h.data=c}):i=f(o),n.requestFlush=i,n.makeRequestCallFromTimer=f}).call(this,n(2))},function(t,e,n){"use strict";var i=n(11);t.exports=function(t,e){for(var n in t)if(i.indexOf(e,n)<0)throw new Error("Unrecognized option: "+n)}},function(t,e){var n="function"==typeof Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(){}t.exports=i,i.prototype.emit=function(t){if("error"===t&&(!this._events||!this._events.error||n(this._events.error)&&!this._events.error.length))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");if(!this._events)return!1;var e=this._events[t];if(!e)return!1;if("function"==typeof e){switch(arguments.length){case 1:e.call(this);break;case 2:e.call(this,arguments[1]);break;case 3:e.call(this,arguments[1],arguments[2]);break;default:var i=Array.prototype.slice.call(arguments,1);e.apply(this,i)}return!0}if(n(e)){i=Array.prototype.slice.call(arguments,1);for(var s=e.slice(),r=0,o=s.length;r<o;r++)s[r].apply(this,i);return!0}return!1},i.prototype.addListener=function(t,e){if("function"!=typeof e)throw new Error("addListener only takes instances of Function");return this._events||(this._events={}),this.emit("newListener",t,e),this._events[t]?n(this._events[t])?this._events[t].push(e):this._events[t]=[this._events[t],e]:this._events[t]=e,this},i.prototype.on=i.prototype.addListener,i.prototype.once=function(t,e){var n=this;return n.on(t,(function i(){n.removeListener(t,i),e.apply(this,arguments)})),this},i.prototype.removeListener=function(t,e){if("function"!=typeof e)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[t])return this;var i=this._events[t];if(n(i)){var s=function(t,e){if(t.indexOf)return t.indexOf(e);for(var n=0;n<t.length;n++)if(e===t[n])return n;return-1}(i,e);if(s<0)return this;i.splice(s,1),0==i.length&&delete this._events[t]}else this._events[t]===e&&delete this._events[t];return this},i.prototype.removeAllListeners=function(t){return 0===arguments.length?(this._events={},this):(t&&this._events&&this._events[t]&&(this._events[t]=null),this)},i.prototype.listeners=function(t){return this._events||(this._events={}),this._events[t]||(this._events[t]=[]),n(this._events[t])||(this._events[t]=[this._events[t]]),this._events[t]}},function(t,e,n){"use strict";(function(e){t.exports={addTimeout:function(t,n,i,s){if(this._timeouts=this._timeouts||{},!this._timeouts.hasOwnProperty(t)){var r=this;this._timeouts[t]=e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n)}},removeTimeout:function(t){this._timeouts=this._timeouts||{};var n=this._timeouts[t];n&&(e.clearTimeout(n),delete this._timeouts[t])},removeAllTimeouts:function(){for(var t in this._timeouts=this._timeouts||{},this._timeouts)this.removeTimeout(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(6),r=n(20),o=n(3),c=n(14),a=n(12),h=n(0),u=n(5),l=n(31),f=n(7),d=h(i(n(4),{UNCONNECTED:1,CONNECTING:2,CONNECTED:3,batching:!1,isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)})),this.connect()},request:function(t){this._pending=this._pending||new r;for(var e=0,n=t.length;e<n;e++)this._pending.add(t[e]);var i=this,o=new s((function(e,n){i.callback((function(n){n&&1===n.readyState&&(n.send(u(t)),e(n))})),i.connect()}));return{abort:function(){o.then((function(t){t.close()}))}}},connect:function(){if(!d._unloaded&&(this._state=this._state||this.UNCONNECTED,this._state===this.UNCONNECTED)){this._state=this.CONNECTING;var t=this._createSocket();if(!t)return this.setDeferredStatus("failed");var e=this;t.onopen=function(){t.headers&&e._storeCookies(t.headers["set-cookie"]),e._socket=t,e._state=e.CONNECTED,e._everConnected=!0,e.setDeferredStatus("succeeded",t)};var n=!1;t.onclose=t.onerror=function(){if(!n){n=!0;var i=e._state===e.CONNECTED;t.onopen=t.onclose=t.onerror=t.onmessage=null,delete e._socket,e._state=e.UNCONNECTED;var s=e._pending?e._pending.toArray():[];delete e._pending,i||e._everConnected?(e.setDeferredStatus("unknown"),e._handleError(s,i)):e.setDeferredStatus("failed")}},t.onmessage=function(t){var n;try{n=JSON.parse(t.data)}catch(t){}if(n){for(var i=0,s=(n=[].concat(n)).length;i<s;i++)void 0!==n[i].successful&&e._pending.remove(n[i]);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=d.getSocketUrl(this.endpoint),e=this._dispatcher.headers,n=this._dispatcher.wsExtensions,i=this._getCookies(),s=this._dispatcher.tls,r={extensions:n,headers:e,proxy:this._proxy,tls:s};""!==i&&(r.headers.Cookie=i);try{return l.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports.websocket=t.transports.websocket||{};return n[e.href]=n[e.href]||new this(t,e),n[e.href]},getSocketUrl:function(t){return(t=a(t)).protocol=this.PROTOCOLS[t.protocol],o.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});h(d.prototype,f),c.Event&&void 0!==e.onbeforeunload&&c.Event.on(e,"beforeunload",(function(){void 0===d._unloaded&&(d._unloaded=!0)})),t.exports=d}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var n=e.MozWebSocket||e.WebSocket;t.exports={create:function(t,e,i){return"function"!=typeof n?null:new n(t)}}}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(7),a=n(4),h=n(21),u=o(i(a,{initialize:function(t,n){if(a.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new h(t,n),(n=r(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),o=this;i.onopen=function(){o._everConnected=!0,o.setDeferredStatus("succeeded")},i.onerror=function(){o._everConnected?o._handleError([]):(o.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?o._receive(e):o._handleError([])},this._socket=i},close:function(){this._socket&&(this._socket.onopen=this._socket.onerror=this._socket.onmessage=null,this._socket.close(),delete this._socket)},isUsable:function(t,e){this.callback((function(){t.call(e,!0)})),this.errback((function(){t.call(e,!1)}))},encode:function(t){return this._xhr.encode(t)},request:function(t){return this._xhr.request(t)}}),{isUsable:function(t,e,n,i){if(!t.clientId)return n.call(i,!1);h.isUsable(t,e,(function(s){if(!s)return n.call(i,!1);this.create(t,e).isUsable(n,i)}),this)},create:function(t,e){var n=t.transports.eventsource=t.transports.eventsource||{},i=t.clientId,o=r(e);return o.pathname+="/"+(i||""),n[o=s.stringify(o)]=n[o]||new this(t,e),n[o]}});o(u.prototype,c),t.exports=u}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(20),r=n(3),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){return"message="+encodeURIComponent(c(t))},request:function(t){var n,i=e.XDomainRequest?XDomainRequest:XMLHttpRequest,s=new i,r=++a._id,o=this._dispatcher.headers,c=this;if(s.open("POST",this.endpoint.href,!0),s.withCredentials=!0,s.setRequestHeader)for(n in s.setRequestHeader("Pragma","no-cache"),o)o.hasOwnProperty(n)&&s.setRequestHeader(n,o[n]);var h=function(){if(!s)return!1;a._pending.remove(r),s.onload=s.onerror=s.ontimeout=s.onprogress=null,s=null};return s.onload=function(){var e;try{e=JSON.parse(s.responseText)}catch(t){}h(),e?c._receive(e):c._handleError(t)},s.onerror=s.ontimeout=function(){h(),c._handleError(t)},s.onprogress=function(){},i===e.XDomainRequest&&a._pending.add({id:r,xhr:s}),s.send(this.encode(t)),s}}),{_id:0,_pending:new s,isUsable:function(t,n,i,s){if(r.isSameOrigin(n))return i.call(s,!1);if(e.XDomainRequest)return i.call(s,n.protocol===location.protocol);if(e.XMLHttpRequest){var o=new XMLHttpRequest;return i.call(s,void 0!==o.withCredentials)}return i.call(s,!1)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";(function(e){var i=n(1),s=n(3),r=n(12),o=n(0),c=n(5),a=o(i(n(4),{encode:function(t){var e=r(this.endpoint);return e.query.message=c(t),e.query.jsonp="__jsonp"+a._cbCount+"__",s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=a.getCallbackName(),h=r(this.endpoint),u=this;h.query.message=c(t),h.query.jsonp=o;var l=function(){if(!e[o])return!1;e[o]=void 0;try{delete e[o]}catch(t){}i.parentNode.removeChild(i)};return e[o]=function(t){l(),u._receive(t)},i.type="text/javascript",i.src=s.stringify(h),n.appendChild(i),i.onerror=function(){l(),u._handleError(t)},{abort:l}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=a}).call(this,n(2))},function(t,e,n){"use strict";var i=n(1),s=n(16),r=i({initialize:function(t,e,n){this.code=t,this.params=Array.prototype.slice.call(e),this.message=n},toString:function(){return this.code+":"+this.params.join(",")+":"+this.message}});r.parse=function(t){if(t=t||"",!s.ERROR.test(t))return new r(null,[],t);var e=t.split(":"),n=parseInt(e[0]),i=e[1].split(",");t=e[2];return new r(n,i,t)};var o={versionMismatch:[300,"Version mismatch"],conntypeMismatch:[301,"Connection types not supported"],extMismatch:[302,"Extension mismatch"],badRequest:[400,"Bad request"],clientUnknown:[401,"Unknown client"],parameterMissing:[402,"Missing required parameter"],channelForbidden:[403,"Forbidden channel"],channelUnknown:[404,"Unknown channel"],channelInvalid:[405,"Invalid channel"],extUnknown:[406,"Unknown extension"],publishFailed:[407,"Failed to publish"],serverError:[500,"Internal server error"]};for(var c in o)!function(t){r[t]=function(){return new r(o[t][0],arguments,o[t][1]).toString()}}(c);t.exports=r},function(t,e,n){"use strict";var i={addExtension:function(t){this._extensions=this._extensions||[],this._extensions.push(t),t.added&&t.added(this)},removeExtension:function(t){if(this._extensions)for(var e=this._extensions.length;e--;)this._extensions[e]===t&&(this._extensions.splice(e,1),t.removed&&t.removed(this))},pipeThroughExtensions:function(t,e,n,i,s){if(this.debug("Passing through ? extensions: ?",t,e),!this._extensions)return i.call(s,e);var r=this._extensions.slice(),o=function(e){if(!e)return i.call(s,e);var c=r.shift();if(!c)return i.call(s,e);var a=c[t];if(!a)return o(e);a.length>=3?c[t](e,n,o):c[t](e,o)};o(e)}};n(0)(i,n(8)),t.exports=i},function(t,e,n){"use strict";var i=n(1),s=n(7);t.exports=i(s)},function(t,e,n){"use strict";var i=n(23),s=n(8),r={VERSION:i.VERSION,Client:n(25),Scheduler:n(22)};s.wrapper=r,t.exports=r}]);
//# sourceMappingURL=faye-browser-min.js.map

@@ -15,3 +15,3 @@ {

"license": "Apache-2.0",
"version": "1.3.0",
"version": "1.4.0",
"engines": {

@@ -37,3 +37,3 @@ "node": ">=0.8.0"

"webpack-cli": "*",
"imports-loader": "*"
"imports-loader": "<1.0.0"
},

@@ -40,0 +40,0 @@ "scripts": {

module.exports = {
VERSION: '1.3.0',
VERSION: '1.4.0',

@@ -4,0 +4,0 @@ BAYEUX_VERSION: '1.0',

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc