socket.io-rails 1.5.1 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ba854b3b3c090627315556323f4984b4952f2e47
4
- data.tar.gz: 4c88408cf0af54624d3b12a259dbd512f3b9d508
3
+ metadata.gz: bcf46c29a28f410fbc34c2026e4ad3b3171baac8
4
+ data.tar.gz: c6703adc8df77902e706a5a7a86e3b54c861148c
5
5
  SHA512:
6
- metadata.gz: 79c7d7f76e85d5c9a283173e869b3b19e01f862a4de12f5d44ac9265f9ca721304acc707215027ecfe1e07277a25facad590756fd6e923fa6b3a6a2f0f35b4e1
7
- data.tar.gz: 0a52e44735a70cbf79859539868155565a90ae7fe1e20185c8a83d00d3b34f12de527e166825345c4f2dfb50ba698de4dc3283863cacba5bf6c891af8d255c16
6
+ metadata.gz: 8043693bf2dbd3a2b4eb63837e6c13992840d01551b88af2628d85ba44551dd0f095802252172a2a9680d22d1cf168f88c1af51a43644e381bc2a5a10b1a86f6
7
+ data.tar.gz: d283f351d79e00402a64decd52dd5887a0ddcd923aa97a5d975d7bcd2475f4104fb19d3c1767153f4b8baa2ef45928340e3f1ca94be4f9e5e395494ad7dd34d8
@@ -1,5 +1,5 @@
1
1
  module Socketio
2
2
  module Rails
3
- VERSION = "1.5.1"
3
+ VERSION = "1.6.0"
4
4
  end
5
5
  end
