text: /** @license
   * eventsource.js
   * Available under MIT License (MIT)
   * https://github.com/Yaffle/EventSource/
   */
  !function(a){"use strict";function b(){this.data={}}function c(){this.listeners=new b}function d(a){setTimeout(function(){throw a},0)}function e(a){this.type=a,this.target=void 0}function f(a,b){e.call(this,a),this.data=b.data,this.lastEventId=b.lastEventId}function x(a,b){var c=a;return c!==c&&(c=b),v>c?v:c>w?w:c}function y(a,b,c){try{"function"==typeof b&&b.call(a,c)}catch(e){d(e)}}function z(b,d){function P(){H=o,void 0!==D&&(D.abort(),D=void 0),0!==E&&(clearTimeout(E),E=0),0!==F&&(clearTimeout(F),F=0),A.readyState=o}function Q(a){var c=H===n||H===m?D.responseText:"",d=void 0,g=!1;if(H===m){var i=0,k="",F=void 0;if(j)try{i=D.status,k=D.statusText,F=D.getResponseHeader("Content-Type")}catch(Q){i=0,k="",F=void 0}else""!==a&&"error"!==a&&(i=200,k="OK",F=D.contentType);if((void 0===F||null===F)&&(F=""),0===i&&""===k&&"load"===a&&""!==c&&(i=200,k="OK",""===F)){var R=/^data\:([^,]*?)(?:;base64)?,[\S]*$/.exec(b);void 0!==R&&null!==R&&(F=R[1])}if(200===i&&u.test(F)){if(H=n,C=!0,B=h,A.readyState=n,d=new e("open"),A.dispatchEvent(d),y(A,A.onopen,d),H===o)return}else if(0!==i){var S="";S=200!==i?"EventSource's response has a status "+i+" "+k.replace(/\s+/g," ")+" that is not 200. Aborting the connection.":"EventSource's response has a Content-Type specifying an unsupported type: "+F.replace(/\s+/g," ")+". Aborting the connection.",setTimeout(function(){throw new Error(S)},0),g=!0}}if(H===n){c.length>G&&(C=!0);for(var T=G-1,U=c.length,V="\n";++T<U;)if(V=c.charAt(T),M===p&&"\n"===V)M=q;else if(M===p&&(M=q),"\r"===V||"\n"===V){if("data"===N?I.push(O):"id"===N?J=O:"event"===N?K=O:"retry"===N?(h=x(Number(O),h),B=h):"heartbeatTimeout"===N&&(v=x(Number(O),v),0!==E&&(clearTimeout(E),E=setTimeout(L,v))),O="",N="",M===q){if(0!==I.length&&(z=J,""===K&&(K="message"),d=new f(K,{data:I.join("\n"),lastEventId:J}),A.dispatchEvent(d),"message"===K&&y(A,A.onmessage,d),H===o))return;I.length=0,K=""}M="\r"===V?p:q}else M===q&&(M=r),M===r?":"===V?M=s:N+=V:M===s?(" "!==V&&(O+=V),M=t):M===t&&(O+=V);G=U}H!==n&&H!==m||!("load"===a||"error"===a||g||G>1048576||0===E&&!C)?0===E&&(C=!1,E=setTimeout(L,v)):(g?P():(H=l,D.abort(),0!==E&&(clearTimeout(E),E=0),B>16*h&&(B=16*h),B>w&&(B=w),E=setTimeout(L,B),B=2*B+1,A.readyState=m),d=new e("error"),A.dispatchEvent(d),y(A,A.onerror,d))}function R(){Q("progress")}function S(){Q("load")}function T(){Q("error")}b=b.toString();var g=i&&void 0!==d&&Boolean(d.withCredentials),h=x(1e3,0),v=x(45e3,0),z="",A=this,B=h,C=!1,D=new k,E=0,F=0,G=0,H=l,I=[],J="",K="",L=void 0,M=q,N="",O="";j&&(F=setTimeout(function U(){3===D.readyState&&Q("progress"),F=setTimeout(U,500)},0)),L=function(){if(E=0,H!==l)return Q(""),void 0;if(j&&(void 0!==D.sendAsBinary||void 0===D.onloadend)&&void 0!==a.document&&void 0!==a.document.readyState&&"complete"!==a.document.readyState)return E=setTimeout(L,4),void 0;D.onload=S,D.onerror=T,j&&(D.onabort=T,D.onreadystatechange=R),D.onprogress=R,C=!1,E=setTimeout(L,v),G=0,H=m,I.length=0,K="",J=z,O="",N="",M=q;var c=b.slice(0,5);c="data:"!==c&&"blob:"!==c?b+((-1===b.indexOf("?",0)?"?":"&")+"lastEventId="+encodeURIComponent(z)+"&r="+(Math.random()+1).toString().slice(2)):b,D.open("GET",c,!0),j&&(D.withCredentials=g,D.responseType="text",D.setRequestHeader("Accept","text/event-stream")),D.send(void 0)},c.call(this),this.close=P,this.url=b,this.readyState=m,this.withCredentials=g,this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,L()}function A(){this.CONNECTING=m,this.OPEN=n,this.CLOSED=o}b.prototype={get:function(a){return this.data[a+"~"]},set:function(a,b){this.data[a+"~"]=b},"delete":function(a){delete this.data[a+"~"]}},c.prototype={dispatchEvent:function(a){a.target=this;var b=a.type.toString(),c=this.listeners,e=c.get(b);if(void 0!==e)for(var f=e.length,g=-1,h=void 0;++g<f;){h=e[g];try{h.call(this,a)}catch(i){d(i)}}},addEventListener:function(a,b){a=a.toString();var c=this.listeners,d=c.get(a);void 0===d&&(d=[],c.set(a,d));for(var e=d.length;--e>=0;)if(d[e]===b)return;d.push(b)},removeEventListener:function(a,b){a=a.toString();var c=this.listeners,d=c.get(a);if(void 0!==d){for(var e=d.length,f=[],g=-1;++g<e;)d[g]!==b&&f.push(d[g]);0===f.length?c["delete"](a):c.set(a,f)}}},f.prototype=e.prototype;var g=a.XMLHttpRequest,h=a.XDomainRequest,i=void 0!==g&&void 0!==(new g).withCredentials,j=i,k=i?g:void 0!==h?h:void 0,l=-1,m=0,n=1,o=2,p=3,q=4,r=5,s=6,t=7,u=/^text\/event\-stream;?(\s*charset\=utf\-8)?$/i,v=1e3,w=18e6;A.prototype=c.prototype,z.prototype=new A,A.call(z);var B=function(){if(void 0!==a.EventSource)try{var b=new a.EventSource("data:text/event-stream;charset=utf-8,");return b.close(),b.withCredentials===!1&&""!==b.url}catch(c){d(c)}return!1};void 0===k||B()||(a.NativeEventSource=a.EventSource,a.EventSource=z)}(this);
  