| 1 | (function webpackUniversalModuleDefinition(root, factory) {
|
|---|
| 2 | if(typeof exports === 'object' && typeof module === 'object')
|
|---|
| 3 | module.exports = factory();
|
|---|
| 4 | else if(typeof define === 'function' && define.amd)
|
|---|
| 5 | define([], factory);
|
|---|
| 6 | else if(typeof exports === 'object')
|
|---|
| 7 | exports["SockJS"] = factory();
|
|---|
| 8 | else
|
|---|
| 9 | root["SockJS"] = factory();
|
|---|
| 10 | })((typeof self !== 'undefined' ? self : this), function() {
|
|---|
| 11 | return /******/ (function() { // webpackBootstrap
|
|---|
| 12 | /******/ var __webpack_modules__ = ({
|
|---|
| 13 |
|
|---|
| 14 | /***/ "./node_modules/inherits/inherits_browser.js":
|
|---|
| 15 | /*!***************************************************!*\
|
|---|
| 16 | !*** ./node_modules/inherits/inherits_browser.js ***!
|
|---|
| 17 | \***************************************************/
|
|---|
| 18 | /***/ (function(module) {
|
|---|
| 19 |
|
|---|
| 20 | if (typeof Object.create === 'function') {
|
|---|
| 21 | // implementation from standard node.js 'util' module
|
|---|
| 22 | module.exports = function inherits(ctor, superCtor) {
|
|---|
| 23 | if (superCtor) {
|
|---|
| 24 | ctor.super_ = superCtor;
|
|---|
| 25 | ctor.prototype = Object.create(superCtor.prototype, {
|
|---|
| 26 | constructor: {
|
|---|
| 27 | value: ctor,
|
|---|
| 28 | enumerable: false,
|
|---|
| 29 | writable: true,
|
|---|
| 30 | configurable: true
|
|---|
| 31 | }
|
|---|
| 32 | });
|
|---|
| 33 | }
|
|---|
| 34 | };
|
|---|
| 35 | } else {
|
|---|
| 36 | // old school shim for old browsers
|
|---|
| 37 | module.exports = function inherits(ctor, superCtor) {
|
|---|
| 38 | if (superCtor) {
|
|---|
| 39 | ctor.super_ = superCtor;
|
|---|
| 40 | var TempCtor = function TempCtor() {};
|
|---|
| 41 | TempCtor.prototype = superCtor.prototype;
|
|---|
| 42 | ctor.prototype = new TempCtor();
|
|---|
| 43 | ctor.prototype.constructor = ctor;
|
|---|
| 44 | }
|
|---|
| 45 | };
|
|---|
| 46 | }
|
|---|
| 47 |
|
|---|
| 48 | /***/ }),
|
|---|
| 49 |
|
|---|
| 50 | /***/ "./node_modules/ms/index.js":
|
|---|
| 51 | /*!**********************************!*\
|
|---|
| 52 | !*** ./node_modules/ms/index.js ***!
|
|---|
| 53 | \**********************************/
|
|---|
| 54 | /***/ (function(module) {
|
|---|
| 55 |
|
|---|
| 56 | /**
|
|---|
| 57 | * Helpers.
|
|---|
| 58 | */
|
|---|
| 59 |
|
|---|
| 60 | var s = 1000;
|
|---|
| 61 | var m = s * 60;
|
|---|
| 62 | var h = m * 60;
|
|---|
| 63 | var d = h * 24;
|
|---|
| 64 | var w = d * 7;
|
|---|
| 65 | var y = d * 365.25;
|
|---|
| 66 |
|
|---|
| 67 | /**
|
|---|
| 68 | * Parse or format the given `val`.
|
|---|
| 69 | *
|
|---|
| 70 | * Options:
|
|---|
| 71 | *
|
|---|
| 72 | * - `long` verbose formatting [false]
|
|---|
| 73 | *
|
|---|
| 74 | * @param {String|Number} val
|
|---|
| 75 | * @param {Object} [options]
|
|---|
| 76 | * @throws {Error} throw an error if val is not a non-empty string or a number
|
|---|
| 77 | * @return {String|Number}
|
|---|
| 78 | * @api public
|
|---|
| 79 | */
|
|---|
| 80 |
|
|---|
| 81 | module.exports = function (val, options) {
|
|---|
| 82 | options = options || {};
|
|---|
| 83 | var type = typeof val;
|
|---|
| 84 | if (type === 'string' && val.length > 0) {
|
|---|
| 85 | return parse(val);
|
|---|
| 86 | } else if (type === 'number' && isFinite(val)) {
|
|---|
| 87 | return options.long ? fmtLong(val) : fmtShort(val);
|
|---|
| 88 | }
|
|---|
| 89 | throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
|
|---|
| 90 | };
|
|---|
| 91 |
|
|---|
| 92 | /**
|
|---|
| 93 | * Parse the given `str` and return milliseconds.
|
|---|
| 94 | *
|
|---|
| 95 | * @param {String} str
|
|---|
| 96 | * @return {Number}
|
|---|
| 97 | * @api private
|
|---|
| 98 | */
|
|---|
| 99 |
|
|---|
| 100 | function parse(str) {
|
|---|
| 101 | str = String(str);
|
|---|
| 102 | if (str.length > 100) {
|
|---|
| 103 | return;
|
|---|
| 104 | }
|
|---|
| 105 | var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(str);
|
|---|
| 106 | if (!match) {
|
|---|
| 107 | return;
|
|---|
| 108 | }
|
|---|
| 109 | var n = parseFloat(match[1]);
|
|---|
| 110 | var type = (match[2] || 'ms').toLowerCase();
|
|---|
| 111 | switch (type) {
|
|---|
| 112 | case 'years':
|
|---|
| 113 | case 'year':
|
|---|
| 114 | case 'yrs':
|
|---|
| 115 | case 'yr':
|
|---|
| 116 | case 'y':
|
|---|
| 117 | return n * y;
|
|---|
| 118 | case 'weeks':
|
|---|
| 119 | case 'week':
|
|---|
| 120 | case 'w':
|
|---|
| 121 | return n * w;
|
|---|
| 122 | case 'days':
|
|---|
| 123 | case 'day':
|
|---|
| 124 | case 'd':
|
|---|
| 125 | return n * d;
|
|---|
| 126 | case 'hours':
|
|---|
| 127 | case 'hour':
|
|---|
| 128 | case 'hrs':
|
|---|
| 129 | case 'hr':
|
|---|
| 130 | case 'h':
|
|---|
| 131 | return n * h;
|
|---|
| 132 | case 'minutes':
|
|---|
| 133 | case 'minute':
|
|---|
| 134 | case 'mins':
|
|---|
| 135 | case 'min':
|
|---|
| 136 | case 'm':
|
|---|
| 137 | return n * m;
|
|---|
| 138 | case 'seconds':
|
|---|
| 139 | case 'second':
|
|---|
| 140 | case 'secs':
|
|---|
| 141 | case 'sec':
|
|---|
| 142 | case 's':
|
|---|
| 143 | return n * s;
|
|---|
| 144 | case 'milliseconds':
|
|---|
| 145 | case 'millisecond':
|
|---|
| 146 | case 'msecs':
|
|---|
| 147 | case 'msec':
|
|---|
| 148 | case 'ms':
|
|---|
| 149 | return n;
|
|---|
| 150 | default:
|
|---|
| 151 | return undefined;
|
|---|
| 152 | }
|
|---|
| 153 | }
|
|---|
| 154 |
|
|---|
| 155 | /**
|
|---|
| 156 | * Short format for `ms`.
|
|---|
| 157 | *
|
|---|
| 158 | * @param {Number} ms
|
|---|
| 159 | * @return {String}
|
|---|
| 160 | * @api private
|
|---|
| 161 | */
|
|---|
| 162 |
|
|---|
| 163 | function fmtShort(ms) {
|
|---|
| 164 | var msAbs = Math.abs(ms);
|
|---|
| 165 | if (msAbs >= d) {
|
|---|
| 166 | return Math.round(ms / d) + 'd';
|
|---|
| 167 | }
|
|---|
| 168 | if (msAbs >= h) {
|
|---|
| 169 | return Math.round(ms / h) + 'h';
|
|---|
| 170 | }
|
|---|
| 171 | if (msAbs >= m) {
|
|---|
| 172 | return Math.round(ms / m) + 'm';
|
|---|
| 173 | }
|
|---|
| 174 | if (msAbs >= s) {
|
|---|
| 175 | return Math.round(ms / s) + 's';
|
|---|
| 176 | }
|
|---|
| 177 | return ms + 'ms';
|
|---|
| 178 | }
|
|---|
| 179 |
|
|---|
| 180 | /**
|
|---|
| 181 | * Long format for `ms`.
|
|---|
| 182 | *
|
|---|
| 183 | * @param {Number} ms
|
|---|
| 184 | * @return {String}
|
|---|
| 185 | * @api private
|
|---|
| 186 | */
|
|---|
| 187 |
|
|---|
| 188 | function fmtLong(ms) {
|
|---|
| 189 | var msAbs = Math.abs(ms);
|
|---|
| 190 | if (msAbs >= d) {
|
|---|
| 191 | return plural(ms, msAbs, d, 'day');
|
|---|
| 192 | }
|
|---|
| 193 | if (msAbs >= h) {
|
|---|
| 194 | return plural(ms, msAbs, h, 'hour');
|
|---|
| 195 | }
|
|---|
| 196 | if (msAbs >= m) {
|
|---|
| 197 | return plural(ms, msAbs, m, 'minute');
|
|---|
| 198 | }
|
|---|
| 199 | if (msAbs >= s) {
|
|---|
| 200 | return plural(ms, msAbs, s, 'second');
|
|---|
| 201 | }
|
|---|
| 202 | return ms + ' ms';
|
|---|
| 203 | }
|
|---|
| 204 |
|
|---|
| 205 | /**
|
|---|
| 206 | * Pluralization helper.
|
|---|
| 207 | */
|
|---|
| 208 |
|
|---|
| 209 | function plural(ms, msAbs, n, name) {
|
|---|
| 210 | var isPlural = msAbs >= n * 1.5;
|
|---|
| 211 | return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
|
|---|
| 212 | }
|
|---|
| 213 |
|
|---|
| 214 | /***/ }),
|
|---|
| 215 |
|
|---|
| 216 | /***/ "./node_modules/querystringify/index.js":
|
|---|
| 217 | /*!**********************************************!*\
|
|---|
| 218 | !*** ./node_modules/querystringify/index.js ***!
|
|---|
| 219 | \**********************************************/
|
|---|
| 220 | /***/ (function(__unused_webpack_module, exports) {
|
|---|
| 221 |
|
|---|
| 222 | "use strict";
|
|---|
| 223 |
|
|---|
| 224 |
|
|---|
| 225 | var has = Object.prototype.hasOwnProperty,
|
|---|
| 226 | undef;
|
|---|
| 227 |
|
|---|
| 228 | /**
|
|---|
| 229 | * Decode a URI encoded string.
|
|---|
| 230 | *
|
|---|
| 231 | * @param {String} input The URI encoded string.
|
|---|
| 232 | * @returns {String|Null} The decoded string.
|
|---|
| 233 | * @api private
|
|---|
| 234 | */
|
|---|
| 235 | function decode(input) {
|
|---|
| 236 | try {
|
|---|
| 237 | return decodeURIComponent(input.replace(/\+/g, ' '));
|
|---|
| 238 | } catch (e) {
|
|---|
| 239 | return null;
|
|---|
| 240 | }
|
|---|
| 241 | }
|
|---|
| 242 |
|
|---|
| 243 | /**
|
|---|
| 244 | * Attempts to encode a given input.
|
|---|
| 245 | *
|
|---|
| 246 | * @param {String} input The string that needs to be encoded.
|
|---|
| 247 | * @returns {String|Null} The encoded string.
|
|---|
| 248 | * @api private
|
|---|
| 249 | */
|
|---|
| 250 | function encode(input) {
|
|---|
| 251 | try {
|
|---|
| 252 | return encodeURIComponent(input);
|
|---|
| 253 | } catch (e) {
|
|---|
| 254 | return null;
|
|---|
| 255 | }
|
|---|
| 256 | }
|
|---|
| 257 |
|
|---|
| 258 | /**
|
|---|
| 259 | * Simple query string parser.
|
|---|
| 260 | *
|
|---|
| 261 | * @param {String} query The query string that needs to be parsed.
|
|---|
| 262 | * @returns {Object}
|
|---|
| 263 | * @api public
|
|---|
| 264 | */
|
|---|
| 265 | function querystring(query) {
|
|---|
| 266 | var parser = /([^=?#&]+)=?([^&]*)/g,
|
|---|
| 267 | result = {},
|
|---|
| 268 | part;
|
|---|
| 269 | while (part = parser.exec(query)) {
|
|---|
| 270 | var key = decode(part[1]),
|
|---|
| 271 | value = decode(part[2]);
|
|---|
| 272 |
|
|---|
| 273 | //
|
|---|
| 274 | // Prevent overriding of existing properties. This ensures that build-in
|
|---|
| 275 | // methods like `toString` or __proto__ are not overriden by malicious
|
|---|
| 276 | // querystrings.
|
|---|
| 277 | //
|
|---|
| 278 | // In the case if failed decoding, we want to omit the key/value pairs
|
|---|
| 279 | // from the result.
|
|---|
| 280 | //
|
|---|
| 281 | if (key === null || value === null || key in result) continue;
|
|---|
| 282 | result[key] = value;
|
|---|
| 283 | }
|
|---|
| 284 | return result;
|
|---|
| 285 | }
|
|---|
| 286 |
|
|---|
| 287 | /**
|
|---|
| 288 | * Transform a query string to an object.
|
|---|
| 289 | *
|
|---|
| 290 | * @param {Object} obj Object that should be transformed.
|
|---|
| 291 | * @param {String} prefix Optional prefix.
|
|---|
| 292 | * @returns {String}
|
|---|
| 293 | * @api public
|
|---|
| 294 | */
|
|---|
| 295 | function querystringify(obj, prefix) {
|
|---|
| 296 | prefix = prefix || '';
|
|---|
| 297 | var pairs = [],
|
|---|
| 298 | value,
|
|---|
| 299 | key;
|
|---|
| 300 |
|
|---|
| 301 | //
|
|---|
| 302 | // Optionally prefix with a '?' if needed
|
|---|
| 303 | //
|
|---|
| 304 | if ('string' !== typeof prefix) prefix = '?';
|
|---|
| 305 | for (key in obj) {
|
|---|
| 306 | if (has.call(obj, key)) {
|
|---|
| 307 | value = obj[key];
|
|---|
| 308 |
|
|---|
| 309 | //
|
|---|
| 310 | // Edge cases where we actually want to encode the value to an empty
|
|---|
| 311 | // string instead of the stringified value.
|
|---|
| 312 | //
|
|---|
| 313 | if (!value && (value === null || value === undef || isNaN(value))) {
|
|---|
| 314 | value = '';
|
|---|
| 315 | }
|
|---|
| 316 | key = encode(key);
|
|---|
| 317 | value = encode(value);
|
|---|
| 318 |
|
|---|
| 319 | //
|
|---|
| 320 | // If we failed to encode the strings, we should bail out as we don't
|
|---|
| 321 | // want to add invalid strings to the query.
|
|---|
| 322 | //
|
|---|
| 323 | if (key === null || value === null) continue;
|
|---|
| 324 | pairs.push(key + '=' + value);
|
|---|
| 325 | }
|
|---|
| 326 | }
|
|---|
| 327 | return pairs.length ? prefix + pairs.join('&') : '';
|
|---|
| 328 | }
|
|---|
| 329 |
|
|---|
| 330 | //
|
|---|
| 331 | // Expose the module.
|
|---|
| 332 | //
|
|---|
| 333 | exports.stringify = querystringify;
|
|---|
| 334 | exports.parse = querystring;
|
|---|
| 335 |
|
|---|
| 336 | /***/ }),
|
|---|
| 337 |
|
|---|
| 338 | /***/ "./node_modules/requires-port/index.js":
|
|---|
| 339 | /*!*********************************************!*\
|
|---|
| 340 | !*** ./node_modules/requires-port/index.js ***!
|
|---|
| 341 | \*********************************************/
|
|---|
| 342 | /***/ (function(module) {
|
|---|
| 343 |
|
|---|
| 344 | "use strict";
|
|---|
| 345 |
|
|---|
| 346 |
|
|---|
| 347 | /**
|
|---|
| 348 | * Check if we're required to add a port number.
|
|---|
| 349 | *
|
|---|
| 350 | * @see https://url.spec.whatwg.org/#default-port
|
|---|
| 351 | * @param {Number|String} port Port number we need to check
|
|---|
| 352 | * @param {String} protocol Protocol we need to check against.
|
|---|
| 353 | * @returns {Boolean} Is it a default port for the given protocol
|
|---|
| 354 | * @api private
|
|---|
| 355 | */
|
|---|
| 356 | module.exports = function required(port, protocol) {
|
|---|
| 357 | protocol = protocol.split(':')[0];
|
|---|
| 358 | port = +port;
|
|---|
| 359 | if (!port) return false;
|
|---|
| 360 | switch (protocol) {
|
|---|
| 361 | case 'http':
|
|---|
| 362 | case 'ws':
|
|---|
| 363 | return port !== 80;
|
|---|
| 364 | case 'https':
|
|---|
| 365 | case 'wss':
|
|---|
| 366 | return port !== 443;
|
|---|
| 367 | case 'ftp':
|
|---|
| 368 | return port !== 21;
|
|---|
| 369 | case 'gopher':
|
|---|
| 370 | return port !== 70;
|
|---|
| 371 | case 'file':
|
|---|
| 372 | return false;
|
|---|
| 373 | }
|
|---|
| 374 | return port !== 0;
|
|---|
| 375 | };
|
|---|
| 376 |
|
|---|
| 377 | /***/ }),
|
|---|
| 378 |
|
|---|
| 379 | /***/ "./node_modules/sockjs-client/lib/entry.js":
|
|---|
| 380 | /*!*************************************************!*\
|
|---|
| 381 | !*** ./node_modules/sockjs-client/lib/entry.js ***!
|
|---|
| 382 | \*************************************************/
|
|---|
| 383 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 384 |
|
|---|
| 385 | "use strict";
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 | var transportList = __webpack_require__(/*! ./transport-list */ "./node_modules/sockjs-client/lib/transport-list.js");
|
|---|
| 389 | module.exports = __webpack_require__(/*! ./main */ "./node_modules/sockjs-client/lib/main.js")(transportList);
|
|---|
| 390 |
|
|---|
| 391 | // TODO can't get rid of this until all servers do
|
|---|
| 392 | if ('_sockjs_onload' in __webpack_require__.g) {
|
|---|
| 393 | setTimeout(__webpack_require__.g._sockjs_onload, 1);
|
|---|
| 394 | }
|
|---|
| 395 |
|
|---|
| 396 | /***/ }),
|
|---|
| 397 |
|
|---|
| 398 | /***/ "./node_modules/sockjs-client/lib/event/close.js":
|
|---|
| 399 | /*!*******************************************************!*\
|
|---|
| 400 | !*** ./node_modules/sockjs-client/lib/event/close.js ***!
|
|---|
| 401 | \*******************************************************/
|
|---|
| 402 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 403 |
|
|---|
| 404 | "use strict";
|
|---|
| 405 |
|
|---|
| 406 |
|
|---|
| 407 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 408 | Event = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/event/event.js");
|
|---|
| 409 | function CloseEvent() {
|
|---|
| 410 | Event.call(this);
|
|---|
| 411 | this.initEvent('close', false, false);
|
|---|
| 412 | this.wasClean = false;
|
|---|
| 413 | this.code = 0;
|
|---|
| 414 | this.reason = '';
|
|---|
| 415 | }
|
|---|
| 416 | inherits(CloseEvent, Event);
|
|---|
| 417 | module.exports = CloseEvent;
|
|---|
| 418 |
|
|---|
| 419 | /***/ }),
|
|---|
| 420 |
|
|---|
| 421 | /***/ "./node_modules/sockjs-client/lib/event/emitter.js":
|
|---|
| 422 | /*!*********************************************************!*\
|
|---|
| 423 | !*** ./node_modules/sockjs-client/lib/event/emitter.js ***!
|
|---|
| 424 | \*********************************************************/
|
|---|
| 425 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 426 |
|
|---|
| 427 | "use strict";
|
|---|
| 428 |
|
|---|
| 429 |
|
|---|
| 430 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 431 | EventTarget = __webpack_require__(/*! ./eventtarget */ "./node_modules/sockjs-client/lib/event/eventtarget.js");
|
|---|
| 432 | function EventEmitter() {
|
|---|
| 433 | EventTarget.call(this);
|
|---|
| 434 | }
|
|---|
| 435 | inherits(EventEmitter, EventTarget);
|
|---|
| 436 | EventEmitter.prototype.removeAllListeners = function (type) {
|
|---|
| 437 | if (type) {
|
|---|
| 438 | delete this._listeners[type];
|
|---|
| 439 | } else {
|
|---|
| 440 | this._listeners = {};
|
|---|
| 441 | }
|
|---|
| 442 | };
|
|---|
| 443 | EventEmitter.prototype.once = function (type, listener) {
|
|---|
| 444 | var self = this,
|
|---|
| 445 | fired = false;
|
|---|
| 446 | function g() {
|
|---|
| 447 | self.removeListener(type, g);
|
|---|
| 448 | if (!fired) {
|
|---|
| 449 | fired = true;
|
|---|
| 450 | listener.apply(this, arguments);
|
|---|
| 451 | }
|
|---|
| 452 | }
|
|---|
| 453 | this.on(type, g);
|
|---|
| 454 | };
|
|---|
| 455 | EventEmitter.prototype.emit = function () {
|
|---|
| 456 | var type = arguments[0];
|
|---|
| 457 | var listeners = this._listeners[type];
|
|---|
| 458 | if (!listeners) {
|
|---|
| 459 | return;
|
|---|
| 460 | }
|
|---|
| 461 | // equivalent of Array.prototype.slice.call(arguments, 1);
|
|---|
| 462 | var l = arguments.length;
|
|---|
| 463 | var args = new Array(l - 1);
|
|---|
| 464 | for (var ai = 1; ai < l; ai++) {
|
|---|
| 465 | args[ai - 1] = arguments[ai];
|
|---|
| 466 | }
|
|---|
| 467 | for (var i = 0; i < listeners.length; i++) {
|
|---|
| 468 | listeners[i].apply(this, args);
|
|---|
| 469 | }
|
|---|
| 470 | };
|
|---|
| 471 | EventEmitter.prototype.on = EventEmitter.prototype.addListener = EventTarget.prototype.addEventListener;
|
|---|
| 472 | EventEmitter.prototype.removeListener = EventTarget.prototype.removeEventListener;
|
|---|
| 473 | module.exports.EventEmitter = EventEmitter;
|
|---|
| 474 |
|
|---|
| 475 | /***/ }),
|
|---|
| 476 |
|
|---|
| 477 | /***/ "./node_modules/sockjs-client/lib/event/event.js":
|
|---|
| 478 | /*!*******************************************************!*\
|
|---|
| 479 | !*** ./node_modules/sockjs-client/lib/event/event.js ***!
|
|---|
| 480 | \*******************************************************/
|
|---|
| 481 | /***/ (function(module) {
|
|---|
| 482 |
|
|---|
| 483 | "use strict";
|
|---|
| 484 |
|
|---|
| 485 |
|
|---|
| 486 | function Event(eventType) {
|
|---|
| 487 | this.type = eventType;
|
|---|
| 488 | }
|
|---|
| 489 | Event.prototype.initEvent = function (eventType, canBubble, cancelable) {
|
|---|
| 490 | this.type = eventType;
|
|---|
| 491 | this.bubbles = canBubble;
|
|---|
| 492 | this.cancelable = cancelable;
|
|---|
| 493 | this.timeStamp = +new Date();
|
|---|
| 494 | return this;
|
|---|
| 495 | };
|
|---|
| 496 | Event.prototype.stopPropagation = function () {};
|
|---|
| 497 | Event.prototype.preventDefault = function () {};
|
|---|
| 498 | Event.CAPTURING_PHASE = 1;
|
|---|
| 499 | Event.AT_TARGET = 2;
|
|---|
| 500 | Event.BUBBLING_PHASE = 3;
|
|---|
| 501 | module.exports = Event;
|
|---|
| 502 |
|
|---|
| 503 | /***/ }),
|
|---|
| 504 |
|
|---|
| 505 | /***/ "./node_modules/sockjs-client/lib/event/eventtarget.js":
|
|---|
| 506 | /*!*************************************************************!*\
|
|---|
| 507 | !*** ./node_modules/sockjs-client/lib/event/eventtarget.js ***!
|
|---|
| 508 | \*************************************************************/
|
|---|
| 509 | /***/ (function(module) {
|
|---|
| 510 |
|
|---|
| 511 | "use strict";
|
|---|
| 512 |
|
|---|
| 513 |
|
|---|
| 514 | /* Simplified implementation of DOM2 EventTarget.
|
|---|
| 515 | * http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-EventTarget
|
|---|
| 516 | */
|
|---|
| 517 | function EventTarget() {
|
|---|
| 518 | this._listeners = {};
|
|---|
| 519 | }
|
|---|
| 520 | EventTarget.prototype.addEventListener = function (eventType, listener) {
|
|---|
| 521 | if (!(eventType in this._listeners)) {
|
|---|
| 522 | this._listeners[eventType] = [];
|
|---|
| 523 | }
|
|---|
| 524 | var arr = this._listeners[eventType];
|
|---|
| 525 | // #4
|
|---|
| 526 | if (arr.indexOf(listener) === -1) {
|
|---|
| 527 | // Make a copy so as not to interfere with a current dispatchEvent.
|
|---|
| 528 | arr = arr.concat([listener]);
|
|---|
| 529 | }
|
|---|
| 530 | this._listeners[eventType] = arr;
|
|---|
| 531 | };
|
|---|
| 532 | EventTarget.prototype.removeEventListener = function (eventType, listener) {
|
|---|
| 533 | var arr = this._listeners[eventType];
|
|---|
| 534 | if (!arr) {
|
|---|
| 535 | return;
|
|---|
| 536 | }
|
|---|
| 537 | var idx = arr.indexOf(listener);
|
|---|
| 538 | if (idx !== -1) {
|
|---|
| 539 | if (arr.length > 1) {
|
|---|
| 540 | // Make a copy so as not to interfere with a current dispatchEvent.
|
|---|
| 541 | this._listeners[eventType] = arr.slice(0, idx).concat(arr.slice(idx + 1));
|
|---|
| 542 | } else {
|
|---|
| 543 | delete this._listeners[eventType];
|
|---|
| 544 | }
|
|---|
| 545 | return;
|
|---|
| 546 | }
|
|---|
| 547 | };
|
|---|
| 548 | EventTarget.prototype.dispatchEvent = function () {
|
|---|
| 549 | var event = arguments[0];
|
|---|
| 550 | var t = event.type;
|
|---|
| 551 | // equivalent of Array.prototype.slice.call(arguments, 0);
|
|---|
| 552 | var args = arguments.length === 1 ? [event] : Array.apply(null, arguments);
|
|---|
| 553 | // TODO: This doesn't match the real behavior; per spec, onfoo get
|
|---|
| 554 | // their place in line from the /first/ time they're set from
|
|---|
| 555 | // non-null. Although WebKit bumps it to the end every time it's
|
|---|
| 556 | // set.
|
|---|
| 557 | if (this['on' + t]) {
|
|---|
| 558 | this['on' + t].apply(this, args);
|
|---|
| 559 | }
|
|---|
| 560 | if (t in this._listeners) {
|
|---|
| 561 | // Grab a reference to the listeners list. removeEventListener may alter the list.
|
|---|
| 562 | var listeners = this._listeners[t];
|
|---|
| 563 | for (var i = 0; i < listeners.length; i++) {
|
|---|
| 564 | listeners[i].apply(this, args);
|
|---|
| 565 | }
|
|---|
| 566 | }
|
|---|
| 567 | };
|
|---|
| 568 | module.exports = EventTarget;
|
|---|
| 569 |
|
|---|
| 570 | /***/ }),
|
|---|
| 571 |
|
|---|
| 572 | /***/ "./node_modules/sockjs-client/lib/event/trans-message.js":
|
|---|
| 573 | /*!***************************************************************!*\
|
|---|
| 574 | !*** ./node_modules/sockjs-client/lib/event/trans-message.js ***!
|
|---|
| 575 | \***************************************************************/
|
|---|
| 576 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 577 |
|
|---|
| 578 | "use strict";
|
|---|
| 579 |
|
|---|
| 580 |
|
|---|
| 581 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 582 | Event = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/event/event.js");
|
|---|
| 583 | function TransportMessageEvent(data) {
|
|---|
| 584 | Event.call(this);
|
|---|
| 585 | this.initEvent('message', false, false);
|
|---|
| 586 | this.data = data;
|
|---|
| 587 | }
|
|---|
| 588 | inherits(TransportMessageEvent, Event);
|
|---|
| 589 | module.exports = TransportMessageEvent;
|
|---|
| 590 |
|
|---|
| 591 | /***/ }),
|
|---|
| 592 |
|
|---|
| 593 | /***/ "./node_modules/sockjs-client/lib/facade.js":
|
|---|
| 594 | /*!**************************************************!*\
|
|---|
| 595 | !*** ./node_modules/sockjs-client/lib/facade.js ***!
|
|---|
| 596 | \**************************************************/
|
|---|
| 597 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 598 |
|
|---|
| 599 | "use strict";
|
|---|
| 600 |
|
|---|
| 601 |
|
|---|
| 602 | var iframeUtils = __webpack_require__(/*! ./utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js");
|
|---|
| 603 | function FacadeJS(transport) {
|
|---|
| 604 | this._transport = transport;
|
|---|
| 605 | transport.on('message', this._transportMessage.bind(this));
|
|---|
| 606 | transport.on('close', this._transportClose.bind(this));
|
|---|
| 607 | }
|
|---|
| 608 | FacadeJS.prototype._transportClose = function (code, reason) {
|
|---|
| 609 | iframeUtils.postMessage('c', JSON.stringify([code, reason]));
|
|---|
| 610 | };
|
|---|
| 611 | FacadeJS.prototype._transportMessage = function (frame) {
|
|---|
| 612 | iframeUtils.postMessage('t', frame);
|
|---|
| 613 | };
|
|---|
| 614 | FacadeJS.prototype._send = function (data) {
|
|---|
| 615 | this._transport.send(data);
|
|---|
| 616 | };
|
|---|
| 617 | FacadeJS.prototype._close = function () {
|
|---|
| 618 | this._transport.close();
|
|---|
| 619 | this._transport.removeAllListeners();
|
|---|
| 620 | };
|
|---|
| 621 | module.exports = FacadeJS;
|
|---|
| 622 |
|
|---|
| 623 | /***/ }),
|
|---|
| 624 |
|
|---|
| 625 | /***/ "./node_modules/sockjs-client/lib/iframe-bootstrap.js":
|
|---|
| 626 | /*!************************************************************!*\
|
|---|
| 627 | !*** ./node_modules/sockjs-client/lib/iframe-bootstrap.js ***!
|
|---|
| 628 | \************************************************************/
|
|---|
| 629 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 630 |
|
|---|
| 631 | "use strict";
|
|---|
| 632 |
|
|---|
| 633 |
|
|---|
| 634 | var urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 635 | eventUtils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 636 | FacadeJS = __webpack_require__(/*! ./facade */ "./node_modules/sockjs-client/lib/facade.js"),
|
|---|
| 637 | InfoIframeReceiver = __webpack_require__(/*! ./info-iframe-receiver */ "./node_modules/sockjs-client/lib/info-iframe-receiver.js"),
|
|---|
| 638 | iframeUtils = __webpack_require__(/*! ./utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js"),
|
|---|
| 639 | loc = __webpack_require__(/*! ./location */ "./node_modules/sockjs-client/lib/location.js");
|
|---|
| 640 | var debug = function debug() {};
|
|---|
| 641 | if (true) {
|
|---|
| 642 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:iframe-bootstrap');
|
|---|
| 643 | }
|
|---|
| 644 | module.exports = function (SockJS, availableTransports) {
|
|---|
| 645 | var transportMap = {};
|
|---|
| 646 | availableTransports.forEach(function (at) {
|
|---|
| 647 | if (at.facadeTransport) {
|
|---|
| 648 | transportMap[at.facadeTransport.transportName] = at.facadeTransport;
|
|---|
| 649 | }
|
|---|
| 650 | });
|
|---|
| 651 |
|
|---|
| 652 | // hard-coded for the info iframe
|
|---|
| 653 | // TODO see if we can make this more dynamic
|
|---|
| 654 | transportMap[InfoIframeReceiver.transportName] = InfoIframeReceiver;
|
|---|
| 655 | var parentOrigin;
|
|---|
| 656 |
|
|---|
| 657 | /* eslint-disable camelcase */
|
|---|
| 658 | SockJS.bootstrap_iframe = function () {
|
|---|
| 659 | /* eslint-enable camelcase */
|
|---|
| 660 | var facade;
|
|---|
| 661 | iframeUtils.currentWindowId = loc.hash.slice(1);
|
|---|
| 662 | var onMessage = function onMessage(e) {
|
|---|
| 663 | if (e.source !== parent) {
|
|---|
| 664 | return;
|
|---|
| 665 | }
|
|---|
| 666 | if (typeof parentOrigin === 'undefined') {
|
|---|
| 667 | parentOrigin = e.origin;
|
|---|
| 668 | }
|
|---|
| 669 | if (e.origin !== parentOrigin) {
|
|---|
| 670 | return;
|
|---|
| 671 | }
|
|---|
| 672 | var iframeMessage;
|
|---|
| 673 | try {
|
|---|
| 674 | iframeMessage = JSON.parse(e.data);
|
|---|
| 675 | } catch (ignored) {
|
|---|
| 676 | debug('bad json', e.data);
|
|---|
| 677 | return;
|
|---|
| 678 | }
|
|---|
| 679 | if (iframeMessage.windowId !== iframeUtils.currentWindowId) {
|
|---|
| 680 | return;
|
|---|
| 681 | }
|
|---|
| 682 | switch (iframeMessage.type) {
|
|---|
| 683 | case 's':
|
|---|
| 684 | var p;
|
|---|
| 685 | try {
|
|---|
| 686 | p = JSON.parse(iframeMessage.data);
|
|---|
| 687 | } catch (ignored) {
|
|---|
| 688 | debug('bad json', iframeMessage.data);
|
|---|
| 689 | break;
|
|---|
| 690 | }
|
|---|
| 691 | var version = p[0];
|
|---|
| 692 | var transport = p[1];
|
|---|
| 693 | var transUrl = p[2];
|
|---|
| 694 | var baseUrl = p[3];
|
|---|
| 695 | debug(version, transport, transUrl, baseUrl);
|
|---|
| 696 | // change this to semver logic
|
|---|
| 697 | if (version !== SockJS.version) {
|
|---|
| 698 | throw new Error('Incompatible SockJS! Main site uses:' + ' "' + version + '", the iframe:' + ' "' + SockJS.version + '".');
|
|---|
| 699 | }
|
|---|
| 700 | if (!urlUtils.isOriginEqual(transUrl, loc.href) || !urlUtils.isOriginEqual(baseUrl, loc.href)) {
|
|---|
| 701 | throw new Error('Can\'t connect to different domain from within an ' + 'iframe. (' + loc.href + ', ' + transUrl + ', ' + baseUrl + ')');
|
|---|
| 702 | }
|
|---|
| 703 | facade = new FacadeJS(new transportMap[transport](transUrl, baseUrl));
|
|---|
| 704 | break;
|
|---|
| 705 | case 'm':
|
|---|
| 706 | facade._send(iframeMessage.data);
|
|---|
| 707 | break;
|
|---|
| 708 | case 'c':
|
|---|
| 709 | if (facade) {
|
|---|
| 710 | facade._close();
|
|---|
| 711 | }
|
|---|
| 712 | facade = null;
|
|---|
| 713 | break;
|
|---|
| 714 | }
|
|---|
| 715 | };
|
|---|
| 716 | eventUtils.attachEvent('message', onMessage);
|
|---|
| 717 |
|
|---|
| 718 | // Start
|
|---|
| 719 | iframeUtils.postMessage('s');
|
|---|
| 720 | };
|
|---|
| 721 | };
|
|---|
| 722 |
|
|---|
| 723 | /***/ }),
|
|---|
| 724 |
|
|---|
| 725 | /***/ "./node_modules/sockjs-client/lib/info-ajax.js":
|
|---|
| 726 | /*!*****************************************************!*\
|
|---|
| 727 | !*** ./node_modules/sockjs-client/lib/info-ajax.js ***!
|
|---|
| 728 | \*****************************************************/
|
|---|
| 729 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 730 |
|
|---|
| 731 | "use strict";
|
|---|
| 732 |
|
|---|
| 733 |
|
|---|
| 734 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 735 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 736 | objectUtils = __webpack_require__(/*! ./utils/object */ "./node_modules/sockjs-client/lib/utils/object.js");
|
|---|
| 737 | var debug = function debug() {};
|
|---|
| 738 | if (true) {
|
|---|
| 739 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-ajax');
|
|---|
| 740 | }
|
|---|
| 741 | function InfoAjax(url, AjaxObject) {
|
|---|
| 742 | EventEmitter.call(this);
|
|---|
| 743 | var self = this;
|
|---|
| 744 | var t0 = +new Date();
|
|---|
| 745 | this.xo = new AjaxObject('GET', url);
|
|---|
| 746 | this.xo.once('finish', function (status, text) {
|
|---|
| 747 | var info, rtt;
|
|---|
| 748 | if (status === 200) {
|
|---|
| 749 | rtt = +new Date() - t0;
|
|---|
| 750 | if (text) {
|
|---|
| 751 | try {
|
|---|
| 752 | info = JSON.parse(text);
|
|---|
| 753 | } catch (e) {
|
|---|
| 754 | debug('bad json', text);
|
|---|
| 755 | }
|
|---|
| 756 | }
|
|---|
| 757 | if (!objectUtils.isObject(info)) {
|
|---|
| 758 | info = {};
|
|---|
| 759 | }
|
|---|
| 760 | }
|
|---|
| 761 | self.emit('finish', info, rtt);
|
|---|
| 762 | self.removeAllListeners();
|
|---|
| 763 | });
|
|---|
| 764 | }
|
|---|
| 765 | inherits(InfoAjax, EventEmitter);
|
|---|
| 766 | InfoAjax.prototype.close = function () {
|
|---|
| 767 | this.removeAllListeners();
|
|---|
| 768 | this.xo.close();
|
|---|
| 769 | };
|
|---|
| 770 | module.exports = InfoAjax;
|
|---|
| 771 |
|
|---|
| 772 | /***/ }),
|
|---|
| 773 |
|
|---|
| 774 | /***/ "./node_modules/sockjs-client/lib/info-iframe-receiver.js":
|
|---|
| 775 | /*!****************************************************************!*\
|
|---|
| 776 | !*** ./node_modules/sockjs-client/lib/info-iframe-receiver.js ***!
|
|---|
| 777 | \****************************************************************/
|
|---|
| 778 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 779 |
|
|---|
| 780 | "use strict";
|
|---|
| 781 |
|
|---|
| 782 |
|
|---|
| 783 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 784 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 785 | XHRLocalObject = __webpack_require__(/*! ./transport/sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js"),
|
|---|
| 786 | InfoAjax = __webpack_require__(/*! ./info-ajax */ "./node_modules/sockjs-client/lib/info-ajax.js");
|
|---|
| 787 | function InfoReceiverIframe(transUrl) {
|
|---|
| 788 | var self = this;
|
|---|
| 789 | EventEmitter.call(this);
|
|---|
| 790 | this.ir = new InfoAjax(transUrl, XHRLocalObject);
|
|---|
| 791 | this.ir.once('finish', function (info, rtt) {
|
|---|
| 792 | self.ir = null;
|
|---|
| 793 | self.emit('message', JSON.stringify([info, rtt]));
|
|---|
| 794 | });
|
|---|
| 795 | }
|
|---|
| 796 | inherits(InfoReceiverIframe, EventEmitter);
|
|---|
| 797 | InfoReceiverIframe.transportName = 'iframe-info-receiver';
|
|---|
| 798 | InfoReceiverIframe.prototype.close = function () {
|
|---|
| 799 | if (this.ir) {
|
|---|
| 800 | this.ir.close();
|
|---|
| 801 | this.ir = null;
|
|---|
| 802 | }
|
|---|
| 803 | this.removeAllListeners();
|
|---|
| 804 | };
|
|---|
| 805 | module.exports = InfoReceiverIframe;
|
|---|
| 806 |
|
|---|
| 807 | /***/ }),
|
|---|
| 808 |
|
|---|
| 809 | /***/ "./node_modules/sockjs-client/lib/info-iframe.js":
|
|---|
| 810 | /*!*******************************************************!*\
|
|---|
| 811 | !*** ./node_modules/sockjs-client/lib/info-iframe.js ***!
|
|---|
| 812 | \*******************************************************/
|
|---|
| 813 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 814 |
|
|---|
| 815 | "use strict";
|
|---|
| 816 |
|
|---|
| 817 |
|
|---|
| 818 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 819 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 820 | utils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 821 | IframeTransport = __webpack_require__(/*! ./transport/iframe */ "./node_modules/sockjs-client/lib/transport/iframe.js"),
|
|---|
| 822 | InfoReceiverIframe = __webpack_require__(/*! ./info-iframe-receiver */ "./node_modules/sockjs-client/lib/info-iframe-receiver.js");
|
|---|
| 823 | var debug = function debug() {};
|
|---|
| 824 | if (true) {
|
|---|
| 825 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-iframe');
|
|---|
| 826 | }
|
|---|
| 827 | function InfoIframe(baseUrl, url) {
|
|---|
| 828 | var self = this;
|
|---|
| 829 | EventEmitter.call(this);
|
|---|
| 830 | var go = function go() {
|
|---|
| 831 | var ifr = self.ifr = new IframeTransport(InfoReceiverIframe.transportName, url, baseUrl);
|
|---|
| 832 | ifr.once('message', function (msg) {
|
|---|
| 833 | if (msg) {
|
|---|
| 834 | var d;
|
|---|
| 835 | try {
|
|---|
| 836 | d = JSON.parse(msg);
|
|---|
| 837 | } catch (e) {
|
|---|
| 838 | debug('bad json', msg);
|
|---|
| 839 | self.emit('finish');
|
|---|
| 840 | self.close();
|
|---|
| 841 | return;
|
|---|
| 842 | }
|
|---|
| 843 | var info = d[0],
|
|---|
| 844 | rtt = d[1];
|
|---|
| 845 | self.emit('finish', info, rtt);
|
|---|
| 846 | }
|
|---|
| 847 | self.close();
|
|---|
| 848 | });
|
|---|
| 849 | ifr.once('close', function () {
|
|---|
| 850 | self.emit('finish');
|
|---|
| 851 | self.close();
|
|---|
| 852 | });
|
|---|
| 853 | };
|
|---|
| 854 |
|
|---|
| 855 | // TODO this seems the same as the 'needBody' from transports
|
|---|
| 856 | if (!__webpack_require__.g.document.body) {
|
|---|
| 857 | utils.attachEvent('load', go);
|
|---|
| 858 | } else {
|
|---|
| 859 | go();
|
|---|
| 860 | }
|
|---|
| 861 | }
|
|---|
| 862 | inherits(InfoIframe, EventEmitter);
|
|---|
| 863 | InfoIframe.enabled = function () {
|
|---|
| 864 | return IframeTransport.enabled();
|
|---|
| 865 | };
|
|---|
| 866 | InfoIframe.prototype.close = function () {
|
|---|
| 867 | if (this.ifr) {
|
|---|
| 868 | this.ifr.close();
|
|---|
| 869 | }
|
|---|
| 870 | this.removeAllListeners();
|
|---|
| 871 | this.ifr = null;
|
|---|
| 872 | };
|
|---|
| 873 | module.exports = InfoIframe;
|
|---|
| 874 |
|
|---|
| 875 | /***/ }),
|
|---|
| 876 |
|
|---|
| 877 | /***/ "./node_modules/sockjs-client/lib/info-receiver.js":
|
|---|
| 878 | /*!*********************************************************!*\
|
|---|
| 879 | !*** ./node_modules/sockjs-client/lib/info-receiver.js ***!
|
|---|
| 880 | \*********************************************************/
|
|---|
| 881 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 882 |
|
|---|
| 883 | "use strict";
|
|---|
| 884 |
|
|---|
| 885 |
|
|---|
| 886 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 887 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 888 | urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 889 | XDR = __webpack_require__(/*! ./transport/sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js"),
|
|---|
| 890 | XHRCors = __webpack_require__(/*! ./transport/sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js"),
|
|---|
| 891 | XHRLocal = __webpack_require__(/*! ./transport/sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js"),
|
|---|
| 892 | XHRFake = __webpack_require__(/*! ./transport/sender/xhr-fake */ "./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js"),
|
|---|
| 893 | InfoIframe = __webpack_require__(/*! ./info-iframe */ "./node_modules/sockjs-client/lib/info-iframe.js"),
|
|---|
| 894 | InfoAjax = __webpack_require__(/*! ./info-ajax */ "./node_modules/sockjs-client/lib/info-ajax.js");
|
|---|
| 895 | var debug = function debug() {};
|
|---|
| 896 | if (true) {
|
|---|
| 897 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:info-receiver');
|
|---|
| 898 | }
|
|---|
| 899 | function InfoReceiver(baseUrl, urlInfo) {
|
|---|
| 900 | debug(baseUrl);
|
|---|
| 901 | var self = this;
|
|---|
| 902 | EventEmitter.call(this);
|
|---|
| 903 | setTimeout(function () {
|
|---|
| 904 | self.doXhr(baseUrl, urlInfo);
|
|---|
| 905 | }, 0);
|
|---|
| 906 | }
|
|---|
| 907 | inherits(InfoReceiver, EventEmitter);
|
|---|
| 908 |
|
|---|
| 909 | // TODO this is currently ignoring the list of available transports and the whitelist
|
|---|
| 910 |
|
|---|
| 911 | InfoReceiver._getReceiver = function (baseUrl, url, urlInfo) {
|
|---|
| 912 | // determine method of CORS support (if needed)
|
|---|
| 913 | if (urlInfo.sameOrigin) {
|
|---|
| 914 | return new InfoAjax(url, XHRLocal);
|
|---|
| 915 | }
|
|---|
| 916 | if (XHRCors.enabled) {
|
|---|
| 917 | return new InfoAjax(url, XHRCors);
|
|---|
| 918 | }
|
|---|
| 919 | if (XDR.enabled && urlInfo.sameScheme) {
|
|---|
| 920 | return new InfoAjax(url, XDR);
|
|---|
| 921 | }
|
|---|
| 922 | if (InfoIframe.enabled()) {
|
|---|
| 923 | return new InfoIframe(baseUrl, url);
|
|---|
| 924 | }
|
|---|
| 925 | return new InfoAjax(url, XHRFake);
|
|---|
| 926 | };
|
|---|
| 927 | InfoReceiver.prototype.doXhr = function (baseUrl, urlInfo) {
|
|---|
| 928 | var self = this,
|
|---|
| 929 | url = urlUtils.addPath(baseUrl, '/info');
|
|---|
| 930 | debug('doXhr', url);
|
|---|
| 931 | this.xo = InfoReceiver._getReceiver(baseUrl, url, urlInfo);
|
|---|
| 932 | this.timeoutRef = setTimeout(function () {
|
|---|
| 933 | debug('timeout');
|
|---|
| 934 | self._cleanup(false);
|
|---|
| 935 | self.emit('finish');
|
|---|
| 936 | }, InfoReceiver.timeout);
|
|---|
| 937 | this.xo.once('finish', function (info, rtt) {
|
|---|
| 938 | debug('finish', info, rtt);
|
|---|
| 939 | self._cleanup(true);
|
|---|
| 940 | self.emit('finish', info, rtt);
|
|---|
| 941 | });
|
|---|
| 942 | };
|
|---|
| 943 | InfoReceiver.prototype._cleanup = function (wasClean) {
|
|---|
| 944 | debug('_cleanup');
|
|---|
| 945 | clearTimeout(this.timeoutRef);
|
|---|
| 946 | this.timeoutRef = null;
|
|---|
| 947 | if (!wasClean && this.xo) {
|
|---|
| 948 | this.xo.close();
|
|---|
| 949 | }
|
|---|
| 950 | this.xo = null;
|
|---|
| 951 | };
|
|---|
| 952 | InfoReceiver.prototype.close = function () {
|
|---|
| 953 | debug('close');
|
|---|
| 954 | this.removeAllListeners();
|
|---|
| 955 | this._cleanup(false);
|
|---|
| 956 | };
|
|---|
| 957 | InfoReceiver.timeout = 8000;
|
|---|
| 958 | module.exports = InfoReceiver;
|
|---|
| 959 |
|
|---|
| 960 | /***/ }),
|
|---|
| 961 |
|
|---|
| 962 | /***/ "./node_modules/sockjs-client/lib/location.js":
|
|---|
| 963 | /*!****************************************************!*\
|
|---|
| 964 | !*** ./node_modules/sockjs-client/lib/location.js ***!
|
|---|
| 965 | \****************************************************/
|
|---|
| 966 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 967 |
|
|---|
| 968 | "use strict";
|
|---|
| 969 |
|
|---|
| 970 |
|
|---|
| 971 | module.exports = __webpack_require__.g.location || {
|
|---|
| 972 | origin: 'http://localhost:80',
|
|---|
| 973 | protocol: 'http:',
|
|---|
| 974 | host: 'localhost',
|
|---|
| 975 | port: 80,
|
|---|
| 976 | href: 'http://localhost/',
|
|---|
| 977 | hash: ''
|
|---|
| 978 | };
|
|---|
| 979 |
|
|---|
| 980 | /***/ }),
|
|---|
| 981 |
|
|---|
| 982 | /***/ "./node_modules/sockjs-client/lib/main.js":
|
|---|
| 983 | /*!************************************************!*\
|
|---|
| 984 | !*** ./node_modules/sockjs-client/lib/main.js ***!
|
|---|
| 985 | \************************************************/
|
|---|
| 986 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 987 |
|
|---|
| 988 | "use strict";
|
|---|
| 989 |
|
|---|
| 990 |
|
|---|
| 991 | __webpack_require__(/*! ./shims */ "./node_modules/sockjs-client/lib/shims.js");
|
|---|
| 992 | var URL = __webpack_require__(/*! url-parse */ "./node_modules/url-parse/index.js"),
|
|---|
| 993 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 994 | random = __webpack_require__(/*! ./utils/random */ "./node_modules/sockjs-client/lib/utils/random.js"),
|
|---|
| 995 | escape = __webpack_require__(/*! ./utils/escape */ "./node_modules/sockjs-client/lib/utils/escape.js"),
|
|---|
| 996 | urlUtils = __webpack_require__(/*! ./utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 997 | eventUtils = __webpack_require__(/*! ./utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 998 | transport = __webpack_require__(/*! ./utils/transport */ "./node_modules/sockjs-client/lib/utils/transport.js"),
|
|---|
| 999 | objectUtils = __webpack_require__(/*! ./utils/object */ "./node_modules/sockjs-client/lib/utils/object.js"),
|
|---|
| 1000 | browser = __webpack_require__(/*! ./utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js"),
|
|---|
| 1001 | log = __webpack_require__(/*! ./utils/log */ "./node_modules/sockjs-client/lib/utils/log.js"),
|
|---|
| 1002 | Event = __webpack_require__(/*! ./event/event */ "./node_modules/sockjs-client/lib/event/event.js"),
|
|---|
| 1003 | EventTarget = __webpack_require__(/*! ./event/eventtarget */ "./node_modules/sockjs-client/lib/event/eventtarget.js"),
|
|---|
| 1004 | loc = __webpack_require__(/*! ./location */ "./node_modules/sockjs-client/lib/location.js"),
|
|---|
| 1005 | CloseEvent = __webpack_require__(/*! ./event/close */ "./node_modules/sockjs-client/lib/event/close.js"),
|
|---|
| 1006 | TransportMessageEvent = __webpack_require__(/*! ./event/trans-message */ "./node_modules/sockjs-client/lib/event/trans-message.js"),
|
|---|
| 1007 | InfoReceiver = __webpack_require__(/*! ./info-receiver */ "./node_modules/sockjs-client/lib/info-receiver.js");
|
|---|
| 1008 | var debug = function debug() {};
|
|---|
| 1009 | if (true) {
|
|---|
| 1010 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:main');
|
|---|
| 1011 | }
|
|---|
| 1012 | var transports;
|
|---|
| 1013 |
|
|---|
| 1014 | // follow constructor steps defined at http://dev.w3.org/html5/websockets/#the-websocket-interface
|
|---|
| 1015 | function SockJS(url, protocols, options) {
|
|---|
| 1016 | if (!(this instanceof SockJS)) {
|
|---|
| 1017 | return new SockJS(url, protocols, options);
|
|---|
| 1018 | }
|
|---|
| 1019 | if (arguments.length < 1) {
|
|---|
| 1020 | throw new TypeError("Failed to construct 'SockJS: 1 argument required, but only 0 present");
|
|---|
| 1021 | }
|
|---|
| 1022 | EventTarget.call(this);
|
|---|
| 1023 | this.readyState = SockJS.CONNECTING;
|
|---|
| 1024 | this.extensions = '';
|
|---|
| 1025 | this.protocol = '';
|
|---|
| 1026 |
|
|---|
| 1027 | // non-standard extension
|
|---|
| 1028 | options = options || {};
|
|---|
| 1029 | if (options.protocols_whitelist) {
|
|---|
| 1030 | log.warn("'protocols_whitelist' is DEPRECATED. Use 'transports' instead.");
|
|---|
| 1031 | }
|
|---|
| 1032 | this._transportsWhitelist = options.transports;
|
|---|
| 1033 | this._transportOptions = options.transportOptions || {};
|
|---|
| 1034 | this._timeout = options.timeout || 0;
|
|---|
| 1035 | var sessionId = options.sessionId || 8;
|
|---|
| 1036 | if (typeof sessionId === 'function') {
|
|---|
| 1037 | this._generateSessionId = sessionId;
|
|---|
| 1038 | } else if (typeof sessionId === 'number') {
|
|---|
| 1039 | this._generateSessionId = function () {
|
|---|
| 1040 | return random.string(sessionId);
|
|---|
| 1041 | };
|
|---|
| 1042 | } else {
|
|---|
| 1043 | throw new TypeError('If sessionId is used in the options, it needs to be a number or a function.');
|
|---|
| 1044 | }
|
|---|
| 1045 | this._server = options.server || random.numberString(1000);
|
|---|
| 1046 |
|
|---|
| 1047 | // Step 1 of WS spec - parse and validate the url. Issue #8
|
|---|
| 1048 | var parsedUrl = new URL(url);
|
|---|
| 1049 | if (!parsedUrl.host || !parsedUrl.protocol) {
|
|---|
| 1050 | throw new SyntaxError("The URL '" + url + "' is invalid");
|
|---|
| 1051 | } else if (parsedUrl.hash) {
|
|---|
| 1052 | throw new SyntaxError('The URL must not contain a fragment');
|
|---|
| 1053 | } else if (parsedUrl.protocol !== 'http:' && parsedUrl.protocol !== 'https:') {
|
|---|
| 1054 | throw new SyntaxError("The URL's scheme must be either 'http:' or 'https:'. '" + parsedUrl.protocol + "' is not allowed.");
|
|---|
| 1055 | }
|
|---|
| 1056 | var secure = parsedUrl.protocol === 'https:';
|
|---|
| 1057 | // Step 2 - don't allow secure origin with an insecure protocol
|
|---|
| 1058 | if (loc.protocol === 'https:' && !secure) {
|
|---|
| 1059 | // exception is 127.0.0.0/8 and ::1 urls
|
|---|
| 1060 | if (!urlUtils.isLoopbackAddr(parsedUrl.hostname)) {
|
|---|
| 1061 | throw new Error('SecurityError: An insecure SockJS connection may not be initiated from a page loaded over HTTPS');
|
|---|
| 1062 | }
|
|---|
| 1063 | }
|
|---|
| 1064 |
|
|---|
| 1065 | // Step 3 - check port access - no need here
|
|---|
| 1066 | // Step 4 - parse protocols argument
|
|---|
| 1067 | if (!protocols) {
|
|---|
| 1068 | protocols = [];
|
|---|
| 1069 | } else if (!Array.isArray(protocols)) {
|
|---|
| 1070 | protocols = [protocols];
|
|---|
| 1071 | }
|
|---|
| 1072 |
|
|---|
| 1073 | // Step 5 - check protocols argument
|
|---|
| 1074 | var sortedProtocols = protocols.sort();
|
|---|
| 1075 | sortedProtocols.forEach(function (proto, i) {
|
|---|
| 1076 | if (!proto) {
|
|---|
| 1077 | throw new SyntaxError("The protocols entry '" + proto + "' is invalid.");
|
|---|
| 1078 | }
|
|---|
| 1079 | if (i < sortedProtocols.length - 1 && proto === sortedProtocols[i + 1]) {
|
|---|
| 1080 | throw new SyntaxError("The protocols entry '" + proto + "' is duplicated.");
|
|---|
| 1081 | }
|
|---|
| 1082 | });
|
|---|
| 1083 |
|
|---|
| 1084 | // Step 6 - convert origin
|
|---|
| 1085 | var o = urlUtils.getOrigin(loc.href);
|
|---|
| 1086 | this._origin = o ? o.toLowerCase() : null;
|
|---|
| 1087 |
|
|---|
| 1088 | // remove the trailing slash
|
|---|
| 1089 | parsedUrl.set('pathname', parsedUrl.pathname.replace(/\/+$/, ''));
|
|---|
| 1090 |
|
|---|
| 1091 | // store the sanitized url
|
|---|
| 1092 | this.url = parsedUrl.href;
|
|---|
| 1093 | debug('using url', this.url);
|
|---|
| 1094 |
|
|---|
| 1095 | // Step 7 - start connection in background
|
|---|
| 1096 | // obtain server info
|
|---|
| 1097 | // http://sockjs.github.io/sockjs-protocol/sockjs-protocol-0.3.3.html#section-26
|
|---|
| 1098 | this._urlInfo = {
|
|---|
| 1099 | nullOrigin: !browser.hasDomain(),
|
|---|
| 1100 | sameOrigin: urlUtils.isOriginEqual(this.url, loc.href),
|
|---|
| 1101 | sameScheme: urlUtils.isSchemeEqual(this.url, loc.href)
|
|---|
| 1102 | };
|
|---|
| 1103 | this._ir = new InfoReceiver(this.url, this._urlInfo);
|
|---|
| 1104 | this._ir.once('finish', this._receiveInfo.bind(this));
|
|---|
| 1105 | }
|
|---|
| 1106 | inherits(SockJS, EventTarget);
|
|---|
| 1107 | function userSetCode(code) {
|
|---|
| 1108 | return code === 1000 || code >= 3000 && code <= 4999;
|
|---|
| 1109 | }
|
|---|
| 1110 | SockJS.prototype.close = function (code, reason) {
|
|---|
| 1111 | // Step 1
|
|---|
| 1112 | if (code && !userSetCode(code)) {
|
|---|
| 1113 | throw new Error('InvalidAccessError: Invalid code');
|
|---|
| 1114 | }
|
|---|
| 1115 | // Step 2.4 states the max is 123 bytes, but we are just checking length
|
|---|
| 1116 | if (reason && reason.length > 123) {
|
|---|
| 1117 | throw new SyntaxError('reason argument has an invalid length');
|
|---|
| 1118 | }
|
|---|
| 1119 |
|
|---|
| 1120 | // Step 3.1
|
|---|
| 1121 | if (this.readyState === SockJS.CLOSING || this.readyState === SockJS.CLOSED) {
|
|---|
| 1122 | return;
|
|---|
| 1123 | }
|
|---|
| 1124 |
|
|---|
| 1125 | // TODO look at docs to determine how to set this
|
|---|
| 1126 | var wasClean = true;
|
|---|
| 1127 | this._close(code || 1000, reason || 'Normal closure', wasClean);
|
|---|
| 1128 | };
|
|---|
| 1129 | SockJS.prototype.send = function (data) {
|
|---|
| 1130 | // #13 - convert anything non-string to string
|
|---|
| 1131 | // TODO this currently turns objects into [object Object]
|
|---|
| 1132 | if (typeof data !== 'string') {
|
|---|
| 1133 | data = '' + data;
|
|---|
| 1134 | }
|
|---|
| 1135 | if (this.readyState === SockJS.CONNECTING) {
|
|---|
| 1136 | throw new Error('InvalidStateError: The connection has not been established yet');
|
|---|
| 1137 | }
|
|---|
| 1138 | if (this.readyState !== SockJS.OPEN) {
|
|---|
| 1139 | return;
|
|---|
| 1140 | }
|
|---|
| 1141 | this._transport.send(escape.quote(data));
|
|---|
| 1142 | };
|
|---|
| 1143 | SockJS.version = __webpack_require__(/*! ./version */ "./node_modules/sockjs-client/lib/version.js");
|
|---|
| 1144 | SockJS.CONNECTING = 0;
|
|---|
| 1145 | SockJS.OPEN = 1;
|
|---|
| 1146 | SockJS.CLOSING = 2;
|
|---|
| 1147 | SockJS.CLOSED = 3;
|
|---|
| 1148 | SockJS.prototype._receiveInfo = function (info, rtt) {
|
|---|
| 1149 | debug('_receiveInfo', rtt);
|
|---|
| 1150 | this._ir = null;
|
|---|
| 1151 | if (!info) {
|
|---|
| 1152 | this._close(1002, 'Cannot connect to server');
|
|---|
| 1153 | return;
|
|---|
| 1154 | }
|
|---|
| 1155 |
|
|---|
| 1156 | // establish a round-trip timeout (RTO) based on the
|
|---|
| 1157 | // round-trip time (RTT)
|
|---|
| 1158 | this._rto = this.countRTO(rtt);
|
|---|
| 1159 | // allow server to override url used for the actual transport
|
|---|
| 1160 | this._transUrl = info.base_url ? info.base_url : this.url;
|
|---|
| 1161 | info = objectUtils.extend(info, this._urlInfo);
|
|---|
| 1162 | debug('info', info);
|
|---|
| 1163 | // determine list of desired and supported transports
|
|---|
| 1164 | var enabledTransports = transports.filterToEnabled(this._transportsWhitelist, info);
|
|---|
| 1165 | this._transports = enabledTransports.main;
|
|---|
| 1166 | debug(this._transports.length + ' enabled transports');
|
|---|
| 1167 | this._connect();
|
|---|
| 1168 | };
|
|---|
| 1169 | SockJS.prototype._connect = function () {
|
|---|
| 1170 | for (var Transport = this._transports.shift(); Transport; Transport = this._transports.shift()) {
|
|---|
| 1171 | debug('attempt', Transport.transportName);
|
|---|
| 1172 | if (Transport.needBody) {
|
|---|
| 1173 | if (!__webpack_require__.g.document.body || typeof __webpack_require__.g.document.readyState !== 'undefined' && __webpack_require__.g.document.readyState !== 'complete' && __webpack_require__.g.document.readyState !== 'interactive') {
|
|---|
| 1174 | debug('waiting for body');
|
|---|
| 1175 | this._transports.unshift(Transport);
|
|---|
| 1176 | eventUtils.attachEvent('load', this._connect.bind(this));
|
|---|
| 1177 | return;
|
|---|
| 1178 | }
|
|---|
| 1179 | }
|
|---|
| 1180 |
|
|---|
| 1181 | // calculate timeout based on RTO and round trips. Default to 5s
|
|---|
| 1182 | var timeoutMs = Math.max(this._timeout, this._rto * Transport.roundTrips || 5000);
|
|---|
| 1183 | this._transportTimeoutId = setTimeout(this._transportTimeout.bind(this), timeoutMs);
|
|---|
| 1184 | debug('using timeout', timeoutMs);
|
|---|
| 1185 | var transportUrl = urlUtils.addPath(this._transUrl, '/' + this._server + '/' + this._generateSessionId());
|
|---|
| 1186 | var options = this._transportOptions[Transport.transportName];
|
|---|
| 1187 | debug('transport url', transportUrl);
|
|---|
| 1188 | var transportObj = new Transport(transportUrl, this._transUrl, options);
|
|---|
| 1189 | transportObj.on('message', this._transportMessage.bind(this));
|
|---|
| 1190 | transportObj.once('close', this._transportClose.bind(this));
|
|---|
| 1191 | transportObj.transportName = Transport.transportName;
|
|---|
| 1192 | this._transport = transportObj;
|
|---|
| 1193 | return;
|
|---|
| 1194 | }
|
|---|
| 1195 | this._close(2000, 'All transports failed', false);
|
|---|
| 1196 | };
|
|---|
| 1197 | SockJS.prototype._transportTimeout = function () {
|
|---|
| 1198 | debug('_transportTimeout');
|
|---|
| 1199 | if (this.readyState === SockJS.CONNECTING) {
|
|---|
| 1200 | if (this._transport) {
|
|---|
| 1201 | this._transport.close();
|
|---|
| 1202 | }
|
|---|
| 1203 | this._transportClose(2007, 'Transport timed out');
|
|---|
| 1204 | }
|
|---|
| 1205 | };
|
|---|
| 1206 | SockJS.prototype._transportMessage = function (msg) {
|
|---|
| 1207 | debug('_transportMessage', msg);
|
|---|
| 1208 | var self = this,
|
|---|
| 1209 | type = msg.slice(0, 1),
|
|---|
| 1210 | content = msg.slice(1),
|
|---|
| 1211 | payload;
|
|---|
| 1212 |
|
|---|
| 1213 | // first check for messages that don't need a payload
|
|---|
| 1214 | switch (type) {
|
|---|
| 1215 | case 'o':
|
|---|
| 1216 | this._open();
|
|---|
| 1217 | return;
|
|---|
| 1218 | case 'h':
|
|---|
| 1219 | this.dispatchEvent(new Event('heartbeat'));
|
|---|
| 1220 | debug('heartbeat', this.transport);
|
|---|
| 1221 | return;
|
|---|
| 1222 | }
|
|---|
| 1223 | if (content) {
|
|---|
| 1224 | try {
|
|---|
| 1225 | payload = JSON.parse(content);
|
|---|
| 1226 | } catch (e) {
|
|---|
| 1227 | debug('bad json', content);
|
|---|
| 1228 | }
|
|---|
| 1229 | }
|
|---|
| 1230 | if (typeof payload === 'undefined') {
|
|---|
| 1231 | debug('empty payload', content);
|
|---|
| 1232 | return;
|
|---|
| 1233 | }
|
|---|
| 1234 | switch (type) {
|
|---|
| 1235 | case 'a':
|
|---|
| 1236 | if (Array.isArray(payload)) {
|
|---|
| 1237 | payload.forEach(function (p) {
|
|---|
| 1238 | debug('message', self.transport, p);
|
|---|
| 1239 | self.dispatchEvent(new TransportMessageEvent(p));
|
|---|
| 1240 | });
|
|---|
| 1241 | }
|
|---|
| 1242 | break;
|
|---|
| 1243 | case 'm':
|
|---|
| 1244 | debug('message', this.transport, payload);
|
|---|
| 1245 | this.dispatchEvent(new TransportMessageEvent(payload));
|
|---|
| 1246 | break;
|
|---|
| 1247 | case 'c':
|
|---|
| 1248 | if (Array.isArray(payload) && payload.length === 2) {
|
|---|
| 1249 | this._close(payload[0], payload[1], true);
|
|---|
| 1250 | }
|
|---|
| 1251 | break;
|
|---|
| 1252 | }
|
|---|
| 1253 | };
|
|---|
| 1254 | SockJS.prototype._transportClose = function (code, reason) {
|
|---|
| 1255 | debug('_transportClose', this.transport, code, reason);
|
|---|
| 1256 | if (this._transport) {
|
|---|
| 1257 | this._transport.removeAllListeners();
|
|---|
| 1258 | this._transport = null;
|
|---|
| 1259 | this.transport = null;
|
|---|
| 1260 | }
|
|---|
| 1261 | if (!userSetCode(code) && code !== 2000 && this.readyState === SockJS.CONNECTING) {
|
|---|
| 1262 | this._connect();
|
|---|
| 1263 | return;
|
|---|
| 1264 | }
|
|---|
| 1265 | this._close(code, reason);
|
|---|
| 1266 | };
|
|---|
| 1267 | SockJS.prototype._open = function () {
|
|---|
| 1268 | debug('_open', this._transport && this._transport.transportName, this.readyState);
|
|---|
| 1269 | if (this.readyState === SockJS.CONNECTING) {
|
|---|
| 1270 | if (this._transportTimeoutId) {
|
|---|
| 1271 | clearTimeout(this._transportTimeoutId);
|
|---|
| 1272 | this._transportTimeoutId = null;
|
|---|
| 1273 | }
|
|---|
| 1274 | this.readyState = SockJS.OPEN;
|
|---|
| 1275 | this.transport = this._transport.transportName;
|
|---|
| 1276 | this.dispatchEvent(new Event('open'));
|
|---|
| 1277 | debug('connected', this.transport);
|
|---|
| 1278 | } else {
|
|---|
| 1279 | // The server might have been restarted, and lost track of our
|
|---|
| 1280 | // connection.
|
|---|
| 1281 | this._close(1006, 'Server lost session');
|
|---|
| 1282 | }
|
|---|
| 1283 | };
|
|---|
| 1284 | SockJS.prototype._close = function (code, reason, wasClean) {
|
|---|
| 1285 | debug('_close', this.transport, code, reason, wasClean, this.readyState);
|
|---|
| 1286 | var forceFail = false;
|
|---|
| 1287 | if (this._ir) {
|
|---|
| 1288 | forceFail = true;
|
|---|
| 1289 | this._ir.close();
|
|---|
| 1290 | this._ir = null;
|
|---|
| 1291 | }
|
|---|
| 1292 | if (this._transport) {
|
|---|
| 1293 | this._transport.close();
|
|---|
| 1294 | this._transport = null;
|
|---|
| 1295 | this.transport = null;
|
|---|
| 1296 | }
|
|---|
| 1297 | if (this.readyState === SockJS.CLOSED) {
|
|---|
| 1298 | throw new Error('InvalidStateError: SockJS has already been closed');
|
|---|
| 1299 | }
|
|---|
| 1300 | this.readyState = SockJS.CLOSING;
|
|---|
| 1301 | setTimeout(function () {
|
|---|
| 1302 | this.readyState = SockJS.CLOSED;
|
|---|
| 1303 | if (forceFail) {
|
|---|
| 1304 | this.dispatchEvent(new Event('error'));
|
|---|
| 1305 | }
|
|---|
| 1306 | var e = new CloseEvent('close');
|
|---|
| 1307 | e.wasClean = wasClean || false;
|
|---|
| 1308 | e.code = code || 1000;
|
|---|
| 1309 | e.reason = reason;
|
|---|
| 1310 | this.dispatchEvent(e);
|
|---|
| 1311 | this.onmessage = this.onclose = this.onerror = null;
|
|---|
| 1312 | debug('disconnected');
|
|---|
| 1313 | }.bind(this), 0);
|
|---|
| 1314 | };
|
|---|
| 1315 |
|
|---|
| 1316 | // See: http://www.erg.abdn.ac.uk/~gerrit/dccp/notes/ccid2/rto_estimator/
|
|---|
| 1317 | // and RFC 2988.
|
|---|
| 1318 | SockJS.prototype.countRTO = function (rtt) {
|
|---|
| 1319 | // In a local environment, when using IE8/9 and the `jsonp-polling`
|
|---|
| 1320 | // transport the time needed to establish a connection (the time that pass
|
|---|
| 1321 | // from the opening of the transport to the call of `_dispatchOpen`) is
|
|---|
| 1322 | // around 200msec (the lower bound used in the article above) and this
|
|---|
| 1323 | // causes spurious timeouts. For this reason we calculate a value slightly
|
|---|
| 1324 | // larger than that used in the article.
|
|---|
| 1325 | if (rtt > 100) {
|
|---|
| 1326 | return 4 * rtt; // rto > 400msec
|
|---|
| 1327 | }
|
|---|
| 1328 |
|
|---|
| 1329 | return 300 + rtt; // 300msec < rto <= 400msec
|
|---|
| 1330 | };
|
|---|
| 1331 |
|
|---|
| 1332 | module.exports = function (availableTransports) {
|
|---|
| 1333 | transports = transport(availableTransports);
|
|---|
| 1334 | __webpack_require__(/*! ./iframe-bootstrap */ "./node_modules/sockjs-client/lib/iframe-bootstrap.js")(SockJS, availableTransports);
|
|---|
| 1335 | return SockJS;
|
|---|
| 1336 | };
|
|---|
| 1337 |
|
|---|
| 1338 | /***/ }),
|
|---|
| 1339 |
|
|---|
| 1340 | /***/ "./node_modules/sockjs-client/lib/shims.js":
|
|---|
| 1341 | /*!*************************************************!*\
|
|---|
| 1342 | !*** ./node_modules/sockjs-client/lib/shims.js ***!
|
|---|
| 1343 | \*************************************************/
|
|---|
| 1344 | /***/ (function() {
|
|---|
| 1345 |
|
|---|
| 1346 | "use strict";
|
|---|
| 1347 | /* eslint-disable */
|
|---|
| 1348 | /* jscs: disable */
|
|---|
| 1349 |
|
|---|
| 1350 |
|
|---|
| 1351 | // pulled specific shims from https://github.com/es-shims/es5-shim
|
|---|
| 1352 | var ArrayPrototype = Array.prototype;
|
|---|
| 1353 | var ObjectPrototype = Object.prototype;
|
|---|
| 1354 | var FunctionPrototype = Function.prototype;
|
|---|
| 1355 | var StringPrototype = String.prototype;
|
|---|
| 1356 | var array_slice = ArrayPrototype.slice;
|
|---|
| 1357 | var _toString = ObjectPrototype.toString;
|
|---|
| 1358 | var isFunction = function isFunction(val) {
|
|---|
| 1359 | return ObjectPrototype.toString.call(val) === '[object Function]';
|
|---|
| 1360 | };
|
|---|
| 1361 | var isArray = function isArray(obj) {
|
|---|
| 1362 | return _toString.call(obj) === '[object Array]';
|
|---|
| 1363 | };
|
|---|
| 1364 | var isString = function isString(obj) {
|
|---|
| 1365 | return _toString.call(obj) === '[object String]';
|
|---|
| 1366 | };
|
|---|
| 1367 | var supportsDescriptors = Object.defineProperty && function () {
|
|---|
| 1368 | try {
|
|---|
| 1369 | Object.defineProperty({}, 'x', {});
|
|---|
| 1370 | return true;
|
|---|
| 1371 | } catch (e) {
|
|---|
| 1372 | /* this is ES3 */
|
|---|
| 1373 | return false;
|
|---|
| 1374 | }
|
|---|
| 1375 | }();
|
|---|
| 1376 |
|
|---|
| 1377 | // Define configurable, writable and non-enumerable props
|
|---|
| 1378 | // if they don't exist.
|
|---|
| 1379 | var defineProperty;
|
|---|
| 1380 | if (supportsDescriptors) {
|
|---|
| 1381 | defineProperty = function defineProperty(object, name, method, forceAssign) {
|
|---|
| 1382 | if (!forceAssign && name in object) {
|
|---|
| 1383 | return;
|
|---|
| 1384 | }
|
|---|
| 1385 | Object.defineProperty(object, name, {
|
|---|
| 1386 | configurable: true,
|
|---|
| 1387 | enumerable: false,
|
|---|
| 1388 | writable: true,
|
|---|
| 1389 | value: method
|
|---|
| 1390 | });
|
|---|
| 1391 | };
|
|---|
| 1392 | } else {
|
|---|
| 1393 | defineProperty = function defineProperty(object, name, method, forceAssign) {
|
|---|
| 1394 | if (!forceAssign && name in object) {
|
|---|
| 1395 | return;
|
|---|
| 1396 | }
|
|---|
| 1397 | object[name] = method;
|
|---|
| 1398 | };
|
|---|
| 1399 | }
|
|---|
| 1400 | var defineProperties = function defineProperties(object, map, forceAssign) {
|
|---|
| 1401 | for (var name in map) {
|
|---|
| 1402 | if (ObjectPrototype.hasOwnProperty.call(map, name)) {
|
|---|
| 1403 | defineProperty(object, name, map[name], forceAssign);
|
|---|
| 1404 | }
|
|---|
| 1405 | }
|
|---|
| 1406 | };
|
|---|
| 1407 | var toObject = function toObject(o) {
|
|---|
| 1408 | if (o == null) {
|
|---|
| 1409 | // this matches both null and undefined
|
|---|
| 1410 | throw new TypeError("can't convert " + o + ' to object');
|
|---|
| 1411 | }
|
|---|
| 1412 | return Object(o);
|
|---|
| 1413 | };
|
|---|
| 1414 |
|
|---|
| 1415 | //
|
|---|
| 1416 | // Util
|
|---|
| 1417 | // ======
|
|---|
| 1418 | //
|
|---|
| 1419 |
|
|---|
| 1420 | // ES5 9.4
|
|---|
| 1421 | // http://es5.github.com/#x9.4
|
|---|
| 1422 | // http://jsperf.com/to-integer
|
|---|
| 1423 |
|
|---|
| 1424 | function toInteger(num) {
|
|---|
| 1425 | var n = +num;
|
|---|
| 1426 | if (n !== n) {
|
|---|
| 1427 | // isNaN
|
|---|
| 1428 | n = 0;
|
|---|
| 1429 | } else if (n !== 0 && n !== 1 / 0 && n !== -(1 / 0)) {
|
|---|
| 1430 | n = (n > 0 || -1) * Math.floor(Math.abs(n));
|
|---|
| 1431 | }
|
|---|
| 1432 | return n;
|
|---|
| 1433 | }
|
|---|
| 1434 | function ToUint32(x) {
|
|---|
| 1435 | return x >>> 0;
|
|---|
| 1436 | }
|
|---|
| 1437 |
|
|---|
| 1438 | //
|
|---|
| 1439 | // Function
|
|---|
| 1440 | // ========
|
|---|
| 1441 | //
|
|---|
| 1442 |
|
|---|
| 1443 | // ES-5 15.3.4.5
|
|---|
| 1444 | // http://es5.github.com/#x15.3.4.5
|
|---|
| 1445 |
|
|---|
| 1446 | function Empty() {}
|
|---|
| 1447 | defineProperties(FunctionPrototype, {
|
|---|
| 1448 | bind: function bind(that) {
|
|---|
| 1449 | // .length is 1
|
|---|
| 1450 | // 1. Let Target be the this value.
|
|---|
| 1451 | var target = this;
|
|---|
| 1452 | // 2. If IsCallable(Target) is false, throw a TypeError exception.
|
|---|
| 1453 | if (!isFunction(target)) {
|
|---|
| 1454 | throw new TypeError('Function.prototype.bind called on incompatible ' + target);
|
|---|
| 1455 | }
|
|---|
| 1456 | // 3. Let A be a new (possibly empty) internal list of all of the
|
|---|
| 1457 | // argument values provided after thisArg (arg1, arg2 etc), in order.
|
|---|
| 1458 | // XXX slicedArgs will stand in for "A" if used
|
|---|
| 1459 | var args = array_slice.call(arguments, 1); // for normal call
|
|---|
| 1460 | // 4. Let F be a new native ECMAScript object.
|
|---|
| 1461 | // 11. Set the [[Prototype]] internal property of F to the standard
|
|---|
| 1462 | // built-in Function prototype object as specified in 15.3.3.1.
|
|---|
| 1463 | // 12. Set the [[Call]] internal property of F as described in
|
|---|
| 1464 | // 15.3.4.5.1.
|
|---|
| 1465 | // 13. Set the [[Construct]] internal property of F as described in
|
|---|
| 1466 | // 15.3.4.5.2.
|
|---|
| 1467 | // 14. Set the [[HasInstance]] internal property of F as described in
|
|---|
| 1468 | // 15.3.4.5.3.
|
|---|
| 1469 | var binder = function binder() {
|
|---|
| 1470 | if (this instanceof bound) {
|
|---|
| 1471 | // 15.3.4.5.2 [[Construct]]
|
|---|
| 1472 | // When the [[Construct]] internal method of a function object,
|
|---|
| 1473 | // F that was created using the bind function is called with a
|
|---|
| 1474 | // list of arguments ExtraArgs, the following steps are taken:
|
|---|
| 1475 | // 1. Let target be the value of F's [[TargetFunction]]
|
|---|
| 1476 | // internal property.
|
|---|
| 1477 | // 2. If target has no [[Construct]] internal method, a
|
|---|
| 1478 | // TypeError exception is thrown.
|
|---|
| 1479 | // 3. Let boundArgs be the value of F's [[BoundArgs]] internal
|
|---|
| 1480 | // property.
|
|---|
| 1481 | // 4. Let args be a new list containing the same values as the
|
|---|
| 1482 | // list boundArgs in the same order followed by the same
|
|---|
| 1483 | // values as the list ExtraArgs in the same order.
|
|---|
| 1484 | // 5. Return the result of calling the [[Construct]] internal
|
|---|
| 1485 | // method of target providing args as the arguments.
|
|---|
| 1486 |
|
|---|
| 1487 | var result = target.apply(this, args.concat(array_slice.call(arguments)));
|
|---|
| 1488 | if (Object(result) === result) {
|
|---|
| 1489 | return result;
|
|---|
| 1490 | }
|
|---|
| 1491 | return this;
|
|---|
| 1492 | } else {
|
|---|
| 1493 | // 15.3.4.5.1 [[Call]]
|
|---|
| 1494 | // When the [[Call]] internal method of a function object, F,
|
|---|
| 1495 | // which was created using the bind function is called with a
|
|---|
| 1496 | // this value and a list of arguments ExtraArgs, the following
|
|---|
| 1497 | // steps are taken:
|
|---|
| 1498 | // 1. Let boundArgs be the value of F's [[BoundArgs]] internal
|
|---|
| 1499 | // property.
|
|---|
| 1500 | // 2. Let boundThis be the value of F's [[BoundThis]] internal
|
|---|
| 1501 | // property.
|
|---|
| 1502 | // 3. Let target be the value of F's [[TargetFunction]] internal
|
|---|
| 1503 | // property.
|
|---|
| 1504 | // 4. Let args be a new list containing the same values as the
|
|---|
| 1505 | // list boundArgs in the same order followed by the same
|
|---|
| 1506 | // values as the list ExtraArgs in the same order.
|
|---|
| 1507 | // 5. Return the result of calling the [[Call]] internal method
|
|---|
| 1508 | // of target providing boundThis as the this value and
|
|---|
| 1509 | // providing args as the arguments.
|
|---|
| 1510 |
|
|---|
| 1511 | // equiv: target.call(this, ...boundArgs, ...args)
|
|---|
| 1512 | return target.apply(that, args.concat(array_slice.call(arguments)));
|
|---|
| 1513 | }
|
|---|
| 1514 | };
|
|---|
| 1515 |
|
|---|
| 1516 | // 15. If the [[Class]] internal property of Target is "Function", then
|
|---|
| 1517 | // a. Let L be the length property of Target minus the length of A.
|
|---|
| 1518 | // b. Set the length own property of F to either 0 or L, whichever is
|
|---|
| 1519 | // larger.
|
|---|
| 1520 | // 16. Else set the length own property of F to 0.
|
|---|
| 1521 |
|
|---|
| 1522 | var boundLength = Math.max(0, target.length - args.length);
|
|---|
| 1523 |
|
|---|
| 1524 | // 17. Set the attributes of the length own property of F to the values
|
|---|
| 1525 | // specified in 15.3.5.1.
|
|---|
| 1526 | var boundArgs = [];
|
|---|
| 1527 | for (var i = 0; i < boundLength; i++) {
|
|---|
| 1528 | boundArgs.push('$' + i);
|
|---|
| 1529 | }
|
|---|
| 1530 |
|
|---|
| 1531 | // XXX Build a dynamic function with desired amount of arguments is the only
|
|---|
| 1532 | // way to set the length property of a function.
|
|---|
| 1533 | // In environments where Content Security Policies enabled (Chrome extensions,
|
|---|
| 1534 | // for ex.) all use of eval or Function costructor throws an exception.
|
|---|
| 1535 | // However in all of these environments Function.prototype.bind exists
|
|---|
| 1536 | // and so this code will never be executed.
|
|---|
| 1537 | var bound = Function('binder', 'return function (' + boundArgs.join(',') + '){ return binder.apply(this, arguments); }')(binder);
|
|---|
| 1538 | if (target.prototype) {
|
|---|
| 1539 | Empty.prototype = target.prototype;
|
|---|
| 1540 | bound.prototype = new Empty();
|
|---|
| 1541 | // Clean up dangling references.
|
|---|
| 1542 | Empty.prototype = null;
|
|---|
| 1543 | }
|
|---|
| 1544 |
|
|---|
| 1545 | // TODO
|
|---|
| 1546 | // 18. Set the [[Extensible]] internal property of F to true.
|
|---|
| 1547 |
|
|---|
| 1548 | // TODO
|
|---|
| 1549 | // 19. Let thrower be the [[ThrowTypeError]] function Object (13.2.3).
|
|---|
| 1550 | // 20. Call the [[DefineOwnProperty]] internal method of F with
|
|---|
| 1551 | // arguments "caller", PropertyDescriptor {[[Get]]: thrower, [[Set]]:
|
|---|
| 1552 | // thrower, [[Enumerable]]: false, [[Configurable]]: false}, and
|
|---|
| 1553 | // false.
|
|---|
| 1554 | // 21. Call the [[DefineOwnProperty]] internal method of F with
|
|---|
| 1555 | // arguments "arguments", PropertyDescriptor {[[Get]]: thrower,
|
|---|
| 1556 | // [[Set]]: thrower, [[Enumerable]]: false, [[Configurable]]: false},
|
|---|
| 1557 | // and false.
|
|---|
| 1558 |
|
|---|
| 1559 | // TODO
|
|---|
| 1560 | // NOTE Function objects created using Function.prototype.bind do not
|
|---|
| 1561 | // have a prototype property or the [[Code]], [[FormalParameters]], and
|
|---|
| 1562 | // [[Scope]] internal properties.
|
|---|
| 1563 | // XXX can't delete prototype in pure-js.
|
|---|
| 1564 |
|
|---|
| 1565 | // 22. Return F.
|
|---|
| 1566 | return bound;
|
|---|
| 1567 | }
|
|---|
| 1568 | });
|
|---|
| 1569 |
|
|---|
| 1570 | //
|
|---|
| 1571 | // Array
|
|---|
| 1572 | // =====
|
|---|
| 1573 | //
|
|---|
| 1574 |
|
|---|
| 1575 | // ES5 15.4.3.2
|
|---|
| 1576 | // http://es5.github.com/#x15.4.3.2
|
|---|
| 1577 | // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/isArray
|
|---|
| 1578 | defineProperties(Array, {
|
|---|
| 1579 | isArray: isArray
|
|---|
| 1580 | });
|
|---|
| 1581 | var boxedString = Object('a');
|
|---|
| 1582 | var splitString = boxedString[0] !== 'a' || !(0 in boxedString);
|
|---|
| 1583 | var properlyBoxesContext = function properlyBoxed(method) {
|
|---|
| 1584 | // Check node 0.6.21 bug where third parameter is not boxed
|
|---|
| 1585 | var properlyBoxesNonStrict = true;
|
|---|
| 1586 | var properlyBoxesStrict = true;
|
|---|
| 1587 | if (method) {
|
|---|
| 1588 | method.call('foo', function (_, __, context) {
|
|---|
| 1589 | if (typeof context !== 'object') {
|
|---|
| 1590 | properlyBoxesNonStrict = false;
|
|---|
| 1591 | }
|
|---|
| 1592 | });
|
|---|
| 1593 | method.call([1], function () {
|
|---|
| 1594 | 'use strict';
|
|---|
| 1595 |
|
|---|
| 1596 | properlyBoxesStrict = typeof this === 'string';
|
|---|
| 1597 | }, 'x');
|
|---|
| 1598 | }
|
|---|
| 1599 | return !!method && properlyBoxesNonStrict && properlyBoxesStrict;
|
|---|
| 1600 | };
|
|---|
| 1601 | defineProperties(ArrayPrototype, {
|
|---|
| 1602 | forEach: function forEach(fun /*, thisp*/) {
|
|---|
| 1603 | var object = toObject(this),
|
|---|
| 1604 | self = splitString && isString(this) ? this.split('') : object,
|
|---|
| 1605 | thisp = arguments[1],
|
|---|
| 1606 | i = -1,
|
|---|
| 1607 | length = self.length >>> 0;
|
|---|
| 1608 |
|
|---|
| 1609 | // If no callback function or if callback is not a callable function
|
|---|
| 1610 | if (!isFunction(fun)) {
|
|---|
| 1611 | throw new TypeError(); // TODO message
|
|---|
| 1612 | }
|
|---|
| 1613 |
|
|---|
| 1614 | while (++i < length) {
|
|---|
| 1615 | if (i in self) {
|
|---|
| 1616 | // Invoke the callback function with call, passing arguments:
|
|---|
| 1617 | // context, property value, property key, thisArg object
|
|---|
| 1618 | // context
|
|---|
| 1619 | fun.call(thisp, self[i], i, object);
|
|---|
| 1620 | }
|
|---|
| 1621 | }
|
|---|
| 1622 | }
|
|---|
| 1623 | }, !properlyBoxesContext(ArrayPrototype.forEach));
|
|---|
| 1624 |
|
|---|
| 1625 | // ES5 15.4.4.14
|
|---|
| 1626 | // http://es5.github.com/#x15.4.4.14
|
|---|
| 1627 | // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Array/indexOf
|
|---|
| 1628 | var hasFirefox2IndexOfBug = Array.prototype.indexOf && [0, 1].indexOf(1, 2) !== -1;
|
|---|
| 1629 | defineProperties(ArrayPrototype, {
|
|---|
| 1630 | indexOf: function indexOf(sought /*, fromIndex */) {
|
|---|
| 1631 | var self = splitString && isString(this) ? this.split('') : toObject(this),
|
|---|
| 1632 | length = self.length >>> 0;
|
|---|
| 1633 | if (!length) {
|
|---|
| 1634 | return -1;
|
|---|
| 1635 | }
|
|---|
| 1636 | var i = 0;
|
|---|
| 1637 | if (arguments.length > 1) {
|
|---|
| 1638 | i = toInteger(arguments[1]);
|
|---|
| 1639 | }
|
|---|
| 1640 |
|
|---|
| 1641 | // handle negative indices
|
|---|
| 1642 | i = i >= 0 ? i : Math.max(0, length + i);
|
|---|
| 1643 | for (; i < length; i++) {
|
|---|
| 1644 | if (i in self && self[i] === sought) {
|
|---|
| 1645 | return i;
|
|---|
| 1646 | }
|
|---|
| 1647 | }
|
|---|
| 1648 | return -1;
|
|---|
| 1649 | }
|
|---|
| 1650 | }, hasFirefox2IndexOfBug);
|
|---|
| 1651 |
|
|---|
| 1652 | //
|
|---|
| 1653 | // String
|
|---|
| 1654 | // ======
|
|---|
| 1655 | //
|
|---|
| 1656 |
|
|---|
| 1657 | // ES5 15.5.4.14
|
|---|
| 1658 | // http://es5.github.com/#x15.5.4.14
|
|---|
| 1659 |
|
|---|
| 1660 | // [bugfix, IE lt 9, firefox 4, Konqueror, Opera, obscure browsers]
|
|---|
| 1661 | // Many browsers do not split properly with regular expressions or they
|
|---|
| 1662 | // do not perform the split correctly under obscure conditions.
|
|---|
| 1663 | // See http://blog.stevenlevithan.com/archives/cross-browser-split
|
|---|
| 1664 | // I've tested in many browsers and this seems to cover the deviant ones:
|
|---|
| 1665 | // 'ab'.split(/(?:ab)*/) should be ["", ""], not [""]
|
|---|
| 1666 | // '.'.split(/(.?)(.?)/) should be ["", ".", "", ""], not ["", ""]
|
|---|
| 1667 | // 'tesst'.split(/(s)*/) should be ["t", undefined, "e", "s", "t"], not
|
|---|
| 1668 | // [undefined, "t", undefined, "e", ...]
|
|---|
| 1669 | // ''.split(/.?/) should be [], not [""]
|
|---|
| 1670 | // '.'.split(/()()/) should be ["."], not ["", "", "."]
|
|---|
| 1671 |
|
|---|
| 1672 | var string_split = StringPrototype.split;
|
|---|
| 1673 | if ('ab'.split(/(?:ab)*/).length !== 2 || '.'.split(/(.?)(.?)/).length !== 4 || 'tesst'.split(/(s)*/)[1] === 't' || 'test'.split(/(?:)/, -1).length !== 4 || ''.split(/.?/).length || '.'.split(/()()/).length > 1) {
|
|---|
| 1674 | (function () {
|
|---|
| 1675 | var compliantExecNpcg = /()??/.exec('')[1] === void 0; // NPCG: nonparticipating capturing group
|
|---|
| 1676 |
|
|---|
| 1677 | StringPrototype.split = function (separator, limit) {
|
|---|
| 1678 | var string = this;
|
|---|
| 1679 | if (separator === void 0 && limit === 0) {
|
|---|
| 1680 | return [];
|
|---|
| 1681 | }
|
|---|
| 1682 |
|
|---|
| 1683 | // If `separator` is not a regex, use native split
|
|---|
| 1684 | if (_toString.call(separator) !== '[object RegExp]') {
|
|---|
| 1685 | return string_split.call(this, separator, limit);
|
|---|
| 1686 | }
|
|---|
| 1687 | var output = [],
|
|---|
| 1688 | flags = (separator.ignoreCase ? 'i' : '') + (separator.multiline ? 'm' : '') + (separator.extended ? 'x' : '') + (
|
|---|
| 1689 | // Proposed for ES6
|
|---|
| 1690 | separator.sticky ? 'y' : ''),
|
|---|
| 1691 | // Firefox 3+
|
|---|
| 1692 | lastLastIndex = 0,
|
|---|
| 1693 | // Make `global` and avoid `lastIndex` issues by working with a copy
|
|---|
| 1694 | separator2,
|
|---|
| 1695 | match,
|
|---|
| 1696 | lastIndex,
|
|---|
| 1697 | lastLength;
|
|---|
| 1698 | separator = new RegExp(separator.source, flags + 'g');
|
|---|
| 1699 | string += ''; // Type-convert
|
|---|
| 1700 | if (!compliantExecNpcg) {
|
|---|
| 1701 | // Doesn't need flags gy, but they don't hurt
|
|---|
| 1702 | separator2 = new RegExp('^' + separator.source + '$(?!\\s)', flags);
|
|---|
| 1703 | }
|
|---|
| 1704 | /* Values for `limit`, per the spec:
|
|---|
| 1705 | * If undefined: 4294967295 // Math.pow(2, 32) - 1
|
|---|
| 1706 | * If 0, Infinity, or NaN: 0
|
|---|
| 1707 | * If positive number: limit = Math.floor(limit); if (limit > 4294967295) limit -= 4294967296;
|
|---|
| 1708 | * If negative number: 4294967296 - Math.floor(Math.abs(limit))
|
|---|
| 1709 | * If other: Type-convert, then use the above rules
|
|---|
| 1710 | */
|
|---|
| 1711 | limit = limit === void 0 ? -1 >>> 0 :
|
|---|
| 1712 | // Math.pow(2, 32) - 1
|
|---|
| 1713 | ToUint32(limit);
|
|---|
| 1714 | while (match = separator.exec(string)) {
|
|---|
| 1715 | // `separator.lastIndex` is not reliable cross-browser
|
|---|
| 1716 | lastIndex = match.index + match[0].length;
|
|---|
| 1717 | if (lastIndex > lastLastIndex) {
|
|---|
| 1718 | output.push(string.slice(lastLastIndex, match.index));
|
|---|
| 1719 | // Fix browsers whose `exec` methods don't consistently return `undefined` for
|
|---|
| 1720 | // nonparticipating capturing groups
|
|---|
| 1721 | if (!compliantExecNpcg && match.length > 1) {
|
|---|
| 1722 | match[0].replace(separator2, function () {
|
|---|
| 1723 | for (var i = 1; i < arguments.length - 2; i++) {
|
|---|
| 1724 | if (arguments[i] === void 0) {
|
|---|
| 1725 | match[i] = void 0;
|
|---|
| 1726 | }
|
|---|
| 1727 | }
|
|---|
| 1728 | });
|
|---|
| 1729 | }
|
|---|
| 1730 | if (match.length > 1 && match.index < string.length) {
|
|---|
| 1731 | ArrayPrototype.push.apply(output, match.slice(1));
|
|---|
| 1732 | }
|
|---|
| 1733 | lastLength = match[0].length;
|
|---|
| 1734 | lastLastIndex = lastIndex;
|
|---|
| 1735 | if (output.length >= limit) {
|
|---|
| 1736 | break;
|
|---|
| 1737 | }
|
|---|
| 1738 | }
|
|---|
| 1739 | if (separator.lastIndex === match.index) {
|
|---|
| 1740 | separator.lastIndex++; // Avoid an infinite loop
|
|---|
| 1741 | }
|
|---|
| 1742 | }
|
|---|
| 1743 |
|
|---|
| 1744 | if (lastLastIndex === string.length) {
|
|---|
| 1745 | if (lastLength || !separator.test('')) {
|
|---|
| 1746 | output.push('');
|
|---|
| 1747 | }
|
|---|
| 1748 | } else {
|
|---|
| 1749 | output.push(string.slice(lastLastIndex));
|
|---|
| 1750 | }
|
|---|
| 1751 | return output.length > limit ? output.slice(0, limit) : output;
|
|---|
| 1752 | };
|
|---|
| 1753 | })();
|
|---|
| 1754 |
|
|---|
| 1755 | // [bugfix, chrome]
|
|---|
| 1756 | // If separator is undefined, then the result array contains just one String,
|
|---|
| 1757 | // which is the this value (converted to a String). If limit is not undefined,
|
|---|
| 1758 | // then the output array is truncated so that it contains no more than limit
|
|---|
| 1759 | // elements.
|
|---|
| 1760 | // "0".split(undefined, 0) -> []
|
|---|
| 1761 | } else if ('0'.split(void 0, 0).length) {
|
|---|
| 1762 | StringPrototype.split = function split(separator, limit) {
|
|---|
| 1763 | if (separator === void 0 && limit === 0) {
|
|---|
| 1764 | return [];
|
|---|
| 1765 | }
|
|---|
| 1766 | return string_split.call(this, separator, limit);
|
|---|
| 1767 | };
|
|---|
| 1768 | }
|
|---|
| 1769 |
|
|---|
| 1770 | // ECMA-262, 3rd B.2.3
|
|---|
| 1771 | // Not an ECMAScript standard, although ECMAScript 3rd Edition has a
|
|---|
| 1772 | // non-normative section suggesting uniform semantics and it should be
|
|---|
| 1773 | // normalized across all browsers
|
|---|
| 1774 | // [bugfix, IE lt 9] IE < 9 substr() with negative value not working in IE
|
|---|
| 1775 | var string_substr = StringPrototype.substr;
|
|---|
| 1776 | var hasNegativeSubstrBug = ''.substr && '0b'.substr(-1) !== 'b';
|
|---|
| 1777 | defineProperties(StringPrototype, {
|
|---|
| 1778 | substr: function substr(start, length) {
|
|---|
| 1779 | return string_substr.call(this, start < 0 ? (start = this.length + start) < 0 ? 0 : start : start, length);
|
|---|
| 1780 | }
|
|---|
| 1781 | }, hasNegativeSubstrBug);
|
|---|
| 1782 |
|
|---|
| 1783 | /***/ }),
|
|---|
| 1784 |
|
|---|
| 1785 | /***/ "./node_modules/sockjs-client/lib/transport-list.js":
|
|---|
| 1786 | /*!**********************************************************!*\
|
|---|
| 1787 | !*** ./node_modules/sockjs-client/lib/transport-list.js ***!
|
|---|
| 1788 | \**********************************************************/
|
|---|
| 1789 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 1790 |
|
|---|
| 1791 | "use strict";
|
|---|
| 1792 |
|
|---|
| 1793 |
|
|---|
| 1794 | module.exports = [
|
|---|
| 1795 | // streaming transports
|
|---|
| 1796 | __webpack_require__(/*! ./transport/websocket */ "./node_modules/sockjs-client/lib/transport/websocket.js"), __webpack_require__(/*! ./transport/xhr-streaming */ "./node_modules/sockjs-client/lib/transport/xhr-streaming.js"), __webpack_require__(/*! ./transport/xdr-streaming */ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js"), __webpack_require__(/*! ./transport/eventsource */ "./node_modules/sockjs-client/lib/transport/eventsource.js"), __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/eventsource */ "./node_modules/sockjs-client/lib/transport/eventsource.js"))
|
|---|
| 1797 |
|
|---|
| 1798 | // polling transports
|
|---|
| 1799 | , __webpack_require__(/*! ./transport/htmlfile */ "./node_modules/sockjs-client/lib/transport/htmlfile.js"), __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/htmlfile */ "./node_modules/sockjs-client/lib/transport/htmlfile.js")), __webpack_require__(/*! ./transport/xhr-polling */ "./node_modules/sockjs-client/lib/transport/xhr-polling.js"), __webpack_require__(/*! ./transport/xdr-polling */ "./node_modules/sockjs-client/lib/transport/xdr-polling.js"), __webpack_require__(/*! ./transport/lib/iframe-wrap */ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js")(__webpack_require__(/*! ./transport/xhr-polling */ "./node_modules/sockjs-client/lib/transport/xhr-polling.js")), __webpack_require__(/*! ./transport/jsonp-polling */ "./node_modules/sockjs-client/lib/transport/jsonp-polling.js")];
|
|---|
| 1800 |
|
|---|
| 1801 | /***/ }),
|
|---|
| 1802 |
|
|---|
| 1803 | /***/ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js":
|
|---|
| 1804 | /*!**************************************************************************!*\
|
|---|
| 1805 | !*** ./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js ***!
|
|---|
| 1806 | \**************************************************************************/
|
|---|
| 1807 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 1808 |
|
|---|
| 1809 | "use strict";
|
|---|
| 1810 |
|
|---|
| 1811 |
|
|---|
| 1812 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 1813 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 1814 | utils = __webpack_require__(/*! ../../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 1815 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 1816 | XHR = __webpack_require__.g.XMLHttpRequest;
|
|---|
| 1817 | var debug = function debug() {};
|
|---|
| 1818 | if (true) {
|
|---|
| 1819 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:browser:xhr');
|
|---|
| 1820 | }
|
|---|
| 1821 | function AbstractXHRObject(method, url, payload, opts) {
|
|---|
| 1822 | debug(method, url);
|
|---|
| 1823 | var self = this;
|
|---|
| 1824 | EventEmitter.call(this);
|
|---|
| 1825 | setTimeout(function () {
|
|---|
| 1826 | self._start(method, url, payload, opts);
|
|---|
| 1827 | }, 0);
|
|---|
| 1828 | }
|
|---|
| 1829 | inherits(AbstractXHRObject, EventEmitter);
|
|---|
| 1830 | AbstractXHRObject.prototype._start = function (method, url, payload, opts) {
|
|---|
| 1831 | var self = this;
|
|---|
| 1832 | try {
|
|---|
| 1833 | this.xhr = new XHR();
|
|---|
| 1834 | } catch (x) {
|
|---|
| 1835 | // intentionally empty
|
|---|
| 1836 | }
|
|---|
| 1837 | if (!this.xhr) {
|
|---|
| 1838 | debug('no xhr');
|
|---|
| 1839 | this.emit('finish', 0, 'no xhr support');
|
|---|
| 1840 | this._cleanup();
|
|---|
| 1841 | return;
|
|---|
| 1842 | }
|
|---|
| 1843 |
|
|---|
| 1844 | // several browsers cache POSTs
|
|---|
| 1845 | url = urlUtils.addQuery(url, 't=' + +new Date());
|
|---|
| 1846 |
|
|---|
| 1847 | // Explorer tends to keep connection open, even after the
|
|---|
| 1848 | // tab gets closed: http://bugs.jquery.com/ticket/5280
|
|---|
| 1849 | this.unloadRef = utils.unloadAdd(function () {
|
|---|
| 1850 | debug('unload cleanup');
|
|---|
| 1851 | self._cleanup(true);
|
|---|
| 1852 | });
|
|---|
| 1853 | try {
|
|---|
| 1854 | this.xhr.open(method, url, true);
|
|---|
| 1855 | if (this.timeout && 'timeout' in this.xhr) {
|
|---|
| 1856 | this.xhr.timeout = this.timeout;
|
|---|
| 1857 | this.xhr.ontimeout = function () {
|
|---|
| 1858 | debug('xhr timeout');
|
|---|
| 1859 | self.emit('finish', 0, '');
|
|---|
| 1860 | self._cleanup(false);
|
|---|
| 1861 | };
|
|---|
| 1862 | }
|
|---|
| 1863 | } catch (e) {
|
|---|
| 1864 | debug('exception', e);
|
|---|
| 1865 | // IE raises an exception on wrong port.
|
|---|
| 1866 | this.emit('finish', 0, '');
|
|---|
| 1867 | this._cleanup(false);
|
|---|
| 1868 | return;
|
|---|
| 1869 | }
|
|---|
| 1870 | if ((!opts || !opts.noCredentials) && AbstractXHRObject.supportsCORS) {
|
|---|
| 1871 | debug('withCredentials');
|
|---|
| 1872 | // Mozilla docs says https://developer.mozilla.org/en/XMLHttpRequest :
|
|---|
| 1873 | // "This never affects same-site requests."
|
|---|
| 1874 |
|
|---|
| 1875 | this.xhr.withCredentials = true;
|
|---|
| 1876 | }
|
|---|
| 1877 | if (opts && opts.headers) {
|
|---|
| 1878 | for (var key in opts.headers) {
|
|---|
| 1879 | this.xhr.setRequestHeader(key, opts.headers[key]);
|
|---|
| 1880 | }
|
|---|
| 1881 | }
|
|---|
| 1882 | this.xhr.onreadystatechange = function () {
|
|---|
| 1883 | if (self.xhr) {
|
|---|
| 1884 | var x = self.xhr;
|
|---|
| 1885 | var text, status;
|
|---|
| 1886 | debug('readyState', x.readyState);
|
|---|
| 1887 | switch (x.readyState) {
|
|---|
| 1888 | case 3:
|
|---|
| 1889 | // IE doesn't like peeking into responseText or status
|
|---|
| 1890 | // on Microsoft.XMLHTTP and readystate=3
|
|---|
| 1891 | try {
|
|---|
| 1892 | status = x.status;
|
|---|
| 1893 | text = x.responseText;
|
|---|
| 1894 | } catch (e) {
|
|---|
| 1895 | // intentionally empty
|
|---|
| 1896 | }
|
|---|
| 1897 | debug('status', status);
|
|---|
| 1898 | // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450
|
|---|
| 1899 | if (status === 1223) {
|
|---|
| 1900 | status = 204;
|
|---|
| 1901 | }
|
|---|
| 1902 |
|
|---|
| 1903 | // IE does return readystate == 3 for 404 answers.
|
|---|
| 1904 | if (status === 200 && text && text.length > 0) {
|
|---|
| 1905 | debug('chunk');
|
|---|
| 1906 | self.emit('chunk', status, text);
|
|---|
| 1907 | }
|
|---|
| 1908 | break;
|
|---|
| 1909 | case 4:
|
|---|
| 1910 | status = x.status;
|
|---|
| 1911 | debug('status', status);
|
|---|
| 1912 | // IE returns 1223 for 204: http://bugs.jquery.com/ticket/1450
|
|---|
| 1913 | if (status === 1223) {
|
|---|
| 1914 | status = 204;
|
|---|
| 1915 | }
|
|---|
| 1916 | // IE returns this for a bad port
|
|---|
| 1917 | // http://msdn.microsoft.com/en-us/library/windows/desktop/aa383770(v=vs.85).aspx
|
|---|
| 1918 | if (status === 12005 || status === 12029) {
|
|---|
| 1919 | status = 0;
|
|---|
| 1920 | }
|
|---|
| 1921 | debug('finish', status, x.responseText);
|
|---|
| 1922 | self.emit('finish', status, x.responseText);
|
|---|
| 1923 | self._cleanup(false);
|
|---|
| 1924 | break;
|
|---|
| 1925 | }
|
|---|
| 1926 | }
|
|---|
| 1927 | };
|
|---|
| 1928 | try {
|
|---|
| 1929 | self.xhr.send(payload);
|
|---|
| 1930 | } catch (e) {
|
|---|
| 1931 | self.emit('finish', 0, '');
|
|---|
| 1932 | self._cleanup(false);
|
|---|
| 1933 | }
|
|---|
| 1934 | };
|
|---|
| 1935 | AbstractXHRObject.prototype._cleanup = function (abort) {
|
|---|
| 1936 | debug('cleanup');
|
|---|
| 1937 | if (!this.xhr) {
|
|---|
| 1938 | return;
|
|---|
| 1939 | }
|
|---|
| 1940 | this.removeAllListeners();
|
|---|
| 1941 | utils.unloadDel(this.unloadRef);
|
|---|
| 1942 |
|
|---|
| 1943 | // IE needs this field to be a function
|
|---|
| 1944 | this.xhr.onreadystatechange = function () {};
|
|---|
| 1945 | if (this.xhr.ontimeout) {
|
|---|
| 1946 | this.xhr.ontimeout = null;
|
|---|
| 1947 | }
|
|---|
| 1948 | if (abort) {
|
|---|
| 1949 | try {
|
|---|
| 1950 | this.xhr.abort();
|
|---|
| 1951 | } catch (x) {
|
|---|
| 1952 | // intentionally empty
|
|---|
| 1953 | }
|
|---|
| 1954 | }
|
|---|
| 1955 | this.unloadRef = this.xhr = null;
|
|---|
| 1956 | };
|
|---|
| 1957 | AbstractXHRObject.prototype.close = function () {
|
|---|
| 1958 | debug('close');
|
|---|
| 1959 | this._cleanup(true);
|
|---|
| 1960 | };
|
|---|
| 1961 | AbstractXHRObject.enabled = !!XHR;
|
|---|
| 1962 | // override XMLHttpRequest for IE6/7
|
|---|
| 1963 | // obfuscate to avoid firewalls
|
|---|
| 1964 | var axo = ['Active'].concat('Object').join('X');
|
|---|
| 1965 | if (!AbstractXHRObject.enabled && axo in __webpack_require__.g) {
|
|---|
| 1966 | debug('overriding xmlhttprequest');
|
|---|
| 1967 | XHR = function XHR() {
|
|---|
| 1968 | try {
|
|---|
| 1969 | return new __webpack_require__.g[axo]('Microsoft.XMLHTTP');
|
|---|
| 1970 | } catch (e) {
|
|---|
| 1971 | return null;
|
|---|
| 1972 | }
|
|---|
| 1973 | };
|
|---|
| 1974 | AbstractXHRObject.enabled = !!new XHR();
|
|---|
| 1975 | }
|
|---|
| 1976 | var cors = false;
|
|---|
| 1977 | try {
|
|---|
| 1978 | cors = 'withCredentials' in new XHR();
|
|---|
| 1979 | } catch (ignored) {
|
|---|
| 1980 | // intentionally empty
|
|---|
| 1981 | }
|
|---|
| 1982 | AbstractXHRObject.supportsCORS = cors;
|
|---|
| 1983 | module.exports = AbstractXHRObject;
|
|---|
| 1984 |
|
|---|
| 1985 | /***/ }),
|
|---|
| 1986 |
|
|---|
| 1987 | /***/ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js":
|
|---|
| 1988 | /*!*************************************************************************!*\
|
|---|
| 1989 | !*** ./node_modules/sockjs-client/lib/transport/browser/eventsource.js ***!
|
|---|
| 1990 | \*************************************************************************/
|
|---|
| 1991 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 1992 |
|
|---|
| 1993 | module.exports = __webpack_require__.g.EventSource;
|
|---|
| 1994 |
|
|---|
| 1995 | /***/ }),
|
|---|
| 1996 |
|
|---|
| 1997 | /***/ "./node_modules/sockjs-client/lib/transport/browser/websocket.js":
|
|---|
| 1998 | /*!***********************************************************************!*\
|
|---|
| 1999 | !*** ./node_modules/sockjs-client/lib/transport/browser/websocket.js ***!
|
|---|
| 2000 | \***********************************************************************/
|
|---|
| 2001 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2002 |
|
|---|
| 2003 | "use strict";
|
|---|
| 2004 |
|
|---|
| 2005 |
|
|---|
| 2006 | var Driver = __webpack_require__.g.WebSocket || __webpack_require__.g.MozWebSocket;
|
|---|
| 2007 | if (Driver) {
|
|---|
| 2008 | module.exports = function WebSocketBrowserDriver(url) {
|
|---|
| 2009 | return new Driver(url);
|
|---|
| 2010 | };
|
|---|
| 2011 | } else {
|
|---|
| 2012 | module.exports = undefined;
|
|---|
| 2013 | }
|
|---|
| 2014 |
|
|---|
| 2015 | /***/ }),
|
|---|
| 2016 |
|
|---|
| 2017 | /***/ "./node_modules/sockjs-client/lib/transport/eventsource.js":
|
|---|
| 2018 | /*!*****************************************************************!*\
|
|---|
| 2019 | !*** ./node_modules/sockjs-client/lib/transport/eventsource.js ***!
|
|---|
| 2020 | \*****************************************************************/
|
|---|
| 2021 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2022 |
|
|---|
| 2023 | "use strict";
|
|---|
| 2024 |
|
|---|
| 2025 |
|
|---|
| 2026 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2027 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js"),
|
|---|
| 2028 | EventSourceReceiver = __webpack_require__(/*! ./receiver/eventsource */ "./node_modules/sockjs-client/lib/transport/receiver/eventsource.js"),
|
|---|
| 2029 | XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js"),
|
|---|
| 2030 | EventSourceDriver = __webpack_require__(/*! eventsource */ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js");
|
|---|
| 2031 | function EventSourceTransport(transUrl) {
|
|---|
| 2032 | if (!EventSourceTransport.enabled()) {
|
|---|
| 2033 | throw new Error('Transport created when disabled');
|
|---|
| 2034 | }
|
|---|
| 2035 | AjaxBasedTransport.call(this, transUrl, '/eventsource', EventSourceReceiver, XHRCorsObject);
|
|---|
| 2036 | }
|
|---|
| 2037 | inherits(EventSourceTransport, AjaxBasedTransport);
|
|---|
| 2038 | EventSourceTransport.enabled = function () {
|
|---|
| 2039 | return !!EventSourceDriver;
|
|---|
| 2040 | };
|
|---|
| 2041 | EventSourceTransport.transportName = 'eventsource';
|
|---|
| 2042 | EventSourceTransport.roundTrips = 2;
|
|---|
| 2043 | module.exports = EventSourceTransport;
|
|---|
| 2044 |
|
|---|
| 2045 | /***/ }),
|
|---|
| 2046 |
|
|---|
| 2047 | /***/ "./node_modules/sockjs-client/lib/transport/htmlfile.js":
|
|---|
| 2048 | /*!**************************************************************!*\
|
|---|
| 2049 | !*** ./node_modules/sockjs-client/lib/transport/htmlfile.js ***!
|
|---|
| 2050 | \**************************************************************/
|
|---|
| 2051 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2052 |
|
|---|
| 2053 | "use strict";
|
|---|
| 2054 |
|
|---|
| 2055 |
|
|---|
| 2056 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2057 | HtmlfileReceiver = __webpack_require__(/*! ./receiver/htmlfile */ "./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js"),
|
|---|
| 2058 | XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js"),
|
|---|
| 2059 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js");
|
|---|
| 2060 | function HtmlFileTransport(transUrl) {
|
|---|
| 2061 | if (!HtmlfileReceiver.enabled) {
|
|---|
| 2062 | throw new Error('Transport created when disabled');
|
|---|
| 2063 | }
|
|---|
| 2064 | AjaxBasedTransport.call(this, transUrl, '/htmlfile', HtmlfileReceiver, XHRLocalObject);
|
|---|
| 2065 | }
|
|---|
| 2066 | inherits(HtmlFileTransport, AjaxBasedTransport);
|
|---|
| 2067 | HtmlFileTransport.enabled = function (info) {
|
|---|
| 2068 | return HtmlfileReceiver.enabled && info.sameOrigin;
|
|---|
| 2069 | };
|
|---|
| 2070 | HtmlFileTransport.transportName = 'htmlfile';
|
|---|
| 2071 | HtmlFileTransport.roundTrips = 2;
|
|---|
| 2072 | module.exports = HtmlFileTransport;
|
|---|
| 2073 |
|
|---|
| 2074 | /***/ }),
|
|---|
| 2075 |
|
|---|
| 2076 | /***/ "./node_modules/sockjs-client/lib/transport/iframe.js":
|
|---|
| 2077 | /*!************************************************************!*\
|
|---|
| 2078 | !*** ./node_modules/sockjs-client/lib/transport/iframe.js ***!
|
|---|
| 2079 | \************************************************************/
|
|---|
| 2080 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2081 |
|
|---|
| 2082 | "use strict";
|
|---|
| 2083 |
|
|---|
| 2084 |
|
|---|
| 2085 | // Few cool transports do work only for same-origin. In order to make
|
|---|
| 2086 | // them work cross-domain we shall use iframe, served from the
|
|---|
| 2087 | // remote domain. New browsers have capabilities to communicate with
|
|---|
| 2088 | // cross domain iframe using postMessage(). In IE it was implemented
|
|---|
| 2089 | // from IE 8+, but of course, IE got some details wrong:
|
|---|
| 2090 | // http://msdn.microsoft.com/en-us/library/cc197015(v=VS.85).aspx
|
|---|
| 2091 | // http://stevesouders.com/misc/test-postmessage.php
|
|---|
| 2092 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2093 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 2094 | version = __webpack_require__(/*! ../version */ "./node_modules/sockjs-client/lib/version.js"),
|
|---|
| 2095 | urlUtils = __webpack_require__(/*! ../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 2096 | iframeUtils = __webpack_require__(/*! ../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js"),
|
|---|
| 2097 | eventUtils = __webpack_require__(/*! ../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 2098 | random = __webpack_require__(/*! ../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js");
|
|---|
| 2099 | var debug = function debug() {};
|
|---|
| 2100 | if (true) {
|
|---|
| 2101 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:transport:iframe');
|
|---|
| 2102 | }
|
|---|
| 2103 | function IframeTransport(transport, transUrl, baseUrl) {
|
|---|
| 2104 | if (!IframeTransport.enabled()) {
|
|---|
| 2105 | throw new Error('Transport created when disabled');
|
|---|
| 2106 | }
|
|---|
| 2107 | EventEmitter.call(this);
|
|---|
| 2108 | var self = this;
|
|---|
| 2109 | this.origin = urlUtils.getOrigin(baseUrl);
|
|---|
| 2110 | this.baseUrl = baseUrl;
|
|---|
| 2111 | this.transUrl = transUrl;
|
|---|
| 2112 | this.transport = transport;
|
|---|
| 2113 | this.windowId = random.string(8);
|
|---|
| 2114 | var iframeUrl = urlUtils.addPath(baseUrl, '/iframe.html') + '#' + this.windowId;
|
|---|
| 2115 | debug(transport, transUrl, iframeUrl);
|
|---|
| 2116 | this.iframeObj = iframeUtils.createIframe(iframeUrl, function (r) {
|
|---|
| 2117 | debug('err callback');
|
|---|
| 2118 | self.emit('close', 1006, 'Unable to load an iframe (' + r + ')');
|
|---|
| 2119 | self.close();
|
|---|
| 2120 | });
|
|---|
| 2121 | this.onmessageCallback = this._message.bind(this);
|
|---|
| 2122 | eventUtils.attachEvent('message', this.onmessageCallback);
|
|---|
| 2123 | }
|
|---|
| 2124 | inherits(IframeTransport, EventEmitter);
|
|---|
| 2125 | IframeTransport.prototype.close = function () {
|
|---|
| 2126 | debug('close');
|
|---|
| 2127 | this.removeAllListeners();
|
|---|
| 2128 | if (this.iframeObj) {
|
|---|
| 2129 | eventUtils.detachEvent('message', this.onmessageCallback);
|
|---|
| 2130 | try {
|
|---|
| 2131 | // When the iframe is not loaded, IE raises an exception
|
|---|
| 2132 | // on 'contentWindow'.
|
|---|
| 2133 | this.postMessage('c');
|
|---|
| 2134 | } catch (x) {
|
|---|
| 2135 | // intentionally empty
|
|---|
| 2136 | }
|
|---|
| 2137 | this.iframeObj.cleanup();
|
|---|
| 2138 | this.iframeObj = null;
|
|---|
| 2139 | this.onmessageCallback = this.iframeObj = null;
|
|---|
| 2140 | }
|
|---|
| 2141 | };
|
|---|
| 2142 | IframeTransport.prototype._message = function (e) {
|
|---|
| 2143 | debug('message', e.data);
|
|---|
| 2144 | if (!urlUtils.isOriginEqual(e.origin, this.origin)) {
|
|---|
| 2145 | debug('not same origin', e.origin, this.origin);
|
|---|
| 2146 | return;
|
|---|
| 2147 | }
|
|---|
| 2148 | var iframeMessage;
|
|---|
| 2149 | try {
|
|---|
| 2150 | iframeMessage = JSON.parse(e.data);
|
|---|
| 2151 | } catch (ignored) {
|
|---|
| 2152 | debug('bad json', e.data);
|
|---|
| 2153 | return;
|
|---|
| 2154 | }
|
|---|
| 2155 | if (iframeMessage.windowId !== this.windowId) {
|
|---|
| 2156 | debug('mismatched window id', iframeMessage.windowId, this.windowId);
|
|---|
| 2157 | return;
|
|---|
| 2158 | }
|
|---|
| 2159 | switch (iframeMessage.type) {
|
|---|
| 2160 | case 's':
|
|---|
| 2161 | this.iframeObj.loaded();
|
|---|
| 2162 | // window global dependency
|
|---|
| 2163 | this.postMessage('s', JSON.stringify([version, this.transport, this.transUrl, this.baseUrl]));
|
|---|
| 2164 | break;
|
|---|
| 2165 | case 't':
|
|---|
| 2166 | this.emit('message', iframeMessage.data);
|
|---|
| 2167 | break;
|
|---|
| 2168 | case 'c':
|
|---|
| 2169 | var cdata;
|
|---|
| 2170 | try {
|
|---|
| 2171 | cdata = JSON.parse(iframeMessage.data);
|
|---|
| 2172 | } catch (ignored) {
|
|---|
| 2173 | debug('bad json', iframeMessage.data);
|
|---|
| 2174 | return;
|
|---|
| 2175 | }
|
|---|
| 2176 | this.emit('close', cdata[0], cdata[1]);
|
|---|
| 2177 | this.close();
|
|---|
| 2178 | break;
|
|---|
| 2179 | }
|
|---|
| 2180 | };
|
|---|
| 2181 | IframeTransport.prototype.postMessage = function (type, data) {
|
|---|
| 2182 | debug('postMessage', type, data);
|
|---|
| 2183 | this.iframeObj.post(JSON.stringify({
|
|---|
| 2184 | windowId: this.windowId,
|
|---|
| 2185 | type: type,
|
|---|
| 2186 | data: data || ''
|
|---|
| 2187 | }), this.origin);
|
|---|
| 2188 | };
|
|---|
| 2189 | IframeTransport.prototype.send = function (message) {
|
|---|
| 2190 | debug('send', message);
|
|---|
| 2191 | this.postMessage('m', message);
|
|---|
| 2192 | };
|
|---|
| 2193 | IframeTransport.enabled = function () {
|
|---|
| 2194 | return iframeUtils.iframeEnabled;
|
|---|
| 2195 | };
|
|---|
| 2196 | IframeTransport.transportName = 'iframe';
|
|---|
| 2197 | IframeTransport.roundTrips = 2;
|
|---|
| 2198 | module.exports = IframeTransport;
|
|---|
| 2199 |
|
|---|
| 2200 | /***/ }),
|
|---|
| 2201 |
|
|---|
| 2202 | /***/ "./node_modules/sockjs-client/lib/transport/jsonp-polling.js":
|
|---|
| 2203 | /*!*******************************************************************!*\
|
|---|
| 2204 | !*** ./node_modules/sockjs-client/lib/transport/jsonp-polling.js ***!
|
|---|
| 2205 | \*******************************************************************/
|
|---|
| 2206 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2207 |
|
|---|
| 2208 | "use strict";
|
|---|
| 2209 |
|
|---|
| 2210 |
|
|---|
| 2211 | // The simplest and most robust transport, using the well-know cross
|
|---|
| 2212 | // domain hack - JSONP. This transport is quite inefficient - one
|
|---|
| 2213 | // message could use up to one http request. But at least it works almost
|
|---|
| 2214 | // everywhere.
|
|---|
| 2215 | // Known limitations:
|
|---|
| 2216 | // o you will get a spinning cursor
|
|---|
| 2217 | // o for Konqueror a dumb timer is needed to detect errors
|
|---|
| 2218 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2219 | SenderReceiver = __webpack_require__(/*! ./lib/sender-receiver */ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js"),
|
|---|
| 2220 | JsonpReceiver = __webpack_require__(/*! ./receiver/jsonp */ "./node_modules/sockjs-client/lib/transport/receiver/jsonp.js"),
|
|---|
| 2221 | jsonpSender = __webpack_require__(/*! ./sender/jsonp */ "./node_modules/sockjs-client/lib/transport/sender/jsonp.js");
|
|---|
| 2222 | function JsonPTransport(transUrl) {
|
|---|
| 2223 | if (!JsonPTransport.enabled()) {
|
|---|
| 2224 | throw new Error('Transport created when disabled');
|
|---|
| 2225 | }
|
|---|
| 2226 | SenderReceiver.call(this, transUrl, '/jsonp', jsonpSender, JsonpReceiver);
|
|---|
| 2227 | }
|
|---|
| 2228 | inherits(JsonPTransport, SenderReceiver);
|
|---|
| 2229 | JsonPTransport.enabled = function () {
|
|---|
| 2230 | return !!__webpack_require__.g.document;
|
|---|
| 2231 | };
|
|---|
| 2232 | JsonPTransport.transportName = 'jsonp-polling';
|
|---|
| 2233 | JsonPTransport.roundTrips = 1;
|
|---|
| 2234 | JsonPTransport.needBody = true;
|
|---|
| 2235 | module.exports = JsonPTransport;
|
|---|
| 2236 |
|
|---|
| 2237 | /***/ }),
|
|---|
| 2238 |
|
|---|
| 2239 | /***/ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js":
|
|---|
| 2240 | /*!********************************************************************!*\
|
|---|
| 2241 | !*** ./node_modules/sockjs-client/lib/transport/lib/ajax-based.js ***!
|
|---|
| 2242 | \********************************************************************/
|
|---|
| 2243 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2244 |
|
|---|
| 2245 | "use strict";
|
|---|
| 2246 |
|
|---|
| 2247 |
|
|---|
| 2248 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2249 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 2250 | SenderReceiver = __webpack_require__(/*! ./sender-receiver */ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js");
|
|---|
| 2251 | var debug = function debug() {};
|
|---|
| 2252 | if (true) {
|
|---|
| 2253 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:ajax-based');
|
|---|
| 2254 | }
|
|---|
| 2255 | function createAjaxSender(AjaxObject) {
|
|---|
| 2256 | return function (url, payload, callback) {
|
|---|
| 2257 | debug('create ajax sender', url, payload);
|
|---|
| 2258 | var opt = {};
|
|---|
| 2259 | if (typeof payload === 'string') {
|
|---|
| 2260 | opt.headers = {
|
|---|
| 2261 | 'Content-type': 'text/plain'
|
|---|
| 2262 | };
|
|---|
| 2263 | }
|
|---|
| 2264 | var ajaxUrl = urlUtils.addPath(url, '/xhr_send');
|
|---|
| 2265 | var xo = new AjaxObject('POST', ajaxUrl, payload, opt);
|
|---|
| 2266 | xo.once('finish', function (status) {
|
|---|
| 2267 | debug('finish', status);
|
|---|
| 2268 | xo = null;
|
|---|
| 2269 | if (status !== 200 && status !== 204) {
|
|---|
| 2270 | return callback(new Error('http status ' + status));
|
|---|
| 2271 | }
|
|---|
| 2272 | callback();
|
|---|
| 2273 | });
|
|---|
| 2274 | return function () {
|
|---|
| 2275 | debug('abort');
|
|---|
| 2276 | xo.close();
|
|---|
| 2277 | xo = null;
|
|---|
| 2278 | var err = new Error('Aborted');
|
|---|
| 2279 | err.code = 1000;
|
|---|
| 2280 | callback(err);
|
|---|
| 2281 | };
|
|---|
| 2282 | };
|
|---|
| 2283 | }
|
|---|
| 2284 | function AjaxBasedTransport(transUrl, urlSuffix, Receiver, AjaxObject) {
|
|---|
| 2285 | SenderReceiver.call(this, transUrl, urlSuffix, createAjaxSender(AjaxObject), Receiver, AjaxObject);
|
|---|
| 2286 | }
|
|---|
| 2287 | inherits(AjaxBasedTransport, SenderReceiver);
|
|---|
| 2288 | module.exports = AjaxBasedTransport;
|
|---|
| 2289 |
|
|---|
| 2290 | /***/ }),
|
|---|
| 2291 |
|
|---|
| 2292 | /***/ "./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js":
|
|---|
| 2293 | /*!*************************************************************************!*\
|
|---|
| 2294 | !*** ./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js ***!
|
|---|
| 2295 | \*************************************************************************/
|
|---|
| 2296 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2297 |
|
|---|
| 2298 | "use strict";
|
|---|
| 2299 |
|
|---|
| 2300 |
|
|---|
| 2301 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2302 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter);
|
|---|
| 2303 | var debug = function debug() {};
|
|---|
| 2304 | if (true) {
|
|---|
| 2305 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:buffered-sender');
|
|---|
| 2306 | }
|
|---|
| 2307 | function BufferedSender(url, sender) {
|
|---|
| 2308 | debug(url);
|
|---|
| 2309 | EventEmitter.call(this);
|
|---|
| 2310 | this.sendBuffer = [];
|
|---|
| 2311 | this.sender = sender;
|
|---|
| 2312 | this.url = url;
|
|---|
| 2313 | }
|
|---|
| 2314 | inherits(BufferedSender, EventEmitter);
|
|---|
| 2315 | BufferedSender.prototype.send = function (message) {
|
|---|
| 2316 | debug('send', message);
|
|---|
| 2317 | this.sendBuffer.push(message);
|
|---|
| 2318 | if (!this.sendStop) {
|
|---|
| 2319 | this.sendSchedule();
|
|---|
| 2320 | }
|
|---|
| 2321 | };
|
|---|
| 2322 |
|
|---|
| 2323 | // For polling transports in a situation when in the message callback,
|
|---|
| 2324 | // new message is being send. If the sending connection was started
|
|---|
| 2325 | // before receiving one, it is possible to saturate the network and
|
|---|
| 2326 | // timeout due to the lack of receiving socket. To avoid that we delay
|
|---|
| 2327 | // sending messages by some small time, in order to let receiving
|
|---|
| 2328 | // connection be started beforehand. This is only a halfmeasure and
|
|---|
| 2329 | // does not fix the big problem, but it does make the tests go more
|
|---|
| 2330 | // stable on slow networks.
|
|---|
| 2331 | BufferedSender.prototype.sendScheduleWait = function () {
|
|---|
| 2332 | debug('sendScheduleWait');
|
|---|
| 2333 | var self = this;
|
|---|
| 2334 | var tref;
|
|---|
| 2335 | this.sendStop = function () {
|
|---|
| 2336 | debug('sendStop');
|
|---|
| 2337 | self.sendStop = null;
|
|---|
| 2338 | clearTimeout(tref);
|
|---|
| 2339 | };
|
|---|
| 2340 | tref = setTimeout(function () {
|
|---|
| 2341 | debug('timeout');
|
|---|
| 2342 | self.sendStop = null;
|
|---|
| 2343 | self.sendSchedule();
|
|---|
| 2344 | }, 25);
|
|---|
| 2345 | };
|
|---|
| 2346 | BufferedSender.prototype.sendSchedule = function () {
|
|---|
| 2347 | debug('sendSchedule', this.sendBuffer.length);
|
|---|
| 2348 | var self = this;
|
|---|
| 2349 | if (this.sendBuffer.length > 0) {
|
|---|
| 2350 | var payload = '[' + this.sendBuffer.join(',') + ']';
|
|---|
| 2351 | this.sendStop = this.sender(this.url, payload, function (err) {
|
|---|
| 2352 | self.sendStop = null;
|
|---|
| 2353 | if (err) {
|
|---|
| 2354 | debug('error', err);
|
|---|
| 2355 | self.emit('close', err.code || 1006, 'Sending error: ' + err);
|
|---|
| 2356 | self.close();
|
|---|
| 2357 | } else {
|
|---|
| 2358 | self.sendScheduleWait();
|
|---|
| 2359 | }
|
|---|
| 2360 | });
|
|---|
| 2361 | this.sendBuffer = [];
|
|---|
| 2362 | }
|
|---|
| 2363 | };
|
|---|
| 2364 | BufferedSender.prototype._cleanup = function () {
|
|---|
| 2365 | debug('_cleanup');
|
|---|
| 2366 | this.removeAllListeners();
|
|---|
| 2367 | };
|
|---|
| 2368 | BufferedSender.prototype.close = function () {
|
|---|
| 2369 | debug('close');
|
|---|
| 2370 | this._cleanup();
|
|---|
| 2371 | if (this.sendStop) {
|
|---|
| 2372 | this.sendStop();
|
|---|
| 2373 | this.sendStop = null;
|
|---|
| 2374 | }
|
|---|
| 2375 | };
|
|---|
| 2376 | module.exports = BufferedSender;
|
|---|
| 2377 |
|
|---|
| 2378 | /***/ }),
|
|---|
| 2379 |
|
|---|
| 2380 | /***/ "./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js":
|
|---|
| 2381 | /*!*********************************************************************!*\
|
|---|
| 2382 | !*** ./node_modules/sockjs-client/lib/transport/lib/iframe-wrap.js ***!
|
|---|
| 2383 | \*********************************************************************/
|
|---|
| 2384 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2385 |
|
|---|
| 2386 | "use strict";
|
|---|
| 2387 |
|
|---|
| 2388 |
|
|---|
| 2389 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2390 | IframeTransport = __webpack_require__(/*! ../iframe */ "./node_modules/sockjs-client/lib/transport/iframe.js"),
|
|---|
| 2391 | objectUtils = __webpack_require__(/*! ../../utils/object */ "./node_modules/sockjs-client/lib/utils/object.js");
|
|---|
| 2392 | module.exports = function (transport) {
|
|---|
| 2393 | function IframeWrapTransport(transUrl, baseUrl) {
|
|---|
| 2394 | IframeTransport.call(this, transport.transportName, transUrl, baseUrl);
|
|---|
| 2395 | }
|
|---|
| 2396 | inherits(IframeWrapTransport, IframeTransport);
|
|---|
| 2397 | IframeWrapTransport.enabled = function (url, info) {
|
|---|
| 2398 | if (!__webpack_require__.g.document) {
|
|---|
| 2399 | return false;
|
|---|
| 2400 | }
|
|---|
| 2401 | var iframeInfo = objectUtils.extend({}, info);
|
|---|
| 2402 | iframeInfo.sameOrigin = true;
|
|---|
| 2403 | return transport.enabled(iframeInfo) && IframeTransport.enabled();
|
|---|
| 2404 | };
|
|---|
| 2405 | IframeWrapTransport.transportName = 'iframe-' + transport.transportName;
|
|---|
| 2406 | IframeWrapTransport.needBody = true;
|
|---|
| 2407 | IframeWrapTransport.roundTrips = IframeTransport.roundTrips + transport.roundTrips - 1; // html, javascript (2) + transport - no CORS (1)
|
|---|
| 2408 |
|
|---|
| 2409 | IframeWrapTransport.facadeTransport = transport;
|
|---|
| 2410 | return IframeWrapTransport;
|
|---|
| 2411 | };
|
|---|
| 2412 |
|
|---|
| 2413 | /***/ }),
|
|---|
| 2414 |
|
|---|
| 2415 | /***/ "./node_modules/sockjs-client/lib/transport/lib/polling.js":
|
|---|
| 2416 | /*!*****************************************************************!*\
|
|---|
| 2417 | !*** ./node_modules/sockjs-client/lib/transport/lib/polling.js ***!
|
|---|
| 2418 | \*****************************************************************/
|
|---|
| 2419 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2420 |
|
|---|
| 2421 | "use strict";
|
|---|
| 2422 |
|
|---|
| 2423 |
|
|---|
| 2424 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2425 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter);
|
|---|
| 2426 | var debug = function debug() {};
|
|---|
| 2427 | if (true) {
|
|---|
| 2428 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:polling');
|
|---|
| 2429 | }
|
|---|
| 2430 | function Polling(Receiver, receiveUrl, AjaxObject) {
|
|---|
| 2431 | debug(receiveUrl);
|
|---|
| 2432 | EventEmitter.call(this);
|
|---|
| 2433 | this.Receiver = Receiver;
|
|---|
| 2434 | this.receiveUrl = receiveUrl;
|
|---|
| 2435 | this.AjaxObject = AjaxObject;
|
|---|
| 2436 | this._scheduleReceiver();
|
|---|
| 2437 | }
|
|---|
| 2438 | inherits(Polling, EventEmitter);
|
|---|
| 2439 | Polling.prototype._scheduleReceiver = function () {
|
|---|
| 2440 | debug('_scheduleReceiver');
|
|---|
| 2441 | var self = this;
|
|---|
| 2442 | var poll = this.poll = new this.Receiver(this.receiveUrl, this.AjaxObject);
|
|---|
| 2443 | poll.on('message', function (msg) {
|
|---|
| 2444 | debug('message', msg);
|
|---|
| 2445 | self.emit('message', msg);
|
|---|
| 2446 | });
|
|---|
| 2447 | poll.once('close', function (code, reason) {
|
|---|
| 2448 | debug('close', code, reason, self.pollIsClosing);
|
|---|
| 2449 | self.poll = poll = null;
|
|---|
| 2450 | if (!self.pollIsClosing) {
|
|---|
| 2451 | if (reason === 'network') {
|
|---|
| 2452 | self._scheduleReceiver();
|
|---|
| 2453 | } else {
|
|---|
| 2454 | self.emit('close', code || 1006, reason);
|
|---|
| 2455 | self.removeAllListeners();
|
|---|
| 2456 | }
|
|---|
| 2457 | }
|
|---|
| 2458 | });
|
|---|
| 2459 | };
|
|---|
| 2460 | Polling.prototype.abort = function () {
|
|---|
| 2461 | debug('abort');
|
|---|
| 2462 | this.removeAllListeners();
|
|---|
| 2463 | this.pollIsClosing = true;
|
|---|
| 2464 | if (this.poll) {
|
|---|
| 2465 | this.poll.abort();
|
|---|
| 2466 | }
|
|---|
| 2467 | };
|
|---|
| 2468 | module.exports = Polling;
|
|---|
| 2469 |
|
|---|
| 2470 | /***/ }),
|
|---|
| 2471 |
|
|---|
| 2472 | /***/ "./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js":
|
|---|
| 2473 | /*!*************************************************************************!*\
|
|---|
| 2474 | !*** ./node_modules/sockjs-client/lib/transport/lib/sender-receiver.js ***!
|
|---|
| 2475 | \*************************************************************************/
|
|---|
| 2476 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2477 |
|
|---|
| 2478 | "use strict";
|
|---|
| 2479 |
|
|---|
| 2480 |
|
|---|
| 2481 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2482 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 2483 | BufferedSender = __webpack_require__(/*! ./buffered-sender */ "./node_modules/sockjs-client/lib/transport/lib/buffered-sender.js"),
|
|---|
| 2484 | Polling = __webpack_require__(/*! ./polling */ "./node_modules/sockjs-client/lib/transport/lib/polling.js");
|
|---|
| 2485 | var debug = function debug() {};
|
|---|
| 2486 | if (true) {
|
|---|
| 2487 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender-receiver');
|
|---|
| 2488 | }
|
|---|
| 2489 | function SenderReceiver(transUrl, urlSuffix, senderFunc, Receiver, AjaxObject) {
|
|---|
| 2490 | var pollUrl = urlUtils.addPath(transUrl, urlSuffix);
|
|---|
| 2491 | debug(pollUrl);
|
|---|
| 2492 | var self = this;
|
|---|
| 2493 | BufferedSender.call(this, transUrl, senderFunc);
|
|---|
| 2494 | this.poll = new Polling(Receiver, pollUrl, AjaxObject);
|
|---|
| 2495 | this.poll.on('message', function (msg) {
|
|---|
| 2496 | debug('poll message', msg);
|
|---|
| 2497 | self.emit('message', msg);
|
|---|
| 2498 | });
|
|---|
| 2499 | this.poll.once('close', function (code, reason) {
|
|---|
| 2500 | debug('poll close', code, reason);
|
|---|
| 2501 | self.poll = null;
|
|---|
| 2502 | self.emit('close', code, reason);
|
|---|
| 2503 | self.close();
|
|---|
| 2504 | });
|
|---|
| 2505 | }
|
|---|
| 2506 | inherits(SenderReceiver, BufferedSender);
|
|---|
| 2507 | SenderReceiver.prototype.close = function () {
|
|---|
| 2508 | BufferedSender.prototype.close.call(this);
|
|---|
| 2509 | debug('close');
|
|---|
| 2510 | this.removeAllListeners();
|
|---|
| 2511 | if (this.poll) {
|
|---|
| 2512 | this.poll.abort();
|
|---|
| 2513 | this.poll = null;
|
|---|
| 2514 | }
|
|---|
| 2515 | };
|
|---|
| 2516 | module.exports = SenderReceiver;
|
|---|
| 2517 |
|
|---|
| 2518 | /***/ }),
|
|---|
| 2519 |
|
|---|
| 2520 | /***/ "./node_modules/sockjs-client/lib/transport/receiver/eventsource.js":
|
|---|
| 2521 | /*!**************************************************************************!*\
|
|---|
| 2522 | !*** ./node_modules/sockjs-client/lib/transport/receiver/eventsource.js ***!
|
|---|
| 2523 | \**************************************************************************/
|
|---|
| 2524 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2525 |
|
|---|
| 2526 | "use strict";
|
|---|
| 2527 |
|
|---|
| 2528 |
|
|---|
| 2529 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2530 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 2531 | EventSourceDriver = __webpack_require__(/*! eventsource */ "./node_modules/sockjs-client/lib/transport/browser/eventsource.js");
|
|---|
| 2532 | var debug = function debug() {};
|
|---|
| 2533 | if (true) {
|
|---|
| 2534 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:eventsource');
|
|---|
| 2535 | }
|
|---|
| 2536 | function EventSourceReceiver(url) {
|
|---|
| 2537 | debug(url);
|
|---|
| 2538 | EventEmitter.call(this);
|
|---|
| 2539 | var self = this;
|
|---|
| 2540 | var es = this.es = new EventSourceDriver(url);
|
|---|
| 2541 | es.onmessage = function (e) {
|
|---|
| 2542 | debug('message', e.data);
|
|---|
| 2543 | self.emit('message', decodeURI(e.data));
|
|---|
| 2544 | };
|
|---|
| 2545 | es.onerror = function (e) {
|
|---|
| 2546 | debug('error', es.readyState, e);
|
|---|
| 2547 | // ES on reconnection has readyState = 0 or 1.
|
|---|
| 2548 | // on network error it's CLOSED = 2
|
|---|
| 2549 | var reason = es.readyState !== 2 ? 'network' : 'permanent';
|
|---|
| 2550 | self._cleanup();
|
|---|
| 2551 | self._close(reason);
|
|---|
| 2552 | };
|
|---|
| 2553 | }
|
|---|
| 2554 | inherits(EventSourceReceiver, EventEmitter);
|
|---|
| 2555 | EventSourceReceiver.prototype.abort = function () {
|
|---|
| 2556 | debug('abort');
|
|---|
| 2557 | this._cleanup();
|
|---|
| 2558 | this._close('user');
|
|---|
| 2559 | };
|
|---|
| 2560 | EventSourceReceiver.prototype._cleanup = function () {
|
|---|
| 2561 | debug('cleanup');
|
|---|
| 2562 | var es = this.es;
|
|---|
| 2563 | if (es) {
|
|---|
| 2564 | es.onmessage = es.onerror = null;
|
|---|
| 2565 | es.close();
|
|---|
| 2566 | this.es = null;
|
|---|
| 2567 | }
|
|---|
| 2568 | };
|
|---|
| 2569 | EventSourceReceiver.prototype._close = function (reason) {
|
|---|
| 2570 | debug('close', reason);
|
|---|
| 2571 | var self = this;
|
|---|
| 2572 | // Safari and chrome < 15 crash if we close window before
|
|---|
| 2573 | // waiting for ES cleanup. See:
|
|---|
| 2574 | // https://code.google.com/p/chromium/issues/detail?id=89155
|
|---|
| 2575 | setTimeout(function () {
|
|---|
| 2576 | self.emit('close', null, reason);
|
|---|
| 2577 | self.removeAllListeners();
|
|---|
| 2578 | }, 200);
|
|---|
| 2579 | };
|
|---|
| 2580 | module.exports = EventSourceReceiver;
|
|---|
| 2581 |
|
|---|
| 2582 | /***/ }),
|
|---|
| 2583 |
|
|---|
| 2584 | /***/ "./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js":
|
|---|
| 2585 | /*!***********************************************************************!*\
|
|---|
| 2586 | !*** ./node_modules/sockjs-client/lib/transport/receiver/htmlfile.js ***!
|
|---|
| 2587 | \***********************************************************************/
|
|---|
| 2588 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2589 |
|
|---|
| 2590 | "use strict";
|
|---|
| 2591 |
|
|---|
| 2592 |
|
|---|
| 2593 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2594 | iframeUtils = __webpack_require__(/*! ../../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js"),
|
|---|
| 2595 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 2596 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 2597 | random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js");
|
|---|
| 2598 | var debug = function debug() {};
|
|---|
| 2599 | if (true) {
|
|---|
| 2600 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:htmlfile');
|
|---|
| 2601 | }
|
|---|
| 2602 | function HtmlfileReceiver(url) {
|
|---|
| 2603 | debug(url);
|
|---|
| 2604 | EventEmitter.call(this);
|
|---|
| 2605 | var self = this;
|
|---|
| 2606 | iframeUtils.polluteGlobalNamespace();
|
|---|
| 2607 | this.id = 'a' + random.string(6);
|
|---|
| 2608 | url = urlUtils.addQuery(url, 'c=' + decodeURIComponent(iframeUtils.WPrefix + '.' + this.id));
|
|---|
| 2609 | debug('using htmlfile', HtmlfileReceiver.htmlfileEnabled);
|
|---|
| 2610 | var constructFunc = HtmlfileReceiver.htmlfileEnabled ? iframeUtils.createHtmlfile : iframeUtils.createIframe;
|
|---|
| 2611 | __webpack_require__.g[iframeUtils.WPrefix][this.id] = {
|
|---|
| 2612 | start: function start() {
|
|---|
| 2613 | debug('start');
|
|---|
| 2614 | self.iframeObj.loaded();
|
|---|
| 2615 | },
|
|---|
| 2616 | message: function message(data) {
|
|---|
| 2617 | debug('message', data);
|
|---|
| 2618 | self.emit('message', data);
|
|---|
| 2619 | },
|
|---|
| 2620 | stop: function stop() {
|
|---|
| 2621 | debug('stop');
|
|---|
| 2622 | self._cleanup();
|
|---|
| 2623 | self._close('network');
|
|---|
| 2624 | }
|
|---|
| 2625 | };
|
|---|
| 2626 | this.iframeObj = constructFunc(url, function () {
|
|---|
| 2627 | debug('callback');
|
|---|
| 2628 | self._cleanup();
|
|---|
| 2629 | self._close('permanent');
|
|---|
| 2630 | });
|
|---|
| 2631 | }
|
|---|
| 2632 | inherits(HtmlfileReceiver, EventEmitter);
|
|---|
| 2633 | HtmlfileReceiver.prototype.abort = function () {
|
|---|
| 2634 | debug('abort');
|
|---|
| 2635 | this._cleanup();
|
|---|
| 2636 | this._close('user');
|
|---|
| 2637 | };
|
|---|
| 2638 | HtmlfileReceiver.prototype._cleanup = function () {
|
|---|
| 2639 | debug('_cleanup');
|
|---|
| 2640 | if (this.iframeObj) {
|
|---|
| 2641 | this.iframeObj.cleanup();
|
|---|
| 2642 | this.iframeObj = null;
|
|---|
| 2643 | }
|
|---|
| 2644 | delete __webpack_require__.g[iframeUtils.WPrefix][this.id];
|
|---|
| 2645 | };
|
|---|
| 2646 | HtmlfileReceiver.prototype._close = function (reason) {
|
|---|
| 2647 | debug('_close', reason);
|
|---|
| 2648 | this.emit('close', null, reason);
|
|---|
| 2649 | this.removeAllListeners();
|
|---|
| 2650 | };
|
|---|
| 2651 | HtmlfileReceiver.htmlfileEnabled = false;
|
|---|
| 2652 |
|
|---|
| 2653 | // obfuscate to avoid firewalls
|
|---|
| 2654 | var axo = ['Active'].concat('Object').join('X');
|
|---|
| 2655 | if (axo in __webpack_require__.g) {
|
|---|
| 2656 | try {
|
|---|
| 2657 | HtmlfileReceiver.htmlfileEnabled = !!new __webpack_require__.g[axo]('htmlfile');
|
|---|
| 2658 | } catch (x) {
|
|---|
| 2659 | // intentionally empty
|
|---|
| 2660 | }
|
|---|
| 2661 | }
|
|---|
| 2662 | HtmlfileReceiver.enabled = HtmlfileReceiver.htmlfileEnabled || iframeUtils.iframeEnabled;
|
|---|
| 2663 | module.exports = HtmlfileReceiver;
|
|---|
| 2664 |
|
|---|
| 2665 | /***/ }),
|
|---|
| 2666 |
|
|---|
| 2667 | /***/ "./node_modules/sockjs-client/lib/transport/receiver/jsonp.js":
|
|---|
| 2668 | /*!********************************************************************!*\
|
|---|
| 2669 | !*** ./node_modules/sockjs-client/lib/transport/receiver/jsonp.js ***!
|
|---|
| 2670 | \********************************************************************/
|
|---|
| 2671 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2672 |
|
|---|
| 2673 | "use strict";
|
|---|
| 2674 |
|
|---|
| 2675 |
|
|---|
| 2676 | var utils = __webpack_require__(/*! ../../utils/iframe */ "./node_modules/sockjs-client/lib/utils/iframe.js"),
|
|---|
| 2677 | random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js"),
|
|---|
| 2678 | browser = __webpack_require__(/*! ../../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js"),
|
|---|
| 2679 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 2680 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2681 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter);
|
|---|
| 2682 | var debug = function debug() {};
|
|---|
| 2683 | if (true) {
|
|---|
| 2684 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:jsonp');
|
|---|
| 2685 | }
|
|---|
| 2686 | function JsonpReceiver(url) {
|
|---|
| 2687 | debug(url);
|
|---|
| 2688 | var self = this;
|
|---|
| 2689 | EventEmitter.call(this);
|
|---|
| 2690 | utils.polluteGlobalNamespace();
|
|---|
| 2691 | this.id = 'a' + random.string(6);
|
|---|
| 2692 | var urlWithId = urlUtils.addQuery(url, 'c=' + encodeURIComponent(utils.WPrefix + '.' + this.id));
|
|---|
| 2693 | __webpack_require__.g[utils.WPrefix][this.id] = this._callback.bind(this);
|
|---|
| 2694 | this._createScript(urlWithId);
|
|---|
| 2695 |
|
|---|
| 2696 | // Fallback mostly for Konqueror - stupid timer, 35 seconds shall be plenty.
|
|---|
| 2697 | this.timeoutId = setTimeout(function () {
|
|---|
| 2698 | debug('timeout');
|
|---|
| 2699 | self._abort(new Error('JSONP script loaded abnormally (timeout)'));
|
|---|
| 2700 | }, JsonpReceiver.timeout);
|
|---|
| 2701 | }
|
|---|
| 2702 | inherits(JsonpReceiver, EventEmitter);
|
|---|
| 2703 | JsonpReceiver.prototype.abort = function () {
|
|---|
| 2704 | debug('abort');
|
|---|
| 2705 | if (__webpack_require__.g[utils.WPrefix][this.id]) {
|
|---|
| 2706 | var err = new Error('JSONP user aborted read');
|
|---|
| 2707 | err.code = 1000;
|
|---|
| 2708 | this._abort(err);
|
|---|
| 2709 | }
|
|---|
| 2710 | };
|
|---|
| 2711 | JsonpReceiver.timeout = 35000;
|
|---|
| 2712 | JsonpReceiver.scriptErrorTimeout = 1000;
|
|---|
| 2713 | JsonpReceiver.prototype._callback = function (data) {
|
|---|
| 2714 | debug('_callback', data);
|
|---|
| 2715 | this._cleanup();
|
|---|
| 2716 | if (this.aborting) {
|
|---|
| 2717 | return;
|
|---|
| 2718 | }
|
|---|
| 2719 | if (data) {
|
|---|
| 2720 | debug('message', data);
|
|---|
| 2721 | this.emit('message', data);
|
|---|
| 2722 | }
|
|---|
| 2723 | this.emit('close', null, 'network');
|
|---|
| 2724 | this.removeAllListeners();
|
|---|
| 2725 | };
|
|---|
| 2726 | JsonpReceiver.prototype._abort = function (err) {
|
|---|
| 2727 | debug('_abort', err);
|
|---|
| 2728 | this._cleanup();
|
|---|
| 2729 | this.aborting = true;
|
|---|
| 2730 | this.emit('close', err.code, err.message);
|
|---|
| 2731 | this.removeAllListeners();
|
|---|
| 2732 | };
|
|---|
| 2733 | JsonpReceiver.prototype._cleanup = function () {
|
|---|
| 2734 | debug('_cleanup');
|
|---|
| 2735 | clearTimeout(this.timeoutId);
|
|---|
| 2736 | if (this.script2) {
|
|---|
| 2737 | this.script2.parentNode.removeChild(this.script2);
|
|---|
| 2738 | this.script2 = null;
|
|---|
| 2739 | }
|
|---|
| 2740 | if (this.script) {
|
|---|
| 2741 | var script = this.script;
|
|---|
| 2742 | // Unfortunately, you can't really abort script loading of
|
|---|
| 2743 | // the script.
|
|---|
| 2744 | script.parentNode.removeChild(script);
|
|---|
| 2745 | script.onreadystatechange = script.onerror = script.onload = script.onclick = null;
|
|---|
| 2746 | this.script = null;
|
|---|
| 2747 | }
|
|---|
| 2748 | delete __webpack_require__.g[utils.WPrefix][this.id];
|
|---|
| 2749 | };
|
|---|
| 2750 | JsonpReceiver.prototype._scriptError = function () {
|
|---|
| 2751 | debug('_scriptError');
|
|---|
| 2752 | var self = this;
|
|---|
| 2753 | if (this.errorTimer) {
|
|---|
| 2754 | return;
|
|---|
| 2755 | }
|
|---|
| 2756 | this.errorTimer = setTimeout(function () {
|
|---|
| 2757 | if (!self.loadedOkay) {
|
|---|
| 2758 | self._abort(new Error('JSONP script loaded abnormally (onerror)'));
|
|---|
| 2759 | }
|
|---|
| 2760 | }, JsonpReceiver.scriptErrorTimeout);
|
|---|
| 2761 | };
|
|---|
| 2762 | JsonpReceiver.prototype._createScript = function (url) {
|
|---|
| 2763 | debug('_createScript', url);
|
|---|
| 2764 | var self = this;
|
|---|
| 2765 | var script = this.script = __webpack_require__.g.document.createElement('script');
|
|---|
| 2766 | var script2; // Opera synchronous load trick.
|
|---|
| 2767 |
|
|---|
| 2768 | script.id = 'a' + random.string(8);
|
|---|
| 2769 | script.src = url;
|
|---|
| 2770 | script.type = 'text/javascript';
|
|---|
| 2771 | script.charset = 'UTF-8';
|
|---|
| 2772 | script.onerror = this._scriptError.bind(this);
|
|---|
| 2773 | script.onload = function () {
|
|---|
| 2774 | debug('onload');
|
|---|
| 2775 | self._abort(new Error('JSONP script loaded abnormally (onload)'));
|
|---|
| 2776 | };
|
|---|
| 2777 |
|
|---|
| 2778 | // IE9 fires 'error' event after onreadystatechange or before, in random order.
|
|---|
| 2779 | // Use loadedOkay to determine if actually errored
|
|---|
| 2780 | script.onreadystatechange = function () {
|
|---|
| 2781 | debug('onreadystatechange', script.readyState);
|
|---|
| 2782 | if (/loaded|closed/.test(script.readyState)) {
|
|---|
| 2783 | if (script && script.htmlFor && script.onclick) {
|
|---|
| 2784 | self.loadedOkay = true;
|
|---|
| 2785 | try {
|
|---|
| 2786 | // In IE, actually execute the script.
|
|---|
| 2787 | script.onclick();
|
|---|
| 2788 | } catch (x) {
|
|---|
| 2789 | // intentionally empty
|
|---|
| 2790 | }
|
|---|
| 2791 | }
|
|---|
| 2792 | if (script) {
|
|---|
| 2793 | self._abort(new Error('JSONP script loaded abnormally (onreadystatechange)'));
|
|---|
| 2794 | }
|
|---|
| 2795 | }
|
|---|
| 2796 | };
|
|---|
| 2797 | // IE: event/htmlFor/onclick trick.
|
|---|
| 2798 | // One can't rely on proper order for onreadystatechange. In order to
|
|---|
| 2799 | // make sure, set a 'htmlFor' and 'event' properties, so that
|
|---|
| 2800 | // script code will be installed as 'onclick' handler for the
|
|---|
| 2801 | // script object. Later, onreadystatechange, manually execute this
|
|---|
| 2802 | // code. FF and Chrome doesn't work with 'event' and 'htmlFor'
|
|---|
| 2803 | // set. For reference see:
|
|---|
| 2804 | // http://jaubourg.net/2010/07/loading-script-as-onclick-handler-of.html
|
|---|
| 2805 | // Also, read on that about script ordering:
|
|---|
| 2806 | // http://wiki.whatwg.org/wiki/Dynamic_Script_Execution_Order
|
|---|
| 2807 | if (typeof script.async === 'undefined' && __webpack_require__.g.document.attachEvent) {
|
|---|
| 2808 | // According to mozilla docs, in recent browsers script.async defaults
|
|---|
| 2809 | // to 'true', so we may use it to detect a good browser:
|
|---|
| 2810 | // https://developer.mozilla.org/en/HTML/Element/script
|
|---|
| 2811 | if (!browser.isOpera()) {
|
|---|
| 2812 | // Naively assume we're in IE
|
|---|
| 2813 | try {
|
|---|
| 2814 | script.htmlFor = script.id;
|
|---|
| 2815 | script.event = 'onclick';
|
|---|
| 2816 | } catch (x) {
|
|---|
| 2817 | // intentionally empty
|
|---|
| 2818 | }
|
|---|
| 2819 | script.async = true;
|
|---|
| 2820 | } else {
|
|---|
| 2821 | // Opera, second sync script hack
|
|---|
| 2822 | script2 = this.script2 = __webpack_require__.g.document.createElement('script');
|
|---|
| 2823 | script2.text = "try{var a = document.getElementById('" + script.id + "'); if(a)a.onerror();}catch(x){};";
|
|---|
| 2824 | script.async = script2.async = false;
|
|---|
| 2825 | }
|
|---|
| 2826 | }
|
|---|
| 2827 | if (typeof script.async !== 'undefined') {
|
|---|
| 2828 | script.async = true;
|
|---|
| 2829 | }
|
|---|
| 2830 | var head = __webpack_require__.g.document.getElementsByTagName('head')[0];
|
|---|
| 2831 | head.insertBefore(script, head.firstChild);
|
|---|
| 2832 | if (script2) {
|
|---|
| 2833 | head.insertBefore(script2, head.firstChild);
|
|---|
| 2834 | }
|
|---|
| 2835 | };
|
|---|
| 2836 | module.exports = JsonpReceiver;
|
|---|
| 2837 |
|
|---|
| 2838 | /***/ }),
|
|---|
| 2839 |
|
|---|
| 2840 | /***/ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js":
|
|---|
| 2841 | /*!******************************************************************!*\
|
|---|
| 2842 | !*** ./node_modules/sockjs-client/lib/transport/receiver/xhr.js ***!
|
|---|
| 2843 | \******************************************************************/
|
|---|
| 2844 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2845 |
|
|---|
| 2846 | "use strict";
|
|---|
| 2847 |
|
|---|
| 2848 |
|
|---|
| 2849 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 2850 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter);
|
|---|
| 2851 | var debug = function debug() {};
|
|---|
| 2852 | if (true) {
|
|---|
| 2853 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:receiver:xhr');
|
|---|
| 2854 | }
|
|---|
| 2855 | function XhrReceiver(url, AjaxObject) {
|
|---|
| 2856 | debug(url);
|
|---|
| 2857 | EventEmitter.call(this);
|
|---|
| 2858 | var self = this;
|
|---|
| 2859 | this.bufferPosition = 0;
|
|---|
| 2860 | this.xo = new AjaxObject('POST', url, null);
|
|---|
| 2861 | this.xo.on('chunk', this._chunkHandler.bind(this));
|
|---|
| 2862 | this.xo.once('finish', function (status, text) {
|
|---|
| 2863 | debug('finish', status, text);
|
|---|
| 2864 | self._chunkHandler(status, text);
|
|---|
| 2865 | self.xo = null;
|
|---|
| 2866 | var reason = status === 200 ? 'network' : 'permanent';
|
|---|
| 2867 | debug('close', reason);
|
|---|
| 2868 | self.emit('close', null, reason);
|
|---|
| 2869 | self._cleanup();
|
|---|
| 2870 | });
|
|---|
| 2871 | }
|
|---|
| 2872 | inherits(XhrReceiver, EventEmitter);
|
|---|
| 2873 | XhrReceiver.prototype._chunkHandler = function (status, text) {
|
|---|
| 2874 | debug('_chunkHandler', status);
|
|---|
| 2875 | if (status !== 200 || !text) {
|
|---|
| 2876 | return;
|
|---|
| 2877 | }
|
|---|
| 2878 | for (var idx = -1;; this.bufferPosition += idx + 1) {
|
|---|
| 2879 | var buf = text.slice(this.bufferPosition);
|
|---|
| 2880 | idx = buf.indexOf('\n');
|
|---|
| 2881 | if (idx === -1) {
|
|---|
| 2882 | break;
|
|---|
| 2883 | }
|
|---|
| 2884 | var msg = buf.slice(0, idx);
|
|---|
| 2885 | if (msg) {
|
|---|
| 2886 | debug('message', msg);
|
|---|
| 2887 | this.emit('message', msg);
|
|---|
| 2888 | }
|
|---|
| 2889 | }
|
|---|
| 2890 | };
|
|---|
| 2891 | XhrReceiver.prototype._cleanup = function () {
|
|---|
| 2892 | debug('_cleanup');
|
|---|
| 2893 | this.removeAllListeners();
|
|---|
| 2894 | };
|
|---|
| 2895 | XhrReceiver.prototype.abort = function () {
|
|---|
| 2896 | debug('abort');
|
|---|
| 2897 | if (this.xo) {
|
|---|
| 2898 | this.xo.close();
|
|---|
| 2899 | debug('close');
|
|---|
| 2900 | this.emit('close', null, 'user');
|
|---|
| 2901 | this.xo = null;
|
|---|
| 2902 | }
|
|---|
| 2903 | this._cleanup();
|
|---|
| 2904 | };
|
|---|
| 2905 | module.exports = XhrReceiver;
|
|---|
| 2906 |
|
|---|
| 2907 | /***/ }),
|
|---|
| 2908 |
|
|---|
| 2909 | /***/ "./node_modules/sockjs-client/lib/transport/sender/jsonp.js":
|
|---|
| 2910 | /*!******************************************************************!*\
|
|---|
| 2911 | !*** ./node_modules/sockjs-client/lib/transport/sender/jsonp.js ***!
|
|---|
| 2912 | \******************************************************************/
|
|---|
| 2913 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 2914 |
|
|---|
| 2915 | "use strict";
|
|---|
| 2916 |
|
|---|
| 2917 |
|
|---|
| 2918 | var random = __webpack_require__(/*! ../../utils/random */ "./node_modules/sockjs-client/lib/utils/random.js"),
|
|---|
| 2919 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js");
|
|---|
| 2920 | var debug = function debug() {};
|
|---|
| 2921 | if (true) {
|
|---|
| 2922 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender:jsonp');
|
|---|
| 2923 | }
|
|---|
| 2924 | var form, area;
|
|---|
| 2925 | function createIframe(id) {
|
|---|
| 2926 | debug('createIframe', id);
|
|---|
| 2927 | try {
|
|---|
| 2928 | // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
|
|---|
| 2929 | return __webpack_require__.g.document.createElement('<iframe name="' + id + '">');
|
|---|
| 2930 | } catch (x) {
|
|---|
| 2931 | var iframe = __webpack_require__.g.document.createElement('iframe');
|
|---|
| 2932 | iframe.name = id;
|
|---|
| 2933 | return iframe;
|
|---|
| 2934 | }
|
|---|
| 2935 | }
|
|---|
| 2936 | function createForm() {
|
|---|
| 2937 | debug('createForm');
|
|---|
| 2938 | form = __webpack_require__.g.document.createElement('form');
|
|---|
| 2939 | form.style.display = 'none';
|
|---|
| 2940 | form.style.position = 'absolute';
|
|---|
| 2941 | form.method = 'POST';
|
|---|
| 2942 | form.enctype = 'application/x-www-form-urlencoded';
|
|---|
| 2943 | form.acceptCharset = 'UTF-8';
|
|---|
| 2944 | area = __webpack_require__.g.document.createElement('textarea');
|
|---|
| 2945 | area.name = 'd';
|
|---|
| 2946 | form.appendChild(area);
|
|---|
| 2947 | __webpack_require__.g.document.body.appendChild(form);
|
|---|
| 2948 | }
|
|---|
| 2949 | module.exports = function (url, payload, callback) {
|
|---|
| 2950 | debug(url, payload);
|
|---|
| 2951 | if (!form) {
|
|---|
| 2952 | createForm();
|
|---|
| 2953 | }
|
|---|
| 2954 | var id = 'a' + random.string(8);
|
|---|
| 2955 | form.target = id;
|
|---|
| 2956 | form.action = urlUtils.addQuery(urlUtils.addPath(url, '/jsonp_send'), 'i=' + id);
|
|---|
| 2957 | var iframe = createIframe(id);
|
|---|
| 2958 | iframe.id = id;
|
|---|
| 2959 | iframe.style.display = 'none';
|
|---|
| 2960 | form.appendChild(iframe);
|
|---|
| 2961 | try {
|
|---|
| 2962 | area.value = payload;
|
|---|
| 2963 | } catch (e) {
|
|---|
| 2964 | // seriously broken browsers get here
|
|---|
| 2965 | }
|
|---|
| 2966 | form.submit();
|
|---|
| 2967 | var completed = function completed(err) {
|
|---|
| 2968 | debug('completed', id, err);
|
|---|
| 2969 | if (!iframe.onerror) {
|
|---|
| 2970 | return;
|
|---|
| 2971 | }
|
|---|
| 2972 | iframe.onreadystatechange = iframe.onerror = iframe.onload = null;
|
|---|
| 2973 | // Opera mini doesn't like if we GC iframe
|
|---|
| 2974 | // immediately, thus this timeout.
|
|---|
| 2975 | setTimeout(function () {
|
|---|
| 2976 | debug('cleaning up', id);
|
|---|
| 2977 | iframe.parentNode.removeChild(iframe);
|
|---|
| 2978 | iframe = null;
|
|---|
| 2979 | }, 500);
|
|---|
| 2980 | area.value = '';
|
|---|
| 2981 | // It is not possible to detect if the iframe succeeded or
|
|---|
| 2982 | // failed to submit our form.
|
|---|
| 2983 | callback(err);
|
|---|
| 2984 | };
|
|---|
| 2985 | iframe.onerror = function () {
|
|---|
| 2986 | debug('onerror', id);
|
|---|
| 2987 | completed();
|
|---|
| 2988 | };
|
|---|
| 2989 | iframe.onload = function () {
|
|---|
| 2990 | debug('onload', id);
|
|---|
| 2991 | completed();
|
|---|
| 2992 | };
|
|---|
| 2993 | iframe.onreadystatechange = function (e) {
|
|---|
| 2994 | debug('onreadystatechange', id, iframe.readyState, e);
|
|---|
| 2995 | if (iframe.readyState === 'complete') {
|
|---|
| 2996 | completed();
|
|---|
| 2997 | }
|
|---|
| 2998 | };
|
|---|
| 2999 | return function () {
|
|---|
| 3000 | debug('aborted', id);
|
|---|
| 3001 | completed(new Error('Aborted'));
|
|---|
| 3002 | };
|
|---|
| 3003 | };
|
|---|
| 3004 |
|
|---|
| 3005 | /***/ }),
|
|---|
| 3006 |
|
|---|
| 3007 | /***/ "./node_modules/sockjs-client/lib/transport/sender/xdr.js":
|
|---|
| 3008 | /*!****************************************************************!*\
|
|---|
| 3009 | !*** ./node_modules/sockjs-client/lib/transport/sender/xdr.js ***!
|
|---|
| 3010 | \****************************************************************/
|
|---|
| 3011 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3012 |
|
|---|
| 3013 | "use strict";
|
|---|
| 3014 |
|
|---|
| 3015 |
|
|---|
| 3016 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 3017 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3018 | eventUtils = __webpack_require__(/*! ../../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 3019 | browser = __webpack_require__(/*! ../../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js"),
|
|---|
| 3020 | urlUtils = __webpack_require__(/*! ../../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js");
|
|---|
| 3021 | var debug = function debug() {};
|
|---|
| 3022 | if (true) {
|
|---|
| 3023 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:sender:xdr');
|
|---|
| 3024 | }
|
|---|
| 3025 |
|
|---|
| 3026 | // References:
|
|---|
| 3027 | // http://ajaxian.com/archives/100-line-ajax-wrapper
|
|---|
| 3028 | // http://msdn.microsoft.com/en-us/library/cc288060(v=VS.85).aspx
|
|---|
| 3029 |
|
|---|
| 3030 | function XDRObject(method, url, payload) {
|
|---|
| 3031 | debug(method, url);
|
|---|
| 3032 | var self = this;
|
|---|
| 3033 | EventEmitter.call(this);
|
|---|
| 3034 | setTimeout(function () {
|
|---|
| 3035 | self._start(method, url, payload);
|
|---|
| 3036 | }, 0);
|
|---|
| 3037 | }
|
|---|
| 3038 | inherits(XDRObject, EventEmitter);
|
|---|
| 3039 | XDRObject.prototype._start = function (method, url, payload) {
|
|---|
| 3040 | debug('_start');
|
|---|
| 3041 | var self = this;
|
|---|
| 3042 | var xdr = new __webpack_require__.g.XDomainRequest();
|
|---|
| 3043 | // IE caches even POSTs
|
|---|
| 3044 | url = urlUtils.addQuery(url, 't=' + +new Date());
|
|---|
| 3045 | xdr.onerror = function () {
|
|---|
| 3046 | debug('onerror');
|
|---|
| 3047 | self._error();
|
|---|
| 3048 | };
|
|---|
| 3049 | xdr.ontimeout = function () {
|
|---|
| 3050 | debug('ontimeout');
|
|---|
| 3051 | self._error();
|
|---|
| 3052 | };
|
|---|
| 3053 | xdr.onprogress = function () {
|
|---|
| 3054 | debug('progress', xdr.responseText);
|
|---|
| 3055 | self.emit('chunk', 200, xdr.responseText);
|
|---|
| 3056 | };
|
|---|
| 3057 | xdr.onload = function () {
|
|---|
| 3058 | debug('load');
|
|---|
| 3059 | self.emit('finish', 200, xdr.responseText);
|
|---|
| 3060 | self._cleanup(false);
|
|---|
| 3061 | };
|
|---|
| 3062 | this.xdr = xdr;
|
|---|
| 3063 | this.unloadRef = eventUtils.unloadAdd(function () {
|
|---|
| 3064 | self._cleanup(true);
|
|---|
| 3065 | });
|
|---|
| 3066 | try {
|
|---|
| 3067 | // Fails with AccessDenied if port number is bogus
|
|---|
| 3068 | this.xdr.open(method, url);
|
|---|
| 3069 | if (this.timeout) {
|
|---|
| 3070 | this.xdr.timeout = this.timeout;
|
|---|
| 3071 | }
|
|---|
| 3072 | this.xdr.send(payload);
|
|---|
| 3073 | } catch (x) {
|
|---|
| 3074 | this._error();
|
|---|
| 3075 | }
|
|---|
| 3076 | };
|
|---|
| 3077 | XDRObject.prototype._error = function () {
|
|---|
| 3078 | this.emit('finish', 0, '');
|
|---|
| 3079 | this._cleanup(false);
|
|---|
| 3080 | };
|
|---|
| 3081 | XDRObject.prototype._cleanup = function (abort) {
|
|---|
| 3082 | debug('cleanup', abort);
|
|---|
| 3083 | if (!this.xdr) {
|
|---|
| 3084 | return;
|
|---|
| 3085 | }
|
|---|
| 3086 | this.removeAllListeners();
|
|---|
| 3087 | eventUtils.unloadDel(this.unloadRef);
|
|---|
| 3088 | this.xdr.ontimeout = this.xdr.onerror = this.xdr.onprogress = this.xdr.onload = null;
|
|---|
| 3089 | if (abort) {
|
|---|
| 3090 | try {
|
|---|
| 3091 | this.xdr.abort();
|
|---|
| 3092 | } catch (x) {
|
|---|
| 3093 | // intentionally empty
|
|---|
| 3094 | }
|
|---|
| 3095 | }
|
|---|
| 3096 | this.unloadRef = this.xdr = null;
|
|---|
| 3097 | };
|
|---|
| 3098 | XDRObject.prototype.close = function () {
|
|---|
| 3099 | debug('close');
|
|---|
| 3100 | this._cleanup(true);
|
|---|
| 3101 | };
|
|---|
| 3102 |
|
|---|
| 3103 | // IE 8/9 if the request target uses the same scheme - #79
|
|---|
| 3104 | XDRObject.enabled = !!(__webpack_require__.g.XDomainRequest && browser.hasDomain());
|
|---|
| 3105 | module.exports = XDRObject;
|
|---|
| 3106 |
|
|---|
| 3107 | /***/ }),
|
|---|
| 3108 |
|
|---|
| 3109 | /***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js":
|
|---|
| 3110 | /*!*********************************************************************!*\
|
|---|
| 3111 | !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js ***!
|
|---|
| 3112 | \*********************************************************************/
|
|---|
| 3113 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3114 |
|
|---|
| 3115 | "use strict";
|
|---|
| 3116 |
|
|---|
| 3117 |
|
|---|
| 3118 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3119 | XhrDriver = __webpack_require__(/*! ../driver/xhr */ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js");
|
|---|
| 3120 | function XHRCorsObject(method, url, payload, opts) {
|
|---|
| 3121 | XhrDriver.call(this, method, url, payload, opts);
|
|---|
| 3122 | }
|
|---|
| 3123 | inherits(XHRCorsObject, XhrDriver);
|
|---|
| 3124 | XHRCorsObject.enabled = XhrDriver.enabled && XhrDriver.supportsCORS;
|
|---|
| 3125 | module.exports = XHRCorsObject;
|
|---|
| 3126 |
|
|---|
| 3127 | /***/ }),
|
|---|
| 3128 |
|
|---|
| 3129 | /***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js":
|
|---|
| 3130 | /*!*********************************************************************!*\
|
|---|
| 3131 | !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-fake.js ***!
|
|---|
| 3132 | \*********************************************************************/
|
|---|
| 3133 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3134 |
|
|---|
| 3135 | "use strict";
|
|---|
| 3136 |
|
|---|
| 3137 |
|
|---|
| 3138 | var EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 3139 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js");
|
|---|
| 3140 | function XHRFake( /* method, url, payload, opts */
|
|---|
| 3141 | ) {
|
|---|
| 3142 | var self = this;
|
|---|
| 3143 | EventEmitter.call(this);
|
|---|
| 3144 | this.to = setTimeout(function () {
|
|---|
| 3145 | self.emit('finish', 200, '{}');
|
|---|
| 3146 | }, XHRFake.timeout);
|
|---|
| 3147 | }
|
|---|
| 3148 | inherits(XHRFake, EventEmitter);
|
|---|
| 3149 | XHRFake.prototype.close = function () {
|
|---|
| 3150 | clearTimeout(this.to);
|
|---|
| 3151 | };
|
|---|
| 3152 | XHRFake.timeout = 2000;
|
|---|
| 3153 | module.exports = XHRFake;
|
|---|
| 3154 |
|
|---|
| 3155 | /***/ }),
|
|---|
| 3156 |
|
|---|
| 3157 | /***/ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js":
|
|---|
| 3158 | /*!**********************************************************************!*\
|
|---|
| 3159 | !*** ./node_modules/sockjs-client/lib/transport/sender/xhr-local.js ***!
|
|---|
| 3160 | \**********************************************************************/
|
|---|
| 3161 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3162 |
|
|---|
| 3163 | "use strict";
|
|---|
| 3164 |
|
|---|
| 3165 |
|
|---|
| 3166 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3167 | XhrDriver = __webpack_require__(/*! ../driver/xhr */ "./node_modules/sockjs-client/lib/transport/browser/abstract-xhr.js");
|
|---|
| 3168 | function XHRLocalObject(method, url, payload /*, opts */) {
|
|---|
| 3169 | XhrDriver.call(this, method, url, payload, {
|
|---|
| 3170 | noCredentials: true
|
|---|
| 3171 | });
|
|---|
| 3172 | }
|
|---|
| 3173 | inherits(XHRLocalObject, XhrDriver);
|
|---|
| 3174 | XHRLocalObject.enabled = XhrDriver.enabled;
|
|---|
| 3175 | module.exports = XHRLocalObject;
|
|---|
| 3176 |
|
|---|
| 3177 | /***/ }),
|
|---|
| 3178 |
|
|---|
| 3179 | /***/ "./node_modules/sockjs-client/lib/transport/websocket.js":
|
|---|
| 3180 | /*!***************************************************************!*\
|
|---|
| 3181 | !*** ./node_modules/sockjs-client/lib/transport/websocket.js ***!
|
|---|
| 3182 | \***************************************************************/
|
|---|
| 3183 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3184 |
|
|---|
| 3185 | "use strict";
|
|---|
| 3186 |
|
|---|
| 3187 |
|
|---|
| 3188 | var utils = __webpack_require__(/*! ../utils/event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 3189 | urlUtils = __webpack_require__(/*! ../utils/url */ "./node_modules/sockjs-client/lib/utils/url.js"),
|
|---|
| 3190 | inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3191 | EventEmitter = (__webpack_require__(/*! events */ "./node_modules/sockjs-client/lib/event/emitter.js").EventEmitter),
|
|---|
| 3192 | WebsocketDriver = __webpack_require__(/*! ./driver/websocket */ "./node_modules/sockjs-client/lib/transport/browser/websocket.js");
|
|---|
| 3193 | var debug = function debug() {};
|
|---|
| 3194 | if (true) {
|
|---|
| 3195 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:websocket');
|
|---|
| 3196 | }
|
|---|
| 3197 | function WebSocketTransport(transUrl, ignore, options) {
|
|---|
| 3198 | if (!WebSocketTransport.enabled()) {
|
|---|
| 3199 | throw new Error('Transport created when disabled');
|
|---|
| 3200 | }
|
|---|
| 3201 | EventEmitter.call(this);
|
|---|
| 3202 | debug('constructor', transUrl);
|
|---|
| 3203 | var self = this;
|
|---|
| 3204 | var url = urlUtils.addPath(transUrl, '/websocket');
|
|---|
| 3205 | if (url.slice(0, 5) === 'https') {
|
|---|
| 3206 | url = 'wss' + url.slice(5);
|
|---|
| 3207 | } else {
|
|---|
| 3208 | url = 'ws' + url.slice(4);
|
|---|
| 3209 | }
|
|---|
| 3210 | this.url = url;
|
|---|
| 3211 | this.ws = new WebsocketDriver(this.url, [], options);
|
|---|
| 3212 | this.ws.onmessage = function (e) {
|
|---|
| 3213 | debug('message event', e.data);
|
|---|
| 3214 | self.emit('message', e.data);
|
|---|
| 3215 | };
|
|---|
| 3216 | // Firefox has an interesting bug. If a websocket connection is
|
|---|
| 3217 | // created after onunload, it stays alive even when user
|
|---|
| 3218 | // navigates away from the page. In such situation let's lie -
|
|---|
| 3219 | // let's not open the ws connection at all. See:
|
|---|
| 3220 | // https://github.com/sockjs/sockjs-client/issues/28
|
|---|
| 3221 | // https://bugzilla.mozilla.org/show_bug.cgi?id=696085
|
|---|
| 3222 | this.unloadRef = utils.unloadAdd(function () {
|
|---|
| 3223 | debug('unload');
|
|---|
| 3224 | self.ws.close();
|
|---|
| 3225 | });
|
|---|
| 3226 | this.ws.onclose = function (e) {
|
|---|
| 3227 | debug('close event', e.code, e.reason);
|
|---|
| 3228 | self.emit('close', e.code, e.reason);
|
|---|
| 3229 | self._cleanup();
|
|---|
| 3230 | };
|
|---|
| 3231 | this.ws.onerror = function (e) {
|
|---|
| 3232 | debug('error event', e);
|
|---|
| 3233 | self.emit('close', 1006, 'WebSocket connection broken');
|
|---|
| 3234 | self._cleanup();
|
|---|
| 3235 | };
|
|---|
| 3236 | }
|
|---|
| 3237 | inherits(WebSocketTransport, EventEmitter);
|
|---|
| 3238 | WebSocketTransport.prototype.send = function (data) {
|
|---|
| 3239 | var msg = '[' + data + ']';
|
|---|
| 3240 | debug('send', msg);
|
|---|
| 3241 | this.ws.send(msg);
|
|---|
| 3242 | };
|
|---|
| 3243 | WebSocketTransport.prototype.close = function () {
|
|---|
| 3244 | debug('close');
|
|---|
| 3245 | var ws = this.ws;
|
|---|
| 3246 | this._cleanup();
|
|---|
| 3247 | if (ws) {
|
|---|
| 3248 | ws.close();
|
|---|
| 3249 | }
|
|---|
| 3250 | };
|
|---|
| 3251 | WebSocketTransport.prototype._cleanup = function () {
|
|---|
| 3252 | debug('_cleanup');
|
|---|
| 3253 | var ws = this.ws;
|
|---|
| 3254 | if (ws) {
|
|---|
| 3255 | ws.onmessage = ws.onclose = ws.onerror = null;
|
|---|
| 3256 | }
|
|---|
| 3257 | utils.unloadDel(this.unloadRef);
|
|---|
| 3258 | this.unloadRef = this.ws = null;
|
|---|
| 3259 | this.removeAllListeners();
|
|---|
| 3260 | };
|
|---|
| 3261 | WebSocketTransport.enabled = function () {
|
|---|
| 3262 | debug('enabled');
|
|---|
| 3263 | return !!WebsocketDriver;
|
|---|
| 3264 | };
|
|---|
| 3265 | WebSocketTransport.transportName = 'websocket';
|
|---|
| 3266 |
|
|---|
| 3267 | // In theory, ws should require 1 round trip. But in chrome, this is
|
|---|
| 3268 | // not very stable over SSL. Most likely a ws connection requires a
|
|---|
| 3269 | // separate SSL connection, in which case 2 round trips are an
|
|---|
| 3270 | // absolute minumum.
|
|---|
| 3271 | WebSocketTransport.roundTrips = 2;
|
|---|
| 3272 | module.exports = WebSocketTransport;
|
|---|
| 3273 |
|
|---|
| 3274 | /***/ }),
|
|---|
| 3275 |
|
|---|
| 3276 | /***/ "./node_modules/sockjs-client/lib/transport/xdr-polling.js":
|
|---|
| 3277 | /*!*****************************************************************!*\
|
|---|
| 3278 | !*** ./node_modules/sockjs-client/lib/transport/xdr-polling.js ***!
|
|---|
| 3279 | \*****************************************************************/
|
|---|
| 3280 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3281 |
|
|---|
| 3282 | "use strict";
|
|---|
| 3283 |
|
|---|
| 3284 |
|
|---|
| 3285 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3286 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js"),
|
|---|
| 3287 | XdrStreamingTransport = __webpack_require__(/*! ./xdr-streaming */ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js"),
|
|---|
| 3288 | XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js"),
|
|---|
| 3289 | XDRObject = __webpack_require__(/*! ./sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js");
|
|---|
| 3290 | function XdrPollingTransport(transUrl) {
|
|---|
| 3291 | if (!XDRObject.enabled) {
|
|---|
| 3292 | throw new Error('Transport created when disabled');
|
|---|
| 3293 | }
|
|---|
| 3294 | AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XDRObject);
|
|---|
| 3295 | }
|
|---|
| 3296 | inherits(XdrPollingTransport, AjaxBasedTransport);
|
|---|
| 3297 | XdrPollingTransport.enabled = XdrStreamingTransport.enabled;
|
|---|
| 3298 | XdrPollingTransport.transportName = 'xdr-polling';
|
|---|
| 3299 | XdrPollingTransport.roundTrips = 2; // preflight, ajax
|
|---|
| 3300 |
|
|---|
| 3301 | module.exports = XdrPollingTransport;
|
|---|
| 3302 |
|
|---|
| 3303 | /***/ }),
|
|---|
| 3304 |
|
|---|
| 3305 | /***/ "./node_modules/sockjs-client/lib/transport/xdr-streaming.js":
|
|---|
| 3306 | /*!*******************************************************************!*\
|
|---|
| 3307 | !*** ./node_modules/sockjs-client/lib/transport/xdr-streaming.js ***!
|
|---|
| 3308 | \*******************************************************************/
|
|---|
| 3309 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3310 |
|
|---|
| 3311 | "use strict";
|
|---|
| 3312 |
|
|---|
| 3313 |
|
|---|
| 3314 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3315 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js"),
|
|---|
| 3316 | XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js"),
|
|---|
| 3317 | XDRObject = __webpack_require__(/*! ./sender/xdr */ "./node_modules/sockjs-client/lib/transport/sender/xdr.js");
|
|---|
| 3318 |
|
|---|
| 3319 | // According to:
|
|---|
| 3320 | // http://stackoverflow.com/questions/1641507/detect-browser-support-for-cross-domain-xmlhttprequests
|
|---|
| 3321 | // http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors/
|
|---|
| 3322 |
|
|---|
| 3323 | function XdrStreamingTransport(transUrl) {
|
|---|
| 3324 | if (!XDRObject.enabled) {
|
|---|
| 3325 | throw new Error('Transport created when disabled');
|
|---|
| 3326 | }
|
|---|
| 3327 | AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XDRObject);
|
|---|
| 3328 | }
|
|---|
| 3329 | inherits(XdrStreamingTransport, AjaxBasedTransport);
|
|---|
| 3330 | XdrStreamingTransport.enabled = function (info) {
|
|---|
| 3331 | if (info.cookie_needed || info.nullOrigin) {
|
|---|
| 3332 | return false;
|
|---|
| 3333 | }
|
|---|
| 3334 | return XDRObject.enabled && info.sameScheme;
|
|---|
| 3335 | };
|
|---|
| 3336 | XdrStreamingTransport.transportName = 'xdr-streaming';
|
|---|
| 3337 | XdrStreamingTransport.roundTrips = 2; // preflight, ajax
|
|---|
| 3338 |
|
|---|
| 3339 | module.exports = XdrStreamingTransport;
|
|---|
| 3340 |
|
|---|
| 3341 | /***/ }),
|
|---|
| 3342 |
|
|---|
| 3343 | /***/ "./node_modules/sockjs-client/lib/transport/xhr-polling.js":
|
|---|
| 3344 | /*!*****************************************************************!*\
|
|---|
| 3345 | !*** ./node_modules/sockjs-client/lib/transport/xhr-polling.js ***!
|
|---|
| 3346 | \*****************************************************************/
|
|---|
| 3347 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3348 |
|
|---|
| 3349 | "use strict";
|
|---|
| 3350 |
|
|---|
| 3351 |
|
|---|
| 3352 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3353 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js"),
|
|---|
| 3354 | XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js"),
|
|---|
| 3355 | XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js"),
|
|---|
| 3356 | XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js");
|
|---|
| 3357 | function XhrPollingTransport(transUrl) {
|
|---|
| 3358 | if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
|
|---|
| 3359 | throw new Error('Transport created when disabled');
|
|---|
| 3360 | }
|
|---|
| 3361 | AjaxBasedTransport.call(this, transUrl, '/xhr', XhrReceiver, XHRCorsObject);
|
|---|
| 3362 | }
|
|---|
| 3363 | inherits(XhrPollingTransport, AjaxBasedTransport);
|
|---|
| 3364 | XhrPollingTransport.enabled = function (info) {
|
|---|
| 3365 | if (info.nullOrigin) {
|
|---|
| 3366 | return false;
|
|---|
| 3367 | }
|
|---|
| 3368 | if (XHRLocalObject.enabled && info.sameOrigin) {
|
|---|
| 3369 | return true;
|
|---|
| 3370 | }
|
|---|
| 3371 | return XHRCorsObject.enabled;
|
|---|
| 3372 | };
|
|---|
| 3373 | XhrPollingTransport.transportName = 'xhr-polling';
|
|---|
| 3374 | XhrPollingTransport.roundTrips = 2; // preflight, ajax
|
|---|
| 3375 |
|
|---|
| 3376 | module.exports = XhrPollingTransport;
|
|---|
| 3377 |
|
|---|
| 3378 | /***/ }),
|
|---|
| 3379 |
|
|---|
| 3380 | /***/ "./node_modules/sockjs-client/lib/transport/xhr-streaming.js":
|
|---|
| 3381 | /*!*******************************************************************!*\
|
|---|
| 3382 | !*** ./node_modules/sockjs-client/lib/transport/xhr-streaming.js ***!
|
|---|
| 3383 | \*******************************************************************/
|
|---|
| 3384 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3385 |
|
|---|
| 3386 | "use strict";
|
|---|
| 3387 |
|
|---|
| 3388 |
|
|---|
| 3389 | var inherits = __webpack_require__(/*! inherits */ "./node_modules/inherits/inherits_browser.js"),
|
|---|
| 3390 | AjaxBasedTransport = __webpack_require__(/*! ./lib/ajax-based */ "./node_modules/sockjs-client/lib/transport/lib/ajax-based.js"),
|
|---|
| 3391 | XhrReceiver = __webpack_require__(/*! ./receiver/xhr */ "./node_modules/sockjs-client/lib/transport/receiver/xhr.js"),
|
|---|
| 3392 | XHRCorsObject = __webpack_require__(/*! ./sender/xhr-cors */ "./node_modules/sockjs-client/lib/transport/sender/xhr-cors.js"),
|
|---|
| 3393 | XHRLocalObject = __webpack_require__(/*! ./sender/xhr-local */ "./node_modules/sockjs-client/lib/transport/sender/xhr-local.js"),
|
|---|
| 3394 | browser = __webpack_require__(/*! ../utils/browser */ "./node_modules/sockjs-client/lib/utils/browser.js");
|
|---|
| 3395 | function XhrStreamingTransport(transUrl) {
|
|---|
| 3396 | if (!XHRLocalObject.enabled && !XHRCorsObject.enabled) {
|
|---|
| 3397 | throw new Error('Transport created when disabled');
|
|---|
| 3398 | }
|
|---|
| 3399 | AjaxBasedTransport.call(this, transUrl, '/xhr_streaming', XhrReceiver, XHRCorsObject);
|
|---|
| 3400 | }
|
|---|
| 3401 | inherits(XhrStreamingTransport, AjaxBasedTransport);
|
|---|
| 3402 | XhrStreamingTransport.enabled = function (info) {
|
|---|
| 3403 | if (info.nullOrigin) {
|
|---|
| 3404 | return false;
|
|---|
| 3405 | }
|
|---|
| 3406 | // Opera doesn't support xhr-streaming #60
|
|---|
| 3407 | // But it might be able to #92
|
|---|
| 3408 | if (browser.isOpera()) {
|
|---|
| 3409 | return false;
|
|---|
| 3410 | }
|
|---|
| 3411 | return XHRCorsObject.enabled;
|
|---|
| 3412 | };
|
|---|
| 3413 | XhrStreamingTransport.transportName = 'xhr-streaming';
|
|---|
| 3414 | XhrStreamingTransport.roundTrips = 2; // preflight, ajax
|
|---|
| 3415 |
|
|---|
| 3416 | // Safari gets confused when a streaming ajax request is started
|
|---|
| 3417 | // before onload. This causes the load indicator to spin indefinetely.
|
|---|
| 3418 | // Only require body when used in a browser
|
|---|
| 3419 | XhrStreamingTransport.needBody = !!__webpack_require__.g.document;
|
|---|
| 3420 | module.exports = XhrStreamingTransport;
|
|---|
| 3421 |
|
|---|
| 3422 | /***/ }),
|
|---|
| 3423 |
|
|---|
| 3424 | /***/ "./node_modules/sockjs-client/lib/utils/browser-crypto.js":
|
|---|
| 3425 | /*!****************************************************************!*\
|
|---|
| 3426 | !*** ./node_modules/sockjs-client/lib/utils/browser-crypto.js ***!
|
|---|
| 3427 | \****************************************************************/
|
|---|
| 3428 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3429 |
|
|---|
| 3430 | "use strict";
|
|---|
| 3431 |
|
|---|
| 3432 |
|
|---|
| 3433 | if (__webpack_require__.g.crypto && __webpack_require__.g.crypto.getRandomValues) {
|
|---|
| 3434 | module.exports.randomBytes = function (length) {
|
|---|
| 3435 | var bytes = new Uint8Array(length);
|
|---|
| 3436 | __webpack_require__.g.crypto.getRandomValues(bytes);
|
|---|
| 3437 | return bytes;
|
|---|
| 3438 | };
|
|---|
| 3439 | } else {
|
|---|
| 3440 | module.exports.randomBytes = function (length) {
|
|---|
| 3441 | var bytes = new Array(length);
|
|---|
| 3442 | for (var i = 0; i < length; i++) {
|
|---|
| 3443 | bytes[i] = Math.floor(Math.random() * 256);
|
|---|
| 3444 | }
|
|---|
| 3445 | return bytes;
|
|---|
| 3446 | };
|
|---|
| 3447 | }
|
|---|
| 3448 |
|
|---|
| 3449 | /***/ }),
|
|---|
| 3450 |
|
|---|
| 3451 | /***/ "./node_modules/sockjs-client/lib/utils/browser.js":
|
|---|
| 3452 | /*!*********************************************************!*\
|
|---|
| 3453 | !*** ./node_modules/sockjs-client/lib/utils/browser.js ***!
|
|---|
| 3454 | \*********************************************************/
|
|---|
| 3455 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3456 |
|
|---|
| 3457 | "use strict";
|
|---|
| 3458 |
|
|---|
| 3459 |
|
|---|
| 3460 | module.exports = {
|
|---|
| 3461 | isOpera: function isOpera() {
|
|---|
| 3462 | return __webpack_require__.g.navigator && /opera/i.test(__webpack_require__.g.navigator.userAgent);
|
|---|
| 3463 | },
|
|---|
| 3464 | isKonqueror: function isKonqueror() {
|
|---|
| 3465 | return __webpack_require__.g.navigator && /konqueror/i.test(__webpack_require__.g.navigator.userAgent);
|
|---|
| 3466 | }
|
|---|
| 3467 |
|
|---|
| 3468 | // #187 wrap document.domain in try/catch because of WP8 from file:///
|
|---|
| 3469 | ,
|
|---|
| 3470 | hasDomain: function hasDomain() {
|
|---|
| 3471 | // non-browser client always has a domain
|
|---|
| 3472 | if (!__webpack_require__.g.document) {
|
|---|
| 3473 | return true;
|
|---|
| 3474 | }
|
|---|
| 3475 | try {
|
|---|
| 3476 | return !!__webpack_require__.g.document.domain;
|
|---|
| 3477 | } catch (e) {
|
|---|
| 3478 | return false;
|
|---|
| 3479 | }
|
|---|
| 3480 | }
|
|---|
| 3481 | };
|
|---|
| 3482 |
|
|---|
| 3483 | /***/ }),
|
|---|
| 3484 |
|
|---|
| 3485 | /***/ "./node_modules/sockjs-client/lib/utils/escape.js":
|
|---|
| 3486 | /*!********************************************************!*\
|
|---|
| 3487 | !*** ./node_modules/sockjs-client/lib/utils/escape.js ***!
|
|---|
| 3488 | \********************************************************/
|
|---|
| 3489 | /***/ (function(module) {
|
|---|
| 3490 |
|
|---|
| 3491 | "use strict";
|
|---|
| 3492 |
|
|---|
| 3493 |
|
|---|
| 3494 | // Some extra characters that Chrome gets wrong, and substitutes with
|
|---|
| 3495 | // something else on the wire.
|
|---|
| 3496 | // eslint-disable-next-line no-control-regex, no-misleading-character-class
|
|---|
| 3497 | var extraEscapable = /[\x00-\x1f\ud800-\udfff\ufffe\uffff\u0300-\u0333\u033d-\u0346\u034a-\u034c\u0350-\u0352\u0357-\u0358\u035c-\u0362\u0374\u037e\u0387\u0591-\u05af\u05c4\u0610-\u0617\u0653-\u0654\u0657-\u065b\u065d-\u065e\u06df-\u06e2\u06eb-\u06ec\u0730\u0732-\u0733\u0735-\u0736\u073a\u073d\u073f-\u0741\u0743\u0745\u0747\u07eb-\u07f1\u0951\u0958-\u095f\u09dc-\u09dd\u09df\u0a33\u0a36\u0a59-\u0a5b\u0a5e\u0b5c-\u0b5d\u0e38-\u0e39\u0f43\u0f4d\u0f52\u0f57\u0f5c\u0f69\u0f72-\u0f76\u0f78\u0f80-\u0f83\u0f93\u0f9d\u0fa2\u0fa7\u0fac\u0fb9\u1939-\u193a\u1a17\u1b6b\u1cda-\u1cdb\u1dc0-\u1dcf\u1dfc\u1dfe\u1f71\u1f73\u1f75\u1f77\u1f79\u1f7b\u1f7d\u1fbb\u1fbe\u1fc9\u1fcb\u1fd3\u1fdb\u1fe3\u1feb\u1fee-\u1fef\u1ff9\u1ffb\u1ffd\u2000-\u2001\u20d0-\u20d1\u20d4-\u20d7\u20e7-\u20e9\u2126\u212a-\u212b\u2329-\u232a\u2adc\u302b-\u302c\uaab2-\uaab3\uf900-\ufa0d\ufa10\ufa12\ufa15-\ufa1e\ufa20\ufa22\ufa25-\ufa26\ufa2a-\ufa2d\ufa30-\ufa6d\ufa70-\ufad9\ufb1d\ufb1f\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufb4e\ufff0-\uffff]/g,
|
|---|
| 3498 | extraLookup;
|
|---|
| 3499 |
|
|---|
| 3500 | // This may be quite slow, so let's delay until user actually uses bad
|
|---|
| 3501 | // characters.
|
|---|
| 3502 | var unrollLookup = function unrollLookup(escapable) {
|
|---|
| 3503 | var i;
|
|---|
| 3504 | var unrolled = {};
|
|---|
| 3505 | var c = [];
|
|---|
| 3506 | for (i = 0; i < 65536; i++) {
|
|---|
| 3507 | c.push(String.fromCharCode(i));
|
|---|
| 3508 | }
|
|---|
| 3509 | escapable.lastIndex = 0;
|
|---|
| 3510 | c.join('').replace(escapable, function (a) {
|
|---|
| 3511 | unrolled[a] = "\\u" + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
|
|---|
| 3512 | return '';
|
|---|
| 3513 | });
|
|---|
| 3514 | escapable.lastIndex = 0;
|
|---|
| 3515 | return unrolled;
|
|---|
| 3516 | };
|
|---|
| 3517 |
|
|---|
| 3518 | // Quote string, also taking care of unicode characters that browsers
|
|---|
| 3519 | // often break. Especially, take care of unicode surrogates:
|
|---|
| 3520 | // http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates
|
|---|
| 3521 | module.exports = {
|
|---|
| 3522 | quote: function quote(string) {
|
|---|
| 3523 | var quoted = JSON.stringify(string);
|
|---|
| 3524 |
|
|---|
| 3525 | // In most cases this should be very fast and good enough.
|
|---|
| 3526 | extraEscapable.lastIndex = 0;
|
|---|
| 3527 | if (!extraEscapable.test(quoted)) {
|
|---|
| 3528 | return quoted;
|
|---|
| 3529 | }
|
|---|
| 3530 | if (!extraLookup) {
|
|---|
| 3531 | extraLookup = unrollLookup(extraEscapable);
|
|---|
| 3532 | }
|
|---|
| 3533 | return quoted.replace(extraEscapable, function (a) {
|
|---|
| 3534 | return extraLookup[a];
|
|---|
| 3535 | });
|
|---|
| 3536 | }
|
|---|
| 3537 | };
|
|---|
| 3538 |
|
|---|
| 3539 | /***/ }),
|
|---|
| 3540 |
|
|---|
| 3541 | /***/ "./node_modules/sockjs-client/lib/utils/event.js":
|
|---|
| 3542 | /*!*******************************************************!*\
|
|---|
| 3543 | !*** ./node_modules/sockjs-client/lib/utils/event.js ***!
|
|---|
| 3544 | \*******************************************************/
|
|---|
| 3545 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3546 |
|
|---|
| 3547 | "use strict";
|
|---|
| 3548 |
|
|---|
| 3549 |
|
|---|
| 3550 | var random = __webpack_require__(/*! ./random */ "./node_modules/sockjs-client/lib/utils/random.js");
|
|---|
| 3551 | var onUnload = {},
|
|---|
| 3552 | afterUnload = false
|
|---|
| 3553 | // detect google chrome packaged apps because they don't allow the 'unload' event
|
|---|
| 3554 | ,
|
|---|
| 3555 | isChromePackagedApp = __webpack_require__.g.chrome && __webpack_require__.g.chrome.app && __webpack_require__.g.chrome.app.runtime;
|
|---|
| 3556 | module.exports = {
|
|---|
| 3557 | attachEvent: function attachEvent(event, listener) {
|
|---|
| 3558 | if (typeof __webpack_require__.g.addEventListener !== 'undefined') {
|
|---|
| 3559 | __webpack_require__.g.addEventListener(event, listener, false);
|
|---|
| 3560 | } else if (__webpack_require__.g.document && __webpack_require__.g.attachEvent) {
|
|---|
| 3561 | // IE quirks.
|
|---|
| 3562 | // According to: http://stevesouders.com/misc/test-postmessage.php
|
|---|
| 3563 | // the message gets delivered only to 'document', not 'window'.
|
|---|
| 3564 | __webpack_require__.g.document.attachEvent('on' + event, listener);
|
|---|
| 3565 | // I get 'window' for ie8.
|
|---|
| 3566 | __webpack_require__.g.attachEvent('on' + event, listener);
|
|---|
| 3567 | }
|
|---|
| 3568 | },
|
|---|
| 3569 | detachEvent: function detachEvent(event, listener) {
|
|---|
| 3570 | if (typeof __webpack_require__.g.addEventListener !== 'undefined') {
|
|---|
| 3571 | __webpack_require__.g.removeEventListener(event, listener, false);
|
|---|
| 3572 | } else if (__webpack_require__.g.document && __webpack_require__.g.detachEvent) {
|
|---|
| 3573 | __webpack_require__.g.document.detachEvent('on' + event, listener);
|
|---|
| 3574 | __webpack_require__.g.detachEvent('on' + event, listener);
|
|---|
| 3575 | }
|
|---|
| 3576 | },
|
|---|
| 3577 | unloadAdd: function unloadAdd(listener) {
|
|---|
| 3578 | if (isChromePackagedApp) {
|
|---|
| 3579 | return null;
|
|---|
| 3580 | }
|
|---|
| 3581 | var ref = random.string(8);
|
|---|
| 3582 | onUnload[ref] = listener;
|
|---|
| 3583 | if (afterUnload) {
|
|---|
| 3584 | setTimeout(this.triggerUnloadCallbacks, 0);
|
|---|
| 3585 | }
|
|---|
| 3586 | return ref;
|
|---|
| 3587 | },
|
|---|
| 3588 | unloadDel: function unloadDel(ref) {
|
|---|
| 3589 | if (ref in onUnload) {
|
|---|
| 3590 | delete onUnload[ref];
|
|---|
| 3591 | }
|
|---|
| 3592 | },
|
|---|
| 3593 | triggerUnloadCallbacks: function triggerUnloadCallbacks() {
|
|---|
| 3594 | for (var ref in onUnload) {
|
|---|
| 3595 | onUnload[ref]();
|
|---|
| 3596 | delete onUnload[ref];
|
|---|
| 3597 | }
|
|---|
| 3598 | }
|
|---|
| 3599 | };
|
|---|
| 3600 | var unloadTriggered = function unloadTriggered() {
|
|---|
| 3601 | if (afterUnload) {
|
|---|
| 3602 | return;
|
|---|
| 3603 | }
|
|---|
| 3604 | afterUnload = true;
|
|---|
| 3605 | module.exports.triggerUnloadCallbacks();
|
|---|
| 3606 | };
|
|---|
| 3607 |
|
|---|
| 3608 | // 'unload' alone is not reliable in opera within an iframe, but we
|
|---|
| 3609 | // can't use `beforeunload` as IE fires it on javascript: links.
|
|---|
| 3610 | if (!isChromePackagedApp) {
|
|---|
| 3611 | module.exports.attachEvent('unload', unloadTriggered);
|
|---|
| 3612 | }
|
|---|
| 3613 |
|
|---|
| 3614 | /***/ }),
|
|---|
| 3615 |
|
|---|
| 3616 | /***/ "./node_modules/sockjs-client/lib/utils/iframe.js":
|
|---|
| 3617 | /*!********************************************************!*\
|
|---|
| 3618 | !*** ./node_modules/sockjs-client/lib/utils/iframe.js ***!
|
|---|
| 3619 | \********************************************************/
|
|---|
| 3620 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3621 |
|
|---|
| 3622 | "use strict";
|
|---|
| 3623 |
|
|---|
| 3624 |
|
|---|
| 3625 | var eventUtils = __webpack_require__(/*! ./event */ "./node_modules/sockjs-client/lib/utils/event.js"),
|
|---|
| 3626 | browser = __webpack_require__(/*! ./browser */ "./node_modules/sockjs-client/lib/utils/browser.js");
|
|---|
| 3627 | var debug = function debug() {};
|
|---|
| 3628 | if (true) {
|
|---|
| 3629 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:iframe');
|
|---|
| 3630 | }
|
|---|
| 3631 | module.exports = {
|
|---|
| 3632 | WPrefix: '_jp',
|
|---|
| 3633 | currentWindowId: null,
|
|---|
| 3634 | polluteGlobalNamespace: function polluteGlobalNamespace() {
|
|---|
| 3635 | if (!(module.exports.WPrefix in __webpack_require__.g)) {
|
|---|
| 3636 | __webpack_require__.g[module.exports.WPrefix] = {};
|
|---|
| 3637 | }
|
|---|
| 3638 | },
|
|---|
| 3639 | postMessage: function postMessage(type, data) {
|
|---|
| 3640 | if (__webpack_require__.g.parent !== __webpack_require__.g) {
|
|---|
| 3641 | __webpack_require__.g.parent.postMessage(JSON.stringify({
|
|---|
| 3642 | windowId: module.exports.currentWindowId,
|
|---|
| 3643 | type: type,
|
|---|
| 3644 | data: data || ''
|
|---|
| 3645 | }), '*');
|
|---|
| 3646 | } else {
|
|---|
| 3647 | debug('Cannot postMessage, no parent window.', type, data);
|
|---|
| 3648 | }
|
|---|
| 3649 | },
|
|---|
| 3650 | createIframe: function createIframe(iframeUrl, errorCallback) {
|
|---|
| 3651 | var iframe = __webpack_require__.g.document.createElement('iframe');
|
|---|
| 3652 | var tref, unloadRef;
|
|---|
| 3653 | var unattach = function unattach() {
|
|---|
| 3654 | debug('unattach');
|
|---|
| 3655 | clearTimeout(tref);
|
|---|
| 3656 | // Explorer had problems with that.
|
|---|
| 3657 | try {
|
|---|
| 3658 | iframe.onload = null;
|
|---|
| 3659 | } catch (x) {
|
|---|
| 3660 | // intentionally empty
|
|---|
| 3661 | }
|
|---|
| 3662 | iframe.onerror = null;
|
|---|
| 3663 | };
|
|---|
| 3664 | var cleanup = function cleanup() {
|
|---|
| 3665 | debug('cleanup');
|
|---|
| 3666 | if (iframe) {
|
|---|
| 3667 | unattach();
|
|---|
| 3668 | // This timeout makes chrome fire onbeforeunload event
|
|---|
| 3669 | // within iframe. Without the timeout it goes straight to
|
|---|
| 3670 | // onunload.
|
|---|
| 3671 | setTimeout(function () {
|
|---|
| 3672 | if (iframe) {
|
|---|
| 3673 | iframe.parentNode.removeChild(iframe);
|
|---|
| 3674 | }
|
|---|
| 3675 | iframe = null;
|
|---|
| 3676 | }, 0);
|
|---|
| 3677 | eventUtils.unloadDel(unloadRef);
|
|---|
| 3678 | }
|
|---|
| 3679 | };
|
|---|
| 3680 | var onerror = function onerror(err) {
|
|---|
| 3681 | debug('onerror', err);
|
|---|
| 3682 | if (iframe) {
|
|---|
| 3683 | cleanup();
|
|---|
| 3684 | errorCallback(err);
|
|---|
| 3685 | }
|
|---|
| 3686 | };
|
|---|
| 3687 | var post = function post(msg, origin) {
|
|---|
| 3688 | debug('post', msg, origin);
|
|---|
| 3689 | setTimeout(function () {
|
|---|
| 3690 | try {
|
|---|
| 3691 | // When the iframe is not loaded, IE raises an exception
|
|---|
| 3692 | // on 'contentWindow'.
|
|---|
| 3693 | if (iframe && iframe.contentWindow) {
|
|---|
| 3694 | iframe.contentWindow.postMessage(msg, origin);
|
|---|
| 3695 | }
|
|---|
| 3696 | } catch (x) {
|
|---|
| 3697 | // intentionally empty
|
|---|
| 3698 | }
|
|---|
| 3699 | }, 0);
|
|---|
| 3700 | };
|
|---|
| 3701 | iframe.src = iframeUrl;
|
|---|
| 3702 | iframe.style.display = 'none';
|
|---|
| 3703 | iframe.style.position = 'absolute';
|
|---|
| 3704 | iframe.onerror = function () {
|
|---|
| 3705 | onerror('onerror');
|
|---|
| 3706 | };
|
|---|
| 3707 | iframe.onload = function () {
|
|---|
| 3708 | debug('onload');
|
|---|
| 3709 | // `onload` is triggered before scripts on the iframe are
|
|---|
| 3710 | // executed. Give it few seconds to actually load stuff.
|
|---|
| 3711 | clearTimeout(tref);
|
|---|
| 3712 | tref = setTimeout(function () {
|
|---|
| 3713 | onerror('onload timeout');
|
|---|
| 3714 | }, 2000);
|
|---|
| 3715 | };
|
|---|
| 3716 | __webpack_require__.g.document.body.appendChild(iframe);
|
|---|
| 3717 | tref = setTimeout(function () {
|
|---|
| 3718 | onerror('timeout');
|
|---|
| 3719 | }, 15000);
|
|---|
| 3720 | unloadRef = eventUtils.unloadAdd(cleanup);
|
|---|
| 3721 | return {
|
|---|
| 3722 | post: post,
|
|---|
| 3723 | cleanup: cleanup,
|
|---|
| 3724 | loaded: unattach
|
|---|
| 3725 | };
|
|---|
| 3726 | }
|
|---|
| 3727 |
|
|---|
| 3728 | /* eslint no-undef: "off", new-cap: "off" */,
|
|---|
| 3729 | createHtmlfile: function createHtmlfile(iframeUrl, errorCallback) {
|
|---|
| 3730 | var axo = ['Active'].concat('Object').join('X');
|
|---|
| 3731 | var doc = new __webpack_require__.g[axo]('htmlfile');
|
|---|
| 3732 | var tref, unloadRef;
|
|---|
| 3733 | var iframe;
|
|---|
| 3734 | var unattach = function unattach() {
|
|---|
| 3735 | clearTimeout(tref);
|
|---|
| 3736 | iframe.onerror = null;
|
|---|
| 3737 | };
|
|---|
| 3738 | var cleanup = function cleanup() {
|
|---|
| 3739 | if (doc) {
|
|---|
| 3740 | unattach();
|
|---|
| 3741 | eventUtils.unloadDel(unloadRef);
|
|---|
| 3742 | iframe.parentNode.removeChild(iframe);
|
|---|
| 3743 | iframe = doc = null;
|
|---|
| 3744 | CollectGarbage();
|
|---|
| 3745 | }
|
|---|
| 3746 | };
|
|---|
| 3747 | var onerror = function onerror(r) {
|
|---|
| 3748 | debug('onerror', r);
|
|---|
| 3749 | if (doc) {
|
|---|
| 3750 | cleanup();
|
|---|
| 3751 | errorCallback(r);
|
|---|
| 3752 | }
|
|---|
| 3753 | };
|
|---|
| 3754 | var post = function post(msg, origin) {
|
|---|
| 3755 | try {
|
|---|
| 3756 | // When the iframe is not loaded, IE raises an exception
|
|---|
| 3757 | // on 'contentWindow'.
|
|---|
| 3758 | setTimeout(function () {
|
|---|
| 3759 | if (iframe && iframe.contentWindow) {
|
|---|
| 3760 | iframe.contentWindow.postMessage(msg, origin);
|
|---|
| 3761 | }
|
|---|
| 3762 | }, 0);
|
|---|
| 3763 | } catch (x) {
|
|---|
| 3764 | // intentionally empty
|
|---|
| 3765 | }
|
|---|
| 3766 | };
|
|---|
| 3767 | doc.open();
|
|---|
| 3768 | doc.write('<html><s' + 'cript>' + 'document.domain="' + __webpack_require__.g.document.domain + '";' + '</s' + 'cript></html>');
|
|---|
| 3769 | doc.close();
|
|---|
| 3770 | doc.parentWindow[module.exports.WPrefix] = __webpack_require__.g[module.exports.WPrefix];
|
|---|
| 3771 | var c = doc.createElement('div');
|
|---|
| 3772 | doc.body.appendChild(c);
|
|---|
| 3773 | iframe = doc.createElement('iframe');
|
|---|
| 3774 | c.appendChild(iframe);
|
|---|
| 3775 | iframe.src = iframeUrl;
|
|---|
| 3776 | iframe.onerror = function () {
|
|---|
| 3777 | onerror('onerror');
|
|---|
| 3778 | };
|
|---|
| 3779 | tref = setTimeout(function () {
|
|---|
| 3780 | onerror('timeout');
|
|---|
| 3781 | }, 15000);
|
|---|
| 3782 | unloadRef = eventUtils.unloadAdd(cleanup);
|
|---|
| 3783 | return {
|
|---|
| 3784 | post: post,
|
|---|
| 3785 | cleanup: cleanup,
|
|---|
| 3786 | loaded: unattach
|
|---|
| 3787 | };
|
|---|
| 3788 | }
|
|---|
| 3789 | };
|
|---|
| 3790 | module.exports.iframeEnabled = false;
|
|---|
| 3791 | if (__webpack_require__.g.document) {
|
|---|
| 3792 | // postMessage misbehaves in konqueror 4.6.5 - the messages are delivered with
|
|---|
| 3793 | // huge delay, or not at all.
|
|---|
| 3794 | module.exports.iframeEnabled = (typeof __webpack_require__.g.postMessage === 'function' || typeof __webpack_require__.g.postMessage === 'object') && !browser.isKonqueror();
|
|---|
| 3795 | }
|
|---|
| 3796 |
|
|---|
| 3797 | /***/ }),
|
|---|
| 3798 |
|
|---|
| 3799 | /***/ "./node_modules/sockjs-client/lib/utils/log.js":
|
|---|
| 3800 | /*!*****************************************************!*\
|
|---|
| 3801 | !*** ./node_modules/sockjs-client/lib/utils/log.js ***!
|
|---|
| 3802 | \*****************************************************/
|
|---|
| 3803 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3804 |
|
|---|
| 3805 | "use strict";
|
|---|
| 3806 |
|
|---|
| 3807 |
|
|---|
| 3808 | var logObject = {};
|
|---|
| 3809 | ['log', 'debug', 'warn'].forEach(function (level) {
|
|---|
| 3810 | var levelExists;
|
|---|
| 3811 | try {
|
|---|
| 3812 | levelExists = __webpack_require__.g.console && __webpack_require__.g.console[level] && __webpack_require__.g.console[level].apply;
|
|---|
| 3813 | } catch (e) {
|
|---|
| 3814 | // do nothing
|
|---|
| 3815 | }
|
|---|
| 3816 | logObject[level] = levelExists ? function () {
|
|---|
| 3817 | return __webpack_require__.g.console[level].apply(__webpack_require__.g.console, arguments);
|
|---|
| 3818 | } : level === 'log' ? function () {} : logObject.log;
|
|---|
| 3819 | });
|
|---|
| 3820 | module.exports = logObject;
|
|---|
| 3821 |
|
|---|
| 3822 | /***/ }),
|
|---|
| 3823 |
|
|---|
| 3824 | /***/ "./node_modules/sockjs-client/lib/utils/object.js":
|
|---|
| 3825 | /*!********************************************************!*\
|
|---|
| 3826 | !*** ./node_modules/sockjs-client/lib/utils/object.js ***!
|
|---|
| 3827 | \********************************************************/
|
|---|
| 3828 | /***/ (function(module) {
|
|---|
| 3829 |
|
|---|
| 3830 | "use strict";
|
|---|
| 3831 |
|
|---|
| 3832 |
|
|---|
| 3833 | module.exports = {
|
|---|
| 3834 | isObject: function isObject(obj) {
|
|---|
| 3835 | var type = typeof obj;
|
|---|
| 3836 | return type === 'function' || type === 'object' && !!obj;
|
|---|
| 3837 | },
|
|---|
| 3838 | extend: function extend(obj) {
|
|---|
| 3839 | if (!this.isObject(obj)) {
|
|---|
| 3840 | return obj;
|
|---|
| 3841 | }
|
|---|
| 3842 | var source, prop;
|
|---|
| 3843 | for (var i = 1, length = arguments.length; i < length; i++) {
|
|---|
| 3844 | source = arguments[i];
|
|---|
| 3845 | for (prop in source) {
|
|---|
| 3846 | if (Object.prototype.hasOwnProperty.call(source, prop)) {
|
|---|
| 3847 | obj[prop] = source[prop];
|
|---|
| 3848 | }
|
|---|
| 3849 | }
|
|---|
| 3850 | }
|
|---|
| 3851 | return obj;
|
|---|
| 3852 | }
|
|---|
| 3853 | };
|
|---|
| 3854 |
|
|---|
| 3855 | /***/ }),
|
|---|
| 3856 |
|
|---|
| 3857 | /***/ "./node_modules/sockjs-client/lib/utils/random.js":
|
|---|
| 3858 | /*!********************************************************!*\
|
|---|
| 3859 | !*** ./node_modules/sockjs-client/lib/utils/random.js ***!
|
|---|
| 3860 | \********************************************************/
|
|---|
| 3861 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3862 |
|
|---|
| 3863 | "use strict";
|
|---|
| 3864 |
|
|---|
| 3865 |
|
|---|
| 3866 | var crypto = __webpack_require__(/*! crypto */ "./node_modules/sockjs-client/lib/utils/browser-crypto.js");
|
|---|
| 3867 |
|
|---|
| 3868 | // This string has length 32, a power of 2, so the modulus doesn't introduce a
|
|---|
| 3869 | // bias.
|
|---|
| 3870 | var _randomStringChars = 'abcdefghijklmnopqrstuvwxyz012345';
|
|---|
| 3871 | module.exports = {
|
|---|
| 3872 | string: function string(length) {
|
|---|
| 3873 | var max = _randomStringChars.length;
|
|---|
| 3874 | var bytes = crypto.randomBytes(length);
|
|---|
| 3875 | var ret = [];
|
|---|
| 3876 | for (var i = 0; i < length; i++) {
|
|---|
| 3877 | ret.push(_randomStringChars.substr(bytes[i] % max, 1));
|
|---|
| 3878 | }
|
|---|
| 3879 | return ret.join('');
|
|---|
| 3880 | },
|
|---|
| 3881 | number: function number(max) {
|
|---|
| 3882 | return Math.floor(Math.random() * max);
|
|---|
| 3883 | },
|
|---|
| 3884 | numberString: function numberString(max) {
|
|---|
| 3885 | var t = ('' + (max - 1)).length;
|
|---|
| 3886 | var p = new Array(t + 1).join('0');
|
|---|
| 3887 | return (p + this.number(max)).slice(-t);
|
|---|
| 3888 | }
|
|---|
| 3889 | };
|
|---|
| 3890 |
|
|---|
| 3891 | /***/ }),
|
|---|
| 3892 |
|
|---|
| 3893 | /***/ "./node_modules/sockjs-client/lib/utils/transport.js":
|
|---|
| 3894 | /*!***********************************************************!*\
|
|---|
| 3895 | !*** ./node_modules/sockjs-client/lib/utils/transport.js ***!
|
|---|
| 3896 | \***********************************************************/
|
|---|
| 3897 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3898 |
|
|---|
| 3899 | "use strict";
|
|---|
| 3900 |
|
|---|
| 3901 |
|
|---|
| 3902 | var debug = function debug() {};
|
|---|
| 3903 | if (true) {
|
|---|
| 3904 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:transport');
|
|---|
| 3905 | }
|
|---|
| 3906 | module.exports = function (availableTransports) {
|
|---|
| 3907 | return {
|
|---|
| 3908 | filterToEnabled: function filterToEnabled(transportsWhitelist, info) {
|
|---|
| 3909 | var transports = {
|
|---|
| 3910 | main: [],
|
|---|
| 3911 | facade: []
|
|---|
| 3912 | };
|
|---|
| 3913 | if (!transportsWhitelist) {
|
|---|
| 3914 | transportsWhitelist = [];
|
|---|
| 3915 | } else if (typeof transportsWhitelist === 'string') {
|
|---|
| 3916 | transportsWhitelist = [transportsWhitelist];
|
|---|
| 3917 | }
|
|---|
| 3918 | availableTransports.forEach(function (trans) {
|
|---|
| 3919 | if (!trans) {
|
|---|
| 3920 | return;
|
|---|
| 3921 | }
|
|---|
| 3922 | if (trans.transportName === 'websocket' && info.websocket === false) {
|
|---|
| 3923 | debug('disabled from server', 'websocket');
|
|---|
| 3924 | return;
|
|---|
| 3925 | }
|
|---|
| 3926 | if (transportsWhitelist.length && transportsWhitelist.indexOf(trans.transportName) === -1) {
|
|---|
| 3927 | debug('not in whitelist', trans.transportName);
|
|---|
| 3928 | return;
|
|---|
| 3929 | }
|
|---|
| 3930 | if (trans.enabled(info)) {
|
|---|
| 3931 | debug('enabled', trans.transportName);
|
|---|
| 3932 | transports.main.push(trans);
|
|---|
| 3933 | if (trans.facadeTransport) {
|
|---|
| 3934 | transports.facade.push(trans.facadeTransport);
|
|---|
| 3935 | }
|
|---|
| 3936 | } else {
|
|---|
| 3937 | debug('disabled', trans.transportName);
|
|---|
| 3938 | }
|
|---|
| 3939 | });
|
|---|
| 3940 | return transports;
|
|---|
| 3941 | }
|
|---|
| 3942 | };
|
|---|
| 3943 | };
|
|---|
| 3944 |
|
|---|
| 3945 | /***/ }),
|
|---|
| 3946 |
|
|---|
| 3947 | /***/ "./node_modules/sockjs-client/lib/utils/url.js":
|
|---|
| 3948 | /*!*****************************************************!*\
|
|---|
| 3949 | !*** ./node_modules/sockjs-client/lib/utils/url.js ***!
|
|---|
| 3950 | \*****************************************************/
|
|---|
| 3951 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 3952 |
|
|---|
| 3953 | "use strict";
|
|---|
| 3954 |
|
|---|
| 3955 |
|
|---|
| 3956 | var URL = __webpack_require__(/*! url-parse */ "./node_modules/url-parse/index.js");
|
|---|
| 3957 | var debug = function debug() {};
|
|---|
| 3958 | if (true) {
|
|---|
| 3959 | debug = __webpack_require__(/*! debug */ "./node_modules/sockjs-client/node_modules/debug/src/browser.js")('sockjs-client:utils:url');
|
|---|
| 3960 | }
|
|---|
| 3961 | module.exports = {
|
|---|
| 3962 | getOrigin: function getOrigin(url) {
|
|---|
| 3963 | if (!url) {
|
|---|
| 3964 | return null;
|
|---|
| 3965 | }
|
|---|
| 3966 | var p = new URL(url);
|
|---|
| 3967 | if (p.protocol === 'file:') {
|
|---|
| 3968 | return null;
|
|---|
| 3969 | }
|
|---|
| 3970 | var port = p.port;
|
|---|
| 3971 | if (!port) {
|
|---|
| 3972 | port = p.protocol === 'https:' ? '443' : '80';
|
|---|
| 3973 | }
|
|---|
| 3974 | return p.protocol + '//' + p.hostname + ':' + port;
|
|---|
| 3975 | },
|
|---|
| 3976 | isOriginEqual: function isOriginEqual(a, b) {
|
|---|
| 3977 | var res = this.getOrigin(a) === this.getOrigin(b);
|
|---|
| 3978 | debug('same', a, b, res);
|
|---|
| 3979 | return res;
|
|---|
| 3980 | },
|
|---|
| 3981 | isSchemeEqual: function isSchemeEqual(a, b) {
|
|---|
| 3982 | return a.split(':')[0] === b.split(':')[0];
|
|---|
| 3983 | },
|
|---|
| 3984 | addPath: function addPath(url, path) {
|
|---|
| 3985 | var qs = url.split('?');
|
|---|
| 3986 | return qs[0] + path + (qs[1] ? '?' + qs[1] : '');
|
|---|
| 3987 | },
|
|---|
| 3988 | addQuery: function addQuery(url, q) {
|
|---|
| 3989 | return url + (url.indexOf('?') === -1 ? '?' + q : '&' + q);
|
|---|
| 3990 | },
|
|---|
| 3991 | isLoopbackAddr: function isLoopbackAddr(addr) {
|
|---|
| 3992 | return /^127\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/i.test(addr) || /^\[::1\]$/.test(addr);
|
|---|
| 3993 | }
|
|---|
| 3994 | };
|
|---|
| 3995 |
|
|---|
| 3996 | /***/ }),
|
|---|
| 3997 |
|
|---|
| 3998 | /***/ "./node_modules/sockjs-client/lib/version.js":
|
|---|
| 3999 | /*!***************************************************!*\
|
|---|
| 4000 | !*** ./node_modules/sockjs-client/lib/version.js ***!
|
|---|
| 4001 | \***************************************************/
|
|---|
| 4002 | /***/ (function(module) {
|
|---|
| 4003 |
|
|---|
| 4004 | module.exports = '1.6.1';
|
|---|
| 4005 |
|
|---|
| 4006 | /***/ }),
|
|---|
| 4007 |
|
|---|
| 4008 | /***/ "./node_modules/sockjs-client/node_modules/debug/src/browser.js":
|
|---|
| 4009 | /*!**********************************************************************!*\
|
|---|
| 4010 | !*** ./node_modules/sockjs-client/node_modules/debug/src/browser.js ***!
|
|---|
| 4011 | \**********************************************************************/
|
|---|
| 4012 | /***/ (function(module, exports, __webpack_require__) {
|
|---|
| 4013 |
|
|---|
| 4014 | "use strict";
|
|---|
| 4015 |
|
|---|
| 4016 |
|
|---|
| 4017 | function _typeof(obj) {
|
|---|
| 4018 | if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
|
|---|
| 4019 | _typeof = function _typeof(obj) {
|
|---|
| 4020 | return typeof obj;
|
|---|
| 4021 | };
|
|---|
| 4022 | } else {
|
|---|
| 4023 | _typeof = function _typeof(obj) {
|
|---|
| 4024 | return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|---|
| 4025 | };
|
|---|
| 4026 | }
|
|---|
| 4027 | return _typeof(obj);
|
|---|
| 4028 | }
|
|---|
| 4029 |
|
|---|
| 4030 | /* eslint-env browser */
|
|---|
| 4031 |
|
|---|
| 4032 | /**
|
|---|
| 4033 | * This is the web browser implementation of `debug()`.
|
|---|
| 4034 | */
|
|---|
| 4035 | exports.log = log;
|
|---|
| 4036 | exports.formatArgs = formatArgs;
|
|---|
| 4037 | exports.save = save;
|
|---|
| 4038 | exports.load = load;
|
|---|
| 4039 | exports.useColors = useColors;
|
|---|
| 4040 | exports.storage = localstorage();
|
|---|
| 4041 | /**
|
|---|
| 4042 | * Colors.
|
|---|
| 4043 | */
|
|---|
| 4044 |
|
|---|
| 4045 | exports.colors = ['#0000CC', '#0000FF', '#0033CC', '#0033FF', '#0066CC', '#0066FF', '#0099CC', '#0099FF', '#00CC00', '#00CC33', '#00CC66', '#00CC99', '#00CCCC', '#00CCFF', '#3300CC', '#3300FF', '#3333CC', '#3333FF', '#3366CC', '#3366FF', '#3399CC', '#3399FF', '#33CC00', '#33CC33', '#33CC66', '#33CC99', '#33CCCC', '#33CCFF', '#6600CC', '#6600FF', '#6633CC', '#6633FF', '#66CC00', '#66CC33', '#9900CC', '#9900FF', '#9933CC', '#9933FF', '#99CC00', '#99CC33', '#CC0000', '#CC0033', '#CC0066', '#CC0099', '#CC00CC', '#CC00FF', '#CC3300', '#CC3333', '#CC3366', '#CC3399', '#CC33CC', '#CC33FF', '#CC6600', '#CC6633', '#CC9900', '#CC9933', '#CCCC00', '#CCCC33', '#FF0000', '#FF0033', '#FF0066', '#FF0099', '#FF00CC', '#FF00FF', '#FF3300', '#FF3333', '#FF3366', '#FF3399', '#FF33CC', '#FF33FF', '#FF6600', '#FF6633', '#FF9900', '#FF9933', '#FFCC00', '#FFCC33'];
|
|---|
| 4046 | /**
|
|---|
| 4047 | * Currently only WebKit-based Web Inspectors, Firefox >= v31,
|
|---|
| 4048 | * and the Firebug extension (any Firefox version) are known
|
|---|
| 4049 | * to support "%c" CSS customizations.
|
|---|
| 4050 | *
|
|---|
| 4051 | * TODO: add a `localStorage` variable to explicitly enable/disable colors
|
|---|
| 4052 | */
|
|---|
| 4053 | // eslint-disable-next-line complexity
|
|---|
| 4054 |
|
|---|
| 4055 | function useColors() {
|
|---|
| 4056 | // NB: In an Electron preload script, document will be defined but not fully
|
|---|
| 4057 | // initialized. Since we know we're in Chrome, we'll just detect this case
|
|---|
| 4058 | // explicitly
|
|---|
| 4059 | if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
|
|---|
| 4060 | return true;
|
|---|
| 4061 | } // Internet Explorer and Edge do not support colors.
|
|---|
| 4062 |
|
|---|
| 4063 | if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
|
|---|
| 4064 | return false;
|
|---|
| 4065 | } // Is webkit? http://stackoverflow.com/a/16459606/376773
|
|---|
| 4066 | // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
|
|---|
| 4067 |
|
|---|
| 4068 | return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance ||
|
|---|
| 4069 | // Is firebug? http://stackoverflow.com/a/398120/376773
|
|---|
| 4070 | typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) ||
|
|---|
| 4071 | // Is firefox >= v31?
|
|---|
| 4072 | // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
|
|---|
| 4073 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 ||
|
|---|
| 4074 | // Double check webkit in userAgent just in case we are in a worker
|
|---|
| 4075 | typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
|
|---|
| 4076 | }
|
|---|
| 4077 | /**
|
|---|
| 4078 | * Colorize log arguments if enabled.
|
|---|
| 4079 | *
|
|---|
| 4080 | * @api public
|
|---|
| 4081 | */
|
|---|
| 4082 |
|
|---|
| 4083 | function formatArgs(args) {
|
|---|
| 4084 | args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
|
|---|
| 4085 | if (!this.useColors) {
|
|---|
| 4086 | return;
|
|---|
| 4087 | }
|
|---|
| 4088 | var c = 'color: ' + this.color;
|
|---|
| 4089 | args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
|
|---|
| 4090 | // arguments passed either before or after the %c, so we need to
|
|---|
| 4091 | // figure out the correct index to insert the CSS into
|
|---|
| 4092 |
|
|---|
| 4093 | var index = 0;
|
|---|
| 4094 | var lastC = 0;
|
|---|
| 4095 | args[0].replace(/%[a-zA-Z%]/g, function (match) {
|
|---|
| 4096 | if (match === '%%') {
|
|---|
| 4097 | return;
|
|---|
| 4098 | }
|
|---|
| 4099 | index++;
|
|---|
| 4100 | if (match === '%c') {
|
|---|
| 4101 | // We only are interested in the *last* %c
|
|---|
| 4102 | // (the user may have provided their own)
|
|---|
| 4103 | lastC = index;
|
|---|
| 4104 | }
|
|---|
| 4105 | });
|
|---|
| 4106 | args.splice(lastC, 0, c);
|
|---|
| 4107 | }
|
|---|
| 4108 | /**
|
|---|
| 4109 | * Invokes `console.log()` when available.
|
|---|
| 4110 | * No-op when `console.log` is not a "function".
|
|---|
| 4111 | *
|
|---|
| 4112 | * @api public
|
|---|
| 4113 | */
|
|---|
| 4114 |
|
|---|
| 4115 | function log() {
|
|---|
| 4116 | var _console;
|
|---|
| 4117 |
|
|---|
| 4118 | // This hackery is required for IE8/9, where
|
|---|
| 4119 | // the `console.log` function doesn't have 'apply'
|
|---|
| 4120 | return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
|
|---|
| 4121 | }
|
|---|
| 4122 | /**
|
|---|
| 4123 | * Save `namespaces`.
|
|---|
| 4124 | *
|
|---|
| 4125 | * @param {String} namespaces
|
|---|
| 4126 | * @api private
|
|---|
| 4127 | */
|
|---|
| 4128 |
|
|---|
| 4129 | function save(namespaces) {
|
|---|
| 4130 | try {
|
|---|
| 4131 | if (namespaces) {
|
|---|
| 4132 | exports.storage.setItem('debug', namespaces);
|
|---|
| 4133 | } else {
|
|---|
| 4134 | exports.storage.removeItem('debug');
|
|---|
| 4135 | }
|
|---|
| 4136 | } catch (error) {// Swallow
|
|---|
| 4137 | // XXX (@Qix-) should we be logging these?
|
|---|
| 4138 | }
|
|---|
| 4139 | }
|
|---|
| 4140 | /**
|
|---|
| 4141 | * Load `namespaces`.
|
|---|
| 4142 | *
|
|---|
| 4143 | * @return {String} returns the previously persisted debug modes
|
|---|
| 4144 | * @api private
|
|---|
| 4145 | */
|
|---|
| 4146 |
|
|---|
| 4147 | function load() {
|
|---|
| 4148 | var r;
|
|---|
| 4149 | try {
|
|---|
| 4150 | r = exports.storage.getItem('debug');
|
|---|
| 4151 | } catch (error) {} // Swallow
|
|---|
| 4152 | // XXX (@Qix-) should we be logging these?
|
|---|
| 4153 | // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
|
|---|
| 4154 |
|
|---|
| 4155 | if (!r && typeof process !== 'undefined' && 'env' in process) {
|
|---|
| 4156 | r = process.env.DEBUG;
|
|---|
| 4157 | }
|
|---|
| 4158 | return r;
|
|---|
| 4159 | }
|
|---|
| 4160 | /**
|
|---|
| 4161 | * Localstorage attempts to return the localstorage.
|
|---|
| 4162 | *
|
|---|
| 4163 | * This is necessary because safari throws
|
|---|
| 4164 | * when a user disables cookies/localstorage
|
|---|
| 4165 | * and you attempt to access it.
|
|---|
| 4166 | *
|
|---|
| 4167 | * @return {LocalStorage}
|
|---|
| 4168 | * @api private
|
|---|
| 4169 | */
|
|---|
| 4170 |
|
|---|
| 4171 | function localstorage() {
|
|---|
| 4172 | try {
|
|---|
| 4173 | // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
|
|---|
| 4174 | // The Browser also has localStorage in the global context.
|
|---|
| 4175 | return localStorage;
|
|---|
| 4176 | } catch (error) {// Swallow
|
|---|
| 4177 | // XXX (@Qix-) should we be logging these?
|
|---|
| 4178 | }
|
|---|
| 4179 | }
|
|---|
| 4180 | module.exports = __webpack_require__(/*! ./common */ "./node_modules/sockjs-client/node_modules/debug/src/common.js")(exports);
|
|---|
| 4181 | var formatters = module.exports.formatters;
|
|---|
| 4182 | /**
|
|---|
| 4183 | * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
|
|---|
| 4184 | */
|
|---|
| 4185 |
|
|---|
| 4186 | formatters.j = function (v) {
|
|---|
| 4187 | try {
|
|---|
| 4188 | return JSON.stringify(v);
|
|---|
| 4189 | } catch (error) {
|
|---|
| 4190 | return '[UnexpectedJSONParseError]: ' + error.message;
|
|---|
| 4191 | }
|
|---|
| 4192 | };
|
|---|
| 4193 |
|
|---|
| 4194 | /***/ }),
|
|---|
| 4195 |
|
|---|
| 4196 | /***/ "./node_modules/sockjs-client/node_modules/debug/src/common.js":
|
|---|
| 4197 | /*!*********************************************************************!*\
|
|---|
| 4198 | !*** ./node_modules/sockjs-client/node_modules/debug/src/common.js ***!
|
|---|
| 4199 | \*********************************************************************/
|
|---|
| 4200 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 4201 |
|
|---|
| 4202 | "use strict";
|
|---|
| 4203 |
|
|---|
| 4204 |
|
|---|
| 4205 | /**
|
|---|
| 4206 | * This is the common logic for both the Node.js and web browser
|
|---|
| 4207 | * implementations of `debug()`.
|
|---|
| 4208 | */
|
|---|
| 4209 | function setup(env) {
|
|---|
| 4210 | createDebug.debug = createDebug;
|
|---|
| 4211 | createDebug.default = createDebug;
|
|---|
| 4212 | createDebug.coerce = coerce;
|
|---|
| 4213 | createDebug.disable = disable;
|
|---|
| 4214 | createDebug.enable = enable;
|
|---|
| 4215 | createDebug.enabled = enabled;
|
|---|
| 4216 | createDebug.humanize = __webpack_require__(/*! ms */ "./node_modules/ms/index.js");
|
|---|
| 4217 | Object.keys(env).forEach(function (key) {
|
|---|
| 4218 | createDebug[key] = env[key];
|
|---|
| 4219 | });
|
|---|
| 4220 | /**
|
|---|
| 4221 | * Active `debug` instances.
|
|---|
| 4222 | */
|
|---|
| 4223 |
|
|---|
| 4224 | createDebug.instances = [];
|
|---|
| 4225 | /**
|
|---|
| 4226 | * The currently active debug mode names, and names to skip.
|
|---|
| 4227 | */
|
|---|
| 4228 |
|
|---|
| 4229 | createDebug.names = [];
|
|---|
| 4230 | createDebug.skips = [];
|
|---|
| 4231 | /**
|
|---|
| 4232 | * Map of special "%n" handling functions, for the debug "format" argument.
|
|---|
| 4233 | *
|
|---|
| 4234 | * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
|
|---|
| 4235 | */
|
|---|
| 4236 |
|
|---|
| 4237 | createDebug.formatters = {};
|
|---|
| 4238 | /**
|
|---|
| 4239 | * Selects a color for a debug namespace
|
|---|
| 4240 | * @param {String} namespace The namespace string for the for the debug instance to be colored
|
|---|
| 4241 | * @return {Number|String} An ANSI color code for the given namespace
|
|---|
| 4242 | * @api private
|
|---|
| 4243 | */
|
|---|
| 4244 |
|
|---|
| 4245 | function selectColor(namespace) {
|
|---|
| 4246 | var hash = 0;
|
|---|
| 4247 | for (var i = 0; i < namespace.length; i++) {
|
|---|
| 4248 | hash = (hash << 5) - hash + namespace.charCodeAt(i);
|
|---|
| 4249 | hash |= 0; // Convert to 32bit integer
|
|---|
| 4250 | }
|
|---|
| 4251 |
|
|---|
| 4252 | return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
|
|---|
| 4253 | }
|
|---|
| 4254 | createDebug.selectColor = selectColor;
|
|---|
| 4255 | /**
|
|---|
| 4256 | * Create a debugger with the given `namespace`.
|
|---|
| 4257 | *
|
|---|
| 4258 | * @param {String} namespace
|
|---|
| 4259 | * @return {Function}
|
|---|
| 4260 | * @api public
|
|---|
| 4261 | */
|
|---|
| 4262 |
|
|---|
| 4263 | function createDebug(namespace) {
|
|---|
| 4264 | var prevTime;
|
|---|
| 4265 | function debug() {
|
|---|
| 4266 | // Disabled?
|
|---|
| 4267 | if (!debug.enabled) {
|
|---|
| 4268 | return;
|
|---|
| 4269 | }
|
|---|
| 4270 | for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|---|
| 4271 | args[_key] = arguments[_key];
|
|---|
| 4272 | }
|
|---|
| 4273 | var self = debug; // Set `diff` timestamp
|
|---|
| 4274 |
|
|---|
| 4275 | var curr = Number(new Date());
|
|---|
| 4276 | var ms = curr - (prevTime || curr);
|
|---|
| 4277 | self.diff = ms;
|
|---|
| 4278 | self.prev = prevTime;
|
|---|
| 4279 | self.curr = curr;
|
|---|
| 4280 | prevTime = curr;
|
|---|
| 4281 | args[0] = createDebug.coerce(args[0]);
|
|---|
| 4282 | if (typeof args[0] !== 'string') {
|
|---|
| 4283 | // Anything else let's inspect with %O
|
|---|
| 4284 | args.unshift('%O');
|
|---|
| 4285 | } // Apply any `formatters` transformations
|
|---|
| 4286 |
|
|---|
| 4287 | var index = 0;
|
|---|
| 4288 | args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
|
|---|
| 4289 | // If we encounter an escaped % then don't increase the array index
|
|---|
| 4290 | if (match === '%%') {
|
|---|
| 4291 | return match;
|
|---|
| 4292 | }
|
|---|
| 4293 | index++;
|
|---|
| 4294 | var formatter = createDebug.formatters[format];
|
|---|
| 4295 | if (typeof formatter === 'function') {
|
|---|
| 4296 | var val = args[index];
|
|---|
| 4297 | match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
|
|---|
| 4298 |
|
|---|
| 4299 | args.splice(index, 1);
|
|---|
| 4300 | index--;
|
|---|
| 4301 | }
|
|---|
| 4302 | return match;
|
|---|
| 4303 | }); // Apply env-specific formatting (colors, etc.)
|
|---|
| 4304 |
|
|---|
| 4305 | createDebug.formatArgs.call(self, args);
|
|---|
| 4306 | var logFn = self.log || createDebug.log;
|
|---|
| 4307 | logFn.apply(self, args);
|
|---|
| 4308 | }
|
|---|
| 4309 | debug.namespace = namespace;
|
|---|
| 4310 | debug.enabled = createDebug.enabled(namespace);
|
|---|
| 4311 | debug.useColors = createDebug.useColors();
|
|---|
| 4312 | debug.color = selectColor(namespace);
|
|---|
| 4313 | debug.destroy = destroy;
|
|---|
| 4314 | debug.extend = extend; // Debug.formatArgs = formatArgs;
|
|---|
| 4315 | // debug.rawLog = rawLog;
|
|---|
| 4316 | // env-specific initialization logic for debug instances
|
|---|
| 4317 |
|
|---|
| 4318 | if (typeof createDebug.init === 'function') {
|
|---|
| 4319 | createDebug.init(debug);
|
|---|
| 4320 | }
|
|---|
| 4321 | createDebug.instances.push(debug);
|
|---|
| 4322 | return debug;
|
|---|
| 4323 | }
|
|---|
| 4324 | function destroy() {
|
|---|
| 4325 | var index = createDebug.instances.indexOf(this);
|
|---|
| 4326 | if (index !== -1) {
|
|---|
| 4327 | createDebug.instances.splice(index, 1);
|
|---|
| 4328 | return true;
|
|---|
| 4329 | }
|
|---|
| 4330 | return false;
|
|---|
| 4331 | }
|
|---|
| 4332 | function extend(namespace, delimiter) {
|
|---|
| 4333 | return createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
|
|---|
| 4334 | }
|
|---|
| 4335 | /**
|
|---|
| 4336 | * Enables a debug mode by namespaces. This can include modes
|
|---|
| 4337 | * separated by a colon and wildcards.
|
|---|
| 4338 | *
|
|---|
| 4339 | * @param {String} namespaces
|
|---|
| 4340 | * @api public
|
|---|
| 4341 | */
|
|---|
| 4342 |
|
|---|
| 4343 | function enable(namespaces) {
|
|---|
| 4344 | createDebug.save(namespaces);
|
|---|
| 4345 | createDebug.names = [];
|
|---|
| 4346 | createDebug.skips = [];
|
|---|
| 4347 | var i;
|
|---|
| 4348 | var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
|
|---|
| 4349 | var len = split.length;
|
|---|
| 4350 | for (i = 0; i < len; i++) {
|
|---|
| 4351 | if (!split[i]) {
|
|---|
| 4352 | // ignore empty strings
|
|---|
| 4353 | continue;
|
|---|
| 4354 | }
|
|---|
| 4355 | namespaces = split[i].replace(/\*/g, '.*?');
|
|---|
| 4356 | if (namespaces[0] === '-') {
|
|---|
| 4357 | createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
|
|---|
| 4358 | } else {
|
|---|
| 4359 | createDebug.names.push(new RegExp('^' + namespaces + '$'));
|
|---|
| 4360 | }
|
|---|
| 4361 | }
|
|---|
| 4362 | for (i = 0; i < createDebug.instances.length; i++) {
|
|---|
| 4363 | var instance = createDebug.instances[i];
|
|---|
| 4364 | instance.enabled = createDebug.enabled(instance.namespace);
|
|---|
| 4365 | }
|
|---|
| 4366 | }
|
|---|
| 4367 | /**
|
|---|
| 4368 | * Disable debug output.
|
|---|
| 4369 | *
|
|---|
| 4370 | * @api public
|
|---|
| 4371 | */
|
|---|
| 4372 |
|
|---|
| 4373 | function disable() {
|
|---|
| 4374 | createDebug.enable('');
|
|---|
| 4375 | }
|
|---|
| 4376 | /**
|
|---|
| 4377 | * Returns true if the given mode name is enabled, false otherwise.
|
|---|
| 4378 | *
|
|---|
| 4379 | * @param {String} name
|
|---|
| 4380 | * @return {Boolean}
|
|---|
| 4381 | * @api public
|
|---|
| 4382 | */
|
|---|
| 4383 |
|
|---|
| 4384 | function enabled(name) {
|
|---|
| 4385 | if (name[name.length - 1] === '*') {
|
|---|
| 4386 | return true;
|
|---|
| 4387 | }
|
|---|
| 4388 | var i;
|
|---|
| 4389 | var len;
|
|---|
| 4390 | for (i = 0, len = createDebug.skips.length; i < len; i++) {
|
|---|
| 4391 | if (createDebug.skips[i].test(name)) {
|
|---|
| 4392 | return false;
|
|---|
| 4393 | }
|
|---|
| 4394 | }
|
|---|
| 4395 | for (i = 0, len = createDebug.names.length; i < len; i++) {
|
|---|
| 4396 | if (createDebug.names[i].test(name)) {
|
|---|
| 4397 | return true;
|
|---|
| 4398 | }
|
|---|
| 4399 | }
|
|---|
| 4400 | return false;
|
|---|
| 4401 | }
|
|---|
| 4402 | /**
|
|---|
| 4403 | * Coerce `val`.
|
|---|
| 4404 | *
|
|---|
| 4405 | * @param {Mixed} val
|
|---|
| 4406 | * @return {Mixed}
|
|---|
| 4407 | * @api private
|
|---|
| 4408 | */
|
|---|
| 4409 |
|
|---|
| 4410 | function coerce(val) {
|
|---|
| 4411 | if (val instanceof Error) {
|
|---|
| 4412 | return val.stack || val.message;
|
|---|
| 4413 | }
|
|---|
| 4414 | return val;
|
|---|
| 4415 | }
|
|---|
| 4416 | createDebug.enable(createDebug.load());
|
|---|
| 4417 | return createDebug;
|
|---|
| 4418 | }
|
|---|
| 4419 | module.exports = setup;
|
|---|
| 4420 |
|
|---|
| 4421 | /***/ }),
|
|---|
| 4422 |
|
|---|
| 4423 | /***/ "./node_modules/url-parse/index.js":
|
|---|
| 4424 | /*!*****************************************!*\
|
|---|
| 4425 | !*** ./node_modules/url-parse/index.js ***!
|
|---|
| 4426 | \*****************************************/
|
|---|
| 4427 | /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
|
|---|
| 4428 |
|
|---|
| 4429 | "use strict";
|
|---|
| 4430 |
|
|---|
| 4431 |
|
|---|
| 4432 | var required = __webpack_require__(/*! requires-port */ "./node_modules/requires-port/index.js"),
|
|---|
| 4433 | qs = __webpack_require__(/*! querystringify */ "./node_modules/querystringify/index.js"),
|
|---|
| 4434 | controlOrWhitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,
|
|---|
| 4435 | CRHTLF = /[\n\r\t]/g,
|
|---|
| 4436 | slashes = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//,
|
|---|
| 4437 | port = /:\d+$/,
|
|---|
| 4438 | protocolre = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,
|
|---|
| 4439 | windowsDriveLetter = /^[a-zA-Z]:/;
|
|---|
| 4440 |
|
|---|
| 4441 | /**
|
|---|
| 4442 | * Remove control characters and whitespace from the beginning of a string.
|
|---|
| 4443 | *
|
|---|
| 4444 | * @param {Object|String} str String to trim.
|
|---|
| 4445 | * @returns {String} A new string representing `str` stripped of control
|
|---|
| 4446 | * characters and whitespace from its beginning.
|
|---|
| 4447 | * @public
|
|---|
| 4448 | */
|
|---|
| 4449 | function trimLeft(str) {
|
|---|
| 4450 | return (str ? str : '').toString().replace(controlOrWhitespace, '');
|
|---|
| 4451 | }
|
|---|
| 4452 |
|
|---|
| 4453 | /**
|
|---|
| 4454 | * These are the parse rules for the URL parser, it informs the parser
|
|---|
| 4455 | * about:
|
|---|
| 4456 | *
|
|---|
| 4457 | * 0. The char it Needs to parse, if it's a string it should be done using
|
|---|
| 4458 | * indexOf, RegExp using exec and NaN means set as current value.
|
|---|
| 4459 | * 1. The property we should set when parsing this value.
|
|---|
| 4460 | * 2. Indication if it's backwards or forward parsing, when set as number it's
|
|---|
| 4461 | * the value of extra chars that should be split off.
|
|---|
| 4462 | * 3. Inherit from location if non existing in the parser.
|
|---|
| 4463 | * 4. `toLowerCase` the resulting value.
|
|---|
| 4464 | */
|
|---|
| 4465 | var rules = [['#', 'hash'],
|
|---|
| 4466 | // Extract from the back.
|
|---|
| 4467 | ['?', 'query'],
|
|---|
| 4468 | // Extract from the back.
|
|---|
| 4469 | function sanitize(address, url) {
|
|---|
| 4470 | // Sanitize what is left of the address
|
|---|
| 4471 | return isSpecial(url.protocol) ? address.replace(/\\/g, '/') : address;
|
|---|
| 4472 | }, ['/', 'pathname'],
|
|---|
| 4473 | // Extract from the back.
|
|---|
| 4474 | ['@', 'auth', 1],
|
|---|
| 4475 | // Extract from the front.
|
|---|
| 4476 | [NaN, 'host', undefined, 1, 1],
|
|---|
| 4477 | // Set left over value.
|
|---|
| 4478 | [/:(\d*)$/, 'port', undefined, 1],
|
|---|
| 4479 | // RegExp the back.
|
|---|
| 4480 | [NaN, 'hostname', undefined, 1, 1] // Set left over.
|
|---|
| 4481 | ];
|
|---|
| 4482 |
|
|---|
| 4483 | /**
|
|---|
| 4484 | * These properties should not be copied or inherited from. This is only needed
|
|---|
| 4485 | * for all non blob URL's as a blob URL does not include a hash, only the
|
|---|
| 4486 | * origin.
|
|---|
| 4487 | *
|
|---|
| 4488 | * @type {Object}
|
|---|
| 4489 | * @private
|
|---|
| 4490 | */
|
|---|
| 4491 | var ignore = {
|
|---|
| 4492 | hash: 1,
|
|---|
| 4493 | query: 1
|
|---|
| 4494 | };
|
|---|
| 4495 |
|
|---|
| 4496 | /**
|
|---|
| 4497 | * The location object differs when your code is loaded through a normal page,
|
|---|
| 4498 | * Worker or through a worker using a blob. And with the blobble begins the
|
|---|
| 4499 | * trouble as the location object will contain the URL of the blob, not the
|
|---|
| 4500 | * location of the page where our code is loaded in. The actual origin is
|
|---|
| 4501 | * encoded in the `pathname` so we can thankfully generate a good "default"
|
|---|
| 4502 | * location from it so we can generate proper relative URL's again.
|
|---|
| 4503 | *
|
|---|
| 4504 | * @param {Object|String} loc Optional default location object.
|
|---|
| 4505 | * @returns {Object} lolcation object.
|
|---|
| 4506 | * @public
|
|---|
| 4507 | */
|
|---|
| 4508 | function lolcation(loc) {
|
|---|
| 4509 | var globalVar;
|
|---|
| 4510 | if (typeof window !== 'undefined') globalVar = window;else if (typeof __webpack_require__.g !== 'undefined') globalVar = __webpack_require__.g;else if (typeof self !== 'undefined') globalVar = self;else globalVar = {};
|
|---|
| 4511 | var location = globalVar.location || {};
|
|---|
| 4512 | loc = loc || location;
|
|---|
| 4513 | var finaldestination = {},
|
|---|
| 4514 | type = typeof loc,
|
|---|
| 4515 | key;
|
|---|
| 4516 | if ('blob:' === loc.protocol) {
|
|---|
| 4517 | finaldestination = new Url(unescape(loc.pathname), {});
|
|---|
| 4518 | } else if ('string' === type) {
|
|---|
| 4519 | finaldestination = new Url(loc, {});
|
|---|
| 4520 | for (key in ignore) delete finaldestination[key];
|
|---|
| 4521 | } else if ('object' === type) {
|
|---|
| 4522 | for (key in loc) {
|
|---|
| 4523 | if (key in ignore) continue;
|
|---|
| 4524 | finaldestination[key] = loc[key];
|
|---|
| 4525 | }
|
|---|
| 4526 | if (finaldestination.slashes === undefined) {
|
|---|
| 4527 | finaldestination.slashes = slashes.test(loc.href);
|
|---|
| 4528 | }
|
|---|
| 4529 | }
|
|---|
| 4530 | return finaldestination;
|
|---|
| 4531 | }
|
|---|
| 4532 |
|
|---|
| 4533 | /**
|
|---|
| 4534 | * Check whether a protocol scheme is special.
|
|---|
| 4535 | *
|
|---|
| 4536 | * @param {String} The protocol scheme of the URL
|
|---|
| 4537 | * @return {Boolean} `true` if the protocol scheme is special, else `false`
|
|---|
| 4538 | * @private
|
|---|
| 4539 | */
|
|---|
| 4540 | function isSpecial(scheme) {
|
|---|
| 4541 | return scheme === 'file:' || scheme === 'ftp:' || scheme === 'http:' || scheme === 'https:' || scheme === 'ws:' || scheme === 'wss:';
|
|---|
| 4542 | }
|
|---|
| 4543 |
|
|---|
| 4544 | /**
|
|---|
| 4545 | * @typedef ProtocolExtract
|
|---|
| 4546 | * @type Object
|
|---|
| 4547 | * @property {String} protocol Protocol matched in the URL, in lowercase.
|
|---|
| 4548 | * @property {Boolean} slashes `true` if protocol is followed by "//", else `false`.
|
|---|
| 4549 | * @property {String} rest Rest of the URL that is not part of the protocol.
|
|---|
| 4550 | */
|
|---|
| 4551 |
|
|---|
| 4552 | /**
|
|---|
| 4553 | * Extract protocol information from a URL with/without double slash ("//").
|
|---|
| 4554 | *
|
|---|
| 4555 | * @param {String} address URL we want to extract from.
|
|---|
| 4556 | * @param {Object} location
|
|---|
| 4557 | * @return {ProtocolExtract} Extracted information.
|
|---|
| 4558 | * @private
|
|---|
| 4559 | */
|
|---|
| 4560 | function extractProtocol(address, location) {
|
|---|
| 4561 | address = trimLeft(address);
|
|---|
| 4562 | address = address.replace(CRHTLF, '');
|
|---|
| 4563 | location = location || {};
|
|---|
| 4564 | var match = protocolre.exec(address);
|
|---|
| 4565 | var protocol = match[1] ? match[1].toLowerCase() : '';
|
|---|
| 4566 | var forwardSlashes = !!match[2];
|
|---|
| 4567 | var otherSlashes = !!match[3];
|
|---|
| 4568 | var slashesCount = 0;
|
|---|
| 4569 | var rest;
|
|---|
| 4570 | if (forwardSlashes) {
|
|---|
| 4571 | if (otherSlashes) {
|
|---|
| 4572 | rest = match[2] + match[3] + match[4];
|
|---|
| 4573 | slashesCount = match[2].length + match[3].length;
|
|---|
| 4574 | } else {
|
|---|
| 4575 | rest = match[2] + match[4];
|
|---|
| 4576 | slashesCount = match[2].length;
|
|---|
| 4577 | }
|
|---|
| 4578 | } else {
|
|---|
| 4579 | if (otherSlashes) {
|
|---|
| 4580 | rest = match[3] + match[4];
|
|---|
| 4581 | slashesCount = match[3].length;
|
|---|
| 4582 | } else {
|
|---|
| 4583 | rest = match[4];
|
|---|
| 4584 | }
|
|---|
| 4585 | }
|
|---|
| 4586 | if (protocol === 'file:') {
|
|---|
| 4587 | if (slashesCount >= 2) {
|
|---|
| 4588 | rest = rest.slice(2);
|
|---|
| 4589 | }
|
|---|
| 4590 | } else if (isSpecial(protocol)) {
|
|---|
| 4591 | rest = match[4];
|
|---|
| 4592 | } else if (protocol) {
|
|---|
| 4593 | if (forwardSlashes) {
|
|---|
| 4594 | rest = rest.slice(2);
|
|---|
| 4595 | }
|
|---|
| 4596 | } else if (slashesCount >= 2 && isSpecial(location.protocol)) {
|
|---|
| 4597 | rest = match[4];
|
|---|
| 4598 | }
|
|---|
| 4599 | return {
|
|---|
| 4600 | protocol: protocol,
|
|---|
| 4601 | slashes: forwardSlashes || isSpecial(protocol),
|
|---|
| 4602 | slashesCount: slashesCount,
|
|---|
| 4603 | rest: rest
|
|---|
| 4604 | };
|
|---|
| 4605 | }
|
|---|
| 4606 |
|
|---|
| 4607 | /**
|
|---|
| 4608 | * Resolve a relative URL pathname against a base URL pathname.
|
|---|
| 4609 | *
|
|---|
| 4610 | * @param {String} relative Pathname of the relative URL.
|
|---|
| 4611 | * @param {String} base Pathname of the base URL.
|
|---|
| 4612 | * @return {String} Resolved pathname.
|
|---|
| 4613 | * @private
|
|---|
| 4614 | */
|
|---|
| 4615 | function resolve(relative, base) {
|
|---|
| 4616 | if (relative === '') return base;
|
|---|
| 4617 | var path = (base || '/').split('/').slice(0, -1).concat(relative.split('/')),
|
|---|
| 4618 | i = path.length,
|
|---|
| 4619 | last = path[i - 1],
|
|---|
| 4620 | unshift = false,
|
|---|
| 4621 | up = 0;
|
|---|
| 4622 | while (i--) {
|
|---|
| 4623 | if (path[i] === '.') {
|
|---|
| 4624 | path.splice(i, 1);
|
|---|
| 4625 | } else if (path[i] === '..') {
|
|---|
| 4626 | path.splice(i, 1);
|
|---|
| 4627 | up++;
|
|---|
| 4628 | } else if (up) {
|
|---|
| 4629 | if (i === 0) unshift = true;
|
|---|
| 4630 | path.splice(i, 1);
|
|---|
| 4631 | up--;
|
|---|
| 4632 | }
|
|---|
| 4633 | }
|
|---|
| 4634 | if (unshift) path.unshift('');
|
|---|
| 4635 | if (last === '.' || last === '..') path.push('');
|
|---|
| 4636 | return path.join('/');
|
|---|
| 4637 | }
|
|---|
| 4638 |
|
|---|
| 4639 | /**
|
|---|
| 4640 | * The actual URL instance. Instead of returning an object we've opted-in to
|
|---|
| 4641 | * create an actual constructor as it's much more memory efficient and
|
|---|
| 4642 | * faster and it pleases my OCD.
|
|---|
| 4643 | *
|
|---|
| 4644 | * It is worth noting that we should not use `URL` as class name to prevent
|
|---|
| 4645 | * clashes with the global URL instance that got introduced in browsers.
|
|---|
| 4646 | *
|
|---|
| 4647 | * @constructor
|
|---|
| 4648 | * @param {String} address URL we want to parse.
|
|---|
| 4649 | * @param {Object|String} [location] Location defaults for relative paths.
|
|---|
| 4650 | * @param {Boolean|Function} [parser] Parser for the query string.
|
|---|
| 4651 | * @private
|
|---|
| 4652 | */
|
|---|
| 4653 | function Url(address, location, parser) {
|
|---|
| 4654 | address = trimLeft(address);
|
|---|
| 4655 | address = address.replace(CRHTLF, '');
|
|---|
| 4656 | if (!(this instanceof Url)) {
|
|---|
| 4657 | return new Url(address, location, parser);
|
|---|
| 4658 | }
|
|---|
| 4659 | var relative,
|
|---|
| 4660 | extracted,
|
|---|
| 4661 | parse,
|
|---|
| 4662 | instruction,
|
|---|
| 4663 | index,
|
|---|
| 4664 | key,
|
|---|
| 4665 | instructions = rules.slice(),
|
|---|
| 4666 | type = typeof location,
|
|---|
| 4667 | url = this,
|
|---|
| 4668 | i = 0;
|
|---|
| 4669 |
|
|---|
| 4670 | //
|
|---|
| 4671 | // The following if statements allows this module two have compatibility with
|
|---|
| 4672 | // 2 different API:
|
|---|
| 4673 | //
|
|---|
| 4674 | // 1. Node.js's `url.parse` api which accepts a URL, boolean as arguments
|
|---|
| 4675 | // where the boolean indicates that the query string should also be parsed.
|
|---|
| 4676 | //
|
|---|
| 4677 | // 2. The `URL` interface of the browser which accepts a URL, object as
|
|---|
| 4678 | // arguments. The supplied object will be used as default values / fall-back
|
|---|
| 4679 | // for relative paths.
|
|---|
| 4680 | //
|
|---|
| 4681 | if ('object' !== type && 'string' !== type) {
|
|---|
| 4682 | parser = location;
|
|---|
| 4683 | location = null;
|
|---|
| 4684 | }
|
|---|
| 4685 | if (parser && 'function' !== typeof parser) parser = qs.parse;
|
|---|
| 4686 | location = lolcation(location);
|
|---|
| 4687 |
|
|---|
| 4688 | //
|
|---|
| 4689 | // Extract protocol information before running the instructions.
|
|---|
| 4690 | //
|
|---|
| 4691 | extracted = extractProtocol(address || '', location);
|
|---|
| 4692 | relative = !extracted.protocol && !extracted.slashes;
|
|---|
| 4693 | url.slashes = extracted.slashes || relative && location.slashes;
|
|---|
| 4694 | url.protocol = extracted.protocol || location.protocol || '';
|
|---|
| 4695 | address = extracted.rest;
|
|---|
| 4696 |
|
|---|
| 4697 | //
|
|---|
| 4698 | // When the authority component is absent the URL starts with a path
|
|---|
| 4699 | // component.
|
|---|
| 4700 | //
|
|---|
| 4701 | if (extracted.protocol === 'file:' && (extracted.slashesCount !== 2 || windowsDriveLetter.test(address)) || !extracted.slashes && (extracted.protocol || extracted.slashesCount < 2 || !isSpecial(url.protocol))) {
|
|---|
| 4702 | instructions[3] = [/(.*)/, 'pathname'];
|
|---|
| 4703 | }
|
|---|
| 4704 | for (; i < instructions.length; i++) {
|
|---|
| 4705 | instruction = instructions[i];
|
|---|
| 4706 | if (typeof instruction === 'function') {
|
|---|
| 4707 | address = instruction(address, url);
|
|---|
| 4708 | continue;
|
|---|
| 4709 | }
|
|---|
| 4710 | parse = instruction[0];
|
|---|
| 4711 | key = instruction[1];
|
|---|
| 4712 | if (parse !== parse) {
|
|---|
| 4713 | url[key] = address;
|
|---|
| 4714 | } else if ('string' === typeof parse) {
|
|---|
| 4715 | index = parse === '@' ? address.lastIndexOf(parse) : address.indexOf(parse);
|
|---|
| 4716 | if (~index) {
|
|---|
| 4717 | if ('number' === typeof instruction[2]) {
|
|---|
| 4718 | url[key] = address.slice(0, index);
|
|---|
| 4719 | address = address.slice(index + instruction[2]);
|
|---|
| 4720 | } else {
|
|---|
| 4721 | url[key] = address.slice(index);
|
|---|
| 4722 | address = address.slice(0, index);
|
|---|
| 4723 | }
|
|---|
| 4724 | }
|
|---|
| 4725 | } else if (index = parse.exec(address)) {
|
|---|
| 4726 | url[key] = index[1];
|
|---|
| 4727 | address = address.slice(0, index.index);
|
|---|
| 4728 | }
|
|---|
| 4729 | url[key] = url[key] || (relative && instruction[3] ? location[key] || '' : '');
|
|---|
| 4730 |
|
|---|
| 4731 | //
|
|---|
| 4732 | // Hostname, host and protocol should be lowercased so they can be used to
|
|---|
| 4733 | // create a proper `origin`.
|
|---|
| 4734 | //
|
|---|
| 4735 | if (instruction[4]) url[key] = url[key].toLowerCase();
|
|---|
| 4736 | }
|
|---|
| 4737 |
|
|---|
| 4738 | //
|
|---|
| 4739 | // Also parse the supplied query string in to an object. If we're supplied
|
|---|
| 4740 | // with a custom parser as function use that instead of the default build-in
|
|---|
| 4741 | // parser.
|
|---|
| 4742 | //
|
|---|
| 4743 | if (parser) url.query = parser(url.query);
|
|---|
| 4744 |
|
|---|
| 4745 | //
|
|---|
| 4746 | // If the URL is relative, resolve the pathname against the base URL.
|
|---|
| 4747 | //
|
|---|
| 4748 | if (relative && location.slashes && url.pathname.charAt(0) !== '/' && (url.pathname !== '' || location.pathname !== '')) {
|
|---|
| 4749 | url.pathname = resolve(url.pathname, location.pathname);
|
|---|
| 4750 | }
|
|---|
| 4751 |
|
|---|
| 4752 | //
|
|---|
| 4753 | // Default to a / for pathname if none exists. This normalizes the URL
|
|---|
| 4754 | // to always have a /
|
|---|
| 4755 | //
|
|---|
| 4756 | if (url.pathname.charAt(0) !== '/' && isSpecial(url.protocol)) {
|
|---|
| 4757 | url.pathname = '/' + url.pathname;
|
|---|
| 4758 | }
|
|---|
| 4759 |
|
|---|
| 4760 | //
|
|---|
| 4761 | // We should not add port numbers if they are already the default port number
|
|---|
| 4762 | // for a given protocol. As the host also contains the port number we're going
|
|---|
| 4763 | // override it with the hostname which contains no port number.
|
|---|
| 4764 | //
|
|---|
| 4765 | if (!required(url.port, url.protocol)) {
|
|---|
| 4766 | url.host = url.hostname;
|
|---|
| 4767 | url.port = '';
|
|---|
| 4768 | }
|
|---|
| 4769 |
|
|---|
| 4770 | //
|
|---|
| 4771 | // Parse down the `auth` for the username and password.
|
|---|
| 4772 | //
|
|---|
| 4773 | url.username = url.password = '';
|
|---|
| 4774 | if (url.auth) {
|
|---|
| 4775 | index = url.auth.indexOf(':');
|
|---|
| 4776 | if (~index) {
|
|---|
| 4777 | url.username = url.auth.slice(0, index);
|
|---|
| 4778 | url.username = encodeURIComponent(decodeURIComponent(url.username));
|
|---|
| 4779 | url.password = url.auth.slice(index + 1);
|
|---|
| 4780 | url.password = encodeURIComponent(decodeURIComponent(url.password));
|
|---|
| 4781 | } else {
|
|---|
| 4782 | url.username = encodeURIComponent(decodeURIComponent(url.auth));
|
|---|
| 4783 | }
|
|---|
| 4784 | url.auth = url.password ? url.username + ':' + url.password : url.username;
|
|---|
| 4785 | }
|
|---|
| 4786 | url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host ? url.protocol + '//' + url.host : 'null';
|
|---|
| 4787 |
|
|---|
| 4788 | //
|
|---|
| 4789 | // The href is just the compiled result.
|
|---|
| 4790 | //
|
|---|
| 4791 | url.href = url.toString();
|
|---|
| 4792 | }
|
|---|
| 4793 |
|
|---|
| 4794 | /**
|
|---|
| 4795 | * This is convenience method for changing properties in the URL instance to
|
|---|
| 4796 | * insure that they all propagate correctly.
|
|---|
| 4797 | *
|
|---|
| 4798 | * @param {String} part Property we need to adjust.
|
|---|
| 4799 | * @param {Mixed} value The newly assigned value.
|
|---|
| 4800 | * @param {Boolean|Function} fn When setting the query, it will be the function
|
|---|
| 4801 | * used to parse the query.
|
|---|
| 4802 | * When setting the protocol, double slash will be
|
|---|
| 4803 | * removed from the final url if it is true.
|
|---|
| 4804 | * @returns {URL} URL instance for chaining.
|
|---|
| 4805 | * @public
|
|---|
| 4806 | */
|
|---|
| 4807 | function set(part, value, fn) {
|
|---|
| 4808 | var url = this;
|
|---|
| 4809 | switch (part) {
|
|---|
| 4810 | case 'query':
|
|---|
| 4811 | if ('string' === typeof value && value.length) {
|
|---|
| 4812 | value = (fn || qs.parse)(value);
|
|---|
| 4813 | }
|
|---|
| 4814 | url[part] = value;
|
|---|
| 4815 | break;
|
|---|
| 4816 | case 'port':
|
|---|
| 4817 | url[part] = value;
|
|---|
| 4818 | if (!required(value, url.protocol)) {
|
|---|
| 4819 | url.host = url.hostname;
|
|---|
| 4820 | url[part] = '';
|
|---|
| 4821 | } else if (value) {
|
|---|
| 4822 | url.host = url.hostname + ':' + value;
|
|---|
| 4823 | }
|
|---|
| 4824 | break;
|
|---|
| 4825 | case 'hostname':
|
|---|
| 4826 | url[part] = value;
|
|---|
| 4827 | if (url.port) value += ':' + url.port;
|
|---|
| 4828 | url.host = value;
|
|---|
| 4829 | break;
|
|---|
| 4830 | case 'host':
|
|---|
| 4831 | url[part] = value;
|
|---|
| 4832 | if (port.test(value)) {
|
|---|
| 4833 | value = value.split(':');
|
|---|
| 4834 | url.port = value.pop();
|
|---|
| 4835 | url.hostname = value.join(':');
|
|---|
| 4836 | } else {
|
|---|
| 4837 | url.hostname = value;
|
|---|
| 4838 | url.port = '';
|
|---|
| 4839 | }
|
|---|
| 4840 | break;
|
|---|
| 4841 | case 'protocol':
|
|---|
| 4842 | url.protocol = value.toLowerCase();
|
|---|
| 4843 | url.slashes = !fn;
|
|---|
| 4844 | break;
|
|---|
| 4845 | case 'pathname':
|
|---|
| 4846 | case 'hash':
|
|---|
| 4847 | if (value) {
|
|---|
| 4848 | var char = part === 'pathname' ? '/' : '#';
|
|---|
| 4849 | url[part] = value.charAt(0) !== char ? char + value : value;
|
|---|
| 4850 | } else {
|
|---|
| 4851 | url[part] = value;
|
|---|
| 4852 | }
|
|---|
| 4853 | break;
|
|---|
| 4854 | case 'username':
|
|---|
| 4855 | case 'password':
|
|---|
| 4856 | url[part] = encodeURIComponent(value);
|
|---|
| 4857 | break;
|
|---|
| 4858 | case 'auth':
|
|---|
| 4859 | var index = value.indexOf(':');
|
|---|
| 4860 | if (~index) {
|
|---|
| 4861 | url.username = value.slice(0, index);
|
|---|
| 4862 | url.username = encodeURIComponent(decodeURIComponent(url.username));
|
|---|
| 4863 | url.password = value.slice(index + 1);
|
|---|
| 4864 | url.password = encodeURIComponent(decodeURIComponent(url.password));
|
|---|
| 4865 | } else {
|
|---|
| 4866 | url.username = encodeURIComponent(decodeURIComponent(value));
|
|---|
| 4867 | }
|
|---|
| 4868 | }
|
|---|
| 4869 | for (var i = 0; i < rules.length; i++) {
|
|---|
| 4870 | var ins = rules[i];
|
|---|
| 4871 | if (ins[4]) url[ins[1]] = url[ins[1]].toLowerCase();
|
|---|
| 4872 | }
|
|---|
| 4873 | url.auth = url.password ? url.username + ':' + url.password : url.username;
|
|---|
| 4874 | url.origin = url.protocol !== 'file:' && isSpecial(url.protocol) && url.host ? url.protocol + '//' + url.host : 'null';
|
|---|
| 4875 | url.href = url.toString();
|
|---|
| 4876 | return url;
|
|---|
| 4877 | }
|
|---|
| 4878 |
|
|---|
| 4879 | /**
|
|---|
| 4880 | * Transform the properties back in to a valid and full URL string.
|
|---|
| 4881 | *
|
|---|
| 4882 | * @param {Function} stringify Optional query stringify function.
|
|---|
| 4883 | * @returns {String} Compiled version of the URL.
|
|---|
| 4884 | * @public
|
|---|
| 4885 | */
|
|---|
| 4886 | function toString(stringify) {
|
|---|
| 4887 | if (!stringify || 'function' !== typeof stringify) stringify = qs.stringify;
|
|---|
| 4888 | var query,
|
|---|
| 4889 | url = this,
|
|---|
| 4890 | host = url.host,
|
|---|
| 4891 | protocol = url.protocol;
|
|---|
| 4892 | if (protocol && protocol.charAt(protocol.length - 1) !== ':') protocol += ':';
|
|---|
| 4893 | var result = protocol + (url.protocol && url.slashes || isSpecial(url.protocol) ? '//' : '');
|
|---|
| 4894 | if (url.username) {
|
|---|
| 4895 | result += url.username;
|
|---|
| 4896 | if (url.password) result += ':' + url.password;
|
|---|
| 4897 | result += '@';
|
|---|
| 4898 | } else if (url.password) {
|
|---|
| 4899 | result += ':' + url.password;
|
|---|
| 4900 | result += '@';
|
|---|
| 4901 | } else if (url.protocol !== 'file:' && isSpecial(url.protocol) && !host && url.pathname !== '/') {
|
|---|
| 4902 | //
|
|---|
| 4903 | // Add back the empty userinfo, otherwise the original invalid URL
|
|---|
| 4904 | // might be transformed into a valid one with `url.pathname` as host.
|
|---|
| 4905 | //
|
|---|
| 4906 | result += '@';
|
|---|
| 4907 | }
|
|---|
| 4908 |
|
|---|
| 4909 | //
|
|---|
| 4910 | // Trailing colon is removed from `url.host` when it is parsed. If it still
|
|---|
| 4911 | // ends with a colon, then add back the trailing colon that was removed. This
|
|---|
| 4912 | // prevents an invalid URL from being transformed into a valid one.
|
|---|
| 4913 | //
|
|---|
| 4914 | if (host[host.length - 1] === ':' || port.test(url.hostname) && !url.port) {
|
|---|
| 4915 | host += ':';
|
|---|
| 4916 | }
|
|---|
| 4917 | result += host + url.pathname;
|
|---|
| 4918 | query = 'object' === typeof url.query ? stringify(url.query) : url.query;
|
|---|
| 4919 | if (query) result += '?' !== query.charAt(0) ? '?' + query : query;
|
|---|
| 4920 | if (url.hash) result += url.hash;
|
|---|
| 4921 | return result;
|
|---|
| 4922 | }
|
|---|
| 4923 | Url.prototype = {
|
|---|
| 4924 | set: set,
|
|---|
| 4925 | toString: toString
|
|---|
| 4926 | };
|
|---|
| 4927 |
|
|---|
| 4928 | //
|
|---|
| 4929 | // Expose the URL parser and some additional properties that might be useful for
|
|---|
| 4930 | // others or testing.
|
|---|
| 4931 | //
|
|---|
| 4932 | Url.extractProtocol = extractProtocol;
|
|---|
| 4933 | Url.location = lolcation;
|
|---|
| 4934 | Url.trimLeft = trimLeft;
|
|---|
| 4935 | Url.qs = qs;
|
|---|
| 4936 | module.exports = Url;
|
|---|
| 4937 |
|
|---|
| 4938 | /***/ })
|
|---|
| 4939 |
|
|---|
| 4940 | /******/ });
|
|---|
| 4941 | /************************************************************************/
|
|---|
| 4942 | /******/ // The module cache
|
|---|
| 4943 | /******/ var __webpack_module_cache__ = {};
|
|---|
| 4944 | /******/
|
|---|
| 4945 | /******/ // The require function
|
|---|
| 4946 | /******/ function __webpack_require__(moduleId) {
|
|---|
| 4947 | /******/ // Check if module is in cache
|
|---|
| 4948 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|---|
| 4949 | /******/ if (cachedModule !== undefined) {
|
|---|
| 4950 | /******/ return cachedModule.exports;
|
|---|
| 4951 | /******/ }
|
|---|
| 4952 | /******/ // Create a new module (and put it into the cache)
|
|---|
| 4953 | /******/ var module = __webpack_module_cache__[moduleId] = {
|
|---|
| 4954 | /******/ // no module.id needed
|
|---|
| 4955 | /******/ // no module.loaded needed
|
|---|
| 4956 | /******/ exports: {}
|
|---|
| 4957 | /******/ };
|
|---|
| 4958 | /******/
|
|---|
| 4959 | /******/ // Execute the module function
|
|---|
| 4960 | /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|---|
| 4961 | /******/
|
|---|
| 4962 | /******/ // Return the exports of the module
|
|---|
| 4963 | /******/ return module.exports;
|
|---|
| 4964 | /******/ }
|
|---|
| 4965 | /******/
|
|---|
| 4966 | /************************************************************************/
|
|---|
| 4967 | /******/ /* webpack/runtime/compat get default export */
|
|---|
| 4968 | /******/ !function() {
|
|---|
| 4969 | /******/ // getDefaultExport function for compatibility with non-harmony modules
|
|---|
| 4970 | /******/ __webpack_require__.n = function(module) {
|
|---|
| 4971 | /******/ var getter = module && module.__esModule ?
|
|---|
| 4972 | /******/ function() { return module['default']; } :
|
|---|
| 4973 | /******/ function() { return module; };
|
|---|
| 4974 | /******/ __webpack_require__.d(getter, { a: getter });
|
|---|
| 4975 | /******/ return getter;
|
|---|
| 4976 | /******/ };
|
|---|
| 4977 | /******/ }();
|
|---|
| 4978 | /******/
|
|---|
| 4979 | /******/ /* webpack/runtime/define property getters */
|
|---|
| 4980 | /******/ !function() {
|
|---|
| 4981 | /******/ // define getter functions for harmony exports
|
|---|
| 4982 | /******/ __webpack_require__.d = function(exports, definition) {
|
|---|
| 4983 | /******/ for(var key in definition) {
|
|---|
| 4984 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|---|
| 4985 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|---|
| 4986 | /******/ }
|
|---|
| 4987 | /******/ }
|
|---|
| 4988 | /******/ };
|
|---|
| 4989 | /******/ }();
|
|---|
| 4990 | /******/
|
|---|
| 4991 | /******/ /* webpack/runtime/global */
|
|---|
| 4992 | /******/ !function() {
|
|---|
| 4993 | /******/ __webpack_require__.g = (function() {
|
|---|
| 4994 | /******/ if (typeof globalThis === 'object') return globalThis;
|
|---|
| 4995 | /******/ try {
|
|---|
| 4996 | /******/ return this || new Function('return this')();
|
|---|
| 4997 | /******/ } catch (e) {
|
|---|
| 4998 | /******/ if (typeof window === 'object') return window;
|
|---|
| 4999 | /******/ }
|
|---|
| 5000 | /******/ })();
|
|---|
| 5001 | /******/ }();
|
|---|
| 5002 | /******/
|
|---|
| 5003 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|---|
| 5004 | /******/ !function() {
|
|---|
| 5005 | /******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
|---|
| 5006 | /******/ }();
|
|---|
| 5007 | /******/
|
|---|
| 5008 | /******/ /* webpack/runtime/make namespace object */
|
|---|
| 5009 | /******/ !function() {
|
|---|
| 5010 | /******/ // define __esModule on exports
|
|---|
| 5011 | /******/ __webpack_require__.r = function(exports) {
|
|---|
| 5012 | /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|---|
| 5013 | /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|---|
| 5014 | /******/ }
|
|---|
| 5015 | /******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|---|
| 5016 | /******/ };
|
|---|
| 5017 | /******/ }();
|
|---|
| 5018 | /******/
|
|---|
| 5019 | /************************************************************************/
|
|---|
| 5020 | var __webpack_exports__ = {};
|
|---|
| 5021 | // This entry need to be wrapped in an IIFE because it need to be in strict mode.
|
|---|
| 5022 | !function() {
|
|---|
| 5023 | "use strict";
|
|---|
| 5024 | /*!***************************************************!*\
|
|---|
| 5025 | !*** ./client-src/modules/sockjs-client/index.js ***!
|
|---|
| 5026 | \***************************************************/
|
|---|
| 5027 | __webpack_require__.r(__webpack_exports__);
|
|---|
| 5028 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|---|
| 5029 | /* harmony export */ "default": function() { return /* reexport default from dynamic */ sockjs_client__WEBPACK_IMPORTED_MODULE_0___default.a; }
|
|---|
| 5030 | /* harmony export */ });
|
|---|
| 5031 | /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! sockjs-client */ "./node_modules/sockjs-client/lib/entry.js");
|
|---|
| 5032 | /* harmony import */ var sockjs_client__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(sockjs_client__WEBPACK_IMPORTED_MODULE_0__);
|
|---|
| 5033 | // eslint-disable-next-line import/no-extraneous-dependencies
|
|---|
| 5034 |
|
|---|
| 5035 | }();
|
|---|
| 5036 | /******/ return __webpack_exports__;
|
|---|
| 5037 | /******/ })()
|
|---|
| 5038 | ;
|
|---|
| 5039 | }); |
|---|