@@ -63,8 +63,8 @@ return /******/ (function(modules) { // webpackBootstrap
63
63
  */
64
64
 
65
65
  var url = __webpack_require__(1);
66
- var parser = __webpack_require__(6);
67
- var Manager = __webpack_require__(13);
66
+ var parser = __webpack_require__(7);
67
+ var Manager = __webpack_require__(17);
68
68
  var debug = __webpack_require__(3)('socket.io-client');
69
69
 
70
70
  /**
@@ -163,8 +163,8 @@ return /******/ (function(modules) { // webpackBootstrap
163
163
  * @api public
164
164
  */
165
165
 
166
- exports.Manager = __webpack_require__(13);
167
- exports.Socket = __webpack_require__(40);
166
+ exports.Manager = __webpack_require__(17);
167
+ exports.Socket = __webpack_require__(45);
168
168
 
169
169
  /***/ },
170
170
  /* 1 */
@@ -252,59 +252,59 @@ return /******/ (function(modules) { // webpackBootstrap
252
252
  /* 2 */
253
253
  /***/ function(module, exports) {
254
254
 
255
- /**
256
- * Parses an URI
257
- *
258
- * @author Steven Levithan <stevenlevithan.com> (MIT license)
259
- * @api private
260
- */
261
-
262
- var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
263
-
264
- var parts = [
265
- 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
266
- ];
267
-
268
- module.exports = function parseuri(str) {
269
- var src = str,
270
- b = str.indexOf('['),
271
- e = str.indexOf(']');
272
-
273
- if (b != -1 && e != -1) {
274
- str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
275
- }
276
-
277
- var m = re.exec(str || ''),
278
- uri = {},
279
- i = 14;
280
-
281
- while (i--) {
282
- uri[parts[i]] = m[i] || '';
283
- }
284
-
285
- if (b != -1 && e != -1) {
286
- uri.source = src;
287
- uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
288
- uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
289
- uri.ipv6uri = true;
290
- }
291
-
292
- return uri;
293
- };
255
+ /**
256
+ * Parses an URI
257
+ *
258
+ * @author Steven Levithan <stevenlevithan.com> (MIT license)
259
+ * @api private
260
+ */
261
+
262
+ var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
263
+
264
+ var parts = [
265
+ 'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'
266
+ ];
267
+
268
+ module.exports = function parseuri(str) {
269
+ var src = str,
270
+ b = str.indexOf('['),
271
+ e = str.indexOf(']');
272
+
273
+ if (b != -1 && e != -1) {
274
+ str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
275
+ }
276
+
277
+ var m = re.exec(str || ''),
278
+ uri = {},
279
+ i = 14;
280
+
281
+ while (i--) {
282
+ uri[parts[i]] = m[i] || '';
283
+ }
284
+
285
+ if (b != -1 && e != -1) {
286
+ uri.source = src;
287
+ uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
288
+ uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
289
+ uri.ipv6uri = true;
290
+ }
291
+
292
+ return uri;
293
+ };
294
294
 
295
295
 
296
296
  /***/ },
297
297
  /* 3 */
298
298
  /***/ function(module, exports, __webpack_require__) {
299
299
 
300
-
300
+ /* WEBPACK VAR INJECTION */(function(process) {
301
301
  /**
302
302
  * This is the web browser implementation of `debug()`.
303
303
  *
304
304
  * Expose `debug()` as the module.
305
305
  */
306
306
 
307
- exports = module.exports = __webpack_require__(4);
307
+ exports = module.exports = __webpack_require__(5);
308
308
  exports.log = log;
309
309
  exports.formatArgs = formatArgs;
310
310
  exports.save = save;
@@ -338,7 +338,8 @@ return /******/ (function(modules) { // webpackBootstrap
338
338
 
339
339
  function useColors() {
340
340
  // is webkit? http://stackoverflow.com/a/16459606/376773
341
- return ('WebkitAppearance' in document.documentElement.style) ||
341
+ // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
342
+ return (typeof document !== 'undefined' && 'WebkitAppearance' in document.documentElement.style) ||
342
343
  // is firebug? http://stackoverflow.com/a/398120/376773
343
344
  (window.console && (console.firebug || (console.exception && console.table))) ||
344
345
  // is firefox >= v31?
@@ -351,7 +352,11 @@ return /******/ (function(modules) { // webpackBootstrap
351
352
  */
352
353
 
353
354
  exports.formatters.j = function(v) {
354
- return JSON.stringify(v);
355
+ try {
356
+ return JSON.stringify(v);
357
+ } catch (err) {
358
+ return '[UnexpectedJSONParseError]: ' + err.message;
359
+ }
355
360
  };
356
361
 
357
362
 
@@ -438,9 +443,13 @@ return /******/ (function(modules) { // webpackBootstrap
438
443
  function load() {
439
444
  var r;
440
445
  try {
441
- r = exports.storage.debug;
446
+ return exports.storage.debug;
442
447
  } catch(e) {}
443
- return r;
448
+
449
+ // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
450
+ if (typeof process !== 'undefined' && 'env' in process) {
451
+ return process.env.DEBUG;
452
+ }
444
453
  }
445
454
 
446
455
  /**
@@ -466,9 +475,196 @@ return /******/ (function(modules) { // webpackBootstrap
466
475
  } catch (e) {}
467
476
  }
468
477
 
478
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
469
479
 
470
480
  /***/ },
471
481
  /* 4 */
482
+ /***/ function(module, exports) {
483
+
484
+ // shim for using process in browser
485
+ var process = module.exports = {};
486
+
487
+ // cached from whatever global is present so that test runners that stub it
488
+ // don't break things. But we need to wrap it in a try catch in case it is
489
+ // wrapped in strict mode code which doesn't define any globals. It's inside a
490
+ // function because try/catches deoptimize in certain engines.
491
+
492
+ var cachedSetTimeout;
493
+ var cachedClearTimeout;
494
+
495
+ function defaultSetTimout() {
496
+ throw new Error('setTimeout has not been defined');
497
+ }
498
+ function defaultClearTimeout () {
499
+ throw new Error('clearTimeout has not been defined');
500
+ }
501
+ (function () {
502
+ try {
503
+ if (typeof setTimeout === 'function') {
504
+ cachedSetTimeout = setTimeout;
505
+ } else {
506
+ cachedSetTimeout = defaultSetTimout;
507
+ }
508
+ } catch (e) {
509
+ cachedSetTimeout = defaultSetTimout;
510
+ }
511
+ try {
512
+ if (typeof clearTimeout === 'function') {
513
+ cachedClearTimeout = clearTimeout;
514
+ } else {
515
+ cachedClearTimeout = defaultClearTimeout;
516
+ }
517
+ } catch (e) {
518
+ cachedClearTimeout = defaultClearTimeout;
519
+ }
520
+ } ())
521
+ function runTimeout(fun) {
522
+ if (cachedSetTimeout === setTimeout) {
523
+ //normal enviroments in sane situations
524
+ return setTimeout(fun, 0);
525
+ }
526
+ // if setTimeout wasn't available but was latter defined
527
+ if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
528
+ cachedSetTimeout = setTimeout;
529
+ return setTimeout(fun, 0);
530
+ }
531
+ try {
532
+ // when when somebody has screwed with setTimeout but no I.E. maddness
533
+ return cachedSetTimeout(fun, 0);
534
+ } catch(e){
535
+ try {
536
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
537
+ return cachedSetTimeout.call(null, fun, 0);
538
+ } catch(e){
539
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error
540
+ return cachedSetTimeout.call(this, fun, 0);
541
+ }
542
+ }
543
+
544
+
545
+ }
546
+ function runClearTimeout(marker) {
547
+ if (cachedClearTimeout === clearTimeout) {
548
+ //normal enviroments in sane situations
549
+ return clearTimeout(marker);
550
+ }
551
+ // if clearTimeout wasn't available but was latter defined
552
+ if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
553
+ cachedClearTimeout = clearTimeout;
554
+ return clearTimeout(marker);
555
+ }
556
+ try {
557
+ // when when somebody has screwed with setTimeout but no I.E. maddness
558
+ return cachedClearTimeout(marker);
559
+ } catch (e){
560
+ try {
561
+ // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
562
+ return cachedClearTimeout.call(null, marker);
563
+ } catch (e){
564
+ // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.
565
+ // Some versions of I.E. have different rules for clearTimeout vs setTimeout
566
+ return cachedClearTimeout.call(this, marker);
567
+ }
568
+ }
569
+
570
+
571
+
572
+ }
573
+ var queue = [];
574
+ var draining = false;
575
+ var currentQueue;
576
+ var queueIndex = -1;
577
+
578
+ function cleanUpNextTick() {
579
+ if (!draining || !currentQueue) {
580
+ return;
581
+ }
582
+ draining = false;
583
+ if (currentQueue.length) {
584
+ queue = currentQueue.concat(queue);
585
+ } else {
586
+ queueIndex = -1;
587
+ }
588
+ if (queue.length) {
589
+ drainQueue();
590
+ }
591
+ }
592
+
593
+ function drainQueue() {
594
+ if (draining) {
595
+ return;
596
+ }
597
+ var timeout = runTimeout(cleanUpNextTick);
598
+ draining = true;
599
+
600
+ var len = queue.length;
601
+ while(len) {
602
+ currentQueue = queue;
603
+ queue = [];
604
+ while (++queueIndex < len) {
605
+ if (currentQueue) {
606
+ currentQueue[queueIndex].run();
607
+ }
608
+ }
609
+ queueIndex = -1;
610
+ len = queue.length;
611
+ }
612
+ currentQueue = null;
613
+ draining = false;
614
+ runClearTimeout(timeout);
615
+ }
616
+
617
+ process.nextTick = function (fun) {
618
+ var args = new Array(arguments.length - 1);
619
+ if (arguments.length > 1) {
620
+ for (var i = 1; i < arguments.length; i++) {
621
+ args[i - 1] = arguments[i];
622
+ }
623
+ }
624
+ queue.push(new Item(fun, args));
625
+ if (queue.length === 1 && !draining) {
626
+ runTimeout(drainQueue);
627
+ }
628
+ };
629
+
630
+ // v8 likes predictible objects
631
+ function Item(fun, array) {
632
+ this.fun = fun;
633
+ this.array = array;
634
+ }
635
+ Item.prototype.run = function () {
636
+ this.fun.apply(null, this.array);
637
+ };
638
+ process.title = 'browser';
639
+ process.browser = true;
640
+ process.env = {};
641
+ process.argv = [];
642
+ process.version = ''; // empty string to avoid regexp issues
643
+ process.versions = {};
644
+
645
+ function noop() {}
646
+
647
+ process.on = noop;
648
+ process.addListener = noop;
649
+ process.once = noop;
650
+ process.off = noop;
651
+ process.removeListener = noop;
652
+ process.removeAllListeners = noop;
653
+ process.emit = noop;
654
+
655
+ process.binding = function (name) {
656
+ throw new Error('process.binding is not supported');
657
+ };
658
+
659
+ process.cwd = function () { return '/' };
660
+ process.chdir = function (dir) {
661
+ throw new Error('process.chdir is not supported');
662
+ };
663
+ process.umask = function() { return 0; };
664
+
665
+
666
+ /***/ },
667
+ /* 5 */
472
668
  /***/ function(module, exports, __webpack_require__) {
473
669
 
474
670
 
@@ -479,12 +675,12 @@ return /******/ (function(modules) { // webpackBootstrap
479
675
  * Expose `debug()` as the module.
480
676
  */
481
677
 
482
- exports = module.exports = debug;
678
+ exports = module.exports = debug.debug = debug;
483
679
  exports.coerce = coerce;
484
680
  exports.disable = disable;
485
681
  exports.enable = enable;
486
682
  exports.enabled = enabled;
487
- exports.humanize = __webpack_require__(5);
683
+ exports.humanize = __webpack_require__(6);
488
684
 
489
685
  /**
490
686
  * The currently active debug mode names, and names to skip.
@@ -556,7 +752,10 @@ return /******/ (function(modules) { // webpackBootstrap
556
752
  if (null == self.useColors) self.useColors = exports.useColors();
557
753
  if (null == self.color && self.useColors) self.color = selectColor();
558
754
 
559
- var args = Array.prototype.slice.call(arguments);
755
+ var args = new Array(arguments.length);
756
+ for (var i = 0; i < args.length; i++) {
757
+ args[i] = arguments[i];
758
+ }
560
759
 
561
760
  args[0] = exports.coerce(args[0]);
562
761
 
@@ -583,9 +782,9 @@ return /******/ (function(modules) { // webpackBootstrap
583
782
  return match;
584
783
  });
585
784
 
586
- if ('function' === typeof exports.formatArgs) {
587
- args = exports.formatArgs.apply(self, args);
588
- }
785
+ // apply env-specific formatting
786
+ args = exports.formatArgs.apply(self, args);
787
+
589
788
  var logFn = enabled.log || exports.log || console.log.bind(console);
590
789
  logFn.apply(self, args);
591
790
  }
@@ -614,7 +813,7 @@ return /******/ (function(modules) { // webpackBootstrap
614
813
 
615
814
  for (var i = 0; i < len; i++) {
616
815
  if (!split[i]) continue; // ignore empty strings
617
- namespaces = split[i].replace(/\*/g, '.*?');
816
+ namespaces = split[i].replace(/[\\^$+?.()|[\]{}]/g, '\\$&').replace(/\*/g, '.*?');
618
817
  if (namespaces[0] === '-') {
619
818
  exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
620
819
  } else {
@@ -671,18 +870,18 @@ return /******/ (function(modules) { // webpackBootstrap
671
870
 
672
871
 
673
872
  /***/ },
674
- /* 5 */
873
+ /* 6 */
675
874
  /***/ function(module, exports) {
676
875
 
677
876
  /**
678
877
  * Helpers.
679
878
  */
680
879
 
681
- var s = 1000;
682
- var m = s * 60;
683
- var h = m * 60;
684
- var d = h * 24;
685
- var y = d * 365.25;
880
+ var s = 1000
881
+ var m = s * 60
882
+ var h = m * 60
883
+ var d = h * 24
884
+ var y = d * 365.25
686
885
 
687
886
  /**
688
887
  * Parse or format the given `val`.
@@ -693,17 +892,23 @@ return /******/ (function(modules) { // webpackBootstrap
693
892
  *
694
893
  * @param {String|Number} val
695
894
  * @param {Object} options
895
+ * @throws {Error} throw an error if val is not a non-empty string or a number
696
896
  * @return {String|Number}
697
897
  * @api public
698
898
  */
699
899
 
700
- module.exports = function(val, options){
701
- options = options || {};
702
- if ('string' == typeof val) return parse(val);
703
- return options.long
704
- ? long(val)
705
- : short(val);
706
- };
900
+ module.exports = function (val, options) {
901
+ options = options || {}
902
+ var type = typeof val
903
+ if (type === 'string' && val.length > 0) {
904
+ return parse(val)
905
+ } else if (type === 'number' && isNaN(val) === false) {
906
+ return options.long ?
907
+ fmtLong(val) :
908
+ fmtShort(val)
909
+ }
910
+ throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val))
911
+ }
707
912
 
708
913
  /**
709
914
  * Parse the given `str` and return milliseconds.
@@ -714,47 +919,53 @@ return /******/ (function(modules) { // webpackBootstrap
714
919
  */
715
920
 
716
921
  function parse(str) {
717
- str = '' + str;
718
- if (str.length > 10000) return;
719
- var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
720
- if (!match) return;
721
- var n = parseFloat(match[1]);
722
- var type = (match[2] || 'ms').toLowerCase();
922
+ str = String(str)
923
+ if (str.length > 10000) {
924
+ return
925
+ }
926
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str)
927
+ if (!match) {
928
+ return
929
+ }
930
+ var n = parseFloat(match[1])
931
+ var type = (match[2] || 'ms').toLowerCase()
723
932
  switch (type) {
724
933
  case 'years':
725
934
  case 'year':
726
935
  case 'yrs':
727
936
  case 'yr':
728
937
  case 'y':
729
- return n * y;
938
+ return n * y
730
939
  case 'days':
731
940
  case 'day':
732
941
  case 'd':
733
- return n * d;
942
+ return n * d
734
943
  case 'hours':
735
944
  case 'hour':
736
945
  case 'hrs':
737
946
  case 'hr':
738
947
  case 'h':
739
- return n * h;
948
+ return n * h
740
949
  case 'minutes':
741
950
  case 'minute':
742
951
  case 'mins':
743
952
  case 'min':
744
953
  case 'm':
745
- return n * m;
954
+ return n * m
746
955
  case 'seconds':
747
956
  case 'second':
748
957
  case 'secs':
749
958
  case 'sec':
750
959
  case 's':
751
- return n * s;
960
+ return n * s
752
961
  case 'milliseconds':
753
962
  case 'millisecond':
754
963
  case 'msecs':
755
964
  case 'msec':
756
965
  case 'ms':
757
- return n;
966
+ return n
967
+ default:
968
+ return undefined
758
969
  }
759
970
  }
760
971
 
@@ -766,12 +977,20 @@ return /******/ (function(modules) { // webpackBootstrap
766
977
  * @api private
767
978
  */
768
979
 
769
- function short(ms) {
770
- if (ms >= d) return Math.round(ms / d) + 'd';
771
- if (ms >= h) return Math.round(ms / h) + 'h';
772
- if (ms >= m) return Math.round(ms / m) + 'm';
773
- if (ms >= s) return Math.round(ms / s) + 's';
774
- return ms + 'ms';
980
+ function fmtShort(ms) {
981
+ if (ms >= d) {
982
+ return Math.round(ms / d) + 'd'
983
+ }
984
+ if (ms >= h) {
985
+ return Math.round(ms / h) + 'h'
986
+ }
987
+ if (ms >= m) {
988
+ return Math.round(ms / m) + 'm'
989
+ }
990
+ if (ms >= s) {
991
+ return Math.round(ms / s) + 's'
992
+ }
993
+ return ms + 'ms'
775
994
  }
776
995
 
777
996
  /**
@@ -782,12 +1001,12 @@ return /******/ (function(modules) { // webpackBootstrap
782
1001
  * @api private
783
1002
  */
784
1003
 
785
- function long(ms) {
786
- return plural(ms, d, 'day')
787
- || plural(ms, h, 'hour')
788
- || plural(ms, m, 'minute')
789
- || plural(ms, s, 'second')
790
- || ms + ' ms';
1004
+ function fmtLong(ms) {
1005
+ return plural(ms, d, 'day') ||
1006
+ plural(ms, h, 'hour') ||
1007
+ plural(ms, m, 'minute') ||
1008
+ plural(ms, s, 'second') ||
1009
+ ms + ' ms'
791
1010
  }
792
1011
 
793
1012
  /**
@@ -795,14 +1014,18 @@ return /******/ (function(modules) { // webpackBootstrap
795
1014
  */
796
1015
 
797
1016
  function plural(ms, n, name) {
798
- if (ms < n) return;
799
- if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
800
- return Math.ceil(ms / n) + ' ' + name + 's';
1017
+ if (ms < n) {
1018
+ return
1019
+ }
1020
+ if (ms < n * 1.5) {
1021
+ return Math.floor(ms / n) + ' ' + name
1022
+ }
1023
+ return Math.ceil(ms / n) + ' ' + name + 's'
801
1024
  }
802
1025
 
803
1026
 
804
1027
  /***/ },
805
- /* 6 */
1028
+ /* 7 */
806
1029
  /***/ function(module, exports, __webpack_require__) {
807
1030
 
808
1031
 
@@ -810,12 +1033,11 @@ return /******/ (function(modules) { // webpackBootstrap
810
1033
  * Module dependencies.
811
1034
  */
812
1035
 
813
- var debug = __webpack_require__(3)('socket.io-parser');
814
- var json = __webpack_require__(7);
815
- var isArray = __webpack_require__(9);
816
- var Emitter = __webpack_require__(10);
817
- var binary = __webpack_require__(11);
818
- var isBuf = __webpack_require__(12);
1036
+ var debug = __webpack_require__(8)('socket.io-parser');
1037
+ var json = __webpack_require__(11);
1038
+ var Emitter = __webpack_require__(13);
1039
+ var binary = __webpack_require__(14);
1040
+ var isBuf = __webpack_require__(16);
819
1041
 
820
1042
  /**
821
1043
  * Protocol version.
@@ -1032,183 +1254,696 @@ return /******/ (function(modules) { // webpackBootstrap
1032
1254
  Emitter(Decoder.prototype);
1033
1255
 
1034
1256
  /**
1035
- * Decodes an ecoded packet string into packet JSON.
1257
+ * Decodes an ecoded packet string into packet JSON.
1258
+ *
1259
+ * @param {String} obj - encoded packet
1260
+ * @return {Object} packet
1261
+ * @api public
1262
+ */
1263
+
1264
+ Decoder.prototype.add = function(obj) {
1265
+ var packet;
1266
+ if ('string' == typeof obj) {
1267
+ packet = decodeString(obj);
1268
+ if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json
1269
+ this.reconstructor = new BinaryReconstructor(packet);
1270
+
1271
+ // no attachments, labeled binary but no binary data to follow
1272
+ if (this.reconstructor.reconPack.attachments === 0) {
1273
+ this.emit('decoded', packet);
1274
+ }
1275
+ } else { // non-binary full packet
1276
+ this.emit('decoded', packet);
1277
+ }
1278
+ }
1279
+ else if (isBuf(obj) || obj.base64) { // raw binary data
1280
+ if (!this.reconstructor) {
1281
+ throw new Error('got binary data when not reconstructing a packet');
1282
+ } else {
1283
+ packet = this.reconstructor.takeBinaryData(obj);
1284
+ if (packet) { // received final buffer
1285
+ this.reconstructor = null;
1286
+ this.emit('decoded', packet);
1287
+ }
1288
+ }
1289
+ }
1290
+ else {
1291
+ throw new Error('Unknown type: ' + obj);
1292
+ }
1293
+ };
1294
+
1295
+ /**
1296
+ * Decode a packet String (JSON data)
1297
+ *
1298
+ * @param {String} str
1299
+ * @return {Object} packet
1300
+ * @api private
1301
+ */
1302
+
1303
+ function decodeString(str) {
1304
+ var p = {};
1305
+ var i = 0;
1306
+
1307
+ // look up type
1308
+ p.type = Number(str.charAt(0));
1309
+ if (null == exports.types[p.type]) return error();
1310
+
1311
+ // look up attachments if type binary
1312
+ if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {
1313
+ var buf = '';
1314
+ while (str.charAt(++i) != '-') {
1315
+ buf += str.charAt(i);
1316
+ if (i == str.length) break;
1317
+ }
1318
+ if (buf != Number(buf) || str.charAt(i) != '-') {
1319
+ throw new Error('Illegal attachments');
1320
+ }
1321
+ p.attachments = Number(buf);
1322
+ }
1323
+
1324
+ // look up namespace (if any)
1325
+ if ('/' == str.charAt(i + 1)) {
1326
+ p.nsp = '';
1327
+ while (++i) {
1328
+ var c = str.charAt(i);
1329
+ if (',' == c) break;
1330
+ p.nsp += c;
1331
+ if (i == str.length) break;
1332
+ }
1333
+ } else {
1334
+ p.nsp = '/';
1335
+ }
1336
+
1337
+ // look up id
1338
+ var next = str.charAt(i + 1);
1339
+ if ('' !== next && Number(next) == next) {
1340
+ p.id = '';
1341
+ while (++i) {
1342
+ var c = str.charAt(i);
1343
+ if (null == c || Number(c) != c) {
1344
+ --i;
1345
+ break;
1346
+ }
1347
+ p.id += str.charAt(i);
1348
+ if (i == str.length) break;
1349
+ }
1350
+ p.id = Number(p.id);
1351
+ }
1352
+
1353
+ // look up json data
1354
+ if (str.charAt(++i)) {
1355
+ p = tryParse(p, str.substr(i));
1356
+ }
1357
+
1358
+ debug('decoded %s as %j', str, p);
1359
+ return p;
1360
+ }
1361
+
1362
+ function tryParse(p, str) {
1363
+ try {
1364
+ p.data = json.parse(str);
1365
+ } catch(e){
1366
+ return error();
1367
+ }
1368
+ return p;
1369
+ };
1370
+
1371
+ /**
1372
+ * Deallocates a parser's resources
1373
+ *
1374
+ * @api public
1375
+ */
1376
+
1377
+ Decoder.prototype.destroy = function() {
1378
+ if (this.reconstructor) {
1379
+ this.reconstructor.finishedReconstruction();
1380
+ }
1381
+ };
1382
+
1383
+ /**
1384
+ * A manager of a binary event's 'buffer sequence'. Should
1385
+ * be constructed whenever a packet of type BINARY_EVENT is
1386
+ * decoded.
1387
+ *
1388
+ * @param {Object} packet
1389
+ * @return {BinaryReconstructor} initialized reconstructor
1390
+ * @api private
1391
+ */
1392
+
1393
+ function BinaryReconstructor(packet) {
1394
+ this.reconPack = packet;
1395
+ this.buffers = [];
1396
+ }
1397
+
1398
+ /**
1399
+ * Method to be called when binary data received from connection
1400
+ * after a BINARY_EVENT packet.
1401
+ *
1402
+ * @param {Buffer | ArrayBuffer} binData - the raw binary data received
1403
+ * @return {null | Object} returns null if more binary data is expected or
1404
+ * a reconstructed packet object if all buffers have been received.
1405
+ * @api private
1406
+ */
1407
+
1408
+ BinaryReconstructor.prototype.takeBinaryData = function(binData) {
1409
+ this.buffers.push(binData);
1410
+ if (this.buffers.length == this.reconPack.attachments) { // done with buffer list
1411
+ var packet = binary.reconstructPacket(this.reconPack, this.buffers);
1412
+ this.finishedReconstruction();
1413
+ return packet;
1414
+ }
1415
+ return null;
1416
+ };
1417
+
1418
+ /**
1419
+ * Cleans up binary packet reconstruction variables.
1420
+ *
1421
+ * @api private
1422
+ */
1423
+
1424
+ BinaryReconstructor.prototype.finishedReconstruction = function() {
1425
+ this.reconPack = null;
1426
+ this.buffers = [];
1427
+ };
1428
+
1429
+ function error(data){
1430
+ return {
1431
+ type: exports.ERROR,
1432
+ data: 'parser error'
1433
+ };
1434
+ }
1435
+
1436
+
1437
+ /***/ },
1438
+ /* 8 */
1439
+ /***/ function(module, exports, __webpack_require__) {
1440
+
1441
+
1442
+ /**
1443
+ * This is the web browser implementation of `debug()`.
1444
+ *
1445
+ * Expose `debug()` as the module.
1446
+ */
1447
+
1448
+ exports = module.exports = __webpack_require__(9);
1449
+ exports.log = log;
1450
+ exports.formatArgs = formatArgs;
1451
+ exports.save = save;
1452
+ exports.load = load;
1453
+ exports.useColors = useColors;
1454
+ exports.storage = 'undefined' != typeof chrome
1455
+ && 'undefined' != typeof chrome.storage
1456
+ ? chrome.storage.local
1457
+ : localstorage();
1458
+
1459
+ /**
1460
+ * Colors.
1461
+ */
1462
+
1463
+ exports.colors = [
1464
+ 'lightseagreen',
1465
+ 'forestgreen',
1466
+ 'goldenrod',
1467
+ 'dodgerblue',
1468
+ 'darkorchid',
1469
+ 'crimson'
1470
+ ];
1471
+
1472
+ /**
1473
+ * Currently only WebKit-based Web Inspectors, Firefox >= v31,
1474
+ * and the Firebug extension (any Firefox version) are known
1475
+ * to support "%c" CSS customizations.
1476
+ *
1477
+ * TODO: add a `localStorage` variable to explicitly enable/disable colors
1478
+ */
1479
+
1480
+ function useColors() {
1481
+ // is webkit? http://stackoverflow.com/a/16459606/376773
1482
+ return ('WebkitAppearance' in document.documentElement.style) ||
1483
+ // is firebug? http://stackoverflow.com/a/398120/376773
1484
+ (window.console && (console.firebug || (console.exception && console.table))) ||
1485
+ // is firefox >= v31?
1486
+ // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
1487
+ (navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31);
1488
+ }
1489
+
1490
+ /**
1491
+ * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
1492
+ */
1493
+
1494
+ exports.formatters.j = function(v) {
1495
+ return JSON.stringify(v);
1496
+ };
1497
+
1498
+
1499
+ /**
1500
+ * Colorize log arguments if enabled.
1501
+ *
1502
+ * @api public
1503
+ */
1504
+
1505
+ function formatArgs() {
1506
+ var args = arguments;
1507
+ var useColors = this.useColors;
1508
+
1509
+ args[0] = (useColors ? '%c' : '')
1510
+ + this.namespace
1511
+ + (useColors ? ' %c' : ' ')
1512
+ + args[0]
1513
+ + (useColors ? '%c ' : ' ')
1514
+ + '+' + exports.humanize(this.diff);
1515
+
1516
+ if (!useColors) return args;
1517
+
1518
+ var c = 'color: ' + this.color;
1519
+ args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));
1520
+
1521
+ // the final "%c" is somewhat tricky, because there could be other
1522
+ // arguments passed either before or after the %c, so we need to
1523
+ // figure out the correct index to insert the CSS into
1524
+ var index = 0;
1525
+ var lastC = 0;
1526
+ args[0].replace(/%[a-z%]/g, function(match) {
1527
+ if ('%%' === match) return;
1528
+ index++;
1529
+ if ('%c' === match) {
1530
+ // we only are interested in the *last* %c
1531
+ // (the user may have provided their own)
1532
+ lastC = index;
1533
+ }
1534
+ });
1535
+
1536
+ args.splice(lastC, 0, c);
1537
+ return args;
1538
+ }
1539
+
1540
+ /**
1541
+ * Invokes `console.log()` when available.
1542
+ * No-op when `console.log` is not a "function".
1543
+ *
1544
+ * @api public
1545
+ */
1546
+
1547
+ function log() {
1548
+ // this hackery is required for IE8/9, where
1549
+ // the `console.log` function doesn't have 'apply'
1550
+ return 'object' === typeof console
1551
+ && console.log
1552
+ && Function.prototype.apply.call(console.log, console, arguments);
1553
+ }
1554
+
1555
+ /**
1556
+ * Save `namespaces`.
1557
+ *
1558
+ * @param {String} namespaces
1559
+ * @api private
1560
+ */
1561
+
1562
+ function save(namespaces) {
1563
+ try {
1564
+ if (null == namespaces) {
1565
+ exports.storage.removeItem('debug');
1566
+ } else {
1567
+ exports.storage.debug = namespaces;
1568
+ }
1569
+ } catch(e) {}
1570
+ }
1571
+
1572
+ /**
1573
+ * Load `namespaces`.
1574
+ *
1575
+ * @return {String} returns the previously persisted debug modes
1576
+ * @api private
1577
+ */
1578
+
1579
+ function load() {
1580
+ var r;
1581
+ try {
1582
+ r = exports.storage.debug;
1583
+ } catch(e) {}
1584
+ return r;
1585
+ }
1586
+
1587
+ /**
1588
+ * Enable namespaces listed in `localStorage.debug` initially.
1589
+ */
1590
+
1591
+ exports.enable(load());
1592
+
1593
+ /**
1594
+ * Localstorage attempts to return the localstorage.
1595
+ *
1596
+ * This is necessary because safari throws
1597
+ * when a user disables cookies/localstorage
1598
+ * and you attempt to access it.
1599
+ *
1600
+ * @return {LocalStorage}
1601
+ * @api private
1602
+ */
1603
+
1604
+ function localstorage(){
1605
+ try {
1606
+ return window.localStorage;
1607
+ } catch (e) {}
1608
+ }
1609
+
1610
+
1611
+ /***/ },
1612
+ /* 9 */
1613
+ /***/ function(module, exports, __webpack_require__) {
1614
+
1615
+
1616
+ /**
1617
+ * This is the common logic for both the Node.js and web browser
1618
+ * implementations of `debug()`.
1619
+ *
1620
+ * Expose `debug()` as the module.
1621
+ */
1622
+
1623
+ exports = module.exports = debug;
1624
+ exports.coerce = coerce;
1625
+ exports.disable = disable;
1626
+ exports.enable = enable;
1627
+ exports.enabled = enabled;
1628
+ exports.humanize = __webpack_require__(10);
1629
+
1630
+ /**
1631
+ * The currently active debug mode names, and names to skip.
1632
+ */
1633
+
1634
+ exports.names = [];
1635
+ exports.skips = [];
1636
+
1637
+ /**
1638
+ * Map of special "%n" handling functions, for the debug "format" argument.
1639
+ *
1640
+ * Valid key names are a single, lowercased letter, i.e. "n".
1641
+ */
1642
+
1643
+ exports.formatters = {};
1644
+
1645
+ /**
1646
+ * Previously assigned color.
1647
+ */
1648
+
1649
+ var prevColor = 0;
1650
+
1651
+ /**
1652
+ * Previous log timestamp.
1653
+ */
1654
+
1655
+ var prevTime;
1656
+
1657
+ /**
1658
+ * Select a color.
1659
+ *
1660
+ * @return {Number}
1661
+ * @api private
1662
+ */
1663
+
1664
+ function selectColor() {
1665
+ return exports.colors[prevColor++ % exports.colors.length];
1666
+ }
1667
+
1668
+ /**
1669
+ * Create a debugger with the given `namespace`.
1670
+ *
1671
+ * @param {String} namespace
1672
+ * @return {Function}
1673
+ * @api public
1674
+ */
1675
+
1676
+ function debug(namespace) {
1677
+
1678
+ // define the `disabled` version
1679
+ function disabled() {
1680
+ }
1681
+ disabled.enabled = false;
1682
+
1683
+ // define the `enabled` version
1684
+ function enabled() {
1685
+
1686
+ var self = enabled;
1687
+
1688
+ // set `diff` timestamp
1689
+ var curr = +new Date();
1690
+ var ms = curr - (prevTime || curr);
1691
+ self.diff = ms;
1692
+ self.prev = prevTime;
1693
+ self.curr = curr;
1694
+ prevTime = curr;
1695
+
1696
+ // add the `color` if not set
1697
+ if (null == self.useColors) self.useColors = exports.useColors();
1698
+ if (null == self.color && self.useColors) self.color = selectColor();
1699
+
1700
+ var args = Array.prototype.slice.call(arguments);
1701
+
1702
+ args[0] = exports.coerce(args[0]);
1703
+
1704
+ if ('string' !== typeof args[0]) {
1705
+ // anything else let's inspect with %o
1706
+ args = ['%o'].concat(args);
1707
+ }
1708
+
1709
+ // apply any `formatters` transformations
1710
+ var index = 0;
1711
+ args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {
1712
+ // if we encounter an escaped % then don't increase the array index
1713
+ if (match === '%%') return match;
1714
+ index++;
1715
+ var formatter = exports.formatters[format];
1716
+ if ('function' === typeof formatter) {
1717
+ var val = args[index];
1718
+ match = formatter.call(self, val);
1719
+
1720
+ // now we need to remove `args[index]` since it's inlined in the `format`
1721
+ args.splice(index, 1);
1722
+ index--;
1723
+ }
1724
+ return match;
1725
+ });
1726
+
1727
+ if ('function' === typeof exports.formatArgs) {
1728
+ args = exports.formatArgs.apply(self, args);
1729
+ }
1730
+ var logFn = enabled.log || exports.log || console.log.bind(console);
1731
+ logFn.apply(self, args);
1732
+ }
1733
+ enabled.enabled = true;
1734
+
1735
+ var fn = exports.enabled(namespace) ? enabled : disabled;
1736
+
1737
+ fn.namespace = namespace;
1738
+
1739
+ return fn;
1740
+ }
1741
+
1742
+ /**
1743
+ * Enables a debug mode by namespaces. This can include modes
1744
+ * separated by a colon and wildcards.
1745
+ *
1746
+ * @param {String} namespaces
1747
+ * @api public
1748
+ */
1749
+
1750
+ function enable(namespaces) {
1751
+ exports.save(namespaces);
1752
+
1753
+ var split = (namespaces || '').split(/[\s,]+/);
1754
+ var len = split.length;
1755
+
1756
+ for (var i = 0; i < len; i++) {
1757
+ if (!split[i]) continue; // ignore empty strings
1758
+ namespaces = split[i].replace(/\*/g, '.*?');
1759
+ if (namespaces[0] === '-') {
1760
+ exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
1761
+ } else {
1762
+ exports.names.push(new RegExp('^' + namespaces + '$'));
1763
+ }
1764
+ }
1765
+ }
1766
+
1767
+ /**
1768
+ * Disable debug output.
1769
+ *
1770
+ * @api public
1771
+ */
1772
+
1773
+ function disable() {
1774
+ exports.enable('');
1775
+ }
1776
+
1777
+ /**
1778
+ * Returns true if the given mode name is enabled, false otherwise.
1036
1779
  *
1037
- * @param {String} obj - encoded packet
1038
- * @return {Object} packet
1780
+ * @param {String} name
1781
+ * @return {Boolean}
1039
1782
  * @api public
1040
1783
  */
1041
1784
 
1042
- Decoder.prototype.add = function(obj) {
1043
- var packet;
1044
- if ('string' == typeof obj) {
1045
- packet = decodeString(obj);
1046
- if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json
1047
- this.reconstructor = new BinaryReconstructor(packet);
1048
-
1049
- // no attachments, labeled binary but no binary data to follow
1050
- if (this.reconstructor.reconPack.attachments === 0) {
1051
- this.emit('decoded', packet);
1052
- }
1053
- } else { // non-binary full packet
1054
- this.emit('decoded', packet);
1785
+ function enabled(name) {
1786
+ var i, len;
1787
+ for (i = 0, len = exports.skips.length; i < len; i++) {
1788
+ if (exports.skips[i].test(name)) {
1789
+ return false;
1055
1790
  }
1056
1791
  }
1057
- else if (isBuf(obj) || obj.base64) { // raw binary data
1058
- if (!this.reconstructor) {
1059
- throw new Error('got binary data when not reconstructing a packet');
1060
- } else {
1061
- packet = this.reconstructor.takeBinaryData(obj);
1062
- if (packet) { // received final buffer
1063
- this.reconstructor = null;
1064
- this.emit('decoded', packet);
1065
- }
1792
+ for (i = 0, len = exports.names.length; i < len; i++) {
1793
+ if (exports.names[i].test(name)) {
1794
+ return true;
1066
1795
  }
1067
1796
  }
1068
- else {
1069
- throw new Error('Unknown type: ' + obj);
1070
- }
1071
- };
1797
+ return false;
1798
+ }
1072
1799
 
1073
1800
  /**
1074
- * Decode a packet String (JSON data)
1801
+ * Coerce `val`.
1075
1802
  *
1076
- * @param {String} str
1077
- * @return {Object} packet
1803
+ * @param {Mixed} val
1804
+ * @return {Mixed}
1078
1805
  * @api private
1079
1806
  */
1080
1807
 
1081
- function decodeString(str) {
1082
- var p = {};
1083
- var i = 0;
1084
-
1085
- // look up type
1086
- p.type = Number(str.charAt(0));
1087
- if (null == exports.types[p.type]) return error();
1088
-
1089
- // look up attachments if type binary
1090
- if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {
1091
- var buf = '';
1092
- while (str.charAt(++i) != '-') {
1093
- buf += str.charAt(i);
1094
- if (i == str.length) break;
1095
- }
1096
- if (buf != Number(buf) || str.charAt(i) != '-') {
1097
- throw new Error('Illegal attachments');
1098
- }
1099
- p.attachments = Number(buf);
1100
- }
1808
+ function coerce(val) {
1809
+ if (val instanceof Error) return val.stack || val.message;
1810
+ return val;
1811
+ }
1101
1812
 
1102
- // look up namespace (if any)
1103
- if ('/' == str.charAt(i + 1)) {
1104
- p.nsp = '';
1105
- while (++i) {
1106
- var c = str.charAt(i);
1107
- if (',' == c) break;
1108
- p.nsp += c;
1109
- if (i == str.length) break;
1110
- }
1111
- } else {
1112
- p.nsp = '/';
1113
- }
1114
1813
 
1115
- // look up id
1116
- var next = str.charAt(i + 1);
1117
- if ('' !== next && Number(next) == next) {
1118
- p.id = '';
1119
- while (++i) {
1120
- var c = str.charAt(i);
1121
- if (null == c || Number(c) != c) {
1122
- --i;
1123
- break;
1124
- }
1125
- p.id += str.charAt(i);
1126
- if (i == str.length) break;
1127
- }
1128
- p.id = Number(p.id);
1129
- }
1814
+ /***/ },
1815
+ /* 10 */
1816
+ /***/ function(module, exports) {
1130
1817
 
1131
- // look up json data
1132
- if (str.charAt(++i)) {
1133
- try {
1134
- p.data = json.parse(str.substr(i));
1135
- } catch(e){
1136
- return error();
1137
- }
1138
- }
1818
+ /**
1819
+ * Helpers.
1820
+ */
1139
1821
 
1140
- debug('decoded %s as %j', str, p);
1141
- return p;
1142
- }
1822
+ var s = 1000;
1823
+ var m = s * 60;
1824
+ var h = m * 60;
1825
+ var d = h * 24;
1826
+ var y = d * 365.25;
1143
1827
 
1144
1828
  /**
1145
- * Deallocates a parser's resources
1829
+ * Parse or format the given `val`.
1830
+ *
1831
+ * Options:
1146
1832
  *
1833
+ * - `long` verbose formatting [false]
1834
+ *
1835
+ * @param {String|Number} val
1836
+ * @param {Object} options
1837
+ * @return {String|Number}
1147
1838
  * @api public
1148
1839
  */
1149
1840
 
1150
- Decoder.prototype.destroy = function() {
1151
- if (this.reconstructor) {
1152
- this.reconstructor.finishedReconstruction();
1153
- }
1841
+ module.exports = function(val, options){
1842
+ options = options || {};
1843
+ if ('string' == typeof val) return parse(val);
1844
+ return options.long
1845
+ ? long(val)
1846
+ : short(val);
1154
1847
  };
1155
1848
 
1156
1849
  /**
1157
- * A manager of a binary event's 'buffer sequence'. Should
1158
- * be constructed whenever a packet of type BINARY_EVENT is
1159
- * decoded.
1850
+ * Parse the given `str` and return milliseconds.
1160
1851
  *
1161
- * @param {Object} packet
1162
- * @return {BinaryReconstructor} initialized reconstructor
1852
+ * @param {String} str
1853
+ * @return {Number}
1163
1854
  * @api private
1164
1855
  */
1165
1856
 
1166
- function BinaryReconstructor(packet) {
1167
- this.reconPack = packet;
1168
- this.buffers = [];
1857
+ function parse(str) {
1858
+ str = '' + str;
1859
+ if (str.length > 10000) return;
1860
+ var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
1861
+ if (!match) return;
1862
+ var n = parseFloat(match[1]);
1863
+ var type = (match[2] || 'ms').toLowerCase();
1864
+ switch (type) {
1865
+ case 'years':
1866
+ case 'year':
1867
+ case 'yrs':
1868
+ case 'yr':
1869
+ case 'y':
1870
+ return n * y;
1871
+ case 'days':
1872
+ case 'day':
1873
+ case 'd':
1874
+ return n * d;
1875
+ case 'hours':
1876
+ case 'hour':
1877
+ case 'hrs':
1878
+ case 'hr':
1879
+ case 'h':
1880
+ return n * h;
1881
+ case 'minutes':
1882
+ case 'minute':
1883
+ case 'mins':
1884
+ case 'min':
1885
+ case 'm':
1886
+ return n * m;
1887
+ case 'seconds':
1888
+ case 'second':
1889
+ case 'secs':
1890
+ case 'sec':
1891
+ case 's':
1892
+ return n * s;
1893
+ case 'milliseconds':
1894
+ case 'millisecond':
1895
+ case 'msecs':
1896
+ case 'msec':
1897
+ case 'ms':
1898
+ return n;
1899
+ }
1169
1900
  }
1170
1901
 
1171
1902
  /**
1172
- * Method to be called when binary data received from connection
1173
- * after a BINARY_EVENT packet.
1903
+ * Short format for `ms`.
1174
1904
  *
1175
- * @param {Buffer | ArrayBuffer} binData - the raw binary data received
1176
- * @return {null | Object} returns null if more binary data is expected or
1177
- * a reconstructed packet object if all buffers have been received.
1905
+ * @param {Number} ms
1906
+ * @return {String}
1178
1907
  * @api private
1179
1908
  */
1180
1909
 
1181
- BinaryReconstructor.prototype.takeBinaryData = function(binData) {
1182
- this.buffers.push(binData);
1183
- if (this.buffers.length == this.reconPack.attachments) { // done with buffer list
1184
- var packet = binary.reconstructPacket(this.reconPack, this.buffers);
1185
- this.finishedReconstruction();
1186
- return packet;
1187
- }
1188
- return null;
1189
- };
1910
+ function short(ms) {
1911
+ if (ms >= d) return Math.round(ms / d) + 'd';
1912
+ if (ms >= h) return Math.round(ms / h) + 'h';
1913
+ if (ms >= m) return Math.round(ms / m) + 'm';
1914
+ if (ms >= s) return Math.round(ms / s) + 's';
1915
+ return ms + 'ms';
1916
+ }
1190
1917
 
1191
1918
  /**
1192
- * Cleans up binary packet reconstruction variables.
1919
+ * Long format for `ms`.
1193
1920
  *
1921
+ * @param {Number} ms
1922
+ * @return {String}
1194
1923
  * @api private
1195
1924
  */
1196
1925
 
1197
- BinaryReconstructor.prototype.finishedReconstruction = function() {
1198
- this.reconPack = null;
1199
- this.buffers = [];
1200
- };
1926
+ function long(ms) {
1927
+ return plural(ms, d, 'day')
1928
+ || plural(ms, h, 'hour')
1929
+ || plural(ms, m, 'minute')
1930
+ || plural(ms, s, 'second')
1931
+ || ms + ' ms';
1932
+ }
1201
1933
 
1202
- function error(data){
1203
- return {
1204
- type: exports.ERROR,
1205
- data: 'parser error'
1206
- };
1934
+ /**
1935
+ * Pluralization helper.
1936
+ */
1937
+
1938
+ function plural(ms, n, name) {
1939
+ if (ms < n) return;
1940
+ if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
1941
+ return Math.ceil(ms / n) + ' ' + name + 's';
1207
1942
  }
1208
1943
 
1209
1944
 
1210
1945
  /***/ },
1211
- /* 7 */
1946
+ /* 11 */
1212
1947
  /***/ function(module, exports, __webpack_require__) {
1213
1948
 
1214
1949
  /* WEBPACK VAR INJECTION */(function(module, global) {/*** IMPORTS FROM imports-loader ***/
@@ -2113,40 +2848,31 @@ return /******/ (function(modules) { // webpackBootstrap
2113
2848
  if (isLoader) {
2114
2849
  define(function () {
2115
2850
  return JSON3;
2116
- });
2117
- }
2118
- }).call(this);
2119
-
2120
-
2121
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), (function() { return this; }())))
2122
-
2123
- /***/ },
2124
- /* 8 */
2125
- /***/ function(module, exports) {
2851
+ });
2852
+ }
2853
+ }).call(this);
2126
2854
 
2127
- module.exports = function(module) {
2128
- if(!module.webpackPolyfill) {
2129
- module.deprecate = function() {};
2130
- module.paths = [];
2131
- // module.parent = undefined by default
2132
- module.children = [];
2133
- module.webpackPolyfill = 1;
2134
- }
2135
- return module;
2136
- }
2137
2855
 
2856
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }())))
2138
2857
 
2139
2858
  /***/ },
2140
- /* 9 */
2859
+ /* 12 */
2141
2860
  /***/ function(module, exports) {
2142
2861
 
2143
- module.exports = Array.isArray || function (arr) {
2144
- return Object.prototype.toString.call(arr) == '[object Array]';
2145
- };
2862
+ module.exports = function(module) {
2863
+ if(!module.webpackPolyfill) {
2864
+ module.deprecate = function() {};
2865
+ module.paths = [];
2866
+ // module.parent = undefined by default
2867
+ module.children = [];
2868
+ module.webpackPolyfill = 1;
2869
+ }
2870
+ return module;
2871
+ }
2146
2872
 
2147
2873
 
2148
2874
  /***/ },
2149
- /* 10 */
2875
+ /* 13 */
2150
2876
  /***/ function(module, exports) {
2151
2877
 
2152
2878
 
@@ -2316,7 +3042,7 @@ return /******/ (function(modules) { // webpackBootstrap
2316
3042
 
2317
3043
 
2318
3044
  /***/ },
2319
- /* 11 */
3045
+ /* 14 */
2320
3046
  /***/ function(module, exports, __webpack_require__) {
2321
3047
 
2322
3048
  /* WEBPACK VAR INJECTION */(function(global) {/*global Blob,File*/
@@ -2325,8 +3051,8 @@ return /******/ (function(modules) { // webpackBootstrap
2325
3051
  * Module requirements
2326
3052
  */
2327
3053
 
2328
- var isArray = __webpack_require__(9);
2329
- var isBuf = __webpack_require__(12);
3054
+ var isArray = __webpack_require__(15);
3055
+ var isBuf = __webpack_require__(16);
2330
3056
 
2331
3057
  /**
2332
3058
  * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
@@ -2464,7 +3190,16 @@ return /******/ (function(modules) { // webpackBootstrap
2464
3190
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2465
3191
 
2466
3192
  /***/ },
2467
- /* 12 */
3193
+ /* 15 */
3194
+ /***/ function(module, exports) {
3195
+
3196
+ module.exports = Array.isArray || function (arr) {
3197
+ return Object.prototype.toString.call(arr) == '[object Array]';
3198
+ };
3199
+
3200
+
3201
+ /***/ },
3202
+ /* 16 */
2468
3203
  /***/ function(module, exports) {
2469
3204
 
2470
3205
  /* WEBPACK VAR INJECTION */(function(global) {
@@ -2484,7 +3219,7 @@ return /******/ (function(modules) { // webpackBootstrap
2484
3219
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
2485
3220
 
2486
3221
  /***/ },
2487
- /* 13 */
3222
+ /* 17 */
2488
3223
  /***/ function(module, exports, __webpack_require__) {
2489
3224
 
2490
3225
  'use strict';
@@ -2495,15 +3230,15 @@ return /******/ (function(modules) { // webpackBootstrap
2495
3230
  * Module dependencies.
2496
3231
  */
2497
3232
 
2498
- var eio = __webpack_require__(14);
2499
- var Socket = __webpack_require__(40);
2500
- var Emitter = __webpack_require__(41);
2501
- var parser = __webpack_require__(6);
2502
- var on = __webpack_require__(43);
2503
- var bind = __webpack_require__(44);
3233
+ var eio = __webpack_require__(18);
3234
+ var Socket = __webpack_require__(45);
3235
+ var Emitter = __webpack_require__(36);
3236
+ var parser = __webpack_require__(7);
3237
+ var on = __webpack_require__(47);
3238
+ var bind = __webpack_require__(48);
2504
3239
  var debug = __webpack_require__(3)('socket.io-client:manager');
2505
- var indexOf = __webpack_require__(38);
2506
- var Backoff = __webpack_require__(46);
3240
+ var indexOf = __webpack_require__(43);
3241
+ var Backoff = __webpack_require__(51);
2507
3242
 
2508
3243
  /**
2509
3244
  * IE6+ hasOwnProperty
@@ -3051,19 +3786,19 @@ return /******/ (function(modules) { // webpackBootstrap
3051
3786
  };
3052
3787
 
3053
3788
  /***/ },
3054
- /* 14 */
3789
+ /* 18 */
3055
3790
  /***/ function(module, exports, __webpack_require__) {
3056
3791
 
3057
3792
 
3058
- module.exports = __webpack_require__(15);
3793
+ module.exports = __webpack_require__(19);
3059
3794
 
3060
3795
 
3061
3796
  /***/ },
3062
- /* 15 */
3797
+ /* 19 */
3063
3798
  /***/ function(module, exports, __webpack_require__) {
3064
3799
 
3065
3800
 
3066
- module.exports = __webpack_require__(16);
3801
+ module.exports = __webpack_require__(20);
3067
3802
 
3068
3803
  /**
3069
3804
  * Exports parser
@@ -3071,25 +3806,25 @@ return /******/ (function(modules) { // webpackBootstrap
3071
3806
  * @api public
3072
3807
  *
3073
3808
  */
3074
- module.exports.parser = __webpack_require__(23);
3809
+ module.exports.parser = __webpack_require__(27);
3075
3810
 
3076
3811
 
3077
3812
  /***/ },
3078
- /* 16 */
3813
+ /* 20 */
3079
3814
  /***/ function(module, exports, __webpack_require__) {
3080
3815
 
3081
3816
  /* WEBPACK VAR INJECTION */(function(global) {/**
3082
3817
  * Module dependencies.
3083
3818
  */
3084
3819
 
3085
- var transports = __webpack_require__(17);
3086
- var Emitter = __webpack_require__(31);
3820
+ var transports = __webpack_require__(21);
3821
+ var Emitter = __webpack_require__(36);
3087
3822
  var debug = __webpack_require__(3)('engine.io-client:socket');
3088
- var index = __webpack_require__(38);
3089
- var parser = __webpack_require__(23);
3823
+ var index = __webpack_require__(43);
3824
+ var parser = __webpack_require__(27);
3090
3825
  var parseuri = __webpack_require__(2);
3091
- var parsejson = __webpack_require__(39);
3092
- var parseqs = __webpack_require__(32);
3826
+ var parsejson = __webpack_require__(44);
3827
+ var parseqs = __webpack_require__(37);
3093
3828
 
3094
3829
  /**
3095
3830
  * Module exports.
@@ -3172,6 +3907,7 @@ return /******/ (function(modules) { // webpackBootstrap
3172
3907
  this.ca = opts.ca || null;
3173
3908
  this.ciphers = opts.ciphers || null;
3174
3909
  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? null : opts.rejectUnauthorized;
3910
+ this.forceNode = !!opts.forceNode;
3175
3911
 
3176
3912
  // other options for Node.js client
3177
3913
  var freeGlobal = typeof global === 'object' && global;
@@ -3179,6 +3915,10 @@ return /******/ (function(modules) { // webpackBootstrap
3179
3915
  if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
3180
3916
  this.extraHeaders = opts.extraHeaders;
3181
3917
  }
3918
+
3919
+ if (opts.localAddress) {
3920
+ this.localAddress = opts.localAddress;
3921
+ }
3182
3922
  }
3183
3923
 
3184
3924
  // set on handshake
@@ -3216,9 +3956,9 @@ return /******/ (function(modules) { // webpackBootstrap
3216
3956
  */
3217
3957
 
3218
3958
  Socket.Socket = Socket;
3219
- Socket.Transport = __webpack_require__(22);
3220
- Socket.transports = __webpack_require__(17);
3221
- Socket.parser = __webpack_require__(23);
3959
+ Socket.Transport = __webpack_require__(26);
3960
+ Socket.transports = __webpack_require__(21);
3961
+ Socket.parser = __webpack_require__(27);
3222
3962
 
3223
3963
  /**
3224
3964
  * Creates transport of the given type.
@@ -3264,7 +4004,9 @@ return /******/ (function(modules) { // webpackBootstrap
3264
4004
  ciphers: this.ciphers,
3265
4005
  rejectUnauthorized: this.rejectUnauthorized,
3266
4006
  perMessageDeflate: this.perMessageDeflate,
3267
- extraHeaders: this.extraHeaders
4007
+ extraHeaders: this.extraHeaders,
4008
+ forceNode: this.forceNode,
4009
+ localAddress: this.localAddress
3268
4010
  });
3269
4011
 
3270
4012
  return transport;
@@ -3495,7 +4237,8 @@ return /******/ (function(modules) { // webpackBootstrap
3495
4237
  */
3496
4238
 
3497
4239
  Socket.prototype.onPacket = function (packet) {
3498
- if ('opening' === this.readyState || 'open' === this.readyState) {
4240
+ if ('opening' === this.readyState || 'open' === this.readyState ||
4241
+ 'closing' === this.readyState) {
3499
4242
  debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
3500
4243
 
3501
4244
  this.emit('packet', packet);
@@ -3812,17 +4555,17 @@ return /******/ (function(modules) { // webpackBootstrap
3812
4555
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
3813
4556
 
3814
4557
  /***/ },
3815
- /* 17 */
4558
+ /* 21 */
3816
4559
  /***/ function(module, exports, __webpack_require__) {
3817
4560
 
3818
4561
  /* WEBPACK VAR INJECTION */(function(global) {/**
3819
4562
  * Module dependencies
3820
4563
  */
3821
4564
 
3822
- var XMLHttpRequest = __webpack_require__(18);
3823
- var XHR = __webpack_require__(20);
3824
- var JSONP = __webpack_require__(35);
3825
- var websocket = __webpack_require__(36);
4565
+ var XMLHttpRequest = __webpack_require__(22);
4566
+ var XHR = __webpack_require__(24);
4567
+ var JSONP = __webpack_require__(40);
4568
+ var websocket = __webpack_require__(41);
3826
4569
 
3827
4570
  /**
3828
4571
  * Export transports.
@@ -3872,15 +4615,12 @@ return /******/ (function(modules) { // webpackBootstrap
3872
4615
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
3873
4616
 
3874
4617
  /***/ },
3875
- /* 18 */
4618
+ /* 22 */
3876
4619
  /***/ function(module, exports, __webpack_require__) {
3877
4620
 
3878
- // browser shim for xmlhttprequest module
3879
-
3880
- // Indicate to eslint that ActiveXObject is global
3881
- /* global ActiveXObject */
4621
+ /* WEBPACK VAR INJECTION */(function(global) {// browser shim for xmlhttprequest module
3882
4622
 
3883
- var hasCORS = __webpack_require__(19);
4623
+ var hasCORS = __webpack_require__(23);
3884
4624
 
3885
4625
  module.exports = function (opts) {
3886
4626
  var xdomain = opts.xdomain;
@@ -3911,14 +4651,15 @@ return /******/ (function(modules) { // webpackBootstrap
3911
4651
 
3912
4652
  if (!xdomain) {
3913
4653
  try {
3914
- return new ActiveXObject('Microsoft.XMLHTTP');
4654
+ return new global[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
3915
4655
  } catch (e) { }
3916
4656
  }
3917
4657
  };
3918
4658
 
4659
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
3919
4660
 
3920
4661
  /***/ },
3921
- /* 19 */
4662
+ /* 23 */
3922
4663
  /***/ function(module, exports) {
3923
4664
 
3924
4665
 
@@ -3941,17 +4682,17 @@ return /******/ (function(modules) { // webpackBootstrap
3941
4682
 
3942
4683
 
3943
4684
  /***/ },
3944
- /* 20 */
4685
+ /* 24 */
3945
4686
  /***/ function(module, exports, __webpack_require__) {
3946
4687
 
3947
4688
  /* WEBPACK VAR INJECTION */(function(global) {/**
3948
4689
  * Module requirements.
3949
4690
  */
3950
4691
 
3951
- var XMLHttpRequest = __webpack_require__(18);
3952
- var Polling = __webpack_require__(21);
3953
- var Emitter = __webpack_require__(31);
3954
- var inherit = __webpack_require__(33);
4692
+ var XMLHttpRequest = __webpack_require__(22);
4693
+ var Polling = __webpack_require__(25);
4694
+ var Emitter = __webpack_require__(36);
4695
+ var inherit = __webpack_require__(38);
3955
4696
  var debug = __webpack_require__(3)('engine.io-client:polling-xhr');
3956
4697
 
3957
4698
  /**
@@ -3976,6 +4717,7 @@ return /******/ (function(modules) { // webpackBootstrap
3976
4717
 
3977
4718
  function XHR (opts) {
3978
4719
  Polling.call(this, opts);
4720
+ this.requestTimeout = opts.requestTimeout;
3979
4721
 
3980
4722
  if (global.location) {
3981
4723
  var isSSL = 'https:' === location.protocol;
@@ -4030,6 +4772,7 @@ return /******/ (function(modules) { // webpackBootstrap
4030
4772
  opts.ca = this.ca;
4031
4773
  opts.ciphers = this.ciphers;
4032
4774
  opts.rejectUnauthorized = this.rejectUnauthorized;
4775
+ opts.requestTimeout = this.requestTimeout;
4033
4776
 
4034
4777
  // other options for Node.js client
4035
4778
  opts.extraHeaders = this.extraHeaders;
@@ -4093,6 +4836,7 @@ return /******/ (function(modules) { // webpackBootstrap
4093
4836
  this.isBinary = opts.isBinary;
4094
4837
  this.supportsBinary = opts.supportsBinary;
4095
4838
  this.enablesXDR = opts.enablesXDR;
4839
+ this.requestTimeout = opts.requestTimeout;
4096
4840
 
4097
4841
  // SSL options for Node.js client
4098
4842
  this.pfx = opts.pfx;
@@ -4165,11 +4909,19 @@ return /******/ (function(modules) { // webpackBootstrap
4165
4909
  } catch (e) {}
4166
4910
  }
4167
4911
 
4912
+ try {
4913
+ xhr.setRequestHeader('Accept', '*/*');
4914
+ } catch (e) {}
4915
+
4168
4916
  // ie6 check
4169
4917
  if ('withCredentials' in xhr) {
4170
4918
  xhr.withCredentials = true;
4171
4919
  }
4172
4920
 
4921
+ if (this.requestTimeout) {
4922
+ xhr.timeout = this.requestTimeout;
4923
+ }
4924
+
4173
4925
  if (this.hasXDR()) {
4174
4926
  xhr.onload = function () {
4175
4927
  self.onLoad();
@@ -4361,18 +5113,18 @@ return /******/ (function(modules) { // webpackBootstrap
4361
5113
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
4362
5114
 
4363
5115
  /***/ },
4364
- /* 21 */
5116
+ /* 25 */
4365
5117
  /***/ function(module, exports, __webpack_require__) {
4366
5118
 
4367
5119
  /**
4368
5120
  * Module dependencies.
4369
5121
  */
4370
5122
 
4371
- var Transport = __webpack_require__(22);
4372
- var parseqs = __webpack_require__(32);
4373
- var parser = __webpack_require__(23);
4374
- var inherit = __webpack_require__(33);
4375
- var yeast = __webpack_require__(34);
5123
+ var Transport = __webpack_require__(26);
5124
+ var parseqs = __webpack_require__(37);
5125
+ var parser = __webpack_require__(27);
5126
+ var inherit = __webpack_require__(38);
5127
+ var yeast = __webpack_require__(39);
4376
5128
  var debug = __webpack_require__(3)('engine.io-client:polling');
4377
5129
 
4378
5130
  /**
@@ -4386,7 +5138,7 @@ return /******/ (function(modules) { // webpackBootstrap
4386
5138
  */
4387
5139
 
4388
5140
  var hasXHR2 = (function () {
4389
- var XMLHttpRequest = __webpack_require__(18);
5141
+ var XMLHttpRequest = __webpack_require__(22);
4390
5142
  var xhr = new XMLHttpRequest({ xdomain: false });
4391
5143
  return null != xhr.responseType;
4392
5144
  })();
@@ -4596,8 +5348,8 @@ return /******/ (function(modules) { // webpackBootstrap
4596
5348
  query = parseqs.encode(query);
4597
5349
 
4598
5350
  // avoid port if default for schema
4599
- if (this.port && (('https' === schema && this.port !== 443) ||
4600
- ('http' === schema && this.port !== 80))) {
5351
+ if (this.port && (('https' === schema && Number(this.port) !== 443) ||
5352
+ ('http' === schema && Number(this.port) !== 80))) {
4601
5353
  port = ':' + this.port;
4602
5354
  }
4603
5355
 
@@ -4612,15 +5364,15 @@ return /******/ (function(modules) { // webpackBootstrap
4612
5364
 
4613
5365
 
4614
5366
  /***/ },
4615
- /* 22 */
5367
+ /* 26 */
4616
5368
  /***/ function(module, exports, __webpack_require__) {
4617
5369
 
4618
5370
  /**
4619
5371
  * Module dependencies.
4620
5372
  */
4621
5373
 
4622
- var parser = __webpack_require__(23);
4623
- var Emitter = __webpack_require__(31);
5374
+ var parser = __webpack_require__(27);
5375
+ var Emitter = __webpack_require__(36);
4624
5376
 
4625
5377
  /**
4626
5378
  * Module exports.
@@ -4656,9 +5408,11 @@ return /******/ (function(modules) { // webpackBootstrap
4656
5408
  this.ca = opts.ca;
4657
5409
  this.ciphers = opts.ciphers;
4658
5410
  this.rejectUnauthorized = opts.rejectUnauthorized;
5411
+ this.forceNode = opts.forceNode;
4659
5412
 
4660
5413
  // other options for Node.js client
4661
5414
  this.extraHeaders = opts.extraHeaders;
5415
+ this.localAddress = opts.localAddress;
4662
5416
  }
4663
5417
 
4664
5418
  /**
@@ -4773,22 +5527,22 @@ return /******/ (function(modules) { // webpackBootstrap
4773
5527
 
4774
5528
 
4775
5529
  /***/ },
4776
- /* 23 */
5530
+ /* 27 */
4777
5531
  /***/ function(module, exports, __webpack_require__) {
4778
5532
 
4779
5533
  /* WEBPACK VAR INJECTION */(function(global) {/**
4780
5534
  * Module dependencies.
4781
5535
  */
4782
5536
 
4783
- var keys = __webpack_require__(24);
4784
- var hasBinary = __webpack_require__(25);
4785
- var sliceBuffer = __webpack_require__(26);
4786
- var after = __webpack_require__(27);
4787
- var utf8 = __webpack_require__(28);
5537
+ var keys = __webpack_require__(28);
5538
+ var hasBinary = __webpack_require__(29);
5539
+ var sliceBuffer = __webpack_require__(31);
5540
+ var after = __webpack_require__(32);
5541
+ var utf8 = __webpack_require__(33);
4788
5542
 
4789
5543
  var base64encoder;
4790
5544
  if (global && global.ArrayBuffer) {
4791
- base64encoder = __webpack_require__(29);
5545
+ base64encoder = __webpack_require__(34);
4792
5546
  }
4793
5547
 
4794
5548
  /**
@@ -4846,7 +5600,7 @@ return /******/ (function(modules) { // webpackBootstrap
4846
5600
  * Create a blob api even for blob builder when vendor prefixes exist
4847
5601
  */
4848
5602
 
4849
- var Blob = __webpack_require__(30);
5603
+ var Blob = __webpack_require__(35);
4850
5604
 
4851
5605
  /**
4852
5606
  * Encodes a packet.
@@ -5389,7 +6143,7 @@ return /******/ (function(modules) { // webpackBootstrap
5389
6143
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
5390
6144
 
5391
6145
  /***/ },
5392
- /* 24 */
6146
+ /* 28 */
5393
6147
  /***/ function(module, exports) {
5394
6148
 
5395
6149
 
@@ -5414,7 +6168,7 @@ return /******/ (function(modules) { // webpackBootstrap
5414
6168
 
5415
6169
 
5416
6170
  /***/ },
5417
- /* 25 */
6171
+ /* 29 */
5418
6172
  /***/ function(module, exports, __webpack_require__) {
5419
6173
 
5420
6174
  /* WEBPACK VAR INJECTION */(function(global) {
@@ -5422,7 +6176,7 @@ return /******/ (function(modules) { // webpackBootstrap
5422
6176
  * Module requirements.
5423
6177
  */
5424
6178
 
5425
- var isArray = __webpack_require__(9);
6179
+ var isArray = __webpack_require__(30);
5426
6180
 
5427
6181
  /**
5428
6182
  * Module exports.
@@ -5479,7 +6233,16 @@ return /******/ (function(modules) { // webpackBootstrap
5479
6233
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
5480
6234
 
5481
6235
  /***/ },
5482
- /* 26 */
6236
+ /* 30 */
6237
+ /***/ function(module, exports) {
6238
+
6239
+ module.exports = Array.isArray || function (arr) {
6240
+ return Object.prototype.toString.call(arr) == '[object Array]';
6241
+ };
6242
+
6243
+
6244
+ /***/ },
6245
+ /* 31 */
5483
6246
  /***/ function(module, exports) {
5484
6247
 
5485
6248
  /**
@@ -5514,7 +6277,7 @@ return /******/ (function(modules) { // webpackBootstrap
5514
6277
 
5515
6278
 
5516
6279
  /***/ },
5517
- /* 27 */
6280
+ /* 32 */
5518
6281
  /***/ function(module, exports) {
5519
6282
 
5520
6283
  module.exports = after
@@ -5548,7 +6311,7 @@ return /******/ (function(modules) { // webpackBootstrap
5548
6311
 
5549
6312
 
5550
6313
  /***/ },
5551
- /* 28 */
6314
+ /* 33 */
5552
6315
  /***/ function(module, exports, __webpack_require__) {
5553
6316
 
5554
6317
  var __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/wtf8 v1.0.0 by @mathias */
@@ -5784,10 +6547,10 @@ return /******/ (function(modules) { // webpackBootstrap
5784
6547
 
5785
6548
  }(this));
5786
6549
 
5787
- /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(8)(module), (function() { return this; }())))
6550
+ /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(12)(module), (function() { return this; }())))
5788
6551
 
5789
6552
  /***/ },
5790
- /* 29 */
6553
+ /* 34 */
5791
6554
  /***/ function(module, exports) {
5792
6555
 
5793
6556
  /*
@@ -5860,7 +6623,7 @@ return /******/ (function(modules) { // webpackBootstrap
5860
6623
 
5861
6624
 
5862
6625
  /***/ },
5863
- /* 30 */
6626
+ /* 35 */
5864
6627
  /***/ function(module, exports) {
5865
6628
 
5866
6629
  /* WEBPACK VAR INJECTION */(function(global) {/**
@@ -5955,228 +6718,227 @@ return /******/ (function(modules) { // webpackBootstrap
5955
6718
  return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;
5956
6719
  } else if (blobBuilderSupported) {
5957
6720
  return BlobBuilderConstructor;
5958
- } else {
5959
- return undefined;
5960
- }
5961
- })();
5962
-
5963
- /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
5964
-
5965
- /***/ },
5966
- /* 31 */
5967
- /***/ function(module, exports) {
5968
-
5969
-
5970
- /**
5971
- * Expose `Emitter`.
5972
- */
5973
-
5974
- module.exports = Emitter;
5975
-
5976
- /**
5977
- * Initialize a new `Emitter`.
5978
- *
5979
- * @api public
5980
- */
5981
-
5982
- function Emitter(obj) {
5983
- if (obj) return mixin(obj);
5984
- };
5985
-
5986
- /**
5987
- * Mixin the emitter properties.
5988
- *
5989
- * @param {Object} obj
5990
- * @return {Object}
5991
- * @api private
5992
- */
5993
-
5994
- function mixin(obj) {
5995
- for (var key in Emitter.prototype) {
5996
- obj[key] = Emitter.prototype[key];
5997
- }
5998
- return obj;
5999
- }
6000
-
6001
- /**
6002
- * Listen on the given `event` with `fn`.
6003
- *
6004
- * @param {String} event
6005
- * @param {Function} fn
6006
- * @return {Emitter}
6007
- * @api public
6008
- */
6009
-
6010
- Emitter.prototype.on =
6011
- Emitter.prototype.addEventListener = function(event, fn){
6012
- this._callbacks = this._callbacks || {};
6013
- (this._callbacks[event] = this._callbacks[event] || [])
6014
- .push(fn);
6015
- return this;
6016
- };
6017
-
6018
- /**
6019
- * Adds an `event` listener that will be invoked a single
6020
- * time then automatically removed.
6021
- *
6022
- * @param {String} event
6023
- * @param {Function} fn
6024
- * @return {Emitter}
6025
- * @api public
6026
- */
6027
-
6028
- Emitter.prototype.once = function(event, fn){
6029
- var self = this;
6030
- this._callbacks = this._callbacks || {};
6031
-
6032
- function on() {
6033
- self.off(event, on);
6034
- fn.apply(this, arguments);
6035
- }
6036
-
6037
- on.fn = fn;
6038
- this.on(event, on);
6039
- return this;
6040
- };
6041
-
6042
- /**
6043
- * Remove the given callback for `event` or all
6044
- * registered callbacks.
6045
- *
6046
- * @param {String} event
6047
- * @param {Function} fn
6048
- * @return {Emitter}
6049
- * @api public
6050
- */
6051
-
6052
- Emitter.prototype.off =
6053
- Emitter.prototype.removeListener =
6054
- Emitter.prototype.removeAllListeners =
6055
- Emitter.prototype.removeEventListener = function(event, fn){
6056
- this._callbacks = this._callbacks || {};
6057
-
6058
- // all
6059
- if (0 == arguments.length) {
6060
- this._callbacks = {};
6061
- return this;
6062
- }
6063
-
6064
- // specific event
6065
- var callbacks = this._callbacks[event];
6066
- if (!callbacks) return this;
6067
-
6068
- // remove all handlers
6069
- if (1 == arguments.length) {
6070
- delete this._callbacks[event];
6071
- return this;
6072
- }
6073
-
6074
- // remove specific handler
6075
- var cb;
6076
- for (var i = 0; i < callbacks.length; i++) {
6077
- cb = callbacks[i];
6078
- if (cb === fn || cb.fn === fn) {
6079
- callbacks.splice(i, 1);
6080
- break;
6081
- }
6082
- }
6083
- return this;
6084
- };
6085
-
6086
- /**
6087
- * Emit `event` with the given args.
6088
- *
6089
- * @param {String} event
6090
- * @param {Mixed} ...
6091
- * @return {Emitter}
6092
- */
6093
-
6094
- Emitter.prototype.emit = function(event){
6095
- this._callbacks = this._callbacks || {};
6096
- var args = [].slice.call(arguments, 1)
6097
- , callbacks = this._callbacks[event];
6098
-
6099
- if (callbacks) {
6100
- callbacks = callbacks.slice(0);
6101
- for (var i = 0, len = callbacks.length; i < len; ++i) {
6102
- callbacks[i].apply(this, args);
6103
- }
6104
- }
6105
-
6106
- return this;
6107
- };
6108
-
6109
- /**
6110
- * Return array of callbacks for `event`.
6111
- *
6112
- * @param {String} event
6113
- * @return {Array}
6114
- * @api public
6115
- */
6116
-
6117
- Emitter.prototype.listeners = function(event){
6118
- this._callbacks = this._callbacks || {};
6119
- return this._callbacks[event] || [];
6120
- };
6121
-
6122
- /**
6123
- * Check if this emitter has `event` handlers.
6124
- *
6125
- * @param {String} event
6126
- * @return {Boolean}
6127
- * @api public
6128
- */
6129
-
6130
- Emitter.prototype.hasListeners = function(event){
6131
- return !! this.listeners(event).length;
6132
- };
6721
+ } else {
6722
+ return undefined;
6723
+ }
6724
+ })();
6133
6725
 
6726
+ /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
6134
6727
 
6135
6728
  /***/ },
6136
- /* 32 */
6137
- /***/ function(module, exports) {
6138
-
6139
- /**
6140
- * Compiles a querystring
6141
- * Returns string representation of the object
6142
- *
6143
- * @param {Object}
6144
- * @api private
6145
- */
6146
-
6147
- exports.encode = function (obj) {
6148
- var str = '';
6729
+ /* 36 */
6730
+ /***/ function(module, exports, __webpack_require__) {
6149
6731
 
6150
- for (var i in obj) {
6151
- if (obj.hasOwnProperty(i)) {
6152
- if (str.length) str += '&';
6153
- str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
6154
- }
6155
- }
6732
+
6733
+ /**
6734
+ * Expose `Emitter`.
6735
+ */
6736
+
6737
+ if (true) {
6738
+ module.exports = Emitter;
6739
+ }
6740
+
6741
+ /**
6742
+ * Initialize a new `Emitter`.
6743
+ *
6744
+ * @api public
6745
+ */
6746
+
6747
+ function Emitter(obj) {
6748
+ if (obj) return mixin(obj);
6749
+ };
6750
+
6751
+ /**
6752
+ * Mixin the emitter properties.
6753
+ *
6754
+ * @param {Object} obj
6755
+ * @return {Object}
6756
+ * @api private
6757
+ */
6758
+
6759
+ function mixin(obj) {
6760
+ for (var key in Emitter.prototype) {
6761
+ obj[key] = Emitter.prototype[key];
6762
+ }
6763
+ return obj;
6764
+ }
6765
+
6766
+ /**
6767
+ * Listen on the given `event` with `fn`.
6768
+ *
6769
+ * @param {String} event
6770
+ * @param {Function} fn
6771
+ * @return {Emitter}
6772
+ * @api public
6773
+ */
6774
+
6775
+ Emitter.prototype.on =
6776
+ Emitter.prototype.addEventListener = function(event, fn){
6777
+ this._callbacks = this._callbacks || {};
6778
+ (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
6779
+ .push(fn);
6780
+ return this;
6781
+ };
6782
+
6783
+ /**
6784
+ * Adds an `event` listener that will be invoked a single
6785
+ * time then automatically removed.
6786
+ *
6787
+ * @param {String} event
6788
+ * @param {Function} fn
6789
+ * @return {Emitter}
6790
+ * @api public
6791
+ */
6792
+
6793
+ Emitter.prototype.once = function(event, fn){
6794
+ function on() {
6795
+ this.off(event, on);
6796
+ fn.apply(this, arguments);
6797
+ }
6798
+
6799
+ on.fn = fn;
6800
+ this.on(event, on);
6801
+ return this;
6802
+ };
6803
+
6804
+ /**
6805
+ * Remove the given callback for `event` or all
6806
+ * registered callbacks.
6807
+ *
6808
+ * @param {String} event
6809
+ * @param {Function} fn
6810
+ * @return {Emitter}
6811
+ * @api public
6812
+ */
6813
+
6814
+ Emitter.prototype.off =
6815
+ Emitter.prototype.removeListener =
6816
+ Emitter.prototype.removeAllListeners =
6817
+ Emitter.prototype.removeEventListener = function(event, fn){
6818
+ this._callbacks = this._callbacks || {};
6819
+
6820
+ // all
6821
+ if (0 == arguments.length) {
6822
+ this._callbacks = {};
6823
+ return this;
6824
+ }
6825
+
6826
+ // specific event
6827
+ var callbacks = this._callbacks['$' + event];
6828
+ if (!callbacks) return this;
6829
+
6830
+ // remove all handlers
6831
+ if (1 == arguments.length) {
6832
+ delete this._callbacks['$' + event];
6833
+ return this;
6834
+ }
6835
+
6836
+ // remove specific handler
6837
+ var cb;
6838
+ for (var i = 0; i < callbacks.length; i++) {
6839
+ cb = callbacks[i];
6840
+ if (cb === fn || cb.fn === fn) {
6841
+ callbacks.splice(i, 1);
6842
+ break;
6843
+ }
6844
+ }
6845
+ return this;
6846
+ };
6847
+
6848
+ /**
6849
+ * Emit `event` with the given args.
6850
+ *
6851
+ * @param {String} event
6852
+ * @param {Mixed} ...
6853
+ * @return {Emitter}
6854
+ */
6855
+
6856
+ Emitter.prototype.emit = function(event){
6857
+ this._callbacks = this._callbacks || {};
6858
+ var args = [].slice.call(arguments, 1)
6859
+ , callbacks = this._callbacks['$' + event];
6860
+
6861
+ if (callbacks) {
6862
+ callbacks = callbacks.slice(0);
6863
+ for (var i = 0, len = callbacks.length; i < len; ++i) {
6864
+ callbacks[i].apply(this, args);
6865
+ }
6866
+ }
6867
+
6868
+ return this;
6869
+ };
6870
+
6871
+ /**
6872
+ * Return array of callbacks for `event`.
6873
+ *
6874
+ * @param {String} event
6875
+ * @return {Array}
6876
+ * @api public
6877
+ */
6878
+
6879
+ Emitter.prototype.listeners = function(event){
6880
+ this._callbacks = this._callbacks || {};
6881
+ return this._callbacks['$' + event] || [];
6882
+ };
6883
+
6884
+ /**
6885
+ * Check if this emitter has `event` handlers.
6886
+ *
6887
+ * @param {String} event
6888
+ * @return {Boolean}
6889
+ * @api public
6890
+ */
6891
+
6892
+ Emitter.prototype.hasListeners = function(event){
6893
+ return !! this.listeners(event).length;
6894
+ };
6156
6895
 
6157
- return str;
6158
- };
6159
6896
 
6160
- /**
6161
- * Parses a simple querystring into an object
6162
- *
6163
- * @param {String} qs
6164
- * @api private
6165
- */
6897
+ /***/ },
6898
+ /* 37 */
6899
+ /***/ function(module, exports) {
6166
6900
 
6167
- exports.decode = function(qs){
6168
- var qry = {};
6169
- var pairs = qs.split('&');
6170
- for (var i = 0, l = pairs.length; i < l; i++) {
6171
- var pair = pairs[i].split('=');
6172
- qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
6173
- }
6174
- return qry;
6175
- };
6901
+ /**
6902
+ * Compiles a querystring
6903
+ * Returns string representation of the object
6904
+ *
6905
+ * @param {Object}
6906
+ * @api private
6907
+ */
6908
+
6909
+ exports.encode = function (obj) {
6910
+ var str = '';
6911
+
6912
+ for (var i in obj) {
6913
+ if (obj.hasOwnProperty(i)) {
6914
+ if (str.length) str += '&';
6915
+ str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
6916
+ }
6917
+ }
6918
+
6919
+ return str;
6920
+ };
6921
+
6922
+ /**
6923
+ * Parses a simple querystring into an object
6924
+ *
6925
+ * @param {String} qs
6926
+ * @api private
6927
+ */
6928
+
6929
+ exports.decode = function(qs){
6930
+ var qry = {};
6931
+ var pairs = qs.split('&');
6932
+ for (var i = 0, l = pairs.length; i < l; i++) {
6933
+ var pair = pairs[i].split('=');
6934
+ qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
6935
+ }
6936
+ return qry;
6937
+ };
6176
6938
 
6177
6939
 
6178
6940
  /***/ },
6179
- /* 33 */
6941
+ /* 38 */
6180
6942
  /***/ function(module, exports) {
6181
6943
 
6182
6944
 
@@ -6188,7 +6950,7 @@ return /******/ (function(modules) { // webpackBootstrap
6188
6950
  };
6189
6951
 
6190
6952
  /***/ },
6191
- /* 34 */
6953
+ /* 39 */
6192
6954
  /***/ function(module, exports) {
6193
6955
 
6194
6956
  'use strict';
@@ -6262,7 +7024,7 @@ return /******/ (function(modules) { // webpackBootstrap
6262
7024
 
6263
7025
 
6264
7026
  /***/ },
6265
- /* 35 */
7027
+ /* 40 */
6266
7028
  /***/ function(module, exports, __webpack_require__) {
6267
7029
 
6268
7030
  /* WEBPACK VAR INJECTION */(function(global) {
@@ -6270,8 +7032,8 @@ return /******/ (function(modules) { // webpackBootstrap
6270
7032
  * Module requirements.
6271
7033
  */
6272
7034
 
6273
- var Polling = __webpack_require__(21);
6274
- var inherit = __webpack_require__(33);
7035
+ var Polling = __webpack_require__(25);
7036
+ var inherit = __webpack_require__(38);
6275
7037
 
6276
7038
  /**
6277
7039
  * Module exports.
@@ -6500,20 +7262,26 @@ return /******/ (function(modules) { // webpackBootstrap
6500
7262
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
6501
7263
 
6502
7264
  /***/ },
6503
- /* 36 */
7265
+ /* 41 */
6504
7266
  /***/ function(module, exports, __webpack_require__) {
6505
7267
 
6506
7268
  /* WEBPACK VAR INJECTION */(function(global) {/**
6507
7269
  * Module dependencies.
6508
7270
  */
6509
7271
 
6510
- var Transport = __webpack_require__(22);
6511
- var parser = __webpack_require__(23);
6512
- var parseqs = __webpack_require__(32);
6513
- var inherit = __webpack_require__(33);
6514
- var yeast = __webpack_require__(34);
7272
+ var Transport = __webpack_require__(26);
7273
+ var parser = __webpack_require__(27);
7274
+ var parseqs = __webpack_require__(37);
7275
+ var inherit = __webpack_require__(38);
7276
+ var yeast = __webpack_require__(39);
6515
7277
  var debug = __webpack_require__(3)('engine.io-client:websocket');
6516
7278
  var BrowserWebSocket = global.WebSocket || global.MozWebSocket;
7279
+ var NodeWebSocket;
7280
+ if (typeof window === 'undefined') {
7281
+ try {
7282
+ NodeWebSocket = __webpack_require__(42);
7283
+ } catch (e) { }
7284
+ }
6517
7285
 
6518
7286
  /**
6519
7287
  * Get either the `WebSocket` or `MozWebSocket` globals
@@ -6523,9 +7291,7 @@ return /******/ (function(modules) { // webpackBootstrap
6523
7291
 
6524
7292
  var WebSocket = BrowserWebSocket;
6525
7293
  if (!WebSocket && typeof window === 'undefined') {
6526
- try {
6527
- WebSocket = __webpack_require__(37);
6528
- } catch (e) { }
7294
+ WebSocket = NodeWebSocket;
6529
7295
  }
6530
7296
 
6531
7297
  /**
@@ -6547,6 +7313,10 @@ return /******/ (function(modules) { // webpackBootstrap
6547
7313
  this.supportsBinary = false;
6548
7314
  }
6549
7315
  this.perMessageDeflate = opts.perMessageDeflate;
7316
+ this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
7317
+ if (!this.usingBrowserWebSocket) {
7318
+ WebSocket = NodeWebSocket;
7319
+ }
6550
7320
  Transport.call(this, opts);
6551
7321
  }
6552
7322
 
@@ -6600,9 +7370,12 @@ return /******/ (function(modules) { // webpackBootstrap
6600
7370
  if (this.extraHeaders) {
6601
7371
  opts.headers = this.extraHeaders;
6602
7372
  }
7373
+ if (this.localAddress) {
7374
+ opts.localAddress = this.localAddress;
7375
+ }
6603
7376
 
6604
7377
  try {
6605
- this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
7378
+ this.ws = this.usingBrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);
6606
7379
  } catch (err) {
6607
7380
  return this.emit('error', err);
6608
7381
  }
@@ -6644,23 +7417,6 @@ return /******/ (function(modules) { // webpackBootstrap
6644
7417
  };
6645
7418
  };
6646
7419
 
6647
- /**
6648
- * Override `onData` to use a timer on iOS.
6649
- * See: https://gist.github.com/mloughran/2052006
6650
- *
6651
- * @api private
6652
- */
6653
-
6654
- if ('undefined' !== typeof navigator &&
6655
- /iPad|iPhone|iPod/i.test(navigator.userAgent)) {
6656
- WS.prototype.onData = function (data) {
6657
- var self = this;
6658
- setTimeout(function () {
6659
- Transport.prototype.onData.call(self, data);
6660
- }, 0);
6661
- };
6662
- }
6663
-
6664
7420
  /**
6665
7421
  * Writes data to socket.
6666
7422
  *
@@ -6678,7 +7434,7 @@ return /******/ (function(modules) { // webpackBootstrap
6678
7434
  for (var i = 0, l = total; i < l; i++) {
6679
7435
  (function (packet) {
6680
7436
  parser.encodePacket(packet, self.supportsBinary, function (data) {
6681
- if (!BrowserWebSocket) {
7437
+ if (!self.usingBrowserWebSocket) {
6682
7438
  // always create a new object (GH-437)
6683
7439
  var opts = {};
6684
7440
  if (packet.options) {
@@ -6697,7 +7453,7 @@ return /******/ (function(modules) { // webpackBootstrap
6697
7453
  // have a chance of informing us about it yet, in that case send will
6698
7454
  // throw an error
6699
7455
  try {
6700
- if (BrowserWebSocket) {
7456
+ if (self.usingBrowserWebSocket) {
6701
7457
  // TypeError is thrown when passing the second argument on Safari
6702
7458
  self.ws.send(data);
6703
7459
  } else {
@@ -6758,8 +7514,8 @@ return /******/ (function(modules) { // webpackBootstrap
6758
7514
  var port = '';
6759
7515
 
6760
7516
  // avoid port if default for schema
6761
- if (this.port && (('wss' === schema && this.port !== 443) ||
6762
- ('ws' === schema && this.port !== 80))) {
7517
+ if (this.port && (('wss' === schema && Number(this.port) !== 443) ||
7518
+ ('ws' === schema && Number(this.port) !== 80))) {
6763
7519
  port = ':' + this.port;
6764
7520
  }
6765
7521
 
@@ -6798,13 +7554,13 @@ return /******/ (function(modules) { // webpackBootstrap
6798
7554
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
6799
7555
 
6800
7556
  /***/ },
6801
- /* 37 */
7557
+ /* 42 */
6802
7558
  /***/ function(module, exports) {
6803
7559
 
6804
7560
  /* (ignored) */
6805
7561
 
6806
7562
  /***/ },
6807
- /* 38 */
7563
+ /* 43 */
6808
7564
  /***/ function(module, exports) {
6809
7565
 
6810
7566
 
@@ -6819,45 +7575,45 @@ return /******/ (function(modules) { // webpackBootstrap
6819
7575
  };
6820
7576
 
6821
7577
  /***/ },
6822
- /* 39 */
7578
+ /* 44 */
6823
7579
  /***/ function(module, exports) {
6824
7580
 
6825
- /* WEBPACK VAR INJECTION */(function(global) {/**
6826
- * JSON parse.
6827
- *
6828
- * @see Based on jQuery#parseJSON (MIT) and JSON2
6829
- * @api private
6830
- */
6831
-
6832
- var rvalidchars = /^[\],:{}\s]*$/;
6833
- var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
6834
- var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
6835
- var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;
6836
- var rtrimLeft = /^\s+/;
6837
- var rtrimRight = /\s+$/;
6838
-
6839
- module.exports = function parsejson(data) {
6840
- if ('string' != typeof data || !data) {
6841
- return null;
6842
- }
6843
-
6844
- data = data.replace(rtrimLeft, '').replace(rtrimRight, '');
6845
-
6846
- // Attempt to parse using the native JSON parser first
6847
- if (global.JSON && JSON.parse) {
6848
- return JSON.parse(data);
6849
- }
6850
-
6851
- if (rvalidchars.test(data.replace(rvalidescape, '@')
6852
- .replace(rvalidtokens, ']')
6853
- .replace(rvalidbraces, ''))) {
6854
- return (new Function('return ' + data))();
6855
- }
7581
+ /* WEBPACK VAR INJECTION */(function(global) {/**
7582
+ * JSON parse.
7583
+ *
7584
+ * @see Based on jQuery#parseJSON (MIT) and JSON2
7585
+ * @api private
7586
+ */
7587
+
7588
+ var rvalidchars = /^[\],:{}\s]*$/;
7589
+ var rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
7590
+ var rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
7591
+ var rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g;
7592
+ var rtrimLeft = /^\s+/;
7593
+ var rtrimRight = /\s+$/;
7594
+
7595
+ module.exports = function parsejson(data) {
7596
+ if ('string' != typeof data || !data) {
7597
+ return null;
7598
+ }
7599
+
7600
+ data = data.replace(rtrimLeft, '').replace(rtrimRight, '');
7601
+
7602
+ // Attempt to parse using the native JSON parser first
7603
+ if (global.JSON && JSON.parse) {
7604
+ return JSON.parse(data);
7605
+ }
7606
+
7607
+ if (rvalidchars.test(data.replace(rvalidescape, '@')
7608
+ .replace(rvalidtokens, ']')
7609
+ .replace(rvalidbraces, ''))) {
7610
+ return (new Function('return ' + data))();
7611
+ }
6856
7612
  };
6857
7613
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
6858
7614
 
6859
7615
  /***/ },
6860
- /* 40 */
7616
+ /* 45 */
6861
7617
  /***/ function(module, exports, __webpack_require__) {
6862
7618
 
6863
7619
  'use strict';
@@ -6866,13 +7622,13 @@ return /******/ (function(modules) { // webpackBootstrap
6866
7622
  * Module dependencies.
6867
7623
  */
6868
7624
 
6869
- var parser = __webpack_require__(6);
6870
- var Emitter = __webpack_require__(41);
6871
- var toArray = __webpack_require__(42);
6872
- var on = __webpack_require__(43);
6873
- var bind = __webpack_require__(44);
7625
+ var parser = __webpack_require__(7);
7626
+ var Emitter = __webpack_require__(36);
7627
+ var toArray = __webpack_require__(46);
7628
+ var on = __webpack_require__(47);
7629
+ var bind = __webpack_require__(48);
6874
7630
  var debug = __webpack_require__(3)('socket.io-client:socket');
6875
- var hasBin = __webpack_require__(45);
7631
+ var hasBin = __webpack_require__(49);
6876
7632
 
6877
7633
  /**
6878
7634
  * Module exports.
@@ -7278,174 +8034,7 @@ return /******/ (function(modules) { // webpackBootstrap
7278
8034
  };
7279
8035
 
7280
8036
  /***/ },
7281
- /* 41 */
7282
- /***/ function(module, exports) {
7283
-
7284
-
7285
- /**
7286
- * Expose `Emitter`.
7287
- */
7288
-
7289
- module.exports = Emitter;
7290
-
7291
- /**
7292
- * Initialize a new `Emitter`.
7293
- *
7294
- * @api public
7295
- */
7296
-
7297
- function Emitter(obj) {
7298
- if (obj) return mixin(obj);
7299
- };
7300
-
7301
- /**
7302
- * Mixin the emitter properties.
7303
- *
7304
- * @param {Object} obj
7305
- * @return {Object}
7306
- * @api private
7307
- */
7308
-
7309
- function mixin(obj) {
7310
- for (var key in Emitter.prototype) {
7311
- obj[key] = Emitter.prototype[key];
7312
- }
7313
- return obj;
7314
- }
7315
-
7316
- /**
7317
- * Listen on the given `event` with `fn`.
7318
- *
7319
- * @param {String} event
7320
- * @param {Function} fn
7321
- * @return {Emitter}
7322
- * @api public
7323
- */
7324
-
7325
- Emitter.prototype.on =
7326
- Emitter.prototype.addEventListener = function(event, fn){
7327
- this._callbacks = this._callbacks || {};
7328
- (this._callbacks['$' + event] = this._callbacks['$' + event] || [])
7329
- .push(fn);
7330
- return this;
7331
- };
7332
-
7333
- /**
7334
- * Adds an `event` listener that will be invoked a single
7335
- * time then automatically removed.
7336
- *
7337
- * @param {String} event
7338
- * @param {Function} fn
7339
- * @return {Emitter}
7340
- * @api public
7341
- */
7342
-
7343
- Emitter.prototype.once = function(event, fn){
7344
- function on() {
7345
- this.off(event, on);
7346
- fn.apply(this, arguments);
7347
- }
7348
-
7349
- on.fn = fn;
7350
- this.on(event, on);
7351
- return this;
7352
- };
7353
-
7354
- /**
7355
- * Remove the given callback for `event` or all
7356
- * registered callbacks.
7357
- *
7358
- * @param {String} event
7359
- * @param {Function} fn
7360
- * @return {Emitter}
7361
- * @api public
7362
- */
7363
-
7364
- Emitter.prototype.off =
7365
- Emitter.prototype.removeListener =
7366
- Emitter.prototype.removeAllListeners =
7367
- Emitter.prototype.removeEventListener = function(event, fn){
7368
- this._callbacks = this._callbacks || {};
7369
-
7370
- // all
7371
- if (0 == arguments.length) {
7372
- this._callbacks = {};
7373
- return this;
7374
- }
7375
-
7376
- // specific event
7377
- var callbacks = this._callbacks['$' + event];
7378
- if (!callbacks) return this;
7379
-
7380
- // remove all handlers
7381
- if (1 == arguments.length) {
7382
- delete this._callbacks['$' + event];
7383
- return this;
7384
- }
7385
-
7386
- // remove specific handler
7387
- var cb;
7388
- for (var i = 0; i < callbacks.length; i++) {
7389
- cb = callbacks[i];
7390
- if (cb === fn || cb.fn === fn) {
7391
- callbacks.splice(i, 1);
7392
- break;
7393
- }
7394
- }
7395
- return this;
7396
- };
7397
-
7398
- /**
7399
- * Emit `event` with the given args.
7400
- *
7401
- * @param {String} event
7402
- * @param {Mixed} ...
7403
- * @return {Emitter}
7404
- */
7405
-
7406
- Emitter.prototype.emit = function(event){
7407
- this._callbacks = this._callbacks || {};
7408
- var args = [].slice.call(arguments, 1)
7409
- , callbacks = this._callbacks['$' + event];
7410
-
7411
- if (callbacks) {
7412
- callbacks = callbacks.slice(0);
7413
- for (var i = 0, len = callbacks.length; i < len; ++i) {
7414
- callbacks[i].apply(this, args);
7415
- }
7416
- }
7417
-
7418
- return this;
7419
- };
7420
-
7421
- /**
7422
- * Return array of callbacks for `event`.
7423
- *
7424
- * @param {String} event
7425
- * @return {Array}
7426
- * @api public
7427
- */
7428
-
7429
- Emitter.prototype.listeners = function(event){
7430
- this._callbacks = this._callbacks || {};
7431
- return this._callbacks['$' + event] || [];
7432
- };
7433
-
7434
- /**
7435
- * Check if this emitter has `event` handlers.
7436
- *
7437
- * @param {String} event
7438
- * @return {Boolean}
7439
- * @api public
7440
- */
7441
-
7442
- Emitter.prototype.hasListeners = function(event){
7443
- return !! this.listeners(event).length;
7444
- };
7445
-
7446
-
7447
- /***/ },
7448
- /* 42 */
8037
+ /* 46 */
7449
8038
  /***/ function(module, exports) {
7450
8039
 
7451
8040
  module.exports = toArray
@@ -7464,7 +8053,7 @@ return /******/ (function(modules) { // webpackBootstrap
7464
8053
 
7465
8054
 
7466
8055
  /***/ },
7467
- /* 43 */
8056
+ /* 47 */
7468
8057
  /***/ function(module, exports) {
7469
8058
 
7470
8059
  "use strict";
@@ -7491,10 +8080,10 @@ return /******/ (function(modules) { // webpackBootstrap
7491
8080
  obj.removeListener(ev, fn);
7492
8081
  }
7493
8082
  };
7494
- }
8083
+ }
7495
8084
 
7496
8085
  /***/ },
7497
- /* 44 */
8086
+ /* 48 */
7498
8087
  /***/ function(module, exports) {
7499
8088
 
7500
8089
  /**
@@ -7523,7 +8112,7 @@ return /******/ (function(modules) { // webpackBootstrap
7523
8112
 
7524
8113
 
7525
8114
  /***/ },
7526
- /* 45 */
8115
+ /* 49 */
7527
8116
  /***/ function(module, exports, __webpack_require__) {
7528
8117
 
7529
8118
  /* WEBPACK VAR INJECTION */(function(global) {
@@ -7531,7 +8120,7 @@ return /******/ (function(modules) { // webpackBootstrap
7531
8120
  * Module requirements.
7532
8121
  */
7533
8122
 
7534
- var isArray = __webpack_require__(9);
8123
+ var isArray = __webpack_require__(50);
7535
8124
 
7536
8125
  /**
7537
8126
  * Module exports.
@@ -7589,7 +8178,16 @@ return /******/ (function(modules) { // webpackBootstrap
7589
8178
  /* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))
7590
8179
 
7591
8180
  /***/ },
7592
- /* 46 */
8181
+ /* 50 */
8182
+ /***/ function(module, exports) {
8183
+
8184
+ module.exports = Array.isArray || function (arr) {
8185
+ return Object.prototype.toString.call(arr) == '[object Array]';
8186
+ };
8187
+
8188
+
8189
+ /***/ },
8190
+ /* 51 */
7593
8191
  /***/ function(module, exports) {
7594
8192
 
7595
8193
 
@@ -7682,4 +8280,5 @@ return /******/ (function(modules) { // webpackBootstrap
7682
8280
  /***/ }
7683
8281
  /******/ ])
7684
8282
  });
7685
- ;
8283
+ ;
8284
+ //# sourceMappingURL=socket.io.js.map