/* sockjs-client v1.3.0 | http://sockjs.org | MIT license */ ! function(e) { if("object" == typeof exports && "undefined" != typeof module) module.exports = e(); else if("function" == typeof define && define.amd) define([], e); else { ("undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : this).SockJS = e() } }(function() { return function i(s, a, l) { function c(t, e) { if(!a[t]) { if(!s[t]) { var n = "function" == typeof require && require; if(!e && n) return n(t, !0); if(u) return u(t, !0); var r = new Error("Cannot find module '" + t + "'"); throw r.code = "MODULE_NOT_FOUND", r } var o = a[t] = { exports: {} }; s[t][0].call(o.exports, function(e) { return c(s[t][1][e] || e) }, o, o.exports, i, s, a, l) } return a[t].exports } for(var u = "function" == typeof require && require, e = 0; e < l.length; e++) c(l[e]); return c }({ 1: [function(n, r, e) { (function(e) { "use strict"; var t = n("./transport-list"); r.exports = n("./main")(t), "_sockjs_onload" in e && setTimeout(e._sockjs_onload, 1) }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "./main": 14, "./transport-list": 16 }], 2: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("./event"); function i() { o.call(this), this.initEvent("close", !1, !1), this.wasClean = !1, this.code = 0, this.reason = "" } r(i, o), t.exports = i }, { "./event": 4, "inherits": 54 }], 3: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("./eventtarget"); function i() { o.call(this) } r(i, o), i.prototype.removeAllListeners = function(e) { e ? delete this._listeners[e] : this._listeners = {} }, i.prototype.once = function(t, n) { var r = this, o = !1; this.on(t, function e() { r.removeListener(t, e), o || (o = !0, n.apply(this, arguments)) }) }, i.prototype.emit = function() { var e = arguments[0], t = this._listeners[e]; if(t) { for(var n = arguments.length, r = new Array(n - 1), o = 1; o < n; o++) r[o - 1] = arguments[o]; for(var i = 0; i < t.length; i++) t[i].apply(this, r) } }, i.prototype.on = i.prototype.addListener = o.prototype.addEventListener, i.prototype.removeListener = o.prototype.removeEventListener, t.exports.EventEmitter = i }, { "./eventtarget": 5, "inherits": 54 }], 4: [function(e, t, n) { "use strict"; function r(e) { this.type = e } r.prototype.initEvent = function(e, t, n) { return this.type = e, this.bubbles = t, this.cancelable = n, this.timeStamp = +new Date, this }, r.prototype.stopPropagation = function() {}, r.prototype.preventDefault = function() {}, r.CAPTURING_PHASE = 1, r.AT_TARGET = 2, r.BUBBLING_PHASE = 3, t.exports = r }, {}], 5: [function(e, t, n) { "use strict"; function r() { this._listeners = {} } r.prototype.addEventListener = function(e, t) { e in this._listeners || (this._listeners[e] = []); var n = this._listeners[e]; - 1 === n.indexOf(t) && (n = n.concat([t])), this._listeners[e] = n }, r.prototype.removeEventListener = function(e, t) { var n = this._listeners[e]; if(n) { var r = n.indexOf(t); - 1 === r || (1 < n.length ? this._listeners[e] = n.slice(0, r).concat(n.slice(r + 1)) : delete this._listeners[e]) } }, r.prototype.dispatchEvent = function() { var e = arguments[0], t = e.type, n = 1 === arguments.length ? [e] : Array.apply(null, arguments); if(this["on" + t] && this["on" + t].apply(this, n), t in this._listeners) for(var r = this._listeners[t], o = 0; o < r.length; o++) r[o].apply(this, n) }, t.exports = r }, {}], 6: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("./event"); function i(e) { o.call(this), this.initEvent("message", !1, !1), this.data = e } r(i, o), t.exports = i }, { "./event": 4, "inherits": 54 }], 7: [function(e, t, n) { "use strict"; var r = e("json3"), o = e("./utils/iframe"); function i(e) { (this._transport = e).on("message", this._transportMessage.bind(this)), e.on("close", this._transportClose.bind(this)) } i.prototype._transportClose = function(e, t) { o.postMessage("c", r.stringify([e, t])) }, i.prototype._transportMessage = function(e) { o.postMessage("t", e) }, i.prototype._send = function(e) { this._transport.send(e) }, i.prototype._close = function() { this._transport.close(), this._transport.removeAllListeners() }, t.exports = i }, { "./utils/iframe": 47, "json3": 55 }], 8: [function(e, t, n) { "use strict"; var f = e("./utils/url"), r = e("./utils/event"), h = e("json3"), d = e("./facade"), o = e("./info-iframe-receiver"), p = e("./utils/iframe"), v = e("./location"), m = function() {}; t.exports = function(l, e) { var c, u = {}; e.forEach(function(e) { e.facadeTransport && (u[e.facadeTransport.transportName] = e.facadeTransport) }), u[o.transportName] = o, l.bootstrap_iframe = function() { var a; p.currentWindowId = v.hash.slice(1); r.attachEvent("message", function(t) { if(t.source === parent && (void 0 === c && (c = t.origin), t.origin === c)) { var n; try { n = h.parse(t.data) } catch(e) { return void m("bad json", t.data) } if(n.windowId === p.currentWindowId) switch(n.type) { case "s": var e; try { e = h.parse(n.data) } catch(e) { m("bad json", n.data); break } var r = e[0], o = e[1], i = e[2], s = e[3]; if(m(r, o, i, s), r !== l.version) throw new Error('Incompatible SockJS! Main site uses: "' + r + '", the iframe: "' + l.version + '".'); if(!f.isOriginEqual(i, v.href) || !f.isOriginEqual(s, v.href)) throw new Error("Can't connect to different domain from within an iframe. (" + v.href + ", " + i + ", " + s + ")"); a = new d(new u[o](i, s)); break; case "m": a._send(n.data); break; case "c": a && a._close(), a = null } } }), p.postMessage("s") } } }, { "./facade": 7, "./info-iframe-receiver": 10, "./location": 13, "./utils/event": 46, "./utils/iframe": 47, "./utils/url": 52, "debug": void 0, "json3": 55 }], 9: [function(e, t, n) { "use strict"; var r = e("events").EventEmitter, o = e("inherits"), s = e("json3"), a = e("./utils/object"), l = function() {}; function i(e, t) { r.call(this); var o = this, i = +new Date; this.xo = new t("GET", e), this.xo.once("finish", function(e, t) { var n, r; if(200 === e) { if(r = +new Date - i, t) try { n = s.parse(t) } catch(e) { l("bad json", t) } a.isObject(n) || (n = {}) } o.emit("finish", n, r), o.removeAllListeners() }) } o(i, r), i.prototype.close = function() { this.removeAllListeners(), this.xo.close() }, t.exports = i }, { "./utils/object": 49, "debug": void 0, "events": 3, "inherits": 54, "json3": 55 }], 10: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("events").EventEmitter, i = e("json3"), s = e("./transport/sender/xhr-local"), a = e("./info-ajax"); function l(e) { var n = this; o.call(this), this.ir = new a(e, s), this.ir.once("finish", function(e, t) { n.ir = null, n.emit("message", i.stringify([e, t])) }) } r(l, o), l.transportName = "iframe-info-receiver", l.prototype.close = function() { this.ir && (this.ir.close(), this.ir = null), this.removeAllListeners() }, t.exports = l }, { "./info-ajax": 9, "./transport/sender/xhr-local": 37, "events": 3, "inherits": 54, "json3": 55 }], 11: [function(n, o, e) { (function(r) { "use strict"; var i = n("events").EventEmitter, e = n("inherits"), s = n("json3"), a = n("./utils/event"), l = n("./transport/iframe"), c = n("./info-iframe-receiver"), u = function() {}; function t(t, n) { var o = this; i.call(this); var e = function() { var e = o.ifr = new l(c.transportName, n, t); e.once("message", function(t) { if(t) { var e; try { e = s.parse(t) } catch(e) { return u("bad json", t), o.emit("finish"), void o.close() } var n = e[0], r = e[1]; o.emit("finish", n, r) } o.close() }), e.once("close", function() { o.emit("finish"), o.close() }) }; r.document.body ? e() : a.attachEvent("load", e) } e(t, i), t.enabled = function() { return l.enabled() }, t.prototype.close = function() { this.ifr && this.ifr.close(), this.removeAllListeners(), this.ifr = null }, o.exports = t }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "./info-iframe-receiver": 10, "./transport/iframe": 22, "./utils/event": 46, "debug": void 0, "events": 3, "inherits": 54, "json3": 55 }], 12: [function(e, t, n) { "use strict"; var r = e("events").EventEmitter, o = e("inherits"), i = e("./utils/url"), s = e("./transport/sender/xdr"), a = e("./transport/sender/xhr-cors"), l = e("./transport/sender/xhr-local"), c = e("./transport/sender/xhr-fake"), u = e("./info-iframe"), f = e("./info-ajax"), h = function() {}; function d(e, t) { h(e); var n = this; r.call(this), setTimeout(function() { n.doXhr(e, t) }, 0) } o(d, r), d._getReceiver = function(e, t, n) { return n.sameOrigin ? new f(t, l) : a.enabled ? new f(t, a) : s.enabled && n.sameScheme ? new f(t, s) : u.enabled() ? new u(e, t) : new f(t, c) }, d.prototype.doXhr = function(e, t) { var n = this, r = i.addPath(e, "/info"); h("doXhr", r), this.xo = d._getReceiver(e, r, t), this.timeoutRef = setTimeout(function() { h("timeout"), n._cleanup(!1), n.emit("finish") }, d.timeout), this.xo.once("finish", function(e, t) { h("finish", e, t), n._cleanup(!0), n.emit("finish", e, t) }) }, d.prototype._cleanup = function(e) { h("_cleanup"), clearTimeout(this.timeoutRef), this.timeoutRef = null, !e && this.xo && this.xo.close(), this.xo = null }, d.prototype.close = function() { h("close"), this.removeAllListeners(), this._cleanup(!1) }, d.timeout = 8e3, t.exports = d }, { "./info-ajax": 9, "./info-iframe": 11, "./transport/sender/xdr": 34, "./transport/sender/xhr-cors": 35, "./transport/sender/xhr-fake": 36, "./transport/sender/xhr-local": 37, "./utils/url": 52, "debug": void 0, "events": 3, "inherits": 54 }], 13: [function(e, t, n) { (function(e) { "use strict"; t.exports = e.location || { origin: "http://localhost:80", protocol: "http:", host: "localhost", port: 80, href: "http://localhost/", hash: "" } }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, {}], 14: [function(_, E, e) { (function(i) { "use strict"; _("./shims"); var r, l = _("url-parse"), e = _("inherits"), s = _("json3"), c = _("./utils/random"), t = _("./utils/escape"), u = _("./utils/url"), a = _("./utils/event"), n = _("./utils/transport"), o = _("./utils/object"), f = _("./utils/browser"), h = _("./utils/log"), d = _("./event/event"), p = _("./event/eventtarget"), v = _("./location"), m = _("./event/close"), b = _("./event/trans-message"), y = _("./info-receiver"), g = function() {}; function w(e, t, n) { if(!(this instanceof w)) return new w(e, t, n); if(arguments.length < 1) throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present"); p.call(this), this.readyState = w.CONNECTING, this.extensions = "", this.protocol = "", (n = n || {}).protocols_whitelist && h.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead."), this._transportsWhitelist = n.transports, this._transportOptions = n.transportOptions || {}; var r = n.sessionId || 8; if("function" == typeof r) this._generateSessionId = r; else { if("number" != typeof r) throw new TypeError("If sessionId is used in the options, it needs to be a number or a function."); this._generateSessionId = function() { return c.string(r) } } this._server = n.server || c.numberString(1e3); var o = new l(e); if(!o.host || !o.protocol) throw new SyntaxError("The URL '" + e + "' is invalid"); if(o.hash) throw new SyntaxError("The URL must not contain a fragment"); if("http:" !== o.protocol && "https:" !== o.protocol) throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '" + o.protocol + "' is not allowed."); var i = "https:" === o.protocol; if("https:" === v.protocol && !i) throw new Error("SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS"); t ? Array.isArray(t) || (t = [t]) : t = []; var s = t.sort(); s.forEach(function(e, t) { if(!e) throw new SyntaxError("The protocols entry '" + e + "' is invalid."); if(t < s.length - 1 && e === s[t + 1]) throw new SyntaxError("The protocols entry '" + e + "' is duplicated.") }); var a = u.getOrigin(v.href); this._origin = a ? a.toLowerCase() : null, o.set("pathname", o.pathname.replace(/\/+$/, "")), this.url = o.href, g("using url", this.url), this._urlInfo = { nullOrigin: !f.hasDomain(), sameOrigin: u.isOriginEqual(this.url, v.href), sameScheme: u.isSchemeEqual(this.url, v.href) }, this._ir = new y(this.url, this._urlInfo), this._ir.once("finish", this._receiveInfo.bind(this)) } function x(e) { return 1e3 === e || 3e3 <= e && e <= 4999 } e(w, p), w.prototype.close = function(e, t) { if(e && !x(e)) throw new Error("InvalidAccessError: Invalid code"); if(t && 123 < t.length) throw new SyntaxError("reason argument has an invalid length"); if(this.readyState !== w.CLOSING && this.readyState !== w.CLOSED) { this._close(e || 1e3, t || "Normal closure", !0) } }, w.prototype.send = function(e) { if("string" != typeof e && (e = "" + e), this.readyState === w.CONNECTING) throw new Error("InvalidStateError: The connection has not been established yet"); this.readyState === w.OPEN && this._transport.send(t.quote(e)) }, w.version = _("./version"), w.CONNECTING = 0, w.OPEN = 1, w.CLOSING = 2, w.CLOSED = 3, w.prototype._receiveInfo = function(e, t) { if(g("_receiveInfo", t), this._ir = null, e) { this._rto = this.countRTO(t), this._transUrl = e.base_url ? e.base_url : this.url, e = o.extend(e, this._urlInfo), g("info", e); var n = r.filterToEnabled(this._transportsWhitelist, e); this._transports = n.main, g(this._transports.length + " enabled transports"), this._connect() } else this._close(1002, "Cannot connect to server") }, w.prototype._connect = function() { for(var e = this._transports.shift(); e; e = this._transports.shift()) { if(g("attempt", e.transportName), e.needBody && (!i.document.body || void 0 !== i.document.readyState && "complete" !== i.document.readyState && "interactive" !== i.document.readyState)) return g("waiting for body"), this._transports.unshift(e), void a.attachEvent("load", this._connect.bind(this)); var t = this._rto * e.roundTrips || 5e3; this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), t), g("using timeout", t); var n = u.addPath(this._transUrl, "/" + this._server + "/" + this._generateSessionId()), r = this._transportOptions[e.transportName]; g("transport url", n); var o = new e(n, this._transUrl, r); return o.on("message", this._transportMessage.bind(this)), o.once("close", this._transportClose.bind(this)), o.transportName = e.transportName, void(this._transport = o) } this._close(2e3, "All transports failed", !1) }, w.prototype._transportTimeout = function() { g("_transportTimeout"), this.readyState === w.CONNECTING && (this._transport && this._transport.close(), this._transportClose(2007, "Transport timed out")) }, w.prototype._transportMessage = function(e) { g("_transportMessage", e); var t, n = this, r = e.slice(0, 1), o = e.slice(1); switch(r) { case "o": return void this._open(); case "h": return this.dispatchEvent(new d("heartbeat")), void g("heartbeat", this.transport) } if(o) try { t = s.parse(o) } catch(e) { g("bad json", o) } if(void 0 !== t) switch(r) { case "a": Array.isArray(t) && t.forEach(function(e) { g("message", n.transport, e), n.dispatchEvent(new b(e)) }); break; case "m": g("message", this.transport, t), this.dispatchEvent(new b(t)); break; case "c": Array.isArray(t) && 2 === t.length && this._close(t[0], t[1], !0) } else g("empty payload", o) }, w.prototype._transportClose = function(e, t) { g("_transportClose", this.transport, e, t), this._transport && (this._transport.removeAllListeners(), this._transport = null, this.transport = null), x(e) || 2e3 === e || this.readyState !== w.CONNECTING ? this._close(e, t) : this._connect() }, w.prototype._open = function() { g("_open", this._transport.transportName, this.readyState), this.readyState === w.CONNECTING ? (this._transportTimeoutId && (clearTimeout(this._transportTimeoutId), this._transportTimeoutId = null), this.readyState = w.OPEN, this.transport = this._transport.transportName, this.dispatchEvent(new d("open")), g("connected", this.transport)) : this._close(1006, "Server lost session") }, w.prototype._close = function(t, n, r) { g("_close", this.transport, t, n, r, this.readyState); var o = !1; if(this._ir && (o = !0, this._ir.close(), this._ir = null), this._transport && (this._transport.close(), this._transport = null, this.transport = null), this.readyState === w.CLOSED) throw new Error("InvalidStateError: SockJS has already been closed"); this.readyState = w.CLOSING, setTimeout(function() { this.readyState = w.CLOSED, o && this.dispatchEvent(new d("error")); var e = new m("close"); e.wasClean = r || !1, e.code = t || 1e3, e.reason = n, this.dispatchEvent(e), this.onmessage = this.onclose = this.onerror = null, g("disconnected") }.bind(this), 0) }, w.prototype.countRTO = function(e) { return 100 < e ? 4 * e : 300 + e }, E.exports = function(e) { return r = n(e), _("./iframe-bootstrap")(w, e), w } }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "./event/close": 2, "./event/event": 4, "./event/eventtarget": 5, "./event/trans-message": 6, "./iframe-bootstrap": 8, "./info-receiver": 12, "./location": 13, "./shims": 15, "./utils/browser": 44, "./utils/escape": 45, "./utils/event": 46, "./utils/log": 48, "./utils/object": 49, "./utils/random": 50, "./utils/transport": 51, "./utils/url": 52, "./version": 53, "debug": void 0, "inherits": 54, "json3": 55, "url-parse": 58 }], 15: [function(e, t, n) { "use strict"; var o, u = Array.prototype, i = Object.prototype, r = Function.prototype, s = String.prototype, a = u.slice, f = i.toString, l = function(e) { return "[object Function]" === i.toString.call(e) }, c = function(e) { return "[object String]" === f.call(e) }, h = Object.defineProperty && function() { try { return Object.defineProperty({}, "x", {}), !0 } catch(e) { return !1 } }(); o = h ? function(e, t, n, r) { !r && t in e || Object.defineProperty(e, t, { configurable: !0, enumerable: !1, writable: !0, value: n }) } : function(e, t, n, r) { !r && t in e || (e[t] = n) }; var d = function(e, t, n) { for(var r in t) i.hasOwnProperty.call(t, r) && o(e, r, t[r], n) }, p = function(e) { if(null == e) throw new TypeError("can't convert " + e + " to object"); return Object(e) }; function v() {} d(r, { bind: function(t) { var n = this; if(!l(n)) throw new TypeError("Function.prototype.bind called on incompatible " + n); for(var r = a.call(arguments, 1), e = Math.max(0, n.length - r.length), o = [], i = 0; i < e; i++) o.push("$" + i); var s = Function("binder", "return function (" + o.join(",") + "){ return binder.apply(this, arguments); }")(function() { if(this instanceof s) { var e = n.apply(this, r.concat(a.call(arguments))); return Object(e) === e ? e : this } return n.apply(t, r.concat(a.call(arguments))) }); return n.prototype && (v.prototype = n.prototype, s.prototype = new v, v.prototype = null), s } }), d(Array, { isArray: function(e) { return "[object Array]" === f.call(e) } }); var m, b, y, g = Object("a"), w = "a" !== g[0] || !(0 in g); d(u, { forEach: function(e) { var t = p(this), n = w && c(this) ? this.split("") : t, r = arguments[1], o = -1, i = n.length >>> 0; if(!l(e)) throw new TypeError; for(; ++o < i;) o in n && e.call(r, n[o], o, t) } }, (m = u.forEach, y = b = !0, m && (m.call("foo", function(e, t, n) { "object" != typeof n && (b = !1) }), m.call([1], function() { y = "string" == typeof this }, "x")), !(m && b && y))); var x = Array.prototype.indexOf && -1 !== [0, 1].indexOf(1, 2); d(u, { indexOf: function(e) { var t = w && c(this) ? this.split("") : p(this), n = t.length >>> 0; if(!n) return -1; var r, o, i = 0; for(1 < arguments.length && (r = arguments[1], (o = +r) != o ? o = 0 : 0 !== o && o !== 1 / 0 && o !== -1 / 0 && (o = (0 < o || -1) * Math.floor(Math.abs(o))), i = o), i = 0 <= i ? i : Math.max(0, n + i); i < n; i++) if(i in t && t[i] === e) return i; return -1 } }, x); var _, E = s.split; 2 !== "ab".split(/(?:ab)*/).length || 4 !== ".".split(/(.?)(.?)/).length || "t" === "tesst".split(/(s)*/)[1] || 4 !== "test".split(/(?:)/, -1).length || "".split(/.?/).length || 1 < ".".split(/()()/).length ? (_ = void 0 === /()??/.exec("")[1], s.split = function(e, t) { var n = this; if(void 0 === e && 0 === t) return []; if("[object RegExp]" !== f.call(e)) return E.call(this, e, t); var r, o, i, s, a = [], l = (e.ignoreCase ? "i" : "") + (e.multiline ? "m" : "") + (e.extended ? "x" : "") + (e.sticky ? "y" : ""), c = 0; for(e = new RegExp(e.source, l + "g"), n += "", _ || (r = new RegExp("^" + e.source + "$(?!\\s)", l)), t = void 0 === t ? -1 >>> 0 : t >>> 0; (o = e.exec(n)) && !(c < (i = o.index + o[0].length) && (a.push(n.slice(c, o.index)), !_ && 1 < o.length && o[0].replace(r, function() { for(var e = 1; e < arguments.length - 2; e++) void 0 === arguments[e] && (o[e] = void 0) }), 1 < o.length && o.index < n.length && u.push.apply(a, o.slice(1)), s = o[0].length, c = i, a.length >= t));) e.lastIndex === o.index && e.lastIndex++; return c === n.length ? !s && e.test("") || a.push("") : a.push(n.slice(c)), a.length > t ? a.slice(0, t) : a }) : "0".split(void 0, 0).length && (s.split = function(e, t) { return void 0 === e && 0 === t ? [] : E.call(this, e, t) }); var j = s.substr, S = "".substr && "b" !== "0b".substr(-1); d(s, { substr: function(e, t) { return j.call(this, e < 0 && (e = this.length + e) < 0 ? 0 : e, t) } }, S) }, {}], 16: [function(e, t, n) { "use strict"; t.exports = [e("./transport/websocket"), e("./transport/xhr-streaming"), e("./transport/xdr-streaming"), e("./transport/eventsource"), e("./transport/lib/iframe-wrap")(e("./transport/eventsource")), e("./transport/htmlfile"), e("./transport/lib/iframe-wrap")(e("./transport/htmlfile")), e("./transport/xhr-polling"), e("./transport/xdr-polling"), e("./transport/lib/iframe-wrap")(e("./transport/xhr-polling")), e("./transport/jsonp-polling")] }, { "./transport/eventsource": 20, "./transport/htmlfile": 21, "./transport/jsonp-polling": 23, "./transport/lib/iframe-wrap": 26, "./transport/websocket": 38, "./transport/xdr-polling": 39, "./transport/xdr-streaming": 40, "./transport/xhr-polling": 41, "./transport/xhr-streaming": 42 }], 17: [function(o, f, e) { (function(e) { "use strict"; var i = o("events").EventEmitter, t = o("inherits"), s = o("../../utils/event"), a = o("../../utils/url"), l = e.XMLHttpRequest, c = function() {}; function u(e, t, n, r) { c(e, t); var o = this; i.call(this), setTimeout(function() { o._start(e, t, n, r) }, 0) } t(u, i), u.prototype._start = function(e, t, n, r) { var o = this; try { this.xhr = new l } catch(e) {} if(!this.xhr) return c("no xhr"), this.emit("finish", 0, "no xhr support"), void this._cleanup(); t = a.addQuery(t, "t=" + +new Date), this.unloadRef = s.unloadAdd(function() { c("unload cleanup"), o._cleanup(!0) }); try { this.xhr.open(e, t, !0), this.timeout && "timeout" in this.xhr && (this.xhr.timeout = this.timeout, this.xhr.ontimeout = function() { c("xhr timeout"), o.emit("finish", 0, ""), o._cleanup(!1) }) } catch(e) { return c("exception", e), this.emit("finish", 0, ""), void this._cleanup(!1) } if(r && r.noCredentials || !u.supportsCORS || (c("withCredentials"), this.xhr.withCredentials = !0), r && r.headers) for(var i in r.headers) this.xhr.setRequestHeader(i, r.headers[i]); this.xhr.onreadystatechange = function() { if(o.xhr) { var e, t, n = o.xhr; switch(c("readyState", n.readyState), n.readyState) { case 3: try { t = n.status, e = n.responseText } catch(e) {} c("status", t), 1223 === t && (t = 204), 200 === t && e && 0 < e.length && (c("chunk"), o.emit("chunk", t, e)); break; case 4: t = n.status, c("status", t), 1223 === t && (t = 204), 12005 !== t && 12029 !== t || (t = 0), c("finish", t, n.responseText), o.emit("finish", t, n.responseText), o._cleanup(!1) } } }; try { o.xhr.send(n) } catch(e) { o.emit("finish", 0, ""), o._cleanup(!1) } }, u.prototype._cleanup = function(e) { if(c("cleanup"), this.xhr) { if(this.removeAllListeners(), s.unloadDel(this.unloadRef), this.xhr.onreadystatechange = function() {}, this.xhr.ontimeout && (this.xhr.ontimeout = null), e) try { this.xhr.abort() } catch(e) {} this.unloadRef = this.xhr = null } }, u.prototype.close = function() { c("close"), this._cleanup(!0) }, u.enabled = !!l; var n = ["Active"].concat("Object").join("X"); !u.enabled && n in e && (c("overriding xmlhttprequest"), u.enabled = !!new(l = function() { try { return new e[n]("Microsoft.XMLHTTP") } catch(e) { return null } })); var r = !1; try { r = "withCredentials" in new l } catch(e) {} u.supportsCORS = r, f.exports = u }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "../../utils/event": 46, "../../utils/url": 52, "debug": void 0, "events": 3, "inherits": 54 }], 18: [function(e, t, n) { (function(e) { t.exports = e.EventSource }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, {}], 19: [function(e, n, t) { (function(e) { "use strict"; var t = e.WebSocket || e.MozWebSocket; n.exports = t ? function(e) { return new t(e) } : void 0 }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, {}], 20: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("./lib/ajax-based"), i = e("./receiver/eventsource"), s = e("./sender/xhr-cors"), a = e("eventsource"); function l(e) { if(!l.enabled()) throw new Error("Transport created when disabled"); o.call(this, e, "/eventsource", i, s) } r(l, o), l.enabled = function() { return !!a }, l.transportName = "eventsource", l.roundTrips = 2, t.exports = l }, { "./lib/ajax-based": 24, "./receiver/eventsource": 29, "./sender/xhr-cors": 35, "eventsource": 18, "inherits": 54 }], 21: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("./receiver/htmlfile"), i = e("./sender/xhr-local"), s = e("./lib/ajax-based"); function a(e) { if(!o.enabled) throw new Error("Transport created when disabled"); s.call(this, e, "/htmlfile", o, i) } r(a, s), a.enabled = function(e) { return o.enabled && e.sameOrigin }, a.transportName = "htmlfile", a.roundTrips = 2, t.exports = a }, { "./lib/ajax-based": 24, "./receiver/htmlfile": 30, "./sender/xhr-local": 37, "inherits": 54 }], 22: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("json3"), i = e("events").EventEmitter, s = e("../version"), a = e("../utils/url"), l = e("../utils/iframe"), c = e("../utils/event"), u = e("../utils/random"), f = function() {}; function h(e, t, n) { if(!h.enabled()) throw new Error("Transport created when disabled"); i.call(this); var r = this; this.origin = a.getOrigin(n), this.baseUrl = n, this.transUrl = t, this.transport = e, this.windowId = u.string(8); var o = a.addPath(n, "/iframe.html") + "#" + this.windowId; f(e, t, o), this.iframeObj = l.createIframe(o, function(e) { f("err callback"), r.emit("close", 1006, "Unable to load an iframe (" + e + ")"), r.close() }), this.onmessageCallback = this._message.bind(this), c.attachEvent("message", this.onmessageCallback) } r(h, i), h.prototype.close = function() { if(f("close"), this.removeAllListeners(), this.iframeObj) { c.detachEvent("message", this.onmessageCallback); try { this.postMessage("c") } catch(e) {} this.iframeObj.cleanup(), this.iframeObj = null, this.onmessageCallback = this.iframeObj = null } }, h.prototype._message = function(t) { if(f("message", t.data), a.isOriginEqual(t.origin, this.origin)) { var n; try { n = o.parse(t.data) } catch(e) { return void f("bad json", t.data) } if(n.windowId === this.windowId) switch(n.type) { case "s": this.iframeObj.loaded(), this.postMessage("s", o.stringify([s, this.transport, this.transUrl, this.baseUrl])); break; case "t": this.emit("message", n.data); break; case "c": var e; try { e = o.parse(n.data) } catch(e) { return void f("bad json", n.data) } this.emit("close", e[0], e[1]), this.close() } else f("mismatched window id", n.windowId, this.windowId) } else f("not same origin", t.origin, this.origin) }, h.prototype.postMessage = function(e, t) { f("postMessage", e, t), this.iframeObj.post(o.stringify({ windowId: this.windowId, type: e, data: t || "" }), this.origin) }, h.prototype.send = function(e) { f("send", e), this.postMessage("m", e) }, h.enabled = function() { return l.iframeEnabled }, h.transportName = "iframe", h.roundTrips = 2, t.exports = h }, { "../utils/event": 46, "../utils/iframe": 47, "../utils/random": 50, "../utils/url": 52, "../version": 53, "debug": void 0, "events": 3, "inherits": 54, "json3": 55 }], 23: [function(s, a, e) { (function(e) { "use strict"; var t = s("inherits"), n = s("./lib/sender-receiver"), r = s("./receiver/jsonp"), o = s("./sender/jsonp"); function i(e) { if(!i.enabled()) throw new Error("Transport created when disabled"); n.call(this, e, "/jsonp", o, r) } t(i, n), i.enabled = function() { return !!e.document }, i.transportName = "jsonp-polling", i.roundTrips = 1, i.needBody = !0, a.exports = i }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "./lib/sender-receiver": 28, "./receiver/jsonp": 31, "./sender/jsonp": 33, "inherits": 54 }], 24: [function(e, t, n) { "use strict"; var r = e("inherits"), a = e("../../utils/url"), o = e("./sender-receiver"), l = function() {}; function i(e, t, n, r) { var s; o.call(this, e, t, (s = r, function(e, t, n) { l("create ajax sender", e, t); var r = {}; "string" == typeof t && (r.headers = { "Content-type": "text/plain" }); var o = a.addPath(e, "/xhr_send"), i = new s("POST", o, t, r); return i.once("finish", function(e) { if(l("finish", e), i = null, 200 !== e && 204 !== e) return n(new Error("http status " + e)); n() }), function() { l("abort"), i.close(), i = null; var e = new Error("Aborted"); e.code = 1e3, n(e) } }), n, r) } r(i, o), t.exports = i }, { "../../utils/url": 52, "./sender-receiver": 28, "debug": void 0, "inherits": 54 }], 25: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("events").EventEmitter, i = function() {}; function s(e, t) { i(e), o.call(this), this.sendBuffer = [], this.sender = t, this.url = e } r(s, o), s.prototype.send = function(e) { i("send", e), this.sendBuffer.push(e), this.sendStop || this.sendSchedule() }, s.prototype.sendScheduleWait = function() { i("sendScheduleWait"); var e, t = this; this.sendStop = function() { i("sendStop"), t.sendStop = null, clearTimeout(e) }, e = setTimeout(function() { i("timeout"), t.sendStop = null, t.sendSchedule() }, 25) }, s.prototype.sendSchedule = function() { i("sendSchedule", this.sendBuffer.length); var t = this; if(0 < this.sendBuffer.length) { var e = "[" + this.sendBuffer.join(",") + "]"; this.sendStop = this.sender(this.url, e, function(e) { t.sendStop = null, e ? (i("error", e), t.emit("close", e.code || 1006, "Sending error: " + e), t.close()) : t.sendScheduleWait() }), this.sendBuffer = [] } }, s.prototype._cleanup = function() { i("_cleanup"), this.removeAllListeners() }, s.prototype.close = function() { i("close"), this._cleanup(), this.sendStop && (this.sendStop(), this.sendStop = null) }, t.exports = s }, { "debug": void 0, "events": 3, "inherits": 54 }], 26: [function(e, n, t) { (function(o) { "use strict"; var t = e("inherits"), i = e("../iframe"), s = e("../../utils/object"); n.exports = function(r) { function e(e, t) { i.call(this, r.transportName, e, t) } return t(e, i), e.enabled = function(e, t) { if(!o.document) return !1; var n = s.extend({}, t); return n.sameOrigin = !0, r.enabled(n) && i.enabled() }, e.transportName = "iframe-" + r.transportName, e.needBody = !0, e.roundTrips = i.roundTrips + r.roundTrips - 1, e.facadeTransport = r, e } }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "../../utils/object": 49, "../iframe": 22, "inherits": 54 }], 27: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("events").EventEmitter, i = function() {}; function s(e, t, n) { i(t), o.call(this), this.Receiver = e, this.receiveUrl = t, this.AjaxObject = n, this._scheduleReceiver() } r(s, o), s.prototype._scheduleReceiver = function() { i("_scheduleReceiver"); var n = this, r = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject); r.on("message", function(e) { i("message", e), n.emit("message", e) }), r.once("close", function(e, t) { i("close", e, t, n.pollIsClosing), n.poll = r = null, n.pollIsClosing || ("network" === t ? n._scheduleReceiver() : (n.emit("close", e || 1006, t), n.removeAllListeners())) }) }, s.prototype.abort = function() { i("abort"), this.removeAllListeners(), this.pollIsClosing = !0, this.poll && this.poll.abort() }, t.exports = s }, { "debug": void 0, "events": 3, "inherits": 54 }], 28: [function(e, t, n) { "use strict"; var r = e("inherits"), a = e("../../utils/url"), l = e("./buffered-sender"), c = e("./polling"), u = function() {}; function o(e, t, n, r, o) { var i = a.addPath(e, t); u(i); var s = this; l.call(this, e, n), this.poll = new c(r, i, o), this.poll.on("message", function(e) { u("poll message", e), s.emit("message", e) }), this.poll.once("close", function(e, t) { u("poll close", e, t), s.poll = null, s.emit("close", e, t), s.close() }) } r(o, l), o.prototype.close = function() { l.prototype.close.call(this), u("close"), this.removeAllListeners(), this.poll && (this.poll.abort(), this.poll = null) }, t.exports = o }, { "../../utils/url": 52, "./buffered-sender": 25, "./polling": 27, "debug": void 0, "inherits": 54 }], 29: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("events").EventEmitter, i = e("eventsource"), s = function() {}; function a(e) { s(e), o.call(this); var n = this, r = this.es = new i(e); r.onmessage = function(e) { s("message", e.data), n.emit("message", decodeURI(e.data)) }, r.onerror = function(e) { s("error", r.readyState, e); var t = 2 !== r.readyState ? "network" : "permanent"; n._cleanup(), n._close(t) } } r(a, o), a.prototype.abort = function() { s("abort"), this._cleanup(), this._close("user") }, a.prototype._cleanup = function() { s("cleanup"); var e = this.es; e && (e.onmessage = e.onerror = null, e.close(), this.es = null) }, a.prototype._close = function(e) { s("close", e); var t = this; setTimeout(function() { t.emit("close", null, e), t.removeAllListeners() }, 200) }, t.exports = a }, { "debug": void 0, "events": 3, "eventsource": 18, "inherits": 54 }], 30: [function(n, u, e) { (function(r) { "use strict"; var e = n("inherits"), o = n("../../utils/iframe"), i = n("../../utils/url"), s = n("events").EventEmitter, a = n("../../utils/random"), l = function() {}; function c(e) { l(e), s.call(this); var t = this; o.polluteGlobalNamespace(), this.id = "a" + a.string(6), e = i.addQuery(e, "c=" + decodeURIComponent(o.WPrefix + "." + this.id)), l("using htmlfile", c.htmlfileEnabled); var n = c.htmlfileEnabled ? o.createHtmlfile : o.createIframe; r[o.WPrefix][this.id] = { start: function() { l("start"), t.iframeObj.loaded() }, message: function(e) { l("message", e), t.emit("message", e) }, stop: function() { l("stop"), t._cleanup(), t._close("network") } }, this.iframeObj = n(e, function() { l("callback"), t._cleanup(), t._close("permanent") }) } e(c, s), c.prototype.abort = function() { l("abort"), this._cleanup(), this._close("user") }, c.prototype._cleanup = function() { l("_cleanup"), this.iframeObj && (this.iframeObj.cleanup(), this.iframeObj = null), delete r[o.WPrefix][this.id] }, c.prototype._close = function(e) { l("_close", e), this.emit("close", null, e), this.removeAllListeners() }, c.htmlfileEnabled = !1; var t = ["Active"].concat("Object").join("X"); if(t in r) try { c.htmlfileEnabled = !!new r[t]("htmlfile") } catch(e) {} c.enabled = c.htmlfileEnabled || o.iframeEnabled, u.exports = c }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "../../utils/iframe": 47, "../../utils/random": 50, "../../utils/url": 52, "debug": void 0, "events": 3, "inherits": 54 }], 31: [function(t, n, e) { (function(i) { "use strict"; var r = t("../../utils/iframe"), s = t("../../utils/random"), a = t("../../utils/browser"), o = t("../../utils/url"), e = t("inherits"), l = t("events").EventEmitter, c = function() {}; function u(e) { c(e); var t = this; l.call(this), r.polluteGlobalNamespace(), this.id = "a" + s.string(6); var n = o.addQuery(e, "c=" + encodeURIComponent(r.WPrefix + "." + this.id)); i[r.WPrefix][this.id] = this._callback.bind(this), this._createScript(n), this.timeoutId = setTimeout(function() { c("timeout"), t._abort(new Error("JSONP script loaded abnormally (timeout)")) }, u.timeout) } e(u, l), u.prototype.abort = function() { if(c("abort"), i[r.WPrefix][this.id]) { var e = new Error("JSONP user aborted read"); e.code = 1e3, this._abort(e) } }, u.timeout = 35e3, u.scriptErrorTimeout = 1e3, u.prototype._callback = function(e) { c("_callback", e), this._cleanup(), this.aborting || (e && (c("message", e), this.emit("message", e)), this.emit("close", null, "network"), this.removeAllListeners()) }, u.prototype._abort = function(e) { c("_abort", e), this._cleanup(), this.aborting = !0, this.emit("close", e.code, e.message), this.removeAllListeners() }, u.prototype._cleanup = function() { if(c("_cleanup"), clearTimeout(this.timeoutId), this.script2 && (this.script2.parentNode.removeChild(this.script2), this.script2 = null), this.script) { var e = this.script; e.parentNode.removeChild(e), e.onreadystatechange = e.onerror = e.onload = e.onclick = null, this.script = null } delete i[r.WPrefix][this.id] }, u.prototype._scriptError = function() { c("_scriptError"); var e = this; this.errorTimer || (this.errorTimer = setTimeout(function() { e.loadedOkay || e._abort(new Error("JSONP script loaded abnormally (onerror)")) }, u.scriptErrorTimeout)) }, u.prototype._createScript = function(e) { c("_createScript", e); var t, n = this, r = this.script = i.document.createElement("script"); if(r.id = "a" + s.string(8), r.src = e, r.type = "text/javascript", r.charset = "UTF-8", r.onerror = this._scriptError.bind(this), r.onload = function() { c("onload"), n._abort(new Error("JSONP script loaded abnormally (onload)")) }, r.onreadystatechange = function() { if(c("onreadystatechange", r.readyState), /loaded|closed/.test(r.readyState)) { if(r && r.htmlFor && r.onclick) { n.loadedOkay = !0; try { r.onclick() } catch(e) {} } r && n._abort(new Error("JSONP script loaded abnormally (onreadystatechange)")) } }, void 0 === r.async && i.document.attachEvent) if(a.isOpera())(t = this.script2 = i.document.createElement("script")).text = "try{var a = document.getElementById('" + r.id + "'); if(a)a.onerror();}catch(x){};", r.async = t.async = !1; else { try { r.htmlFor = r.id, r.event = "onclick" } catch(e) {} r.async = !0 } void 0 !== r.async && (r.async = !0); var o = i.document.getElementsByTagName("head")[0]; o.insertBefore(r, o.firstChild), t && o.insertBefore(t, o.firstChild) }, n.exports = u }).call(this, "undefined" != typeof global ? global : "undefined" != typeof self ? self : "undefined" != typeof window ? window : {}) }, { "../../utils/browser": 44, "../../utils/iframe": 47, "../../utils/random": 50, "../../utils/url": 52, "debug": void 0, "events": 3, "inherits": 54 }], 32: [function(e, t, n) { "use strict"; var r = e("inherits"), o = e("events").EventEmitter, i = function() {}; function s(e, t) { i(e), o.call(this); var r = this; this.bufferPosition = 0, this.xo = new t("POST", e, null), this.xo.on("chunk", this._chunkHandler.bind(this)), this.xo.once("finish", function(e, t) { i("finish", e, t), r._chunkHandler(e, t), r.xo = null; var n = 200 === e ? "network" : "permanent"; i("close", n), r.emit("close", null, n), r._cleanup() }) } r(s, o), s.prototype._chunkHandler = function(e, t) { if(i("_chunkHandler", e), 200 === e && t) for(var n = -1;; this.bufferPosition += n + 1) { var r = t.slice(this.bufferPosition); if(-1 === (n = r.indexOf("\n"))) break; var o = r.slice(0, n); o && (i("message", o), this.emit("message", o)) } }, s.prototype._cleanup = function() { i("_cleanup"), this.removeAllListeners() }, s.prototype.abort = function() { i("abort"), this.xo && (this.xo.close(), i("close"), this.emit("close", null, "user"), this.xo = null), this._cleanup() }, t.exports = s }, { "debug": void 0, "events": 3, "inherits": 54 }], 33: [function(e, t, n) { (function(s) { "use strict"; var a, l, c = e("../../utils/random"), u = e("../../utils/url"), f = function() {}; t.exports = function(e, t, n) { f(e, t), a || (f("createForm"), (a = s.document.createElement("form")).style.display = "none", a.style.position = "absolute", a.method = "POST", a.enctype = "application/x-www-form-urlencoded", a.acceptCharset = "UTF-8", (l = s.document.createElement("textarea")).name = "d", a.appendChild(l), s.document.body.appendChild(a)); var r = "a" + c.string(8); a.target = r, a.action = u.addQuery(u.addPath(e, "/jsonp_send"), "i=" + r); var o = function(t) { f("createIframe", t); try { return s.document.createElement('