faye 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/build/client/faye-browser-min.js +1 -1
- data/build/client/faye-browser-min.js.map +1 -1
- data/build/client/faye-browser.js +8 -8
- data/build/client/faye-browser.js.map +1 -1
- data/lib/faye.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 002aa96c2d8361e358d19a52f5c76578a0447dd5e8527cad86c2584a61f5ed99
|
|
4
|
+
data.tar.gz: e686dae4fcbd5d98bece8f24f7abf18d7015befe893a04089b0a05cd42333f45
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3433b109f89c0f0f720f1d538ca68b01b4f8714a0fef3a27fc1770b127c5a1981d67ecf5527c430b8d6b3886349366b149ea07c5b2f83153af6c71899ab60481
|
|
7
|
+
data.tar.gz: cac23a73b66227e8135aa92a832a95dab6971d2b6102acd94c1e9a2f9a1462a0cc7bf454e9b94aa6a45e4e87fefd0ac5217b555a44ee6bc41c23c13fb4b1be5e
|
data/CHANGELOG.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
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=33)}([function(t,e,n){"use strict";t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},i=function(){};return i.prototype=t.prototype,n.prototype=new i,Object.assign(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.pathname},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t,e){return"string"!=typeof t?t:"undefined"==typeof location?new URL(t,e):new URL(t,e||location.href)},stringify:function(t){return"string"==typeof t?t:t.href},clone:function(t){return this.parse(t.href)}}},function(t,e,n){"use strict";var i=n(0),s=n(14).Cookie,r=n(8),o=n(6),c=n(24),a=n(11),h=Object.assign(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=Object.assign({},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===a.HANDSHAKE?this._publish(.01):(t.channel===a.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):Promise.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new Promise((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(let e of t)this._dispatcher.handleResponse(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(let e of t)this._dispatcher.handleError(e)},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?r.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){t=[].concat(t);for(let r of t)e=s.parse(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 o=t.endpoint;r.asyncEach(this._transports,(function(o,c){var a=o[0],h=o[1],u=t.endpointFor(a);return r.indexOf(n,a)>=0?c():r.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 "+o.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return r.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(let t of this._transports)t[1]._unloaded=!1},_transports:[]});Object.assign(h.prototype,o),Object.assign(h.prototype,c),t.exports=h},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";(function(e){t.exports={then:function(t,e){var n=this;return this._promise||(this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e}))),0===arguments.length?this._promise:this._promise.then(t,e)},callback:function(t,e){if(t)return this.then((function(n){t.call(e,n)}))},errback:function(t,e){if(t)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(1))},function(t,e,n){"use strict";var i=n(4),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(let t of Object.keys(s.LOG_LEVELS))s[t]=function(){this.writeLog(arguments,t)};t.exports=s},function(t,e,n){"use strict";var i=n(23),s={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]))}};Object.assign(s,i.prototype),s.trigger=s.emit,t.exports=s},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(let[s,r]of Object.entries(t))i.push(e.call(n||null,s,r));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";t.exports={Event:{_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)}}}},function(t,e,n){"use strict";var i=n(0),s=n(7),r=n(12),o=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});Object.assign(o.prototype,s),Object.assign(o,{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 r.CHANNEL_NAME.test(t)||r.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=new Map},getKeys:function(){return[...this._channels.keys()]},remove:function(t){this._channels.delete(t)},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(let n of t)this._channels.has(n)||this._channels.set(n,new o(n)),this._channels.get(n).bind("message",e)},unsubscribe:function(t,e){var n=this._channels.get(t);return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){var e=o.expand(t.channel);for(let i of e){var n=this._channels.get(i);n&&n.trigger("message",t)}}})}),t.exports=o},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(0),s=n(2),r=n(14),o=n(6),c=n(7),a=n(15),h=n(18),u=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=new Map,this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||h,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){i=[].concat(i);for(let t of i)this.addWebsocketExtension(t)}this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca;for(let[t,e]of Object.entries(this._alternates))this._alternates[t]=s.parse(e);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),a.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 a.getConnectionTypes()},selectTransport:function(t){a.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=t.id,s=n.attempts,r=n.deadline&&(new Date).getTime()+1e3*n.deadline,o=this._envelopes.get(i);o||(o={message:t,scheduler:new this._scheduler(t,{timeout:e,interval:this.retry,attempts:s,deadline:r})},this._envelopes.set(i,o)),this._sendEnvelope(o)},_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 this._envelopes.delete(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.get(t.id);void 0!==t.successful&&n&&(n.scheduler.succeed(),this._envelopes.delete(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.get(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"))}}});u.create=function(t,e,n){return new u(t,e,n)},Object.assign(u.prototype,c),Object.assign(u.prototype,o),t.exports=u}).call(this,n(1))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(3);i.register("websocket",n(25)),i.register("eventsource",n(27)),i.register("long-polling",n(17)),i.register("cross-origin-long-polling",n(28)),i.register("callback-polling",n(29)),t.exports=i},function(t,e,n){"use strict";var i=n(0);t.exports=i({initialize:function(){this._index=new Map},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.has(e)&&(this._index.set(e,t),!0)},[Symbol.iterator]:function(){return this._index.values()},isEmpty:function(){return 0===this._index.size},member:function(t){for(let e of this._index.values())if(e===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index.get(e);return this._index.delete(e),n}})},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(10),o=n(4),c=n(3),a=Object.assign(i(c,{encode:function(t){return o(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(let[t,e]of Object.entries(o))n.setRequestHeader(t,e);var c=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",c),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,a=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",c),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(a)}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(1))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};Object.assign(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.2",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(0),s=n(5),r=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()}});Object.assign(r.prototype,s),t.exports=r},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(8),r=n(10),o=n(19),c=n(22),a=n(5),h=n(6),u=n(7),l=n(11),f=n(13),d=n(30),p=n(31),_=n(32),v=n(20),g=i({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),c(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new l.Set,this._dispatcher=f.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks=new Map,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),r.Event&&void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",(function(){s.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 i=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(o.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:l.HANDSHAKE,version:o.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(s){s.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=s.clientId,this._dispatcher.selectTransport(s.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&Promise.resolve().then((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){i.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:l.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 _;return this._sendMessage({channel:l.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",d.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new l.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return s.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new v(this,t,e,n),r=!0===e;return this._channels.hasSubscription(t)&&!r?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),r||this._channels.subscribe([t],i),this._sendMessage({channel:l.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",d.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 s.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:l.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){c(n||{},["attempts","deadline"]);var i=new _;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",d.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.set(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.get(n),this._responseCallbacks.delete(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){Object.assign(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)}});Object.assign(g.prototype,a),Object.assign(g.prototype,u),Object.assign(g.prototype,h),Object.assign(g.prototype,p),t.exports=g}).call(this,n(1))},function(t,e,n){"use strict";var i=n(8);t.exports=function(t,e){for(let n of Object.keys(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||new Map,!this._timeouts.has(t)){var r=this;this._timeouts.set(t,e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n))}},removeTimeout:function(t){this._timeouts=this._timeouts||new Map;var n=this._timeouts.get(t);n&&(e.clearTimeout(n),this._timeouts.delete(t))},removeAllTimeouts:function(){this._timeouts=this._timeouts||new Map;for(let t of this._timeouts.keys())this.removeTimeout(t)}}}).call(this,n(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(16),r=n(2),o=n(10),c=n(4),a=n(26),h=n(5),u=n(3),l=Object.assign(i(u,{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 s;for(let e of t)this._pending.add(e);var e=this,n=new Promise((function(n,i){e.callback((function(e){e&&1===e.readyState&&(e.send(c(t)),n(e))})),e.connect()}));return{abort:function(){n.then((function(t){t.close()}))}}},connect:function(){if(!l._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]:[];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){n=[].concat(n);for(let t of n)void 0!==t.successful&&e._pending.remove(t);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=l.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 a.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports,i=n.websocket=n.websocket||new Map;return i.has(e.href)||i.set(e.href,new this(t,e)),i.get(e.href)},getSocketUrl:function(t){return(t=r.clone(t)).protocol=this.PROTOCOLS[t.protocol],r.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});Object.assign(l.prototype,h),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){void 0===l._unloaded&&(l._unloaded=!0)})),t.exports=l}).call(this,n(1))},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(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(5),o=n(3),c=n(17),a=Object.assign(i(o,{initialize:function(t,n){if(o.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new c(t,n),(n=s.clone(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),r=this;i.onopen=function(){r._everConnected=!0,r.setDeferredStatus("succeeded")},i.onerror=function(){r._everConnected?r._handleError([]):(r.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?r._receive(e):r._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);c.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,i=n.eventsource=n.eventsource||new Map,r=t.clientId,o=s.clone(e);return o.pathname+="/"+(r||""),o=s.stringify(o),i.has(o)||i.set(o,new this(t,e)),i.get(o)}});Object.assign(a.prototype,r),t.exports=a}).call(this,n(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(16),r=n(2),o=n(4),c=n(3),a=Object.assign(i(c,{encode:function(t){return"message="+encodeURIComponent(o(t))},request:function(t){var n=e.XDomainRequest?XDomainRequest:XMLHttpRequest,i=new n,s=++a._id,r=this._dispatcher.headers,o=this;if(i.open("POST",this.endpoint.href,!0),i.withCredentials=!0,i.setRequestHeader){i.setRequestHeader("Pragma","no-cache");for(let[t,e]of Object.entries(r))i.setRequestHeader(t,e)}var c=function(){if(!i)return!1;a._pending.remove(s),i.onload=i.onerror=i.ontimeout=i.onprogress=null,i=null};return i.onload=function(){var e;try{e=JSON.parse(i.responseText)}catch(t){}c(),e?o._receive(e):o._handleError(t)},i.onerror=i.ontimeout=function(){c(),o._handleError(t)},i.onprogress=function(){},n===e.XDomainRequest&&a._pending.add({id:s,xhr:i}),i.send(this.encode(t)),i}}),{_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(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(4),o=n(3),c=Object.assign(i(o,{encode:function(t){var e=s.clone(this.endpoint);return e.searchParams.set("message",r(t)),e.searchParams.set("jsonp","__jsonp"+c._cbCount+"__"),s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=c.getCallbackName(),a=s.clone(this.endpoint),h=this;a.searchParams.set("message",r(t)),a.searchParams.set("jsonp",o);var u=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){u(),h._receive(t)},i.type="text/javascript",i.src=s.stringify(a),n.appendChild(i),i.onerror=function(){u(),h._handleError(t)},{abort:u}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=c}).call(this,n(1))},function(t,e,n){"use strict";var i=n(0),s=n(12),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)};for(let[t,[e,n]]of Object.entries({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"]}))r[t]=function(){return new r(e,arguments,n).toString()};t.exports=r},function(t,e,n){"use strict";var i=n(6),s={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)}};Object.assign(s,i),t.exports=s},function(t,e,n){"use strict";var i=n(0),s=n(5);t.exports=i(s)},function(t,e,n){"use strict";var i=n(19),s=n(6),r={VERSION:i.VERSION,Client:n(21),Scheduler:n(18)};s.wrapper=r,t.exports=r}]);
|
|
1
|
+
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=33)}([function(t,e,n){"use strict";t.exports=function(t,e){"function"!=typeof t&&(e=t,t=Object);var n=function(){return this.initialize&&this.initialize.apply(this,arguments)||this},i=function(){};return i.prototype=t.prototype,n.prototype=new i,Object.assign(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.pathname},isSameOrigin:function(t){return t.protocol===location.protocol&&t.hostname===location.hostname&&t.port===location.port},parse:function(t,e){return"string"!=typeof t?t:"undefined"==typeof location?new URL(t,e):new URL(t,e||location.href)},stringify:function(t){return"string"==typeof t?t:t.href},clone:function(t){return this.parse(t.href)}}},function(t,e,n){"use strict";var i=n(0),s=n(14).Cookie,r=n(8),o=n(6),c=n(24),a=n(11),h=Object.assign(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=Object.assign({},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===a.HANDSHAKE?this._publish(.01):(t.channel===a.CONNECT&&(this._connectMessage=t),this._publish(this.MAX_DELAY))):Promise.resolve(this.request([t]))},_makePromise:function(){var t=this;this._requestPromise=this._requestPromise||new Promise((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(let e of t)this._dispatcher.handleResponse(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(let e of t)this._dispatcher.handleError(e)},_getCookies:function(){var t=this._dispatcher.cookies,e=this.endpoint.href;return t?r.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){t=[].concat(t);for(let r of t)e=s.parse(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 o=t.endpoint;r.asyncEach(this._transports,(function(o,c){var a=o[0],h=o[1],u=t.endpointFor(a);return r.indexOf(n,a)>=0?c():r.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 "+o.href)}))},register:function(t,e){this._transports.push([t,e]),e.prototype.connectionType=t},getConnectionTypes:function(){return r.map(this._transports,(function(t){return t[0]}))},disable:function(t){if("autodisconnect"===t)for(let t of this._transports)t[1]._unloaded=!1},_transports:[]});Object.assign(h.prototype,o),Object.assign(h.prototype,c),t.exports=h},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";(function(e){t.exports={then:function(t,e){var n=this,i=function(){};return this._promise||(this._promise=new Promise((function(t,e){n._resolve=t,n._reject=e}))),this._promise.then(t||i,e||i)},callback:function(t,e){t&&this.then((function(n){t.call(e,n)}))},errback:function(t,e){t&&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(1))},function(t,e,n){"use strict";var i=n(4),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(let t of Object.keys(s.LOG_LEVELS))s[t]=function(){this.writeLog(arguments,t)};t.exports=s},function(t,e,n){"use strict";var i=n(23),s={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]))}};Object.assign(s,i.prototype),s.trigger=s.emit,t.exports=s},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(let[s,r]of Object.entries(t))i.push(e.call(n||null,s,r));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";t.exports={Event:{_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)}}}},function(t,e,n){"use strict";var i=n(0),s=n(7),r=n(12),o=i({initialize:function(t){this.id=this.name=t},push:function(t){this.trigger("message",t)},isUnused:function(){return 0===this.countListeners("message")}});Object.assign(o.prototype,s),Object.assign(o,{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 r.CHANNEL_NAME.test(t)||r.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=new Map},getKeys:function(){return[...this._channels.keys()]},remove:function(t){this._channels.delete(t)},hasSubscription:function(t){return this._channels.hasOwnProperty(t)},subscribe:function(t,e){for(let n of t)this._channels.has(n)||this._channels.set(n,new o(n)),this._channels.get(n).bind("message",e)},unsubscribe:function(t,e){var n=this._channels.get(t);return!!n&&(n.unbind("message",e),!!n.isUnused()&&(this.remove(t),!0))},distributeMessage:function(t){var e=o.expand(t.channel);for(let i of e){var n=this._channels.get(i);n&&n.trigger("message",t)}}})}),t.exports=o},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(0),s=n(2),r=n(14),o=n(6),c=n(7),a=n(15),h=n(18),u=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=new Map,this.headers={},this.retry=n.retry||this.DEFAULT_RETRY,this._scheduler=n.scheduler||h,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){i=[].concat(i);for(let t of i)this.addWebsocketExtension(t)}this.tls=n.tls||{},this.tls.ca=this.tls.ca||n.ca;for(let[t,e]of Object.entries(this._alternates))this._alternates[t]=s.parse(e);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),a.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 a.getConnectionTypes()},selectTransport:function(t){a.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=t.id,s=n.attempts,r=n.deadline&&(new Date).getTime()+1e3*n.deadline,o=this._envelopes.get(i);o||(o={message:t,scheduler:new this._scheduler(t,{timeout:e,interval:this.retry,attempts:s,deadline:r})},this._envelopes.set(i,o)),this._sendEnvelope(o)},_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 this._envelopes.delete(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.get(t.id);void 0!==t.successful&&n&&(n.scheduler.succeed(),this._envelopes.delete(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.get(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"))}}});u.create=function(t,e,n){return new u(t,e,n)},Object.assign(u.prototype,c),Object.assign(u.prototype,o),t.exports=u}).call(this,n(1))},function(t,e,n){"use strict";t.exports={}},function(t,e,n){"use strict";var i=n(3);i.register("websocket",n(25)),i.register("eventsource",n(27)),i.register("long-polling",n(17)),i.register("cross-origin-long-polling",n(28)),i.register("callback-polling",n(29)),t.exports=i},function(t,e,n){"use strict";var i=n(0);t.exports=i({initialize:function(){this._index=new Map},add:function(t){var e=void 0!==t.id?t.id:t;return!this._index.has(e)&&(this._index.set(e,t),!0)},[Symbol.iterator]:function(){return this._index.values()},isEmpty:function(){return 0===this._index.size},member:function(t){for(let e of this._index.values())if(e===t)return!0;return!1},remove:function(t){var e=void 0!==t.id?t.id:t,n=this._index.get(e);return this._index.delete(e),n}})},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(10),o=n(4),c=n(3),a=Object.assign(i(c,{encode:function(t){return o(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(let[t,e]of Object.entries(o))n.setRequestHeader(t,e);var c=function(){n.abort()};return void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",c),n.onreadystatechange=function(){if(n&&4===n.readyState){var i=null,o=n.status,a=n.responseText,h=o>=200&&o<300||304===o||1223===o;if(void 0!==e.onbeforeunload&&r.Event.detach(e,"beforeunload",c),n.onreadystatechange=function(){},n=null,!h)return s._handleError(t);try{i=JSON.parse(a)}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(1))},function(t,e,n){"use strict";var i=function(t,e){this.message=t,this.options=e,this.attempts=0};Object.assign(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.3",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(0),s=n(5),r=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()}});Object.assign(r.prototype,s),t.exports=r},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(8),r=n(10),o=n(19),c=n(22),a=n(5),h=n(6),u=n(7),l=n(11),f=n(13),d=n(30),p=n(31),_=n(32),v=n(20),g=i({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),c(n=n||{},["interval","timeout","endpoints","proxy","retry","scheduler","websocketExtensions","tls","ca"]),this._channels=new l.Set,this._dispatcher=f.create(this,t||this.DEFAULT_ENDPOINT,n),this._messageId=0,this._state=this.UNCONNECTED,this._responseCallbacks=new Map,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),r.Event&&void 0!==e.onbeforeunload&&r.Event.on(e,"beforeunload",(function(){s.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 i=this;this.info("Initiating handshake with ?",this._dispatcher.endpoint.href),this._dispatcher.selectTransport(o.MANDATORY_CONNECTION_TYPES),this._sendMessage({channel:l.HANDSHAKE,version:o.BAYEUX_VERSION,supportedConnectionTypes:this._dispatcher.getConnectionTypes()},{},(function(s){s.successful?(this._state=this.CONNECTED,this._dispatcher.clientId=s.clientId,this._dispatcher.selectTransport(s.supportedConnectionTypes),this.info("Handshake successful: ?",this._dispatcher.clientId),this.subscribe(this._channels.getKeys(),!0),t&&Promise.resolve().then((function(){t.call(n)}))):(this.info("Handshake unsuccessful"),e.setTimeout((function(){i.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:l.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 _;return this._sendMessage({channel:l.DISCONNECT,clientId:this._dispatcher.clientId},{},(function(e){e.successful?(this._dispatcher.close(),t.setDeferredStatus("succeeded")):t.setDeferredStatus("failed",d.parse(e.error))}),this),this.info("Clearing channel listeners for ?",this._dispatcher.clientId),this._channels=new l.Set,t}},subscribe:function(t,e,n){if(t instanceof Array)return s.map(t,(function(t){return this.subscribe(t,e,n)}),this);var i=new v(this,t,e,n),r=!0===e;return this._channels.hasSubscription(t)&&!r?(this._channels.subscribe([t],i),i.setDeferredStatus("succeeded"),i):(this.connect((function(){this.info("Client ? attempting to subscribe to ?",this._dispatcher.clientId,t),r||this._channels.subscribe([t],i),this._sendMessage({channel:l.SUBSCRIBE,clientId:this._dispatcher.clientId,subscription:t},{},(function(e){if(!e.successful)return i.setDeferredStatus("failed",d.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 s.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:l.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){c(n||{},["attempts","deadline"]);var i=new _;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",d.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.set(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.get(n),this._responseCallbacks.delete(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){Object.assign(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)}});Object.assign(g.prototype,a),Object.assign(g.prototype,u),Object.assign(g.prototype,h),Object.assign(g.prototype,p),t.exports=g}).call(this,n(1))},function(t,e,n){"use strict";var i=n(8);t.exports=function(t,e){for(let n of Object.keys(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||new Map,!this._timeouts.has(t)){var r=this;this._timeouts.set(t,e.setTimeout((function(){delete r._timeouts[t],i.call(s)}),1e3*n))}},removeTimeout:function(t){this._timeouts=this._timeouts||new Map;var n=this._timeouts.get(t);n&&(e.clearTimeout(n),this._timeouts.delete(t))},removeAllTimeouts:function(){this._timeouts=this._timeouts||new Map;for(let t of this._timeouts.keys())this.removeTimeout(t)}}}).call(this,n(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(16),r=n(2),o=n(10),c=n(4),a=n(26),h=n(5),u=n(3),l=Object.assign(i(u,{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 s;for(let e of t)this._pending.add(e);var e=this,n=new Promise((function(n,i){e.callback((function(e){e&&1===e.readyState&&(e.send(c(t)),n(e))})),e.connect()}));return{abort:function(){n.then((function(t){t.close()}))}}},connect:function(){if(!l._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]:[];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){n=[].concat(n);for(let t of n)void 0!==t.successful&&e._pending.remove(t);e._receive(n)}}}},close:function(){this._socket&&this._socket.close()},_createSocket:function(){var t=l.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 a.create(t,[],r)}catch(t){}}}),{PROTOCOLS:{"http:":"ws:","https:":"wss:"},create:function(t,e){var n=t.transports,i=n.websocket=n.websocket||new Map;return i.has(e.href)||i.set(e.href,new this(t,e)),i.get(e.href)},getSocketUrl:function(t){return(t=r.clone(t)).protocol=this.PROTOCOLS[t.protocol],r.stringify(t)},isUsable:function(t,e,n,i){this.create(t,e).isUsable(n,i)}});Object.assign(l.prototype,h),o.Event&&void 0!==e.onbeforeunload&&o.Event.on(e,"beforeunload",(function(){void 0===l._unloaded&&(l._unloaded=!0)})),t.exports=l}).call(this,n(1))},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(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(5),o=n(3),c=n(17),a=Object.assign(i(o,{initialize:function(t,n){if(o.prototype.initialize.call(this,t,n),!e.EventSource)return this.setDeferredStatus("failed");this._xhr=new c(t,n),(n=s.clone(n)).pathname+="/"+t.clientId;var i=new e.EventSource(s.stringify(n)),r=this;i.onopen=function(){r._everConnected=!0,r.setDeferredStatus("succeeded")},i.onerror=function(){r._everConnected?r._handleError([]):(r.setDeferredStatus("failed"),i.close())},i.onmessage=function(t){var e;try{e=JSON.parse(t.data)}catch(t){}e?r._receive(e):r._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);c.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,i=n.eventsource=n.eventsource||new Map,r=t.clientId,o=s.clone(e);return o.pathname+="/"+(r||""),o=s.stringify(o),i.has(o)||i.set(o,new this(t,e)),i.get(o)}});Object.assign(a.prototype,r),t.exports=a}).call(this,n(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(16),r=n(2),o=n(4),c=n(3),a=Object.assign(i(c,{encode:function(t){return"message="+encodeURIComponent(o(t))},request:function(t){var n=e.XDomainRequest?XDomainRequest:XMLHttpRequest,i=new n,s=++a._id,r=this._dispatcher.headers,o=this;if(i.open("POST",this.endpoint.href,!0),i.withCredentials=!0,i.setRequestHeader){i.setRequestHeader("Pragma","no-cache");for(let[t,e]of Object.entries(r))i.setRequestHeader(t,e)}var c=function(){if(!i)return!1;a._pending.remove(s),i.onload=i.onerror=i.ontimeout=i.onprogress=null,i=null};return i.onload=function(){var e;try{e=JSON.parse(i.responseText)}catch(t){}c(),e?o._receive(e):o._handleError(t)},i.onerror=i.ontimeout=function(){c(),o._handleError(t)},i.onprogress=function(){},n===e.XDomainRequest&&a._pending.add({id:s,xhr:i}),i.send(this.encode(t)),i}}),{_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(1))},function(t,e,n){"use strict";(function(e){var i=n(0),s=n(2),r=n(4),o=n(3),c=Object.assign(i(o,{encode:function(t){var e=s.clone(this.endpoint);return e.searchParams.set("message",r(t)),e.searchParams.set("jsonp","__jsonp"+c._cbCount+"__"),s.stringify(e)},request:function(t){var n=document.getElementsByTagName("head")[0],i=document.createElement("script"),o=c.getCallbackName(),a=s.clone(this.endpoint),h=this;a.searchParams.set("message",r(t)),a.searchParams.set("jsonp",o);var u=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){u(),h._receive(t)},i.type="text/javascript",i.src=s.stringify(a),n.appendChild(i),i.onerror=function(){u(),h._handleError(t)},{abort:u}}}),{_cbCount:0,getCallbackName:function(){return this._cbCount+=1,"__jsonp"+this._cbCount+"__"},isUsable:function(t,e,n,i){n.call(i,!0)}});t.exports=c}).call(this,n(1))},function(t,e,n){"use strict";var i=n(0),s=n(12),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)};for(let[t,[e,n]]of Object.entries({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"]}))r[t]=function(){return new r(e,arguments,n).toString()};t.exports=r},function(t,e,n){"use strict";var i=n(6),s={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)}};Object.assign(s,i),t.exports=s},function(t,e,n){"use strict";var i=n(0),s=n(5);t.exports=i(s)},function(t,e,n){"use strict";var i=n(19),s=n(6),r={VERSION:i.VERSION,Client:n(21),Scheduler:n(18)};s.wrapper=r,t.exports=r}]);
|
|
2
2
|
//# sourceMappingURL=faye-browser-min.js.map
|