text: /******/ (function(modules) { // webpackBootstrap
  /******/ 	// The module cache
  /******/ 	var installedModules = {};
  /******/
  /******/ 	// The require function
  /******/ 	function __webpack_require__(moduleId) {
  /******/
  /******/ 		// Check if module is in cache
  /******/ 		if(installedModules[moduleId]) {
  /******/ 			return installedModules[moduleId].exports;
  /******/ 		}
  /******/ 		// Create a new module (and put it into the cache)
  /******/ 		var module = installedModules[moduleId] = {
  /******/ 			i: moduleId,
  /******/ 			l: false,
  /******/ 			exports: {}
  /******/ 		};
  /******/
  /******/ 		// Execute the module function
  /******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  /******/
  /******/ 		// Flag the module as loaded
  /******/ 		module.l = true;
  /******/
  /******/ 		// Return the exports of the module
  /******/ 		return module.exports;
  /******/ 	}
  /******/
  /******/
  /******/ 	// expose the modules object (__webpack_modules__)
  /******/ 	__webpack_require__.m = modules;
  /******/
  /******/ 	// expose the module cache
  /******/ 	__webpack_require__.c = installedModules;
  /******/
  /******/ 	// define getter function for harmony exports
  /******/ 	__webpack_require__.d = function(exports, name, getter) {
  /******/ 		if(!__webpack_require__.o(exports, name)) {
  /******/ 			Object.defineProperty(exports, name, {
  /******/ 				configurable: false,
  /******/ 				enumerable: true,
  /******/ 				get: getter
  /******/ 			});
  /******/ 		}
  /******/ 	};
  /******/
  /******/ 	// getDefaultExport function for compatibility with non-harmony modules
  /******/ 	__webpack_require__.n = function(module) {
  /******/ 		var getter = module && module.__esModule ?
  /******/ 			function getDefault() { return module['default']; } :
  /******/ 			function getModuleExports() { return module; };
  /******/ 		__webpack_require__.d(getter, 'a', getter);
  /******/ 		return getter;
  /******/ 	};
  /******/
  /******/ 	// Object.prototype.hasOwnProperty.call
  /******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
  /******/
  /******/ 	// __webpack_public_path__
  /******/ 	__webpack_require__.p = "";
  /******/
  /******/ 	// Load entry module and return exports
  /******/ 	return __webpack_require__(__webpack_require__.s = 25);
  /******/ })
  /************************************************************************/
  /******/ ([
  /* 0 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Expose `Emitter`.
   */
  if (true) {
    module.exports = Emitter;
  }
  /**
   * Initialize a new `Emitter`.
   *
   * @api public
   */
  
  
  function Emitter(obj) {
    if (obj) return mixin(obj);
  }
  
  ;
  /**
   * Mixin the emitter properties.
   *
   * @param {Object} obj
   * @return {Object}
   * @api private
   */
  
  function mixin(obj) {
    for (var key in Emitter.prototype) {
      obj[key] = Emitter.prototype[key];
    }
  
    return obj;
  }
  /**
   * Listen on the given `event` with `fn`.
   *
   * @param {String} event
   * @param {Function} fn
   * @return {Emitter}
   * @api public
   */
  
  
  Emitter.prototype.on = Emitter.prototype.addEventListener = function (event, fn) {
    this._callbacks = this._callbacks || {};
    (this._callbacks['$' + event] = this._callbacks['$' + event] || []).push(fn);
    return this;
  };
  /**
   * Adds an `event` listener that will be invoked a single
   * time then automatically removed.
   *
   * @param {String} event
   * @param {Function} fn
   * @return {Emitter}
   * @api public
   */
  
  
  Emitter.prototype.once = function (event, fn) {
    function on() {
      this.off(event, on);
      fn.apply(this, arguments);
    }
  
    on.fn = fn;
    this.on(event, on);
    return this;
  };
  /**
   * Remove the given callback for `event` or all
   * registered callbacks.
   *
   * @param {String} event
   * @param {Function} fn
   * @return {Emitter}
   * @api public
   */
  
  
  Emitter.prototype.off = Emitter.prototype.removeListener = Emitter.prototype.removeAllListeners = Emitter.prototype.removeEventListener = function (event, fn) {
    this._callbacks = this._callbacks || {}; // all
  
    if (0 == arguments.length) {
      this._callbacks = {};
      return this;
    } // specific event
  
  
    var callbacks = this._callbacks['$' + event];
    if (!callbacks) return this; // remove all handlers
  
    if (1 == arguments.length) {
      delete this._callbacks['$' + event];
      return this;
    } // remove specific handler
  
  
    var cb;
  
    for (var i = 0; i < callbacks.length; i++) {
      cb = callbacks[i];
  
      if (cb === fn || cb.fn === fn) {
        callbacks.splice(i, 1);
        break;
      }
    }
  
    return this;
  };
  /**
   * Emit `event` with the given args.
   *
   * @param {String} event
   * @param {Mixed} ...
   * @return {Emitter}
   */
  
  
  Emitter.prototype.emit = function (event) {
    this._callbacks = this._callbacks || {};
    var args = [].slice.call(arguments, 1),
        callbacks = this._callbacks['$' + event];
  
    if (callbacks) {
      callbacks = callbacks.slice(0);
  
      for (var i = 0, len = callbacks.length; i < len; ++i) {
        callbacks[i].apply(this, args);
      }
    }
  
    return this;
  };
  /**
   * Return array of callbacks for `event`.
   *
   * @param {String} event
   * @return {Array}
   * @api public
   */
  
  
  Emitter.prototype.listeners = function (event) {
    this._callbacks = this._callbacks || {};
    return this._callbacks['$' + event] || [];
  };
  /**
   * Check if this emitter has `event` handlers.
   *
   * @param {String} event
   * @return {Boolean}
   * @api public
   */
  
  
  Emitter.prototype.hasListeners = function (event) {
    return !!this.listeners(event).length;
  };
  
  /***/ }),
  /* 1 */
  /***/ (function(module, exports) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  var g; // This works in non-strict mode
  
  g = function () {
    return this;
  }();
  
  try {
    // This works if eval is allowed (see CSP)
    g = g || Function("return this")() || (1, eval)("this");
  } catch (e) {
    // This works if the window reference is available
    if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
  } // g can still be undefined, but nothing to do about it...
  // We return undefined, instead of nothing here, so it's
  // easier to handle this case. if(!global) { ...}
  
  
  module.exports = g;
  
  /***/ }),
  /* 2 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies.
   */
  var keys = __webpack_require__(44);
  
  var hasBinary = __webpack_require__(18);
  
  var sliceBuffer = __webpack_require__(46);
  
  var after = __webpack_require__(47);
  
  var utf8 = __webpack_require__(48);
  
  var base64encoder;
  
  if (typeof ArrayBuffer !== 'undefined') {
    base64encoder = __webpack_require__(49);
  }
  /**
   * Check if we are running an android browser. That requires us to use
   * ArrayBuffer with polling transports...
   *
   * http://ghinda.net/jpeg-blob-ajax-android/
   */
  
  
  var isAndroid = typeof navigator !== 'undefined' && /Android/i.test(navigator.userAgent);
  /**
   * Check if we are running in PhantomJS.
   * Uploading a Blob with PhantomJS does not work correctly, as reported here:
   * https://github.com/ariya/phantomjs/issues/11395
   * @type boolean
   */
  
  var isPhantomJS = typeof navigator !== 'undefined' && /PhantomJS/i.test(navigator.userAgent);
  /**
   * When true, avoids using Blobs to encode payloads.
   * @type boolean
   */
  
  var dontSendBlobs = isAndroid || isPhantomJS;
  /**
   * Current protocol version.
   */
  
  exports.protocol = 3;
  /**
   * Packet types.
   */
  
  var packets = exports.packets = {
    open: 0 // non-ws
    ,
    close: 1 // non-ws
    ,
    ping: 2,
    pong: 3,
    message: 4,
    upgrade: 5,
    noop: 6
  };
  var packetslist = keys(packets);
  /**
   * Premade error packet.
   */
  
  var err = {
    type: 'error',
    data: 'parser error'
  };
  /**
   * Create a blob api even for blob builder when vendor prefixes exist
   */
  
  var Blob = __webpack_require__(50);
  /**
   * Encodes a packet.
   *
   *     <packet type id> [ <data> ]
   *
   * Example:
   *
   *     5hello world
   *     3
   *     4
   *
   * Binary is encoded in an identical principle
   *
   * @api private
   */
  
  
  exports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {
    if (typeof supportsBinary === 'function') {
      callback = supportsBinary;
      supportsBinary = false;
    }
  
    if (typeof utf8encode === 'function') {
      callback = utf8encode;
      utf8encode = null;
    }
  
    var data = packet.data === undefined ? undefined : packet.data.buffer || packet.data;
  
    if (typeof ArrayBuffer !== 'undefined' && data instanceof ArrayBuffer) {
      return encodeArrayBuffer(packet, supportsBinary, callback);
    } else if (typeof Blob !== 'undefined' && data instanceof Blob) {
      return encodeBlob(packet, supportsBinary, callback);
    } // might be an object with { base64: true, data: dataAsBase64String }
  
  
    if (data && data.base64) {
      return encodeBase64Object(packet, callback);
    } // Sending data as a utf-8 string
  
  
    var encoded = packets[packet.type]; // data fragment is optional
  
    if (undefined !== packet.data) {
      encoded += utf8encode ? utf8.encode(String(packet.data), {
        strict: false
      }) : String(packet.data);
    }
  
    return callback('' + encoded);
  };
  
  function encodeBase64Object(packet, callback) {
    // packet data is an object { base64: true, data: dataAsBase64String }
    var message = 'b' + exports.packets[packet.type] + packet.data.data;
    return callback(message);
  }
  /**
   * Encode packet helpers for binary types
   */
  
  
  function encodeArrayBuffer(packet, supportsBinary, callback) {
    if (!supportsBinary) {
      return exports.encodeBase64Packet(packet, callback);
    }
  
    var data = packet.data;
    var contentArray = new Uint8Array(data);
    var resultBuffer = new Uint8Array(1 + data.byteLength);
    resultBuffer[0] = packets[packet.type];
  
    for (var i = 0; i < contentArray.length; i++) {
      resultBuffer[i + 1] = contentArray[i];
    }
  
    return callback(resultBuffer.buffer);
  }
  
  function encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {
    if (!supportsBinary) {
      return exports.encodeBase64Packet(packet, callback);
    }
  
    var fr = new FileReader();
  
    fr.onload = function () {
      exports.encodePacket({
        type: packet.type,
        data: fr.result
      }, supportsBinary, true, callback);
    };
  
    return fr.readAsArrayBuffer(packet.data);
  }
  
  function encodeBlob(packet, supportsBinary, callback) {
    if (!supportsBinary) {
      return exports.encodeBase64Packet(packet, callback);
    }
  
    if (dontSendBlobs) {
      return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);
    }
  
    var length = new Uint8Array(1);
    length[0] = packets[packet.type];
    var blob = new Blob([length.buffer, packet.data]);
    return callback(blob);
  }
  /**
   * Encodes a packet with binary data in a base64 string
   *
   * @param {Object} packet, has `type` and `data`
   * @return {String} base64 encoded message
   */
  
  
  exports.encodeBase64Packet = function (packet, callback) {
    var message = 'b' + exports.packets[packet.type];
  
    if (typeof Blob !== 'undefined' && packet.data instanceof Blob) {
      var fr = new FileReader();
  
      fr.onload = function () {
        var b64 = fr.result.split(',')[1];
        callback(message + b64);
      };
  
      return fr.readAsDataURL(packet.data);
    }
  
    var b64data;
  
    try {
      b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));
    } catch (e) {
      // iPhone Safari doesn't let you apply with typed arrays
      var typed = new Uint8Array(packet.data);
      var basic = new Array(typed.length);
  
      for (var i = 0; i < typed.length; i++) {
        basic[i] = typed[i];
      }
  
      b64data = String.fromCharCode.apply(null, basic);
    }
  
    message += btoa(b64data);
    return callback(message);
  };
  /**
   * Decodes a packet. Changes format to Blob if requested.
   *
   * @return {Object} with `type` and `data` (if any)
   * @api private
   */
  
  
  exports.decodePacket = function (data, binaryType, utf8decode) {
    if (data === undefined) {
      return err;
    } // String data
  
  
    if (typeof data === 'string') {
      if (data.charAt(0) === 'b') {
        return exports.decodeBase64Packet(data.substr(1), binaryType);
      }
  
      if (utf8decode) {
        data = tryDecode(data);
  
        if (data === false) {
          return err;
        }
      }
  
      var type = data.charAt(0);
  
      if (Number(type) != type || !packetslist[type]) {
        return err;
      }
  
      if (data.length > 1) {
        return {
          type: packetslist[type],
          data: data.substring(1)
        };
      } else {
        return {
          type: packetslist[type]
        };
      }
    }
  
    var asArray = new Uint8Array(data);
    var type = asArray[0];
    var rest = sliceBuffer(data, 1);
  
    if (Blob && binaryType === 'blob') {
      rest = new Blob([rest]);
    }
  
    return {
      type: packetslist[type],
      data: rest
    };
  };
  
  function tryDecode(data) {
    try {
      data = utf8.decode(data, {
        strict: false
      });
    } catch (e) {
      return false;
    }
  
    return data;
  }
  /**
   * Decodes a packet encoded in a base64 string
   *
   * @param {String} base64 encoded message
   * @return {Object} with `type` and `data` (if any)
   */
  
  
  exports.decodeBase64Packet = function (msg, binaryType) {
    var type = packetslist[msg.charAt(0)];
  
    if (!base64encoder) {
      return {
        type: type,
        data: {
          base64: true,
          data: msg.substr(1)
        }
      };
    }
  
    var data = base64encoder.decode(msg.substr(1));
  
    if (binaryType === 'blob' && Blob) {
      data = new Blob([data]);
    }
  
    return {
      type: type,
      data: data
    };
  };
  /**
   * Encodes multiple messages (payload).
   *
   *     <length>:data
   *
   * Example:
   *
   *     11:hello world2:hi
   *
   * If any contents are binary, they will be encoded as base64 strings. Base64
   * encoded strings are marked with a b before the length specifier
   *
   * @param {Array} packets
   * @api private
   */
  
  
  exports.encodePayload = function (packets, supportsBinary, callback) {
    if (typeof supportsBinary === 'function') {
      callback = supportsBinary;
      supportsBinary = null;
    }
  
    var isBinary = hasBinary(packets);
  
    if (supportsBinary && isBinary) {
      if (Blob && !dontSendBlobs) {
        return exports.encodePayloadAsBlob(packets, callback);
      }
  
      return exports.encodePayloadAsArrayBuffer(packets, callback);
    }
  
    if (!packets.length) {
      return callback('0:');
    }
  
    function setLengthHeader(message) {
      return message.length + ':' + message;
    }
  
    function encodeOne(packet, doneCallback) {
      exports.encodePacket(packet, !isBinary ? false : supportsBinary, false, function (message) {
        doneCallback(null, setLengthHeader(message));
      });
    }
  
    map(packets, encodeOne, function (err, results) {
      return callback(results.join(''));
    });
  };
  /**
   * Async array map using after
   */
  
  
  function map(ary, each, done) {
    var result = new Array(ary.length);
    var next = after(ary.length, done);
  
    var eachWithIndex = function eachWithIndex(i, el, cb) {
      each(el, function (error, msg) {
        result[i] = msg;
        cb(error, result);
      });
    };
  
    for (var i = 0; i < ary.length; i++) {
      eachWithIndex(i, ary[i], next);
    }
  }
  /*
   * Decodes data when a payload is maybe expected. Possible binary contents are
   * decoded from their base64 representation
   *
   * @param {String} data, callback method
   * @api public
   */
  
  
  exports.decodePayload = function (data, binaryType, callback) {
    if (typeof data !== 'string') {
      return exports.decodePayloadAsBinary(data, binaryType, callback);
    }
  
    if (typeof binaryType === 'function') {
      callback = binaryType;
      binaryType = null;
    }
  
    var packet;
  
    if (data === '') {
      // parser error - ignoring payload
      return callback(err, 0, 1);
    }
  
    var length = '',
        n,
        msg;
  
    for (var i = 0, l = data.length; i < l; i++) {
      var chr = data.charAt(i);
  
      if (chr !== ':') {
        length += chr;
        continue;
      }
  
      if (length === '' || length != (n = Number(length))) {
        // parser error - ignoring payload
        return callback(err, 0, 1);
      }
  
      msg = data.substr(i + 1, n);
  
      if (length != msg.length) {
        // parser error - ignoring payload
        return callback(err, 0, 1);
      }
  
      if (msg.length) {
        packet = exports.decodePacket(msg, binaryType, false);
  
        if (err.type === packet.type && err.data === packet.data) {
          // parser error in individual packet - ignoring payload
          return callback(err, 0, 1);
        }
  
        var ret = callback(packet, i + n, l);
        if (false === ret) return;
      } // advance cursor
  
  
      i += n;
      length = '';
    }
  
    if (length !== '') {
      // parser error - ignoring payload
      return callback(err, 0, 1);
    }
  };
  /**
   * Encodes multiple messages (payload) as binary.
   *
   * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number
   * 255><data>
   *
   * Example:
   * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers
   *
   * @param {Array} packets
   * @return {ArrayBuffer} encoded payload
   * @api private
   */
  
  
  exports.encodePayloadAsArrayBuffer = function (packets, callback) {
    if (!packets.length) {
      return callback(new ArrayBuffer(0));
    }
  
    function encodeOne(packet, doneCallback) {
      exports.encodePacket(packet, true, true, function (data) {
        return doneCallback(null, data);
      });
    }
  
    map(packets, encodeOne, function (err, encodedPackets) {
      var totalLength = encodedPackets.reduce(function (acc, p) {
        var len;
  
        if (typeof p === 'string') {
          len = p.length;
        } else {
          len = p.byteLength;
        }
  
        return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2
      }, 0);
      var resultArray = new Uint8Array(totalLength);
      var bufferIndex = 0;
      encodedPackets.forEach(function (p) {
        var isString = typeof p === 'string';
        var ab = p;
  
        if (isString) {
          var view = new Uint8Array(p.length);
  
          for (var i = 0; i < p.length; i++) {
            view[i] = p.charCodeAt(i);
          }
  
          ab = view.buffer;
        }
  
        if (isString) {
          // not true binary
          resultArray[bufferIndex++] = 0;
        } else {
          // true binary
          resultArray[bufferIndex++] = 1;
        }
  
        var lenStr = ab.byteLength.toString();
  
        for (var i = 0; i < lenStr.length; i++) {
          resultArray[bufferIndex++] = parseInt(lenStr[i]);
        }
  
        resultArray[bufferIndex++] = 255;
        var view = new Uint8Array(ab);
  
        for (var i = 0; i < view.length; i++) {
          resultArray[bufferIndex++] = view[i];
        }
      });
      return callback(resultArray.buffer);
    });
  };
  /**
   * Encode as Blob
   */
  
  
  exports.encodePayloadAsBlob = function (packets, callback) {
    function encodeOne(packet, doneCallback) {
      exports.encodePacket(packet, true, true, function (encoded) {
        var binaryIdentifier = new Uint8Array(1);
        binaryIdentifier[0] = 1;
  
        if (typeof encoded === 'string') {
          var view = new Uint8Array(encoded.length);
  
          for (var i = 0; i < encoded.length; i++) {
            view[i] = encoded.charCodeAt(i);
          }
  
          encoded = view.buffer;
          binaryIdentifier[0] = 0;
        }
  
        var len = encoded instanceof ArrayBuffer ? encoded.byteLength : encoded.size;
        var lenStr = len.toString();
        var lengthAry = new Uint8Array(lenStr.length + 1);
  
        for (var i = 0; i < lenStr.length; i++) {
          lengthAry[i] = parseInt(lenStr[i]);
        }
  
        lengthAry[lenStr.length] = 255;
  
        if (Blob) {
          var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);
          doneCallback(null, blob);
        }
      });
    }
  
    map(packets, encodeOne, function (err, results) {
      return callback(new Blob(results));
    });
  };
  /*
   * Decodes data when a payload is maybe expected. Strings are decoded by
   * interpreting each byte as a key code for entries marked to start with 0. See
   * description of encodePayloadAsBinary
   *
   * @param {ArrayBuffer} data, callback method
   * @api public
   */
  
  
  exports.decodePayloadAsBinary = function (data, binaryType, callback) {
    if (typeof binaryType === 'function') {
      callback = binaryType;
      binaryType = null;
    }
  
    var bufferTail = data;
    var buffers = [];
  
    while (bufferTail.byteLength > 0) {
      var tailArray = new Uint8Array(bufferTail);
      var isString = tailArray[0] === 0;
      var msgLength = '';
  
      for (var i = 1;; i++) {
        if (tailArray[i] === 255) break; // 310 = char length of Number.MAX_VALUE
  
        if (msgLength.length > 310) {
          return callback(err, 0, 1);
        }
  
        msgLength += tailArray[i];
      }
  
      bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);
      msgLength = parseInt(msgLength);
      var msg = sliceBuffer(bufferTail, 0, msgLength);
  
      if (isString) {
        try {
          msg = String.fromCharCode.apply(null, new Uint8Array(msg));
        } catch (e) {
          // iPhone Safari doesn't let you apply to typed arrays
          var typed = new Uint8Array(msg);
          msg = '';
  
          for (var i = 0; i < typed.length; i++) {
            msg += String.fromCharCode(typed[i]);
          }
        }
      }
  
      buffers.push(msg);
      bufferTail = sliceBuffer(bufferTail, msgLength);
    }
  
    var total = buffers.length;
    buffers.forEach(function (buffer, i) {
      callback(exports.decodePacket(buffer, binaryType, true), i, total);
    });
  };
  
  /***/ }),
  /* 3 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(process) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /* eslint-env browser */
  
  /**
   * This is the web browser implementation of `debug()`.
   */
  exports.log = log;
  exports.formatArgs = formatArgs;
  exports.save = save;
  exports.load = load;
  exports.useColors = useColors;
  exports.storage = localstorage();
  /**
   * Colors.
   */
  
  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'];
  /**
   * Currently only WebKit-based Web Inspectors, Firefox >= v31,
   * and the Firebug extension (any Firefox version) are known
   * to support "%c" CSS customizations.
   *
   * TODO: add a `localStorage` variable to explicitly enable/disable colors
   */
  // eslint-disable-next-line complexity
  
  function useColors() {
    // NB: In an Electron preload script, document will be defined but not fully
    // initialized. Since we know we're in Chrome, we'll just detect this case
    // explicitly
    if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
      return true;
    } // Internet Explorer and Edge do not support colors.
  
  
    if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
      return false;
    } // Is webkit? http://stackoverflow.com/a/16459606/376773
    // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  
  
    return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
    typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  }
  /**
   * Colorize log arguments if enabled.
   *
   * @api public
   */
  
  
  function formatArgs(args) {
    args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
  
    if (!this.useColors) {
      return;
    }
  
    var c = 'color: ' + this.color;
    args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
    // arguments passed either before or after the %c, so we need to
    // figure out the correct index to insert the CSS into
  
    var index = 0;
    var lastC = 0;
    args[0].replace(/%[a-zA-Z%]/g, function (match) {
      if (match === '%%') {
        return;
      }
  
      index++;
  
      if (match === '%c') {
        // We only are interested in the *last* %c
        // (the user may have provided their own)
        lastC = index;
      }
    });
    args.splice(lastC, 0, c);
  }
  /**
   * Invokes `console.log()` when available.
   * No-op when `console.log` is not a "function".
   *
   * @api public
   */
  
  
  function log() {
    var _console;
  
    // This hackery is required for IE8/9, where
    // the `console.log` function doesn't have 'apply'
    return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
  }
  /**
   * Save `namespaces`.
   *
   * @param {String} namespaces
   * @api private
   */
  
  
  function save(namespaces) {
    try {
      if (namespaces) {
        exports.storage.setItem('debug', namespaces);
      } else {
        exports.storage.removeItem('debug');
      }
    } catch (error) {// Swallow
      // XXX (@Qix-) should we be logging these?
    }
  }
  /**
   * Load `namespaces`.
   *
   * @return {String} returns the previously persisted debug modes
   * @api private
   */
  
  
  function load() {
    var r;
  
    try {
      r = exports.storage.getItem('debug');
    } catch (error) {} // Swallow
    // XXX (@Qix-) should we be logging these?
    // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  
  
    if (!r && typeof process !== 'undefined' && 'env' in process) {
      r = process.env.DEBUG;
    }
  
    return r;
  }
  /**
   * Localstorage attempts to return the localstorage.
   *
   * This is necessary because safari throws
   * when a user disables cookies/localstorage
   * and you attempt to access it.
   *
   * @return {LocalStorage}
   * @api private
   */
  
  
  function localstorage() {
    try {
      // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
      // The Browser also has localStorage in the global context.
      return localStorage;
    } catch (error) {// Swallow
      // XXX (@Qix-) should we be logging these?
    }
  }
  
  module.exports = __webpack_require__(31)(exports);
  var formatters = module.exports.formatters;
  /**
   * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
   */
  
  formatters.j = function (v) {
    try {
      return JSON.stringify(v);
    } catch (error) {
      return '[UnexpectedJSONParseError]: ' + error.message;
    }
  };
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
  
  /***/ }),
  /* 4 */
  /***/ (function(module, exports) {
  
  // shim for using process in browser
  var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
  // don't break things.  But we need to wrap it in a try catch in case it is
  // wrapped in strict mode code which doesn't define any globals.  It's inside a
  // function because try/catches deoptimize in certain engines.
  
  var cachedSetTimeout;
  var cachedClearTimeout;
  
  function defaultSetTimout() {
    throw new Error('setTimeout has not been defined');
  }
  
  function defaultClearTimeout() {
    throw new Error('clearTimeout has not been defined');
  }
  
  (function () {
    try {
      if (typeof setTimeout === 'function') {
        cachedSetTimeout = setTimeout;
      } else {
        cachedSetTimeout = defaultSetTimout;
      }
    } catch (e) {
      cachedSetTimeout = defaultSetTimout;
    }
  
    try {
      if (typeof clearTimeout === 'function') {
        cachedClearTimeout = clearTimeout;
      } else {
        cachedClearTimeout = defaultClearTimeout;
      }
    } catch (e) {
      cachedClearTimeout = defaultClearTimeout;
    }
  })();
  
  function runTimeout(fun) {
    if (cachedSetTimeout === setTimeout) {
      //normal enviroments in sane situations
      return setTimeout(fun, 0);
    } // if setTimeout wasn't available but was latter defined
  
  
    if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
      cachedSetTimeout = setTimeout;
      return setTimeout(fun, 0);
    }
  
    try {
      // when when somebody has screwed with setTimeout but no I.E. maddness
      return cachedSetTimeout(fun, 0);
    } catch (e) {
      try {
        // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
        return cachedSetTimeout.call(null, fun, 0);
      } catch (e) {
        // 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
        return cachedSetTimeout.call(this, fun, 0);
      }
    }
  }
  
  function runClearTimeout(marker) {
    if (cachedClearTimeout === clearTimeout) {
      //normal enviroments in sane situations
      return clearTimeout(marker);
    } // if clearTimeout wasn't available but was latter defined
  
  
    if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
      cachedClearTimeout = clearTimeout;
      return clearTimeout(marker);
    }
  
    try {
      // when when somebody has screwed with setTimeout but no I.E. maddness
      return cachedClearTimeout(marker);
    } catch (e) {
      try {
        // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
        return cachedClearTimeout.call(null, marker);
      } catch (e) {
        // 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.
        // Some versions of I.E. have different rules for clearTimeout vs setTimeout
        return cachedClearTimeout.call(this, marker);
      }
    }
  }
  
  var queue = [];
  var draining = false;
  var currentQueue;
  var queueIndex = -1;
  
  function cleanUpNextTick() {
    if (!draining || !currentQueue) {
      return;
    }
  
    draining = false;
  
    if (currentQueue.length) {
      queue = currentQueue.concat(queue);
    } else {
      queueIndex = -1;
    }
  
    if (queue.length) {
      drainQueue();
    }
  }
  
  function drainQueue() {
    if (draining) {
      return;
    }
  
    var timeout = runTimeout(cleanUpNextTick);
    draining = true;
    var len = queue.length;
  
    while (len) {
      currentQueue = queue;
      queue = [];
  
      while (++queueIndex < len) {
        if (currentQueue) {
          currentQueue[queueIndex].run();
        }
      }
  
      queueIndex = -1;
      len = queue.length;
    }
  
    currentQueue = null;
    draining = false;
    runClearTimeout(timeout);
  }
  
  process.nextTick = function (fun) {
    var args = new Array(arguments.length - 1);
  
    if (arguments.length > 1) {
      for (var i = 1; i < arguments.length; i++) {
        args[i - 1] = arguments[i];
      }
    }
  
    queue.push(new Item(fun, args));
  
    if (queue.length === 1 && !draining) {
      runTimeout(drainQueue);
    }
  }; // v8 likes predictible objects
  
  
  function Item(fun, array) {
    this.fun = fun;
    this.array = array;
  }
  
  Item.prototype.run = function () {
    this.fun.apply(null, this.array);
  };
  
  process.title = 'browser';
  process.browser = true;
  process.env = {};
  process.argv = [];
  process.version = ''; // empty string to avoid regexp issues
  
  process.versions = {};
  
  function noop() {}
  
  process.on = noop;
  process.addListener = noop;
  process.once = noop;
  process.off = noop;
  process.removeListener = noop;
  process.removeAllListeners = noop;
  process.emit = noop;
  process.prependListener = noop;
  process.prependOnceListener = noop;
  
  process.listeners = function (name) {
    return [];
  };
  
  process.binding = function (name) {
    throw new Error('process.binding is not supported');
  };
  
  process.cwd = function () {
    return '/';
  };
  
  process.chdir = function (dir) {
    throw new Error('process.chdir is not supported');
  };
  
  process.umask = function () {
    return 0;
  };
  
  /***/ }),
  /* 5 */
  /***/ (function(module, exports) {
  
  /**
   * Compiles a querystring
   * Returns string representation of the object
   *
   * @param {Object}
   * @api private
   */
  exports.encode = function (obj) {
    var str = '';
  
    for (var i in obj) {
      if (obj.hasOwnProperty(i)) {
        if (str.length) str += '&';
        str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);
      }
    }
  
    return str;
  };
  /**
   * Parses a simple querystring into an object
   *
   * @param {String} qs
   * @api private
   */
  
  
  exports.decode = function (qs) {
    var qry = {};
    var pairs = qs.split('&');
  
    for (var i = 0, l = pairs.length; i < l; i++) {
      var pair = pairs[i].split('=');
      qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);
    }
  
    return qry;
  };
  
  /***/ }),
  /* 6 */
  /***/ (function(module, exports) {
  
  module.exports = function (a, b) {
    var fn = function fn() {};
  
    fn.prototype = b.prototype;
    a.prototype = new fn();
    a.prototype.constructor = a;
  };
  
  /***/ }),
  /* 7 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(process) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /* eslint-env browser */
  
  /**
   * This is the web browser implementation of `debug()`.
   */
  exports.log = log;
  exports.formatArgs = formatArgs;
  exports.save = save;
  exports.load = load;
  exports.useColors = useColors;
  exports.storage = localstorage();
  /**
   * Colors.
   */
  
  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'];
  /**
   * Currently only WebKit-based Web Inspectors, Firefox >= v31,
   * and the Firebug extension (any Firefox version) are known
   * to support "%c" CSS customizations.
   *
   * TODO: add a `localStorage` variable to explicitly enable/disable colors
   */
  // eslint-disable-next-line complexity
  
  function useColors() {
    // NB: In an Electron preload script, document will be defined but not fully
    // initialized. Since we know we're in Chrome, we'll just detect this case
    // explicitly
    if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
      return true;
    } // Internet Explorer and Edge do not support colors.
  
  
    if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
      return false;
    } // Is webkit? http://stackoverflow.com/a/16459606/376773
    // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  
  
    return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
    typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  }
  /**
   * Colorize log arguments if enabled.
   *
   * @api public
   */
  
  
  function formatArgs(args) {
    args[0] = (this.useColors ? '%c' : '') + this.namespace + (this.useColors ? ' %c' : ' ') + args[0] + (this.useColors ? '%c ' : ' ') + '+' + module.exports.humanize(this.diff);
  
    if (!this.useColors) {
      return;
    }
  
    var c = 'color: ' + this.color;
    args.splice(1, 0, c, 'color: inherit'); // The final "%c" is somewhat tricky, because there could be other
    // arguments passed either before or after the %c, so we need to
    // figure out the correct index to insert the CSS into
  
    var index = 0;
    var lastC = 0;
    args[0].replace(/%[a-zA-Z%]/g, function (match) {
      if (match === '%%') {
        return;
      }
  
      index++;
  
      if (match === '%c') {
        // We only are interested in the *last* %c
        // (the user may have provided their own)
        lastC = index;
      }
    });
    args.splice(lastC, 0, c);
  }
  /**
   * Invokes `console.log()` when available.
   * No-op when `console.log` is not a "function".
   *
   * @api public
   */
  
  
  function log() {
    var _console;
  
    // This hackery is required for IE8/9, where
    // the `console.log` function doesn't have 'apply'
    return (typeof console === "undefined" ? "undefined" : _typeof(console)) === 'object' && console.log && (_console = console).log.apply(_console, arguments);
  }
  /**
   * Save `namespaces`.
   *
   * @param {String} namespaces
   * @api private
   */
  
  
  function save(namespaces) {
    try {
      if (namespaces) {
        exports.storage.setItem('debug', namespaces);
      } else {
        exports.storage.removeItem('debug');
      }
    } catch (error) {// Swallow
      // XXX (@Qix-) should we be logging these?
    }
  }
  /**
   * Load `namespaces`.
   *
   * @return {String} returns the previously persisted debug modes
   * @api private
   */
  
  
  function load() {
    var r;
  
    try {
      r = exports.storage.getItem('debug');
    } catch (error) {} // Swallow
    // XXX (@Qix-) should we be logging these?
    // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  
  
    if (!r && typeof process !== 'undefined' && 'env' in process) {
      r = process.env.DEBUG;
    }
  
    return r;
  }
  /**
   * Localstorage attempts to return the localstorage.
   *
   * This is necessary because safari throws
   * when a user disables cookies/localstorage
   * and you attempt to access it.
   *
   * @return {LocalStorage}
   * @api private
   */
  
  
  function localstorage() {
    try {
      // TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
      // The Browser also has localStorage in the global context.
      return localStorage;
    } catch (error) {// Swallow
      // XXX (@Qix-) should we be logging these?
    }
  }
  
  module.exports = __webpack_require__(51)(exports);
  var formatters = module.exports.formatters;
  /**
   * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
   */
  
  formatters.j = function (v) {
    try {
      return JSON.stringify(v);
    } catch (error) {
      return '[UnexpectedJSONParseError]: ' + error.message;
    }
  };
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
  
  /***/ }),
  /* 8 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies.
   */
  var debug = __webpack_require__(33)('socket.io-parser');
  
  var Emitter = __webpack_require__(0);
  
  var binary = __webpack_require__(36);
  
  var isArray = __webpack_require__(13);
  
  var isBuf = __webpack_require__(14);
  /**
   * Protocol version.
   *
   * @api public
   */
  
  
  exports.protocol = 4;
  /**
   * Packet types.
   *
   * @api public
   */
  
  exports.types = ['CONNECT', 'DISCONNECT', 'EVENT', 'ACK', 'ERROR', 'BINARY_EVENT', 'BINARY_ACK'];
  /**
   * Packet type `connect`.
   *
   * @api public
   */
  
  exports.CONNECT = 0;
  /**
   * Packet type `disconnect`.
   *
   * @api public
   */
  
  exports.DISCONNECT = 1;
  /**
   * Packet type `event`.
   *
   * @api public
   */
  
  exports.EVENT = 2;
  /**
   * Packet type `ack`.
   *
   * @api public
   */
  
  exports.ACK = 3;
  /**
   * Packet type `error`.
   *
   * @api public
   */
  
  exports.ERROR = 4;
  /**
   * Packet type 'binary event'
   *
   * @api public
   */
  
  exports.BINARY_EVENT = 5;
  /**
   * Packet type `binary ack`. For acks with binary arguments.
   *
   * @api public
   */
  
  exports.BINARY_ACK = 6;
  /**
   * Encoder constructor.
   *
   * @api public
   */
  
  exports.Encoder = Encoder;
  /**
   * Decoder constructor.
   *
   * @api public
   */
  
  exports.Decoder = Decoder;
  /**
   * A socket.io Encoder instance
   *
   * @api public
   */
  
  function Encoder() {}
  
  var ERROR_PACKET = exports.ERROR + '"encode error"';
  /**
   * Encode a packet as a single string if non-binary, or as a
   * buffer sequence, depending on packet type.
   *
   * @param {Object} obj - packet object
   * @param {Function} callback - function to handle encodings (likely engine.write)
   * @return Calls callback with Array of encodings
   * @api public
   */
  
  Encoder.prototype.encode = function (obj, callback) {
    debug('encoding packet %j', obj);
  
    if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
      encodeAsBinary(obj, callback);
    } else {
      var encoding = encodeAsString(obj);
      callback([encoding]);
    }
  };
  /**
   * Encode packet as string.
   *
   * @param {Object} packet
   * @return {String} encoded
   * @api private
   */
  
  
  function encodeAsString(obj) {
    // first is type
    var str = '' + obj.type; // attachments if we have them
  
    if (exports.BINARY_EVENT === obj.type || exports.BINARY_ACK === obj.type) {
      str += obj.attachments + '-';
    } // if we have a namespace other than `/`
    // we append it followed by a comma `,`
  
  
    if (obj.nsp && '/' !== obj.nsp) {
      str += obj.nsp + ',';
    } // immediately followed by the id
  
  
    if (null != obj.id) {
      str += obj.id;
    } // json data
  
  
    if (null != obj.data) {
      var payload = tryStringify(obj.data);
  
      if (payload !== false) {
        str += payload;
      } else {
        return ERROR_PACKET;
      }
    }
  
    debug('encoded %j as %s', obj, str);
    return str;
  }
  
  function tryStringify(str) {
    try {
      return JSON.stringify(str);
    } catch (e) {
      return false;
    }
  }
  /**
   * Encode packet as 'buffer sequence' by removing blobs, and
   * deconstructing packet into object with placeholders and
   * a list of buffers.
   *
   * @param {Object} packet
   * @return {Buffer} encoded
   * @api private
   */
  
  
  function encodeAsBinary(obj, callback) {
    function writeEncoding(bloblessData) {
      var deconstruction = binary.deconstructPacket(bloblessData);
      var pack = encodeAsString(deconstruction.packet);
      var buffers = deconstruction.buffers;
      buffers.unshift(pack); // add packet info to beginning of data list
  
      callback(buffers); // write all the buffers
    }
  
    binary.removeBlobs(obj, writeEncoding);
  }
  /**
   * A socket.io Decoder instance
   *
   * @return {Object} decoder
   * @api public
   */
  
  
  function Decoder() {
    this.reconstructor = null;
  }
  /**
   * Mix in `Emitter` with Decoder.
   */
  
  
  Emitter(Decoder.prototype);
  /**
   * Decodes an encoded packet string into packet JSON.
   *
   * @param {String} obj - encoded packet
   * @return {Object} packet
   * @api public
   */
  
  Decoder.prototype.add = function (obj) {
    var packet;
  
    if (typeof obj === 'string') {
      packet = decodeString(obj);
  
      if (exports.BINARY_EVENT === packet.type || exports.BINARY_ACK === packet.type) {
        // binary packet's json
        this.reconstructor = new BinaryReconstructor(packet); // no attachments, labeled binary but no binary data to follow
  
        if (this.reconstructor.reconPack.attachments === 0) {
          this.emit('decoded', packet);
        }
      } else {
        // non-binary full packet
        this.emit('decoded', packet);
      }
    } else if (isBuf(obj) || obj.base64) {
      // raw binary data
      if (!this.reconstructor) {
        throw new Error('got binary data when not reconstructing a packet');
      } else {
        packet = this.reconstructor.takeBinaryData(obj);
  
        if (packet) {
          // received final buffer
          this.reconstructor = null;
          this.emit('decoded', packet);
        }
      }
    } else {
      throw new Error('Unknown type: ' + obj);
    }
  };
  /**
   * Decode a packet String (JSON data)
   *
   * @param {String} str
   * @return {Object} packet
   * @api private
   */
  
  
  function decodeString(str) {
    var i = 0; // look up type
  
    var p = {
      type: Number(str.charAt(0))
    };
  
    if (null == exports.types[p.type]) {
      return error('unknown packet type ' + p.type);
    } // look up attachments if type binary
  
  
    if (exports.BINARY_EVENT === p.type || exports.BINARY_ACK === p.type) {
      var buf = '';
  
      while (str.charAt(++i) !== '-') {
        buf += str.charAt(i);
        if (i == str.length) break;
      }
  
      if (buf != Number(buf) || str.charAt(i) !== '-') {
        throw new Error('Illegal attachments');
      }
  
      p.attachments = Number(buf);
    } // look up namespace (if any)
  
  
    if ('/' === str.charAt(i + 1)) {
      p.nsp = '';
  
      while (++i) {
        var c = str.charAt(i);
        if (',' === c) break;
        p.nsp += c;
        if (i === str.length) break;
      }
    } else {
      p.nsp = '/';
    } // look up id
  
  
    var next = str.charAt(i + 1);
  
    if ('' !== next && Number(next) == next) {
      p.id = '';
  
      while (++i) {
        var c = str.charAt(i);
  
        if (null == c || Number(c) != c) {
          --i;
          break;
        }
  
        p.id += str.charAt(i);
        if (i === str.length) break;
      }
  
      p.id = Number(p.id);
    } // look up json data
  
  
    if (str.charAt(++i)) {
      var payload = tryParse(str.substr(i));
      var isPayloadValid = payload !== false && (p.type === exports.ERROR || isArray(payload));
  
      if (isPayloadValid) {
        p.data = payload;
      } else {
        return error('invalid payload');
      }
    }
  
    debug('decoded %s as %j', str, p);
    return p;
  }
  
  function tryParse(str) {
    try {
      return JSON.parse(str);
    } catch (e) {
      return false;
    }
  }
  /**
   * Deallocates a parser's resources
   *
   * @api public
   */
  
  
  Decoder.prototype.destroy = function () {
    if (this.reconstructor) {
      this.reconstructor.finishedReconstruction();
    }
  };
  /**
   * A manager of a binary event's 'buffer sequence'. Should
   * be constructed whenever a packet of type BINARY_EVENT is
   * decoded.
   *
   * @param {Object} packet
   * @return {BinaryReconstructor} initialized reconstructor
   * @api private
   */
  
  
  function BinaryReconstructor(packet) {
    this.reconPack = packet;
    this.buffers = [];
  }
  /**
   * Method to be called when binary data received from connection
   * after a BINARY_EVENT packet.
   *
   * @param {Buffer | ArrayBuffer} binData - the raw binary data received
   * @return {null | Object} returns null if more binary data is expected or
   *   a reconstructed packet object if all buffers have been received.
   * @api private
   */
  
  
  BinaryReconstructor.prototype.takeBinaryData = function (binData) {
    this.buffers.push(binData);
  
    if (this.buffers.length === this.reconPack.attachments) {
      // done with buffer list
      var packet = binary.reconstructPacket(this.reconPack, this.buffers);
      this.finishedReconstruction();
      return packet;
    }
  
    return null;
  };
  /**
   * Cleans up binary packet reconstruction variables.
   *
   * @api private
   */
  
  
  BinaryReconstructor.prototype.finishedReconstruction = function () {
    this.reconPack = null;
    this.buffers = [];
  };
  
  function error(msg) {
    return {
      type: exports.ERROR,
      data: 'parser error: ' + msg
    };
  }
  
  /***/ }),
  /* 9 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(global) {/*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <http://feross.org>
   * @license  MIT
   */
  
  /* eslint-disable no-proto */
  
  
  var base64 = __webpack_require__(37);
  
  var ieee754 = __webpack_require__(38);
  
  var isArray = __webpack_require__(39);
  
  exports.Buffer = Buffer;
  exports.SlowBuffer = SlowBuffer;
  exports.INSPECT_MAX_BYTES = 50;
  /**
   * If `Buffer.TYPED_ARRAY_SUPPORT`:
   *   === true    Use Uint8Array implementation (fastest)
   *   === false   Use Object implementation (most compatible, even IE6)
   *
   * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
   * Opera 11.6+, iOS 4.2+.
   *
   * Due to various browser bugs, sometimes the Object implementation will be used even
   * when the browser supports typed arrays.
   *
   * Note:
   *
   *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
   *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
   *
   *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
   *
   *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
   *     incorrect length in some situations.
  
   * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
   * get the Object implementation, which is slower but behaves correctly.
   */
  
  Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();
  /*
   * Export kMaxLength after typed array support is determined.
   */
  
  exports.kMaxLength = kMaxLength();
  
  function typedArraySupport() {
    try {
      var arr = new Uint8Array(1);
      arr.__proto__ = {
        __proto__: Uint8Array.prototype,
        foo: function foo() {
          return 42;
        }
      };
      return arr.foo() === 42 && // typed array instances can be augmented
      typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
      arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`
    } catch (e) {
      return false;
    }
  }
  
  function kMaxLength() {
    return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
  }
  
  function createBuffer(that, length) {
    if (kMaxLength() < length) {
      throw new RangeError('Invalid typed array length');
    }
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      // Return an augmented `Uint8Array` instance, for best performance
      that = new Uint8Array(length);
      that.__proto__ = Buffer.prototype;
    } else {
      // Fallback: Return an object instance of the Buffer class
      if (that === null) {
        that = new Buffer(length);
      }
  
      that.length = length;
    }
  
    return that;
  }
  /**
   * The Buffer constructor returns instances of `Uint8Array` that have their
   * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
   * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
   * and the `Uint8Array` methods. Square bracket notation works as expected -- it
   * returns a single octet.
   *
   * The `Uint8Array` prototype remains unmodified.
   */
  
  
  function Buffer(arg, encodingOrOffset, length) {
    if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
      return new Buffer(arg, encodingOrOffset, length);
    } // Common case.
  
  
    if (typeof arg === 'number') {
      if (typeof encodingOrOffset === 'string') {
        throw new Error('If encoding is specified then the first argument must be a string');
      }
  
      return allocUnsafe(this, arg);
    }
  
    return from(this, arg, encodingOrOffset, length);
  }
  
  Buffer.poolSize = 8192; // not used by this implementation
  // TODO: Legacy, not needed anymore. Remove in next major version.
  
  Buffer._augment = function (arr) {
    arr.__proto__ = Buffer.prototype;
    return arr;
  };
  
  function from(that, value, encodingOrOffset, length) {
    if (typeof value === 'number') {
      throw new TypeError('"value" argument must not be a number');
    }
  
    if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
      return fromArrayBuffer(that, value, encodingOrOffset, length);
    }
  
    if (typeof value === 'string') {
      return fromString(that, value, encodingOrOffset);
    }
  
    return fromObject(that, value);
  }
  /**
   * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
   * if value is a number.
   * Buffer.from(str[, encoding])
   * Buffer.from(array)
   * Buffer.from(buffer)
   * Buffer.from(arrayBuffer[, byteOffset[, length]])
   **/
  
  
  Buffer.from = function (value, encodingOrOffset, length) {
    return from(null, value, encodingOrOffset, length);
  };
  
  if (Buffer.TYPED_ARRAY_SUPPORT) {
    Buffer.prototype.__proto__ = Uint8Array.prototype;
    Buffer.__proto__ = Uint8Array;
  
    if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {
      // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
      Object.defineProperty(Buffer, Symbol.species, {
        value: null,
        configurable: true
      });
    }
  }
  
  function assertSize(size) {
    if (typeof size !== 'number') {
      throw new TypeError('"size" argument must be a number');
    } else if (size < 0) {
      throw new RangeError('"size" argument must not be negative');
    }
  }
  
  function alloc(that, size, fill, encoding) {
    assertSize(size);
  
    if (size <= 0) {
      return createBuffer(that, size);
    }
  
    if (fill !== undefined) {
      // Only pay attention to encoding if it's a string. This
      // prevents accidentally sending in a number that would
      // be interpretted as a start offset.
      return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
    }
  
    return createBuffer(that, size);
  }
  /**
   * Creates a new filled Buffer instance.
   * alloc(size[, fill[, encoding]])
   **/
  
  
  Buffer.alloc = function (size, fill, encoding) {
    return alloc(null, size, fill, encoding);
  };
  
  function allocUnsafe(that, size) {
    assertSize(size);
    that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
  
    if (!Buffer.TYPED_ARRAY_SUPPORT) {
      for (var i = 0; i < size; ++i) {
        that[i] = 0;
      }
    }
  
    return that;
  }
  /**
   * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
   * */
  
  
  Buffer.allocUnsafe = function (size) {
    return allocUnsafe(null, size);
  };
  /**
   * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
   */
  
  
  Buffer.allocUnsafeSlow = function (size) {
    return allocUnsafe(null, size);
  };
  
  function fromString(that, string, encoding) {
    if (typeof encoding !== 'string' || encoding === '') {
      encoding = 'utf8';
    }
  
    if (!Buffer.isEncoding(encoding)) {
      throw new TypeError('"encoding" must be a valid string encoding');
    }
  
    var length = byteLength(string, encoding) | 0;
    that = createBuffer(that, length);
    var actual = that.write(string, encoding);
  
    if (actual !== length) {
      // Writing a hex string, for example, that contains invalid characters will
      // cause everything after the first invalid character to be ignored. (e.g.
      // 'abxxcd' will be treated as 'ab')
      that = that.slice(0, actual);
    }
  
    return that;
  }
  
  function fromArrayLike(that, array) {
    var length = array.length < 0 ? 0 : checked(array.length) | 0;
    that = createBuffer(that, length);
  
    for (var i = 0; i < length; i += 1) {
      that[i] = array[i] & 255;
    }
  
    return that;
  }
  
  function fromArrayBuffer(that, array, byteOffset, length) {
    array.byteLength; // this throws if `array` is not a valid ArrayBuffer
  
    if (byteOffset < 0 || array.byteLength < byteOffset) {
      throw new RangeError('\'offset\' is out of bounds');
    }
  
    if (array.byteLength < byteOffset + (length || 0)) {
      throw new RangeError('\'length\' is out of bounds');
    }
  
    if (byteOffset === undefined && length === undefined) {
      array = new Uint8Array(array);
    } else if (length === undefined) {
      array = new Uint8Array(array, byteOffset);
    } else {
      array = new Uint8Array(array, byteOffset, length);
    }
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      // Return an augmented `Uint8Array` instance, for best performance
      that = array;
      that.__proto__ = Buffer.prototype;
    } else {
      // Fallback: Return an object instance of the Buffer class
      that = fromArrayLike(that, array);
    }
  
    return that;
  }
  
  function fromObject(that, obj) {
    if (Buffer.isBuffer(obj)) {
      var len = checked(obj.length) | 0;
      that = createBuffer(that, len);
  
      if (that.length === 0) {
        return that;
      }
  
      obj.copy(that, 0, 0, len);
      return that;
    }
  
    if (obj) {
      if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
        if (typeof obj.length !== 'number' || isnan(obj.length)) {
          return createBuffer(that, 0);
        }
  
        return fromArrayLike(that, obj);
      }
  
      if (obj.type === 'Buffer' && isArray(obj.data)) {
        return fromArrayLike(that, obj.data);
      }
    }
  
    throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
  }
  
  function checked(length) {
    // Note: cannot use `length < kMaxLength()` here because that fails when
    // length is NaN (which is otherwise coerced to zero.)
    if (length >= kMaxLength()) {
      throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
    }
  
    return length | 0;
  }
  
  function SlowBuffer(length) {
    if (+length != length) {
      // eslint-disable-line eqeqeq
      length = 0;
    }
  
    return Buffer.alloc(+length);
  }
  
  Buffer.isBuffer = function isBuffer(b) {
    return !!(b != null && b._isBuffer);
  };
  
  Buffer.compare = function compare(a, b) {
    if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
      throw new TypeError('Arguments must be Buffers');
    }
  
    if (a === b) return 0;
    var x = a.length;
    var y = b.length;
  
    for (var i = 0, len = Math.min(x, y); i < len; ++i) {
      if (a[i] !== b[i]) {
        x = a[i];
        y = b[i];
        break;
      }
    }
  
    if (x < y) return -1;
    if (y < x) return 1;
    return 0;
  };
  
  Buffer.isEncoding = function isEncoding(encoding) {
    switch (String(encoding).toLowerCase()) {
      case 'hex':
      case 'utf8':
      case 'utf-8':
      case 'ascii':
      case 'latin1':
      case 'binary':
      case 'base64':
      case 'ucs2':
      case 'ucs-2':
      case 'utf16le':
      case 'utf-16le':
        return true;
  
      default:
        return false;
    }
  };
  
  Buffer.concat = function concat(list, length) {
    if (!isArray(list)) {
      throw new TypeError('"list" argument must be an Array of Buffers');
    }
  
    if (list.length === 0) {
      return Buffer.alloc(0);
    }
  
    var i;
  
    if (length === undefined) {
      length = 0;
  
      for (i = 0; i < list.length; ++i) {
        length += list[i].length;
      }
    }
  
    var buffer = Buffer.allocUnsafe(length);
    var pos = 0;
  
    for (i = 0; i < list.length; ++i) {
      var buf = list[i];
  
      if (!Buffer.isBuffer(buf)) {
        throw new TypeError('"list" argument must be an Array of Buffers');
      }
  
      buf.copy(buffer, pos);
      pos += buf.length;
    }
  
    return buffer;
  };
  
  function byteLength(string, encoding) {
    if (Buffer.isBuffer(string)) {
      return string.length;
    }
  
    if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
      return string.byteLength;
    }
  
    if (typeof string !== 'string') {
      string = '' + string;
    }
  
    var len = string.length;
    if (len === 0) return 0; // Use a for loop to avoid recursion
  
    var loweredCase = false;
  
    for (;;) {
      switch (encoding) {
        case 'ascii':
        case 'latin1':
        case 'binary':
          return len;
  
        case 'utf8':
        case 'utf-8':
        case undefined:
          return utf8ToBytes(string).length;
  
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return len * 2;
  
        case 'hex':
          return len >>> 1;
  
        case 'base64':
          return base64ToBytes(string).length;
  
        default:
          if (loweredCase) return utf8ToBytes(string).length; // assume utf8
  
          encoding = ('' + encoding).toLowerCase();
          loweredCase = true;
      }
    }
  }
  
  Buffer.byteLength = byteLength;
  
  function slowToString(encoding, start, end) {
    var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
    // property of a typed array.
    // This behaves neither like String nor Uint8Array in that we set start/end
    // to their upper/lower bounds if the value passed is out of range.
    // undefined is handled specially as per ECMA-262 6th Edition,
    // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  
    if (start === undefined || start < 0) {
      start = 0;
    } // Return early if start > this.length. Done here to prevent potential uint32
    // coercion fail below.
  
  
    if (start > this.length) {
      return '';
    }
  
    if (end === undefined || end > this.length) {
      end = this.length;
    }
  
    if (end <= 0) {
      return '';
    } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  
  
    end >>>= 0;
    start >>>= 0;
  
    if (end <= start) {
      return '';
    }
  
    if (!encoding) encoding = 'utf8';
  
    while (true) {
      switch (encoding) {
        case 'hex':
          return hexSlice(this, start, end);
  
        case 'utf8':
        case 'utf-8':
          return utf8Slice(this, start, end);
  
        case 'ascii':
          return asciiSlice(this, start, end);
  
        case 'latin1':
        case 'binary':
          return latin1Slice(this, start, end);
  
        case 'base64':
          return base64Slice(this, start, end);
  
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return utf16leSlice(this, start, end);
  
        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
          encoding = (encoding + '').toLowerCase();
          loweredCase = true;
      }
    }
  } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
  // Buffer instances.
  
  
  Buffer.prototype._isBuffer = true;
  
  function swap(b, n, m) {
    var i = b[n];
    b[n] = b[m];
    b[m] = i;
  }
  
  Buffer.prototype.swap16 = function swap16() {
    var len = this.length;
  
    if (len % 2 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 16-bits');
    }
  
    for (var i = 0; i < len; i += 2) {
      swap(this, i, i + 1);
    }
  
    return this;
  };
  
  Buffer.prototype.swap32 = function swap32() {
    var len = this.length;
  
    if (len % 4 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 32-bits');
    }
  
    for (var i = 0; i < len; i += 4) {
      swap(this, i, i + 3);
      swap(this, i + 1, i + 2);
    }
  
    return this;
  };
  
  Buffer.prototype.swap64 = function swap64() {
    var len = this.length;
  
    if (len % 8 !== 0) {
      throw new RangeError('Buffer size must be a multiple of 64-bits');
    }
  
    for (var i = 0; i < len; i += 8) {
      swap(this, i, i + 7);
      swap(this, i + 1, i + 6);
      swap(this, i + 2, i + 5);
      swap(this, i + 3, i + 4);
    }
  
    return this;
  };
  
  Buffer.prototype.toString = function toString() {
    var length = this.length | 0;
    if (length === 0) return '';
    if (arguments.length === 0) return utf8Slice(this, 0, length);
    return slowToString.apply(this, arguments);
  };
  
  Buffer.prototype.equals = function equals(b) {
    if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
    if (this === b) return true;
    return Buffer.compare(this, b) === 0;
  };
  
  Buffer.prototype.inspect = function inspect() {
    var str = '';
    var max = exports.INSPECT_MAX_BYTES;
  
    if (this.length > 0) {
      str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
      if (this.length > max) str += ' ... ';
    }
  
    return '<Buffer ' + str + '>';
  };
  
  Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
    if (!Buffer.isBuffer(target)) {
      throw new TypeError('Argument must be a Buffer');
    }
  
    if (start === undefined) {
      start = 0;
    }
  
    if (end === undefined) {
      end = target ? target.length : 0;
    }
  
    if (thisStart === undefined) {
      thisStart = 0;
    }
  
    if (thisEnd === undefined) {
      thisEnd = this.length;
    }
  
    if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
      throw new RangeError('out of range index');
    }
  
    if (thisStart >= thisEnd && start >= end) {
      return 0;
    }
  
    if (thisStart >= thisEnd) {
      return -1;
    }
  
    if (start >= end) {
      return 1;
    }
  
    start >>>= 0;
    end >>>= 0;
    thisStart >>>= 0;
    thisEnd >>>= 0;
    if (this === target) return 0;
    var x = thisEnd - thisStart;
    var y = end - start;
    var len = Math.min(x, y);
    var thisCopy = this.slice(thisStart, thisEnd);
    var targetCopy = target.slice(start, end);
  
    for (var i = 0; i < len; ++i) {
      if (thisCopy[i] !== targetCopy[i]) {
        x = thisCopy[i];
        y = targetCopy[i];
        break;
      }
    }
  
    if (x < y) return -1;
    if (y < x) return 1;
    return 0;
  }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
  // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
  //
  // Arguments:
  // - buffer - a Buffer to search
  // - val - a string, Buffer, or number
  // - byteOffset - an index into `buffer`; will be clamped to an int32
  // - encoding - an optional encoding, relevant is val is a string
  // - dir - true for indexOf, false for lastIndexOf
  
  
  function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
    // Empty buffer means no match
    if (buffer.length === 0) return -1; // Normalize byteOffset
  
    if (typeof byteOffset === 'string') {
      encoding = byteOffset;
      byteOffset = 0;
    } else if (byteOffset > 0x7fffffff) {
      byteOffset = 0x7fffffff;
    } else if (byteOffset < -0x80000000) {
      byteOffset = -0x80000000;
    }
  
    byteOffset = +byteOffset; // Coerce to Number.
  
    if (isNaN(byteOffset)) {
      // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
      byteOffset = dir ? 0 : buffer.length - 1;
    } // Normalize byteOffset: negative offsets start from the end of the buffer
  
  
    if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
  
    if (byteOffset >= buffer.length) {
      if (dir) return -1;else byteOffset = buffer.length - 1;
    } else if (byteOffset < 0) {
      if (dir) byteOffset = 0;else return -1;
    } // Normalize val
  
  
    if (typeof val === 'string') {
      val = Buffer.from(val, encoding);
    } // Finally, search either indexOf (if dir is true) or lastIndexOf
  
  
    if (Buffer.isBuffer(val)) {
      // Special case: looking for empty string/buffer always fails
      if (val.length === 0) {
        return -1;
      }
  
      return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
    } else if (typeof val === 'number') {
      val = val & 0xFF; // Search for a byte value [0-255]
  
      if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
        if (dir) {
          return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
        } else {
          return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
        }
      }
  
      return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
    }
  
    throw new TypeError('val must be string, number or Buffer');
  }
  
  function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
    var indexSize = 1;
    var arrLength = arr.length;
    var valLength = val.length;
  
    if (encoding !== undefined) {
      encoding = String(encoding).toLowerCase();
  
      if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
        if (arr.length < 2 || val.length < 2) {
          return -1;
        }
  
        indexSize = 2;
        arrLength /= 2;
        valLength /= 2;
        byteOffset /= 2;
      }
    }
  
    function read(buf, i) {
      if (indexSize === 1) {
        return buf[i];
      } else {
        return buf.readUInt16BE(i * indexSize);
      }
    }
  
    var i;
  
    if (dir) {
      var foundIndex = -1;
  
      for (i = byteOffset; i < arrLength; i++) {
        if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
          if (foundIndex === -1) foundIndex = i;
          if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
        } else {
          if (foundIndex !== -1) i -= i - foundIndex;
          foundIndex = -1;
        }
      }
    } else {
      if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
  
      for (i = byteOffset; i >= 0; i--) {
        var found = true;
  
        for (var j = 0; j < valLength; j++) {
          if (read(arr, i + j) !== read(val, j)) {
            found = false;
            break;
          }
        }
  
        if (found) return i;
      }
    }
  
    return -1;
  }
  
  Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
    return this.indexOf(val, byteOffset, encoding) !== -1;
  };
  
  Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
  };
  
  Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
    return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
  };
  
  function hexWrite(buf, string, offset, length) {
    offset = Number(offset) || 0;
    var remaining = buf.length - offset;
  
    if (!length) {
      length = remaining;
    } else {
      length = Number(length);
  
      if (length > remaining) {
        length = remaining;
      }
    } // must be an even number of digits
  
  
    var strLen = string.length;
    if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
  
    if (length > strLen / 2) {
      length = strLen / 2;
    }
  
    for (var i = 0; i < length; ++i) {
      var parsed = parseInt(string.substr(i * 2, 2), 16);
      if (isNaN(parsed)) return i;
      buf[offset + i] = parsed;
    }
  
    return i;
  }
  
  function utf8Write(buf, string, offset, length) {
    return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
  }
  
  function asciiWrite(buf, string, offset, length) {
    return blitBuffer(asciiToBytes(string), buf, offset, length);
  }
  
  function latin1Write(buf, string, offset, length) {
    return asciiWrite(buf, string, offset, length);
  }
  
  function base64Write(buf, string, offset, length) {
    return blitBuffer(base64ToBytes(string), buf, offset, length);
  }
  
  function ucs2Write(buf, string, offset, length) {
    return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
  }
  
  Buffer.prototype.write = function write(string, offset, length, encoding) {
    // Buffer#write(string)
    if (offset === undefined) {
      encoding = 'utf8';
      length = this.length;
      offset = 0; // Buffer#write(string, encoding)
    } else if (length === undefined && typeof offset === 'string') {
      encoding = offset;
      length = this.length;
      offset = 0; // Buffer#write(string, offset[, length][, encoding])
    } else if (isFinite(offset)) {
      offset = offset | 0;
  
      if (isFinite(length)) {
        length = length | 0;
        if (encoding === undefined) encoding = 'utf8';
      } else {
        encoding = length;
        length = undefined;
      } // legacy write(string, encoding, offset, length) - remove in v0.13
  
    } else {
      throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
    }
  
    var remaining = this.length - offset;
    if (length === undefined || length > remaining) length = remaining;
  
    if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
      throw new RangeError('Attempt to write outside buffer bounds');
    }
  
    if (!encoding) encoding = 'utf8';
    var loweredCase = false;
  
    for (;;) {
      switch (encoding) {
        case 'hex':
          return hexWrite(this, string, offset, length);
  
        case 'utf8':
        case 'utf-8':
          return utf8Write(this, string, offset, length);
  
        case 'ascii':
          return asciiWrite(this, string, offset, length);
  
        case 'latin1':
        case 'binary':
          return latin1Write(this, string, offset, length);
  
        case 'base64':
          // Warning: maxLength not taken into account in base64Write
          return base64Write(this, string, offset, length);
  
        case 'ucs2':
        case 'ucs-2':
        case 'utf16le':
        case 'utf-16le':
          return ucs2Write(this, string, offset, length);
  
        default:
          if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
          encoding = ('' + encoding).toLowerCase();
          loweredCase = true;
      }
    }
  };
  
  Buffer.prototype.toJSON = function toJSON() {
    return {
      type: 'Buffer',
      data: Array.prototype.slice.call(this._arr || this, 0)
    };
  };
  
  function base64Slice(buf, start, end) {
    if (start === 0 && end === buf.length) {
      return base64.fromByteArray(buf);
    } else {
      return base64.fromByteArray(buf.slice(start, end));
    }
  }
  
  function utf8Slice(buf, start, end) {
    end = Math.min(buf.length, end);
    var res = [];
    var i = start;
  
    while (i < end) {
      var firstByte = buf[i];
      var codePoint = null;
      var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
  
      if (i + bytesPerSequence <= end) {
        var secondByte, thirdByte, fourthByte, tempCodePoint;
  
        switch (bytesPerSequence) {
          case 1:
            if (firstByte < 0x80) {
              codePoint = firstByte;
            }
  
            break;
  
          case 2:
            secondByte = buf[i + 1];
  
            if ((secondByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
  
              if (tempCodePoint > 0x7F) {
                codePoint = tempCodePoint;
              }
            }
  
            break;
  
          case 3:
            secondByte = buf[i + 1];
            thirdByte = buf[i + 2];
  
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
  
              if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
                codePoint = tempCodePoint;
              }
            }
  
            break;
  
          case 4:
            secondByte = buf[i + 1];
            thirdByte = buf[i + 2];
            fourthByte = buf[i + 3];
  
            if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
              tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
  
              if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
                codePoint = tempCodePoint;
              }
            }
  
        }
      }
  
      if (codePoint === null) {
        // we did not generate a valid codePoint so insert a
        // replacement char (U+FFFD) and advance only 1 byte
        codePoint = 0xFFFD;
        bytesPerSequence = 1;
      } else if (codePoint > 0xFFFF) {
        // encode to utf16 (surrogate pair dance)
        codePoint -= 0x10000;
        res.push(codePoint >>> 10 & 0x3FF | 0xD800);
        codePoint = 0xDC00 | codePoint & 0x3FF;
      }
  
      res.push(codePoint);
      i += bytesPerSequence;
    }
  
    return decodeCodePointsArray(res);
  } // Based on http://stackoverflow.com/a/22747272/680742, the browser with
  // the lowest limit is Chrome, with 0x10000 args.
  // We go 1 magnitude less, for safety
  
  
  var MAX_ARGUMENTS_LENGTH = 0x1000;
  
  function decodeCodePointsArray(codePoints) {
    var len = codePoints.length;
  
    if (len <= MAX_ARGUMENTS_LENGTH) {
      return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
    } // Decode in chunks to avoid "call stack size exceeded".
  
  
    var res = '';
    var i = 0;
  
    while (i < len) {
      res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
    }
  
    return res;
  }
  
  function asciiSlice(buf, start, end) {
    var ret = '';
    end = Math.min(buf.length, end);
  
    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i] & 0x7F);
    }
  
    return ret;
  }
  
  function latin1Slice(buf, start, end) {
    var ret = '';
    end = Math.min(buf.length, end);
  
    for (var i = start; i < end; ++i) {
      ret += String.fromCharCode(buf[i]);
    }
  
    return ret;
  }
  
  function hexSlice(buf, start, end) {
    var len = buf.length;
    if (!start || start < 0) start = 0;
    if (!end || end < 0 || end > len) end = len;
    var out = '';
  
    for (var i = start; i < end; ++i) {
      out += toHex(buf[i]);
    }
  
    return out;
  }
  
  function utf16leSlice(buf, start, end) {
    var bytes = buf.slice(start, end);
    var res = '';
  
    for (var i = 0; i < bytes.length; i += 2) {
      res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
    }
  
    return res;
  }
  
  Buffer.prototype.slice = function slice(start, end) {
    var len = this.length;
    start = ~~start;
    end = end === undefined ? len : ~~end;
  
    if (start < 0) {
      start += len;
      if (start < 0) start = 0;
    } else if (start > len) {
      start = len;
    }
  
    if (end < 0) {
      end += len;
      if (end < 0) end = 0;
    } else if (end > len) {
      end = len;
    }
  
    if (end < start) end = start;
    var newBuf;
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      newBuf = this.subarray(start, end);
      newBuf.__proto__ = Buffer.prototype;
    } else {
      var sliceLen = end - start;
      newBuf = new Buffer(sliceLen, undefined);
  
      for (var i = 0; i < sliceLen; ++i) {
        newBuf[i] = this[i + start];
      }
    }
  
    return newBuf;
  };
  /*
   * Need to make sure that buffer isn't trying to write out of bounds.
   */
  
  
  function checkOffset(offset, ext, length) {
    if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
    if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
  }
  
  Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);
    var val = this[offset];
    var mul = 1;
    var i = 0;
  
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul;
    }
  
    return val;
  };
  
  Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
  
    if (!noAssert) {
      checkOffset(offset, byteLength, this.length);
    }
  
    var val = this[offset + --byteLength];
    var mul = 1;
  
    while (byteLength > 0 && (mul *= 0x100)) {
      val += this[offset + --byteLength] * mul;
    }
  
    return val;
  };
  
  Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length);
    return this[offset];
  };
  
  Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    return this[offset] | this[offset + 1] << 8;
  };
  
  Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    return this[offset] << 8 | this[offset + 1];
  };
  
  Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
  };
  
  Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
  };
  
  Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);
    var val = this[offset];
    var mul = 1;
    var i = 0;
  
    while (++i < byteLength && (mul *= 0x100)) {
      val += this[offset + i] * mul;
    }
  
    mul *= 0x80;
    if (val >= mul) val -= Math.pow(2, 8 * byteLength);
    return val;
  };
  
  Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
    offset = offset | 0;
    byteLength = byteLength | 0;
    if (!noAssert) checkOffset(offset, byteLength, this.length);
    var i = byteLength;
    var mul = 1;
    var val = this[offset + --i];
  
    while (i > 0 && (mul *= 0x100)) {
      val += this[offset + --i] * mul;
    }
  
    mul *= 0x80;
    if (val >= mul) val -= Math.pow(2, 8 * byteLength);
    return val;
  };
  
  Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 1, this.length);
    if (!(this[offset] & 0x80)) return this[offset];
    return (0xff - this[offset] + 1) * -1;
  };
  
  Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    var val = this[offset] | this[offset + 1] << 8;
    return val & 0x8000 ? val | 0xFFFF0000 : val;
  };
  
  Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 2, this.length);
    var val = this[offset + 1] | this[offset] << 8;
    return val & 0x8000 ? val | 0xFFFF0000 : val;
  };
  
  Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
  };
  
  Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
  };
  
  Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return ieee754.read(this, offset, true, 23, 4);
  };
  
  Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 4, this.length);
    return ieee754.read(this, offset, false, 23, 4);
  };
  
  Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length);
    return ieee754.read(this, offset, true, 52, 8);
  };
  
  Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
    if (!noAssert) checkOffset(offset, 8, this.length);
    return ieee754.read(this, offset, false, 52, 8);
  };
  
  function checkInt(buf, value, offset, ext, max, min) {
    if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
    if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
    if (offset + ext > buf.length) throw new RangeError('Index out of range');
  }
  
  Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    byteLength = byteLength | 0;
  
    if (!noAssert) {
      var maxBytes = Math.pow(2, 8 * byteLength) - 1;
      checkInt(this, value, offset, byteLength, maxBytes, 0);
    }
  
    var mul = 1;
    var i = 0;
    this[offset] = value & 0xFF;
  
    while (++i < byteLength && (mul *= 0x100)) {
      this[offset + i] = value / mul & 0xFF;
    }
  
    return offset + byteLength;
  };
  
  Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
    byteLength = byteLength | 0;
  
    if (!noAssert) {
      var maxBytes = Math.pow(2, 8 * byteLength) - 1;
      checkInt(this, value, offset, byteLength, maxBytes, 0);
    }
  
    var i = byteLength - 1;
    var mul = 1;
    this[offset + i] = value & 0xFF;
  
    while (--i >= 0 && (mul *= 0x100)) {
      this[offset + i] = value / mul & 0xFF;
    }
  
    return offset + byteLength;
  };
  
  Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
    if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
    this[offset] = value & 0xff;
    return offset + 1;
  };
  
  function objectWriteUInt16(buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffff + value + 1;
  
    for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
      buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
    }
  }
  
  Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value & 0xff;
      this[offset + 1] = value >>> 8;
    } else {
      objectWriteUInt16(this, value, offset, true);
    }
  
    return offset + 2;
  };
  
  Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value >>> 8;
      this[offset + 1] = value & 0xff;
    } else {
      objectWriteUInt16(this, value, offset, false);
    }
  
    return offset + 2;
  };
  
  function objectWriteUInt32(buf, value, offset, littleEndian) {
    if (value < 0) value = 0xffffffff + value + 1;
  
    for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
      buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
    }
  }
  
  Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset + 3] = value >>> 24;
      this[offset + 2] = value >>> 16;
      this[offset + 1] = value >>> 8;
      this[offset] = value & 0xff;
    } else {
      objectWriteUInt32(this, value, offset, true);
    }
  
    return offset + 4;
  };
  
  Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value >>> 24;
      this[offset + 1] = value >>> 16;
      this[offset + 2] = value >>> 8;
      this[offset + 3] = value & 0xff;
    } else {
      objectWriteUInt32(this, value, offset, false);
    }
  
    return offset + 4;
  };
  
  Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
  
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1);
      checkInt(this, value, offset, byteLength, limit - 1, -limit);
    }
  
    var i = 0;
    var mul = 1;
    var sub = 0;
    this[offset] = value & 0xFF;
  
    while (++i < byteLength && (mul *= 0x100)) {
      if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
        sub = 1;
      }
  
      this[offset + i] = (value / mul >> 0) - sub & 0xFF;
    }
  
    return offset + byteLength;
  };
  
  Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
    value = +value;
    offset = offset | 0;
  
    if (!noAssert) {
      var limit = Math.pow(2, 8 * byteLength - 1);
      checkInt(this, value, offset, byteLength, limit - 1, -limit);
    }
  
    var i = byteLength - 1;
    var mul = 1;
    var sub = 0;
    this[offset + i] = value & 0xFF;
  
    while (--i >= 0 && (mul *= 0x100)) {
      if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
        sub = 1;
      }
  
      this[offset + i] = (value / mul >> 0) - sub & 0xFF;
    }
  
    return offset + byteLength;
  };
  
  Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
    if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
    if (value < 0) value = 0xff + value + 1;
    this[offset] = value & 0xff;
    return offset + 1;
  };
  
  Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value & 0xff;
      this[offset + 1] = value >>> 8;
    } else {
      objectWriteUInt16(this, value, offset, true);
    }
  
    return offset + 2;
  };
  
  Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value >>> 8;
      this[offset + 1] = value & 0xff;
    } else {
      objectWriteUInt16(this, value, offset, false);
    }
  
    return offset + 2;
  };
  
  Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value & 0xff;
      this[offset + 1] = value >>> 8;
      this[offset + 2] = value >>> 16;
      this[offset + 3] = value >>> 24;
    } else {
      objectWriteUInt32(this, value, offset, true);
    }
  
    return offset + 4;
  };
  
  Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
    value = +value;
    offset = offset | 0;
    if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
    if (value < 0) value = 0xffffffff + value + 1;
  
    if (Buffer.TYPED_ARRAY_SUPPORT) {
      this[offset] = value >>> 24;
      this[offset + 1] = value >>> 16;
      this[offset + 2] = value >>> 8;
      this[offset + 3] = value & 0xff;
    } else {
      objectWriteUInt32(this, value, offset, false);
    }
  
    return offset + 4;
  };
  
  function checkIEEE754(buf, value, offset, ext, max, min) {
    if (offset + ext > buf.length) throw new RangeError('Index out of range');
    if (offset < 0) throw new RangeError('Index out of range');
  }
  
  function writeFloat(buf, value, offset, littleEndian, noAssert) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
    }
  
    ieee754.write(buf, value, offset, littleEndian, 23, 4);
    return offset + 4;
  }
  
  Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
    return writeFloat(this, value, offset, true, noAssert);
  };
  
  Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
    return writeFloat(this, value, offset, false, noAssert);
  };
  
  function writeDouble(buf, value, offset, littleEndian, noAssert) {
    if (!noAssert) {
      checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
    }
  
    ieee754.write(buf, value, offset, littleEndian, 52, 8);
    return offset + 8;
  }
  
  Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
    return writeDouble(this, value, offset, true, noAssert);
  };
  
  Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
    return writeDouble(this, value, offset, false, noAssert);
  }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  
  
  Buffer.prototype.copy = function copy(target, targetStart, start, end) {
    if (!start) start = 0;
    if (!end && end !== 0) end = this.length;
    if (targetStart >= target.length) targetStart = target.length;
    if (!targetStart) targetStart = 0;
    if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done
  
    if (end === start) return 0;
    if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions
  
    if (targetStart < 0) {
      throw new RangeError('targetStart out of bounds');
    }
  
    if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
    if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?
  
    if (end > this.length) end = this.length;
  
    if (target.length - targetStart < end - start) {
      end = target.length - targetStart + start;
    }
  
    var len = end - start;
    var i;
  
    if (this === target && start < targetStart && targetStart < end) {
      // descending copy from end
      for (i = len - 1; i >= 0; --i) {
        target[i + targetStart] = this[i + start];
      }
    } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
      // ascending copy from start
      for (i = 0; i < len; ++i) {
        target[i + targetStart] = this[i + start];
      }
    } else {
      Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
    }
  
    return len;
  }; // Usage:
  //    buffer.fill(number[, offset[, end]])
  //    buffer.fill(buffer[, offset[, end]])
  //    buffer.fill(string[, offset[, end]][, encoding])
  
  
  Buffer.prototype.fill = function fill(val, start, end, encoding) {
    // Handle string cases:
    if (typeof val === 'string') {
      if (typeof start === 'string') {
        encoding = start;
        start = 0;
        end = this.length;
      } else if (typeof end === 'string') {
        encoding = end;
        end = this.length;
      }
  
      if (val.length === 1) {
        var code = val.charCodeAt(0);
  
        if (code < 256) {
          val = code;
        }
      }
  
      if (encoding !== undefined && typeof encoding !== 'string') {
        throw new TypeError('encoding must be a string');
      }
  
      if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
        throw new TypeError('Unknown encoding: ' + encoding);
      }
    } else if (typeof val === 'number') {
      val = val & 255;
    } // Invalid ranges are not set to a default, so can range check early.
  
  
    if (start < 0 || this.length < start || this.length < end) {
      throw new RangeError('Out of range index');
    }
  
    if (end <= start) {
      return this;
    }
  
    start = start >>> 0;
    end = end === undefined ? this.length : end >>> 0;
    if (!val) val = 0;
    var i;
  
    if (typeof val === 'number') {
      for (i = start; i < end; ++i) {
        this[i] = val;
      }
    } else {
      var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
      var len = bytes.length;
  
      for (i = 0; i < end - start; ++i) {
        this[i + start] = bytes[i % len];
      }
    }
  
    return this;
  }; // HELPER FUNCTIONS
  // ================
  
  
  var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
  
  function base64clean(str) {
    // Node strips out invalid characters like \n and \t from the string, base64-js does not
    str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''
  
    if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  
    while (str.length % 4 !== 0) {
      str = str + '=';
    }
  
    return str;
  }
  
  function stringtrim(str) {
    if (str.trim) return str.trim();
    return str.replace(/^\s+|\s+$/g, '');
  }
  
  function toHex(n) {
    if (n < 16) return '0' + n.toString(16);
    return n.toString(16);
  }
  
  function utf8ToBytes(string, units) {
    units = units || Infinity;
    var codePoint;
    var length = string.length;
    var leadSurrogate = null;
    var bytes = [];
  
    for (var i = 0; i < length; ++i) {
      codePoint = string.charCodeAt(i); // is surrogate component
  
      if (codePoint > 0xD7FF && codePoint < 0xE000) {
        // last char was a lead
        if (!leadSurrogate) {
          // no lead yet
          if (codePoint > 0xDBFF) {
            // unexpected trail
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
            continue;
          } else if (i + 1 === length) {
            // unpaired lead
            if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
            continue;
          } // valid lead
  
  
          leadSurrogate = codePoint;
          continue;
        } // 2 leads in a row
  
  
        if (codePoint < 0xDC00) {
          if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
          leadSurrogate = codePoint;
          continue;
        } // valid surrogate pair
  
  
        codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
      } else if (leadSurrogate) {
        // valid bmp char, but last char was a lead
        if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
      }
  
      leadSurrogate = null; // encode utf8
  
      if (codePoint < 0x80) {
        if ((units -= 1) < 0) break;
        bytes.push(codePoint);
      } else if (codePoint < 0x800) {
        if ((units -= 2) < 0) break;
        bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
      } else if (codePoint < 0x10000) {
        if ((units -= 3) < 0) break;
        bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
      } else if (codePoint < 0x110000) {
        if ((units -= 4) < 0) break;
        bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
      } else {
        throw new Error('Invalid code point');
      }
    }
  
    return bytes;
  }
  
  function asciiToBytes(str) {
    var byteArray = [];
  
    for (var i = 0; i < str.length; ++i) {
      // Node's code seems to be doing this and not & 0x7F..
      byteArray.push(str.charCodeAt(i) & 0xFF);
    }
  
    return byteArray;
  }
  
  function utf16leToBytes(str, units) {
    var c, hi, lo;
    var byteArray = [];
  
    for (var i = 0; i < str.length; ++i) {
      if ((units -= 2) < 0) break;
      c = str.charCodeAt(i);
      hi = c >> 8;
      lo = c % 256;
      byteArray.push(lo);
      byteArray.push(hi);
    }
  
    return byteArray;
  }
  
  function base64ToBytes(str) {
    return base64.toByteArray(base64clean(str));
  }
  
  function blitBuffer(src, dst, offset, length) {
    for (var i = 0; i < length; ++i) {
      if (i + offset >= dst.length || i >= src.length) break;
      dst[i + offset] = src[i];
    }
  
    return i;
  }
  
  function isnan(val) {
    return val !== val; // eslint-disable-line no-self-compare
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
  
  /***/ }),
  /* 10 */
  /***/ (function(module, exports, __webpack_require__) {
  
  // browser shim for xmlhttprequest module
  var hasCORS = __webpack_require__(42);
  
  module.exports = function (opts) {
    var xdomain = opts.xdomain; // scheme must be same when usign XDomainRequest
    // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx
  
    var xscheme = opts.xscheme; // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.
    // https://github.com/Automattic/engine.io-client/pull/217
  
    var enablesXDR = opts.enablesXDR; // XMLHttpRequest can be disabled on IE
  
    try {
      if ('undefined' !== typeof XMLHttpRequest && (!xdomain || hasCORS)) {
        return new XMLHttpRequest();
      }
    } catch (e) {} // Use XDomainRequest for IE8 if enablesXDR is true
    // because loading bar keeps flashing when using jsonp-polling
    // https://github.com/yujiosaka/socke.io-ie8-loading-example
  
  
    try {
      if ('undefined' !== typeof XDomainRequest && !xscheme && enablesXDR) {
        return new XDomainRequest();
      }
    } catch (e) {}
  
    if (!xdomain) {
      try {
        return new self[['Active'].concat('Object').join('X')]('Microsoft.XMLHTTP');
      } catch (e) {}
    }
  };
  
  /***/ }),
  /* 11 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies.
   */
  var parser = __webpack_require__(2);
  
  var Emitter = __webpack_require__(0);
  /**
   * Module exports.
   */
  
  
  module.exports = Transport;
  /**
   * Transport abstract constructor.
   *
   * @param {Object} options.
   * @api private
   */
  
  function Transport(opts) {
    this.path = opts.path;
    this.hostname = opts.hostname;
    this.port = opts.port;
    this.secure = opts.secure;
    this.query = opts.query;
    this.timestampParam = opts.timestampParam;
    this.timestampRequests = opts.timestampRequests;
    this.readyState = '';
    this.agent = opts.agent || false;
    this.socket = opts.socket;
    this.enablesXDR = opts.enablesXDR;
    this.withCredentials = opts.withCredentials; // SSL options for Node.js client
  
    this.pfx = opts.pfx;
    this.key = opts.key;
    this.passphrase = opts.passphrase;
    this.cert = opts.cert;
    this.ca = opts.ca;
    this.ciphers = opts.ciphers;
    this.rejectUnauthorized = opts.rejectUnauthorized;
    this.forceNode = opts.forceNode; // results of ReactNative environment detection
  
    this.isReactNative = opts.isReactNative; // other options for Node.js client
  
    this.extraHeaders = opts.extraHeaders;
    this.localAddress = opts.localAddress;
  }
  /**
   * Mix in `Emitter`.
   */
  
  
  Emitter(Transport.prototype);
  /**
   * Emits an error.
   *
   * @param {String} str
   * @return {Transport} for chaining
   * @api public
   */
  
  Transport.prototype.onError = function (msg, desc) {
    var err = new Error(msg);
    err.type = 'TransportError';
    err.description = desc;
    this.emit('error', err);
    return this;
  };
  /**
   * Opens the transport.
   *
   * @api public
   */
  
  
  Transport.prototype.open = function () {
    if ('closed' === this.readyState || '' === this.readyState) {
      this.readyState = 'opening';
      this.doOpen();
    }
  
    return this;
  };
  /**
   * Closes the transport.
   *
   * @api private
   */
  
  
  Transport.prototype.close = function () {
    if ('opening' === this.readyState || 'open' === this.readyState) {
      this.doClose();
      this.onClose();
    }
  
    return this;
  };
  /**
   * Sends multiple packets.
   *
   * @param {Array} packets
   * @api private
   */
  
  
  Transport.prototype.send = function (packets) {
    if ('open' === this.readyState) {
      this.write(packets);
    } else {
      throw new Error('Transport not open');
    }
  };
  /**
   * Called upon open
   *
   * @api private
   */
  
  
  Transport.prototype.onOpen = function () {
    this.readyState = 'open';
    this.writable = true;
    this.emit('open');
  };
  /**
   * Called with data.
   *
   * @param {String} data
   * @api private
   */
  
  
  Transport.prototype.onData = function (data) {
    var packet = parser.decodePacket(data, this.socket.binaryType);
    this.onPacket(packet);
  };
  /**
   * Called with a decoded packet.
   */
  
  
  Transport.prototype.onPacket = function (packet) {
    this.emit('packet', packet);
  };
  /**
   * Called upon close.
   *
   * @api private
   */
  
  
  Transport.prototype.onClose = function () {
    this.readyState = 'closed';
    this.emit('close');
  };
  
  /***/ }),
  /* 12 */
  /***/ (function(module, exports) {
  
  /**
   * Parses an URI
   *
   * @author Steven Levithan <stevenlevithan.com> (MIT license)
   * @api private
   */
  var re = /^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
  var parts = ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'];
  
  module.exports = function parseuri(str) {
    var src = str,
        b = str.indexOf('['),
        e = str.indexOf(']');
  
    if (b != -1 && e != -1) {
      str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);
    }
  
    var m = re.exec(str || ''),
        uri = {},
        i = 14;
  
    while (i--) {
      uri[parts[i]] = m[i] || '';
    }
  
    if (b != -1 && e != -1) {
      uri.source = src;
      uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');
      uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');
      uri.ipv6uri = true;
    }
  
    return uri;
  };
  
  /***/ }),
  /* 13 */
  /***/ (function(module, exports) {
  
  var toString = {}.toString;
  
  module.exports = Array.isArray || function (arr) {
    return toString.call(arr) == '[object Array]';
  };
  
  /***/ }),
  /* 14 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {module.exports = isBuf;
  var withNativeBuffer = typeof Buffer === 'function' && typeof Buffer.isBuffer === 'function';
  var withNativeArrayBuffer = typeof ArrayBuffer === 'function';
  
  var isView = function isView(obj) {
    return typeof ArrayBuffer.isView === 'function' ? ArrayBuffer.isView(obj) : obj.buffer instanceof ArrayBuffer;
  };
  /**
   * Returns true if obj is a buffer or an arraybuffer.
   *
   * @api private
   */
  
  
  function isBuf(obj) {
    return withNativeBuffer && Buffer.isBuffer(obj) || withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj));
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9).Buffer))
  
  /***/ }),
  /* 15 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Module dependencies.
   */
  var eio = __webpack_require__(40);
  
  var Socket = __webpack_require__(21);
  
  var Emitter = __webpack_require__(0);
  
  var parser = __webpack_require__(8);
  
  var on = __webpack_require__(22);
  
  var bind = __webpack_require__(23);
  
  var debug = __webpack_require__(3)('socket.io-client:manager');
  
  var indexOf = __webpack_require__(20);
  
  var Backoff = __webpack_require__(57);
  /**
   * IE6+ hasOwnProperty
   */
  
  
  var has = Object.prototype.hasOwnProperty;
  /**
   * Module exports
   */
  
  module.exports = Manager;
  /**
   * `Manager` constructor.
   *
   * @param {String} engine instance or engine uri/opts
   * @param {Object} options
   * @api public
   */
  
  function Manager(uri, opts) {
    if (!(this instanceof Manager)) return new Manager(uri, opts);
  
    if (uri && 'object' === _typeof(uri)) {
      opts = uri;
      uri = undefined;
    }
  
    opts = opts || {};
    opts.path = opts.path || '/socket.io';
    this.nsps = {};
    this.subs = [];
    this.opts = opts;
    this.reconnection(opts.reconnection !== false);
    this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
    this.reconnectionDelay(opts.reconnectionDelay || 1000);
    this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);
    this.randomizationFactor(opts.randomizationFactor || 0.5);
    this.backoff = new Backoff({
      min: this.reconnectionDelay(),
      max: this.reconnectionDelayMax(),
      jitter: this.randomizationFactor()
    });
    this.timeout(null == opts.timeout ? 20000 : opts.timeout);
    this.readyState = 'closed';
    this.uri = uri;
    this.connecting = [];
    this.lastPing = null;
    this.encoding = false;
    this.packetBuffer = [];
  
    var _parser = opts.parser || parser;
  
    this.encoder = new _parser.Encoder();
    this.decoder = new _parser.Decoder();
    this.autoConnect = opts.autoConnect !== false;
    if (this.autoConnect) this.open();
  }
  /**
   * Propagate given event to sockets and emit on `this`
   *
   * @api private
   */
  
  
  Manager.prototype.emitAll = function () {
    this.emit.apply(this, arguments);
  
    for (var nsp in this.nsps) {
      if (has.call(this.nsps, nsp)) {
        this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);
      }
    }
  };
  /**
   * Update `socket.id` of all sockets
   *
   * @api private
   */
  
  
  Manager.prototype.updateSocketIds = function () {
    for (var nsp in this.nsps) {
      if (has.call(this.nsps, nsp)) {
        this.nsps[nsp].id = this.generateId(nsp);
      }
    }
  };
  /**
   * generate `socket.id` for the given `nsp`
   *
   * @param {String} nsp
   * @return {String}
   * @api private
   */
  
  
  Manager.prototype.generateId = function (nsp) {
    return (nsp === '/' ? '' : nsp + '#') + this.engine.id;
  };
  /**
   * Mix in `Emitter`.
   */
  
  
  Emitter(Manager.prototype);
  /**
   * Sets the `reconnection` config.
   *
   * @param {Boolean} true/false if it should automatically reconnect
   * @return {Manager} self or value
   * @api public
   */
  
  Manager.prototype.reconnection = function (v) {
    if (!arguments.length) return this._reconnection;
    this._reconnection = !!v;
    return this;
  };
  /**
   * Sets the reconnection attempts config.
   *
   * @param {Number} max reconnection attempts before giving up
   * @return {Manager} self or value
   * @api public
   */
  
  
  Manager.prototype.reconnectionAttempts = function (v) {
    if (!arguments.length) return this._reconnectionAttempts;
    this._reconnectionAttempts = v;
    return this;
  };
  /**
   * Sets the delay between reconnections.
   *
   * @param {Number} delay
   * @return {Manager} self or value
   * @api public
   */
  
  
  Manager.prototype.reconnectionDelay = function (v) {
    if (!arguments.length) return this._reconnectionDelay;
    this._reconnectionDelay = v;
    this.backoff && this.backoff.setMin(v);
    return this;
  };
  
  Manager.prototype.randomizationFactor = function (v) {
    if (!arguments.length) return this._randomizationFactor;
    this._randomizationFactor = v;
    this.backoff && this.backoff.setJitter(v);
    return this;
  };
  /**
   * Sets the maximum delay between reconnections.
   *
   * @param {Number} delay
   * @return {Manager} self or value
   * @api public
   */
  
  
  Manager.prototype.reconnectionDelayMax = function (v) {
    if (!arguments.length) return this._reconnectionDelayMax;
    this._reconnectionDelayMax = v;
    this.backoff && this.backoff.setMax(v);
    return this;
  };
  /**
   * Sets the connection timeout. `false` to disable
   *
   * @return {Manager} self or value
   * @api public
   */
  
  
  Manager.prototype.timeout = function (v) {
    if (!arguments.length) return this._timeout;
    this._timeout = v;
    return this;
  };
  /**
   * Starts trying to reconnect if reconnection is enabled and we have not
   * started reconnecting yet
   *
   * @api private
   */
  
  
  Manager.prototype.maybeReconnectOnOpen = function () {
    // Only try to reconnect if it's the first time we're connecting
    if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {
      // keeps reconnection from firing twice for the same reconnection loop
      this.reconnect();
    }
  };
  /**
   * Sets the current transport `socket`.
   *
   * @param {Function} optional, callback
   * @return {Manager} self
   * @api public
   */
  
  
  Manager.prototype.open = Manager.prototype.connect = function (fn, opts) {
    debug('readyState %s', this.readyState);
    if (~this.readyState.indexOf('open')) return this;
    debug('opening %s', this.uri);
    this.engine = eio(this.uri, this.opts);
    var socket = this.engine;
    var self = this;
    this.readyState = 'opening';
    this.skipReconnect = false; // emit `open`
  
    var openSub = on(socket, 'open', function () {
      self.onopen();
      fn && fn();
    }); // emit `connect_error`
  
    var errorSub = on(socket, 'error', function (data) {
      debug('connect_error');
      self.cleanup();
      self.readyState = 'closed';
      self.emitAll('connect_error', data);
  
      if (fn) {
        var err = new Error('Connection error');
        err.data = data;
        fn(err);
      } else {
        // Only do this if there is no fn to handle the error
        self.maybeReconnectOnOpen();
      }
    }); // emit `connect_timeout`
  
    if (false !== this._timeout) {
      var timeout = this._timeout;
      debug('connect attempt will timeout after %d', timeout); // set timer
  
      var timer = setTimeout(function () {
        debug('connect attempt timed out after %d', timeout);
        openSub.destroy();
        socket.close();
        socket.emit('error', 'timeout');
        self.emitAll('connect_timeout', timeout);
      }, timeout);
      this.subs.push({
        destroy: function destroy() {
          clearTimeout(timer);
        }
      });
    }
  
    this.subs.push(openSub);
    this.subs.push(errorSub);
    return this;
  };
  /**
   * Called upon transport open.
   *
   * @api private
   */
  
  
  Manager.prototype.onopen = function () {
    debug('open'); // clear old subs
  
    this.cleanup(); // mark as open
  
    this.readyState = 'open';
    this.emit('open'); // add new subs
  
    var socket = this.engine;
    this.subs.push(on(socket, 'data', bind(this, 'ondata')));
    this.subs.push(on(socket, 'ping', bind(this, 'onping')));
    this.subs.push(on(socket, 'pong', bind(this, 'onpong')));
    this.subs.push(on(socket, 'error', bind(this, 'onerror')));
    this.subs.push(on(socket, 'close', bind(this, 'onclose')));
    this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));
  };
  /**
   * Called upon a ping.
   *
   * @api private
   */
  
  
  Manager.prototype.onping = function () {
    this.lastPing = new Date();
    this.emitAll('ping');
  };
  /**
   * Called upon a packet.
   *
   * @api private
   */
  
  
  Manager.prototype.onpong = function () {
    this.emitAll('pong', new Date() - this.lastPing);
  };
  /**
   * Called with data.
   *
   * @api private
   */
  
  
  Manager.prototype.ondata = function (data) {
    this.decoder.add(data);
  };
  /**
   * Called when parser fully decodes a packet.
   *
   * @api private
   */
  
  
  Manager.prototype.ondecoded = function (packet) {
    this.emit('packet', packet);
  };
  /**
   * Called upon socket error.
   *
   * @api private
   */
  
  
  Manager.prototype.onerror = function (err) {
    debug('error', err);
    this.emitAll('error', err);
  };
  /**
   * Creates a new socket for the given `nsp`.
   *
   * @return {Socket}
   * @api public
   */
  
  
  Manager.prototype.socket = function (nsp, opts) {
    var socket = this.nsps[nsp];
  
    if (!socket) {
      socket = new Socket(this, nsp, opts);
      this.nsps[nsp] = socket;
      var self = this;
      socket.on('connecting', onConnecting);
      socket.on('connect', function () {
        socket.id = self.generateId(nsp);
      });
  
      if (this.autoConnect) {
        // manually call here since connecting event is fired before listening
        onConnecting();
      }
    }
  
    function onConnecting() {
      if (!~indexOf(self.connecting, socket)) {
        self.connecting.push(socket);
      }
    }
  
    return socket;
  };
  /**
   * Called upon a socket close.
   *
   * @param {Socket} socket
   */
  
  
  Manager.prototype.destroy = function (socket) {
    var index = indexOf(this.connecting, socket);
    if (~index) this.connecting.splice(index, 1);
    if (this.connecting.length) return;
    this.close();
  };
  /**
   * Writes a packet.
   *
   * @param {Object} packet
   * @api private
   */
  
  
  Manager.prototype.packet = function (packet) {
    debug('writing packet %j', packet);
    var self = this;
    if (packet.query && packet.type === 0) packet.nsp += '?' + packet.query;
  
    if (!self.encoding) {
      // encode, then write to engine with result
      self.encoding = true;
      this.encoder.encode(packet, function (encodedPackets) {
        for (var i = 0; i < encodedPackets.length; i++) {
          self.engine.write(encodedPackets[i], packet.options);
        }
  
        self.encoding = false;
        self.processPacketQueue();
      });
    } else {
      // add packet to the queue
      self.packetBuffer.push(packet);
    }
  };
  /**
   * If packet buffer is non-empty, begins encoding the
   * next packet in line.
   *
   * @api private
   */
  
  
  Manager.prototype.processPacketQueue = function () {
    if (this.packetBuffer.length > 0 && !this.encoding) {
      var pack = this.packetBuffer.shift();
      this.packet(pack);
    }
  };
  /**
   * Clean up transport subscriptions and packet buffer.
   *
   * @api private
   */
  
  
  Manager.prototype.cleanup = function () {
    debug('cleanup');
    var subsLength = this.subs.length;
  
    for (var i = 0; i < subsLength; i++) {
      var sub = this.subs.shift();
      sub.destroy();
    }
  
    this.packetBuffer = [];
    this.encoding = false;
    this.lastPing = null;
    this.decoder.destroy();
  };
  /**
   * Close the current socket.
   *
   * @api private
   */
  
  
  Manager.prototype.close = Manager.prototype.disconnect = function () {
    debug('disconnect');
    this.skipReconnect = true;
    this.reconnecting = false;
  
    if ('opening' === this.readyState) {
      // `onclose` will not fire because
      // an open event never happened
      this.cleanup();
    }
  
    this.backoff.reset();
    this.readyState = 'closed';
    if (this.engine) this.engine.close();
  };
  /**
   * Called upon engine close.
   *
   * @api private
   */
  
  
  Manager.prototype.onclose = function (reason) {
    debug('onclose');
    this.cleanup();
    this.backoff.reset();
    this.readyState = 'closed';
    this.emit('close', reason);
  
    if (this._reconnection && !this.skipReconnect) {
      this.reconnect();
    }
  };
  /**
   * Attempt a reconnection.
   *
   * @api private
   */
  
  
  Manager.prototype.reconnect = function () {
    if (this.reconnecting || this.skipReconnect) return this;
    var self = this;
  
    if (this.backoff.attempts >= this._reconnectionAttempts) {
      debug('reconnect failed');
      this.backoff.reset();
      this.emitAll('reconnect_failed');
      this.reconnecting = false;
    } else {
      var delay = this.backoff.duration();
      debug('will wait %dms before reconnect attempt', delay);
      this.reconnecting = true;
      var timer = setTimeout(function () {
        if (self.skipReconnect) return;
        debug('attempting reconnect');
        self.emitAll('reconnect_attempt', self.backoff.attempts);
        self.emitAll('reconnecting', self.backoff.attempts); // check again for the case socket closed in above events
  
        if (self.skipReconnect) return;
        self.open(function (err) {
          if (err) {
            debug('reconnect attempt error');
            self.reconnecting = false;
            self.reconnect();
            self.emitAll('reconnect_error', err.data);
          } else {
            debug('reconnect success');
            self.onreconnect();
          }
        });
      }, delay);
      this.subs.push({
        destroy: function destroy() {
          clearTimeout(timer);
        }
      });
    }
  };
  /**
   * Called upon successful reconnect.
   *
   * @api private
   */
  
  
  Manager.prototype.onreconnect = function () {
    var attempt = this.backoff.attempts;
    this.reconnecting = false;
    this.backoff.reset();
    this.updateSocketIds();
    this.emitAll('reconnect', attempt);
  };
  
  /***/ }),
  /* 16 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies
   */
  var XMLHttpRequest = __webpack_require__(10);
  
  var XHR = __webpack_require__(43);
  
  var JSONP = __webpack_require__(53);
  
  var websocket = __webpack_require__(54);
  /**
   * Export transports.
   */
  
  
  exports.polling = polling;
  exports.websocket = websocket;
  /**
   * Polling transport polymorphic constructor.
   * Decides on xhr vs jsonp based on feature detection.
   *
   * @api private
   */
  
  function polling(opts) {
    var xhr;
    var xd = false;
    var xs = false;
    var jsonp = false !== opts.jsonp;
  
    if (typeof location !== 'undefined') {
      var isSSL = 'https:' === location.protocol;
      var port = location.port; // some user agents have empty `location.port`
  
      if (!port) {
        port = isSSL ? 443 : 80;
      }
  
      xd = opts.hostname !== location.hostname || port !== opts.port;
      xs = opts.secure !== isSSL;
    }
  
    opts.xdomain = xd;
    opts.xscheme = xs;
    xhr = new XMLHttpRequest(opts);
  
    if ('open' in xhr && !opts.forceJSONP) {
      return new XHR(opts);
    } else {
      if (!jsonp) throw new Error('JSONP disabled');
      return new JSONP(opts);
    }
  }
  
  /***/ }),
  /* 17 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies.
   */
  var Transport = __webpack_require__(11);
  
  var parseqs = __webpack_require__(5);
  
  var parser = __webpack_require__(2);
  
  var inherit = __webpack_require__(6);
  
  var yeast = __webpack_require__(19);
  
  var debug = __webpack_require__(7)('engine.io-client:polling');
  /**
   * Module exports.
   */
  
  
  module.exports = Polling;
  /**
   * Is XHR2 supported?
   */
  
  var hasXHR2 = function () {
    var XMLHttpRequest = __webpack_require__(10);
  
    var xhr = new XMLHttpRequest({
      xdomain: false
    });
    return null != xhr.responseType;
  }();
  /**
   * Polling interface.
   *
   * @param {Object} opts
   * @api private
   */
  
  
  function Polling(opts) {
    var forceBase64 = opts && opts.forceBase64;
  
    if (!hasXHR2 || forceBase64) {
      this.supportsBinary = false;
    }
  
    Transport.call(this, opts);
  }
  /**
   * Inherits from Transport.
   */
  
  
  inherit(Polling, Transport);
  /**
   * Transport name.
   */
  
  Polling.prototype.name = 'polling';
  /**
   * Opens the socket (triggers polling). We write a PING message to determine
   * when the transport is open.
   *
   * @api private
   */
  
  Polling.prototype.doOpen = function () {
    this.poll();
  };
  /**
   * Pauses polling.
   *
   * @param {Function} callback upon buffers are flushed and transport is paused
   * @api private
   */
  
  
  Polling.prototype.pause = function (onPause) {
    var self = this;
    this.readyState = 'pausing';
  
    function pause() {
      debug('paused');
      self.readyState = 'paused';
      onPause();
    }
  
    if (this.polling || !this.writable) {
      var total = 0;
  
      if (this.polling) {
        debug('we are currently polling - waiting to pause');
        total++;
        this.once('pollComplete', function () {
          debug('pre-pause polling complete');
          --total || pause();
        });
      }
  
      if (!this.writable) {
        debug('we are currently writing - waiting to pause');
        total++;
        this.once('drain', function () {
          debug('pre-pause writing complete');
          --total || pause();
        });
      }
    } else {
      pause();
    }
  };
  /**
   * Starts polling cycle.
   *
   * @api public
   */
  
  
  Polling.prototype.poll = function () {
    debug('polling');
    this.polling = true;
    this.doPoll();
    this.emit('poll');
  };
  /**
   * Overloads onData to detect payloads.
   *
   * @api private
   */
  
  
  Polling.prototype.onData = function (data) {
    var self = this;
    debug('polling got data %s', data);
  
    var callback = function callback(packet, index, total) {
      // if its the first message we consider the transport open
      if ('opening' === self.readyState) {
        self.onOpen();
      } // if its a close packet, we close the ongoing requests
  
  
      if ('close' === packet.type) {
        self.onClose();
        return false;
      } // otherwise bypass onData and handle the message
  
  
      self.onPacket(packet);
    }; // decode payload
  
  
    parser.decodePayload(data, this.socket.binaryType, callback); // if an event did not trigger closing
  
    if ('closed' !== this.readyState) {
      // if we got data we're not polling
      this.polling = false;
      this.emit('pollComplete');
  
      if ('open' === this.readyState) {
        this.poll();
      } else {
        debug('ignoring poll - transport state "%s"', this.readyState);
      }
    }
  };
  /**
   * For polling, send a close packet.
   *
   * @api private
   */
  
  
  Polling.prototype.doClose = function () {
    var self = this;
  
    function close() {
      debug('writing close packet');
      self.write([{
        type: 'close'
      }]);
    }
  
    if ('open' === this.readyState) {
      debug('transport open - closing');
      close();
    } else {
      // in case we're trying to close while
      // handshaking is in progress (GH-164)
      debug('transport not open - deferring close');
      this.once('open', close);
    }
  };
  /**
   * Writes a packets payload.
   *
   * @param {Array} data packets
   * @param {Function} drain callback
   * @api private
   */
  
  
  Polling.prototype.write = function (packets) {
    var self = this;
    this.writable = false;
  
    var callbackfn = function callbackfn() {
      self.writable = true;
      self.emit('drain');
    };
  
    parser.encodePayload(packets, this.supportsBinary, function (data) {
      self.doWrite(data, callbackfn);
    });
  };
  /**
   * Generates uri for connection.
   *
   * @api private
   */
  
  
  Polling.prototype.uri = function () {
    var query = this.query || {};
    var schema = this.secure ? 'https' : 'http';
    var port = ''; // cache busting is forced
  
    if (false !== this.timestampRequests) {
      query[this.timestampParam] = yeast();
    }
  
    if (!this.supportsBinary && !query.sid) {
      query.b64 = 1;
    }
  
    query = parseqs.encode(query); // avoid port if default for schema
  
    if (this.port && ('https' === schema && Number(this.port) !== 443 || 'http' === schema && Number(this.port) !== 80)) {
      port = ':' + this.port;
    } // prepend ? to query
  
  
    if (query.length) {
      query = '?' + query;
    }
  
    var ipv6 = this.hostname.indexOf(':') !== -1;
    return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  };
  
  /***/ }),
  /* 18 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /* global Blob File */
  
  /*
   * Module requirements.
   */
  var isArray = __webpack_require__(45);
  
  var toString = Object.prototype.toString;
  var withNativeBlob = typeof Blob === 'function' || typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';
  var withNativeFile = typeof File === 'function' || typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';
  /**
   * Module exports.
   */
  
  module.exports = hasBinary;
  /**
   * Checks for binary data.
   *
   * Supports Buffer, ArrayBuffer, Blob and File.
   *
   * @param {Object} anything
   * @api public
   */
  
  function hasBinary(obj) {
    if (!obj || _typeof(obj) !== 'object') {
      return false;
    }
  
    if (isArray(obj)) {
      for (var i = 0, l = obj.length; i < l; i++) {
        if (hasBinary(obj[i])) {
          return true;
        }
      }
  
      return false;
    }
  
    if (typeof Buffer === 'function' && Buffer.isBuffer && Buffer.isBuffer(obj) || typeof ArrayBuffer === 'function' && obj instanceof ArrayBuffer || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File) {
      return true;
    } // see: https://github.com/Automattic/has-binary/pull/4
  
  
    if (obj.toJSON && typeof obj.toJSON === 'function' && arguments.length === 1) {
      return hasBinary(obj.toJSON(), true);
    }
  
    for (var key in obj) {
      if (Object.prototype.hasOwnProperty.call(obj, key) && hasBinary(obj[key])) {
        return true;
      }
    }
  
    return false;
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9).Buffer))
  
  /***/ }),
  /* 19 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split(''),
      length = 64,
      map = {},
      seed = 0,
      i = 0,
      prev;
  /**
   * Return a string representing the specified number.
   *
   * @param {Number} num The number to convert.
   * @returns {String} The string representation of the number.
   * @api public
   */
  
  function encode(num) {
    var encoded = '';
  
    do {
      encoded = alphabet[num % length] + encoded;
      num = Math.floor(num / length);
    } while (num > 0);
  
    return encoded;
  }
  /**
   * Return the integer value specified by the given string.
   *
   * @param {String} str The string to convert.
   * @returns {Number} The integer value represented by the string.
   * @api public
   */
  
  
  function decode(str) {
    var decoded = 0;
  
    for (i = 0; i < str.length; i++) {
      decoded = decoded * length + map[str.charAt(i)];
    }
  
    return decoded;
  }
  /**
   * Yeast: A tiny growing id generator.
   *
   * @returns {String} A unique id.
   * @api public
   */
  
  
  function yeast() {
    var now = encode(+new Date());
    if (now !== prev) return seed = 0, prev = now;
    return now + '.' + encode(seed++);
  } //
  // Map each character to its index.
  //
  
  
  for (; i < length; i++) {
    map[alphabet[i]] = i;
  } //
  // Expose the `yeast`, `encode` and `decode` functions.
  //
  
  
  yeast.encode = encode;
  yeast.decode = decode;
  module.exports = yeast;
  
  /***/ }),
  /* 20 */
  /***/ (function(module, exports) {
  
  var indexOf = [].indexOf;
  
  module.exports = function (arr, obj) {
    if (indexOf) return arr.indexOf(obj);
  
    for (var i = 0; i < arr.length; ++i) {
      if (arr[i] === obj) return i;
    }
  
    return -1;
  };
  
  /***/ }),
  /* 21 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Module dependencies.
   */
  var parser = __webpack_require__(8);
  
  var Emitter = __webpack_require__(0);
  
  var toArray = __webpack_require__(56);
  
  var on = __webpack_require__(22);
  
  var bind = __webpack_require__(23);
  
  var debug = __webpack_require__(3)('socket.io-client:socket');
  
  var parseqs = __webpack_require__(5);
  
  var hasBin = __webpack_require__(18);
  /**
   * Module exports.
   */
  
  
  module.exports = exports = Socket;
  /**
   * Internal events (blacklisted).
   * These events can't be emitted by the user.
   *
   * @api private
   */
  
  var events = {
    connect: 1,
    connect_error: 1,
    connect_timeout: 1,
    connecting: 1,
    disconnect: 1,
    error: 1,
    reconnect: 1,
    reconnect_attempt: 1,
    reconnect_failed: 1,
    reconnect_error: 1,
    reconnecting: 1,
    ping: 1,
    pong: 1
  };
  /**
   * Shortcut to `Emitter#emit`.
   */
  
  var emit = Emitter.prototype.emit;
  /**
   * `Socket` constructor.
   *
   * @api public
   */
  
  function Socket(io, nsp, opts) {
    this.io = io;
    this.nsp = nsp;
    this.json = this; // compat
  
    this.ids = 0;
    this.acks = {};
    this.receiveBuffer = [];
    this.sendBuffer = [];
    this.connected = false;
    this.disconnected = true;
    this.flags = {};
  
    if (opts && opts.query) {
      this.query = opts.query;
    }
  
    if (this.io.autoConnect) this.open();
  }
  /**
   * Mix in `Emitter`.
   */
  
  
  Emitter(Socket.prototype);
  /**
   * Subscribe to open, close and packet events
   *
   * @api private
   */
  
  Socket.prototype.subEvents = function () {
    if (this.subs) return;
    var io = this.io;
    this.subs = [on(io, 'open', bind(this, 'onopen')), on(io, 'packet', bind(this, 'onpacket')), on(io, 'close', bind(this, 'onclose'))];
  };
  /**
   * "Opens" the socket.
   *
   * @api public
   */
  
  
  Socket.prototype.open = Socket.prototype.connect = function () {
    if (this.connected) return this;
    this.subEvents();
    this.io.open(); // ensure open
  
    if ('open' === this.io.readyState) this.onopen();
    this.emit('connecting');
    return this;
  };
  /**
   * Sends a `message` event.
   *
   * @return {Socket} self
   * @api public
   */
  
  
  Socket.prototype.send = function () {
    var args = toArray(arguments);
    args.unshift('message');
    this.emit.apply(this, args);
    return this;
  };
  /**
   * Override `emit`.
   * If the event is in `events`, it's emitted normally.
   *
   * @param {String} event name
   * @return {Socket} self
   * @api public
   */
  
  
  Socket.prototype.emit = function (ev) {
    if (events.hasOwnProperty(ev)) {
      emit.apply(this, arguments);
      return this;
    }
  
    var args = toArray(arguments);
    var packet = {
      type: (this.flags.binary !== undefined ? this.flags.binary : hasBin(args)) ? parser.BINARY_EVENT : parser.EVENT,
      data: args
    };
    packet.options = {};
    packet.options.compress = !this.flags || false !== this.flags.compress; // event ack callback
  
    if ('function' === typeof args[args.length - 1]) {
      debug('emitting packet with ack id %d', this.ids);
      this.acks[this.ids] = args.pop();
      packet.id = this.ids++;
    }
  
    if (this.connected) {
      this.packet(packet);
    } else {
      this.sendBuffer.push(packet);
    }
  
    this.flags = {};
    return this;
  };
  /**
   * Sends a packet.
   *
   * @param {Object} packet
   * @api private
   */
  
  
  Socket.prototype.packet = function (packet) {
    packet.nsp = this.nsp;
    this.io.packet(packet);
  };
  /**
   * Called upon engine `open`.
   *
   * @api private
   */
  
  
  Socket.prototype.onopen = function () {
    debug('transport is open - connecting'); // write connect packet if necessary
  
    if ('/' !== this.nsp) {
      if (this.query) {
        var query = _typeof(this.query) === 'object' ? parseqs.encode(this.query) : this.query;
        debug('sending connect packet with query %s', query);
        this.packet({
          type: parser.CONNECT,
          query: query
        });
      } else {
        this.packet({
          type: parser.CONNECT
        });
      }
    }
  };
  /**
   * Called upon engine `close`.
   *
   * @param {String} reason
   * @api private
   */
  
  
  Socket.prototype.onclose = function (reason) {
    debug('close (%s)', reason);
    this.connected = false;
    this.disconnected = true;
    delete this.id;
    this.emit('disconnect', reason);
  };
  /**
   * Called with socket packet.
   *
   * @param {Object} packet
   * @api private
   */
  
  
  Socket.prototype.onpacket = function (packet) {
    var sameNamespace = packet.nsp === this.nsp;
    var rootNamespaceError = packet.type === parser.ERROR && packet.nsp === '/';
    if (!sameNamespace && !rootNamespaceError) return;
  
    switch (packet.type) {
      case parser.CONNECT:
        this.onconnect();
        break;
  
      case parser.EVENT:
        this.onevent(packet);
        break;
  
      case parser.BINARY_EVENT:
        this.onevent(packet);
        break;
  
      case parser.ACK:
        this.onack(packet);
        break;
  
      case parser.BINARY_ACK:
        this.onack(packet);
        break;
  
      case parser.DISCONNECT:
        this.ondisconnect();
        break;
  
      case parser.ERROR:
        this.emit('error', packet.data);
        break;
    }
  };
  /**
   * Called upon a server event.
   *
   * @param {Object} packet
   * @api private
   */
  
  
  Socket.prototype.onevent = function (packet) {
    var args = packet.data || [];
    debug('emitting event %j', args);
  
    if (null != packet.id) {
      debug('attaching ack callback to event');
      args.push(this.ack(packet.id));
    }
  
    if (this.connected) {
      emit.apply(this, args);
    } else {
      this.receiveBuffer.push(args);
    }
  };
  /**
   * Produces an ack callback to emit with an event.
   *
   * @api private
   */
  
  
  Socket.prototype.ack = function (id) {
    var self = this;
    var sent = false;
    return function () {
      // prevent double callbacks
      if (sent) return;
      sent = true;
      var args = toArray(arguments);
      debug('sending ack %j', args);
      self.packet({
        type: hasBin(args) ? parser.BINARY_ACK : parser.ACK,
        id: id,
        data: args
      });
    };
  };
  /**
   * Called upon a server acknowlegement.
   *
   * @param {Object} packet
   * @api private
   */
  
  
  Socket.prototype.onack = function (packet) {
    var ack = this.acks[packet.id];
  
    if ('function' === typeof ack) {
      debug('calling ack %s with %j', packet.id, packet.data);
      ack.apply(this, packet.data);
      delete this.acks[packet.id];
    } else {
      debug('bad ack %s', packet.id);
    }
  };
  /**
   * Called upon server connect.
   *
   * @api private
   */
  
  
  Socket.prototype.onconnect = function () {
    this.connected = true;
    this.disconnected = false;
    this.emit('connect');
    this.emitBuffered();
  };
  /**
   * Emit buffered events (received and emitted).
   *
   * @api private
   */
  
  
  Socket.prototype.emitBuffered = function () {
    var i;
  
    for (i = 0; i < this.receiveBuffer.length; i++) {
      emit.apply(this, this.receiveBuffer[i]);
    }
  
    this.receiveBuffer = [];
  
    for (i = 0; i < this.sendBuffer.length; i++) {
      this.packet(this.sendBuffer[i]);
    }
  
    this.sendBuffer = [];
  };
  /**
   * Called upon server disconnect.
   *
   * @api private
   */
  
  
  Socket.prototype.ondisconnect = function () {
    debug('server disconnect (%s)', this.nsp);
    this.destroy();
    this.onclose('io server disconnect');
  };
  /**
   * Called upon forced client/server side disconnections,
   * this method ensures the manager stops tracking us and
   * that reconnections don't get triggered for this.
   *
   * @api private.
   */
  
  
  Socket.prototype.destroy = function () {
    if (this.subs) {
      // clean subscriptions to avoid reconnections
      for (var i = 0; i < this.subs.length; i++) {
        this.subs[i].destroy();
      }
  
      this.subs = null;
    }
  
    this.io.destroy(this);
  };
  /**
   * Disconnects the socket manually.
   *
   * @return {Socket} self
   * @api public
   */
  
  
  Socket.prototype.close = Socket.prototype.disconnect = function () {
    if (this.connected) {
      debug('performing disconnect (%s)', this.nsp);
      this.packet({
        type: parser.DISCONNECT
      });
    } // remove socket from pool
  
  
    this.destroy();
  
    if (this.connected) {
      // fire events
      this.onclose('io client disconnect');
    }
  
    return this;
  };
  /**
   * Sets the compress flag.
   *
   * @param {Boolean} if `true`, compresses the sending data
   * @return {Socket} self
   * @api public
   */
  
  
  Socket.prototype.compress = function (compress) {
    this.flags.compress = compress;
    return this;
  };
  /**
   * Sets the binary flag
   *
   * @param {Boolean} whether the emitted data contains binary
   * @return {Socket} self
   * @api public
   */
  
  
  Socket.prototype.binary = function (binary) {
    this.flags.binary = binary;
    return this;
  };
  
  /***/ }),
  /* 22 */
  /***/ (function(module, exports) {
  
  /**
   * Module exports.
   */
  module.exports = on;
  /**
   * Helper for subscriptions.
   *
   * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`
   * @param {String} event name
   * @param {Function} callback
   * @api public
   */
  
  function on(obj, ev, fn) {
    obj.on(ev, fn);
    return {
      destroy: function destroy() {
        obj.removeListener(ev, fn);
      }
    };
  }
  
  /***/ }),
  /* 23 */
  /***/ (function(module, exports) {
  
  /**
   * Slice reference.
   */
  var slice = [].slice;
  /**
   * Bind `obj` to `fn`.
   *
   * @param {Object} obj
   * @param {Function|String} fn or string
   * @return {Function}
   * @api public
   */
  
  module.exports = function (obj, fn) {
    if ('string' == typeof fn) fn = obj[fn];
    if ('function' != typeof fn) throw new Error('bind() requires a function');
    var args = slice.call(arguments, 2);
    return function () {
      return fn.apply(obj, args.concat(slice.call(arguments)));
    };
  };
  
  /***/ }),
  /* 24 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var inline_worker_1 = __webpack_require__(61);
  
  var Recorder =
  /** @class */
  function () {
    function Recorder(source, cfg) {
      var _this = this;
  
      this.config = {
        bufferLen: 4096,
        numChannels: 2,
        mimeType: 'audio/wav'
      };
      this.recording = false;
      this.callbacks = {
        getBuffer: [],
        exportWAV: []
      };
      Object.assign(this.config, cfg);
      this.context = source.context;
      this.node = (this.context.createScriptProcessor || this.context.createJavaScriptNode).call(this.context, this.config.bufferLen, this.config.numChannels, this.config.numChannels);
  
      this.node.onaudioprocess = function (e) {
        if (!_this.recording) return;
        var buffer = [];
  
        for (var channel = 0; channel < _this.config.numChannels; channel++) {
          buffer.push(e.inputBuffer.getChannelData(channel));
        }
  
        _this.worker.postMessage({
          command: 'record',
          buffer: buffer
        });
      };
  
      source.connect(this.node);
      this.node.connect(this.context.destination); //this should not be necessary
  
      var self = {};
      this.worker = new inline_worker_1["default"](function () {
        var recLength = 0,
            recBuffers = [],
            sampleRate,
            numChannels;
  
        this.onmessage = function (e) {
          switch (e.data.command) {
            case 'init':
              init(e.data.config);
              break;
  
            case 'record':
              record(e.data.buffer);
              break;
  
            case 'exportWAV':
              exportWAV(e.data.type);
              break;
  
            case 'getBuffer':
              getBuffer();
              break;
  
            case 'clear':
              clear();
              break;
          }
        };
  
        function init(config) {
          sampleRate = config.sampleRate;
          numChannels = config.numChannels;
          initBuffers();
        }
  
        function record(inputBuffer) {
          for (var channel = 0; channel < numChannels; channel++) {
            recBuffers[channel].push(inputBuffer[channel]);
          }
  
          recLength += inputBuffer[0].length;
        }
  
        function exportWAV(type) {
          var buffers = [];
  
          for (var channel = 0; channel < numChannels; channel++) {
            buffers.push(mergeBuffers(recBuffers[channel], recLength));
          }
  
          var interleaved;
  
          if (numChannels === 2) {
            interleaved = interleave(buffers[0], buffers[1]);
          } else {
            interleaved = buffers[0];
          }
  
          var dataview = encodeWAV(interleaved);
          var audioBlob = new Blob([dataview], {
            type: type
          });
          this.postMessage({
            command: 'exportWAV',
            data: audioBlob
          });
        }
  
        function getBuffer() {
          var buffers = [];
  
          for (var channel = 0; channel < numChannels; channel++) {
            buffers.push(mergeBuffers(recBuffers[channel], recLength));
          }
  
          this.postMessage({
            command: 'getBuffer',
            data: buffers
          });
        }
  
        function clear() {
          recLength = 0;
          recBuffers = [];
          initBuffers();
        }
  
        function initBuffers() {
          for (var channel = 0; channel < numChannels; channel++) {
            recBuffers[channel] = [];
          }
        }
  
        function mergeBuffers(recBuffers, recLength) {
          var result = new Float32Array(recLength);
          var offset = 0;
  
          for (var i = 0; i < recBuffers.length; i++) {
            result.set(recBuffers[i], offset);
            offset += recBuffers[i].length;
          }
  
          return result;
        }
  
        function interleave(inputL, inputR) {
          var length = inputL.length + inputR.length;
          var result = new Float32Array(length);
          var index = 0,
              inputIndex = 0;
  
          while (index < length) {
            result[index++] = inputL[inputIndex];
            result[index++] = inputR[inputIndex];
            inputIndex++;
          }
  
          return result;
        }
  
        function floatTo16BitPCM(output, offset, input) {
          for (var i = 0; i < input.length; i++, offset += 2) {
            var s = Math.max(-1, Math.min(1, input[i]));
            output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true);
          }
        }
  
        function writeString(view, offset, string) {
          for (var i = 0; i < string.length; i++) {
            view.setUint8(offset + i, string.charCodeAt(i));
          }
        }
  
        function encodeWAV(samples) {
          var buffer = new ArrayBuffer(44 + samples.length * 2);
          var view = new DataView(buffer);
          /* RIFF identifier */
  
          writeString(view, 0, 'RIFF');
          /* RIFF chunk length */
  
          view.setUint32(4, 36 + samples.length * 2, true);
          /* RIFF type */
  
          writeString(view, 8, 'WAVE');
          /* format chunk identifier */
  
          writeString(view, 12, 'fmt ');
          /* format chunk length */
  
          view.setUint32(16, 16, true);
          /* sample format (raw) */
  
          view.setUint16(20, 1, true);
          /* channel count */
  
          view.setUint16(22, numChannels, true);
          /* sample rate */
  
          view.setUint32(24, sampleRate, true);
          /* byte rate (sample rate * block align) */
  
          view.setUint32(28, sampleRate * 4, true);
          /* block align (channel count * bytes per sample) */
  
          view.setUint16(32, numChannels * 2, true);
          /* bits per sample */
  
          view.setUint16(34, 16, true);
          /* data chunk identifier */
  
          writeString(view, 36, 'data');
          /* data chunk length */
  
          view.setUint32(40, samples.length * 2, true);
          floatTo16BitPCM(view, 44, samples);
          return view;
        }
      }, self);
      this.worker.postMessage({
        command: 'init',
        config: {
          sampleRate: this.context.sampleRate,
          numChannels: this.config.numChannels
        }
      });
  
      this.worker.onmessage = function (e) {
        var cb = _this.callbacks[e.data.command].pop();
  
        if (typeof cb == 'function') {
          cb(e.data.data);
        }
      };
    }
  
    Recorder.prototype.record = function () {
      this.recording = true;
    };
  
    Recorder.prototype.stop = function () {
      this.recording = false;
    };
  
    Recorder.prototype.clear = function () {
      this.worker.postMessage({
        command: 'clear'
      });
    };
  
    Recorder.prototype.getBuffer = function (cb) {
      cb = cb || this.config.callback;
      if (!cb) throw new Error('Callback not set');
      this.callbacks.getBuffer.push(cb);
      this.worker.postMessage({
        command: 'getBuffer'
      });
    };
  
    Recorder.prototype.exportWAV = function (cb, mimeType) {
      mimeType = mimeType || this.config.mimeType;
      cb = cb || this.config.callback;
      if (!cb) throw new Error('Callback not set');
      this.callbacks.exportWAV.push(cb);
      this.worker.postMessage({
        command: 'exportWAV',
        type: mimeType
      });
    };
  
    Recorder.forceDownload = function (blob, filename) {
      var url = (window.URL || window.webkitURL).createObjectURL(blob);
      var link = window.document.createElement('a');
      link.href = url;
      link.download = filename || 'output.wav';
      var click = document.createEvent("Event");
      click.initEvent("click", true, true);
      link.dispatchEvent(click);
    };
  
    return Recorder;
  }();
  
  exports["default"] = Recorder;
  
  /***/ }),
  /* 25 */
  /***/ (function(module, exports, __webpack_require__) {
  
  window.speechSDK = __webpack_require__(26);
  
  /***/ }),
  /* 26 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  function __export(m) {
    for (var p in m) {
      if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }
  }
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  __export(__webpack_require__(27));
  
  /***/ }),
  /* 27 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
   // IMPORTANT - Dont publish internal modules.
  
  function __export(m) {
    for (var p in m) {
      if (!exports.hasOwnProperty(p)) exports[p] = m[p];
    }
  }
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  __export(__webpack_require__(28));
  
  __export(__webpack_require__(24));
  
  /***/ }),
  /* 28 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
      function fulfilled(value) {
        try {
          step(generator.next(value));
        } catch (e) {
          reject(e);
        }
      }
  
      function rejected(value) {
        try {
          step(generator["throw"](value));
        } catch (e) {
          reject(e);
        }
      }
  
      function step(result) {
        result.done ? resolve(result.value) : new P(function (resolve) {
          resolve(result.value);
        }).then(fulfilled, rejected);
      }
  
      step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
  };
  
  var __generator = this && this.__generator || function (thisArg, body) {
    var _ = {
      label: 0,
      sent: function sent() {
        if (t[0] & 1) throw t[1];
        return t[1];
      },
      trys: [],
      ops: []
    },
        f,
        y,
        t,
        g;
    return g = {
      next: verb(0),
      "throw": verb(1),
      "return": verb(2)
    }, typeof Symbol === "function" && (g[Symbol.iterator] = function () {
      return this;
    }), g;
  
    function verb(n) {
      return function (v) {
        return step([n, v]);
      };
    }
  
    function step(op) {
      if (f) throw new TypeError("Generator is already executing.");
  
      while (_) {
        try {
          if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
          if (y = 0, t) op = [0, t.value];
  
          switch (op[0]) {
            case 0:
            case 1:
              t = op;
              break;
  
            case 4:
              _.label++;
              return {
                value: op[1],
                done: false
              };
  
            case 5:
              _.label++;
              y = op[1];
              op = [0];
              continue;
  
            case 7:
              op = _.ops.pop();
  
              _.trys.pop();
  
              continue;
  
            default:
              if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
                _ = 0;
                continue;
              }
  
              if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
                _.label = op[1];
                break;
              }
  
              if (op[0] === 6 && _.label < t[1]) {
                _.label = t[1];
                t = op;
                break;
              }
  
              if (t && _.label < t[2]) {
                _.label = t[2];
  
                _.ops.push(op);
  
                break;
              }
  
              if (t[2]) _.ops.pop();
  
              _.trys.pop();
  
              continue;
          }
  
          op = body.call(thisArg, _);
        } catch (e) {
          op = [6, e];
          y = 0;
        } finally {
          f = t = 0;
        }
      }
  
      if (op[0] & 5) throw op[1];
      return {
        value: op[0] ? op[1] : void 0,
        done: true
      };
    }
  };
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var io = __webpack_require__(29);
  
  var ss = __webpack_require__(58);
  
  var recorder_1 = __webpack_require__(24);
  
  var DeepSpeech =
  /** @class */
  function () {
    function DeepSpeech() {}
  
    DeepSpeech.prototype.init = function () {
      return __awaiter(this, void 0, void 0, function () {
        var _this = this;
  
        return __generator(this, function (_a) {
          return [2
          /*return*/
          , new Promise(function (resolve, reject) {
            return __awaiter(_this, void 0, void 0, function () {
              var _a, input, err_1;
  
              return __generator(this, function (_b) {
                switch (_b.label) {
                  case 0:
                    _b.trys.push([0, 4,, 5]);
  
                    this.socket = io.connect("http://192.168.50.86:3000");
                    this.context = new AudioContext();
                    _a = this;
                    return [4
                    /*yield*/
                    , this.getMediaStream()];
  
                  case 1:
                    _a.stream = _b.sent();
                    if (!(this.context.state == "suspended")) return [3
                    /*break*/
                    , 3];
                    return [4
                    /*yield*/
                    , this.resumeAudioContext()];
  
                  case 2:
                    _b.sent();
  
                    _b.label = 3;
  
                  case 3:
                    input = this.context.createMediaStreamSource(this.stream);
                    this.recorder = new recorder_1["default"](input, {
                      numChannels: 1
                    });
                    console.log("recorder....", this.recorder);
                    resolve();
                    return [3
                    /*break*/
                    , 5];
  
                  case 4:
                    err_1 = _b.sent();
                    reject(err_1);
                    return [3
                    /*break*/
                    , 5];
  
                  case 5:
                    return [2
                    /*return*/
                    ];
                }
              });
            });
          })];
        });
      });
    };
  
    DeepSpeech.prototype.recordAudio = function () {
      this.recorder.clear();
      this.recorder.record();
    };
  
    DeepSpeech.prototype.stopAudio = function () {
      var _this = this;
  
      return new Promise(function (resolve, reject) {
        try {
          _this.recorder.stop();
  
          _this.recorder.exportWAV(function (blob) {
            var stream = ss.createStream();
            ss(_this.socket).emit('audio', stream);
            ss.createBlobReadStream(blob).pipe(stream);
            ss(_this.socket).on('sttresult', function (stream, data) {
              if (!stream || data.err) {
                reject('Issue at DeepSpeech side');
              } else {
                resolve(data.text);
              }
            });
          });
        } catch (err) {
          // console.log("error...",err);
          reject(err);
        }
      });
    };
  
    DeepSpeech.prototype.getMediaStream = function () {
      return __awaiter(this, void 0, void 0, function () {
        var stream, constraints, err_2;
        return __generator(this, function (_a) {
          switch (_a.label) {
            case 0:
              stream = null;
              constraints = {
                audio: true,
                echoCancellation: true,
                noiseSuppression: true
              };
              _a.label = 1;
  
            case 1:
              _a.trys.push([1, 3,, 4]);
  
              return [4
              /*yield*/
              , navigator.mediaDevices.getUserMedia(constraints)];
  
            case 2:
              stream = _a.sent();
              return [2
              /*return*/
              , stream];
  
            case 3:
              err_2 = _a.sent();
              throw err_2;
  
            case 4:
              return [2
              /*return*/
              ];
          }
        });
      });
    };
  
    DeepSpeech.prototype.resumeAudioContext = function () {
      var _this = this;
  
      return new Promise(function (resolve, reject) {
        _this.context.resume().then(function () {
          // console.log('Playback resumed successfully');
          resolve();
        })["catch"](function (err) {
          //   console.log("resumeAudioContext error",err)
          reject(err);
        });
      });
    };
  
    return DeepSpeech;
  }();
  
  exports.DeepSpeech = DeepSpeech;
  
  /***/ }),
  /* 29 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Module dependencies.
   */
  var url = __webpack_require__(30);
  
  var parser = __webpack_require__(8);
  
  var Manager = __webpack_require__(15);
  
  var debug = __webpack_require__(3)('socket.io-client');
  /**
   * Module exports.
   */
  
  
  module.exports = exports = lookup;
  /**
   * Managers cache.
   */
  
  var cache = exports.managers = {};
  /**
   * Looks up an existing `Manager` for multiplexing.
   * If the user summons:
   *
   *   `io('http://localhost/a');`
   *   `io('http://localhost/b');`
   *
   * We reuse the existing instance based on same scheme/port/host,
   * and we initialize sockets for each namespace.
   *
   * @api public
   */
  
  function lookup(uri, opts) {
    if (_typeof(uri) === 'object') {
      opts = uri;
      uri = undefined;
    }
  
    opts = opts || {};
    var parsed = url(uri);
    var source = parsed.source;
    var id = parsed.id;
    var path = parsed.path;
    var sameNamespace = cache[id] && path in cache[id].nsps;
    var newConnection = opts.forceNew || opts['force new connection'] || false === opts.multiplex || sameNamespace;
    var io;
  
    if (newConnection) {
      debug('ignoring socket cache for %s', source);
      io = Manager(source, opts);
    } else {
      if (!cache[id]) {
        debug('new io instance for %s', source);
        cache[id] = Manager(source, opts);
      }
  
      io = cache[id];
    }
  
    if (parsed.query && !opts.query) {
      opts.query = parsed.query;
    }
  
    return io.socket(parsed.path, opts);
  }
  /**
   * Protocol version.
   *
   * @api public
   */
  
  
  exports.protocol = parser.protocol;
  /**
   * `connect`.
   *
   * @param {String} uri
   * @api public
   */
  
  exports.connect = lookup;
  /**
   * Expose constructors for standalone build.
   *
   * @api public
   */
  
  exports.Manager = __webpack_require__(15);
  exports.Socket = __webpack_require__(21);
  
  /***/ }),
  /* 30 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * Module dependencies.
   */
  var parseuri = __webpack_require__(12);
  
  var debug = __webpack_require__(3)('socket.io-client:url');
  /**
   * Module exports.
   */
  
  
  module.exports = url;
  /**
   * URL parser.
   *
   * @param {String} url
   * @param {Object} An object meant to mimic window.location.
   *                 Defaults to window.location.
   * @api public
   */
  
  function url(uri, loc) {
    var obj = uri; // default to window.location
  
    loc = loc || typeof location !== 'undefined' && location;
    if (null == uri) uri = loc.protocol + '//' + loc.host; // relative path support
  
    if ('string' === typeof uri) {
      if ('/' === uri.charAt(0)) {
        if ('/' === uri.charAt(1)) {
          uri = loc.protocol + uri;
        } else {
          uri = loc.host + uri;
        }
      }
  
      if (!/^(https?|wss?):\/\//.test(uri)) {
        debug('protocol-less url %s', uri);
  
        if ('undefined' !== typeof loc) {
          uri = loc.protocol + '//' + uri;
        } else {
          uri = 'https://' + uri;
        }
      } // parse
  
  
      debug('parse %s', uri);
      obj = parseuri(uri);
    } // make sure we treat `localhost:80` and `localhost` equally
  
  
    if (!obj.port) {
      if (/^(http|ws)$/.test(obj.protocol)) {
        obj.port = '80';
      } else if (/^(http|ws)s$/.test(obj.protocol)) {
        obj.port = '443';
      }
    }
  
    obj.path = obj.path || '/';
    var ipv6 = obj.host.indexOf(':') !== -1;
    var host = ipv6 ? '[' + obj.host + ']' : obj.host; // define unique id
  
    obj.id = obj.protocol + '://' + host + ':' + obj.port; // define href
  
    obj.href = obj.protocol + '://' + host + (loc && loc.port === obj.port ? '' : ':' + obj.port);
    return obj;
  }
  
  /***/ }),
  /* 31 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  
  function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  
  /**
   * This is the common logic for both the Node.js and web browser
   * implementations of `debug()`.
   */
  function setup(env) {
    createDebug.debug = createDebug;
    createDebug["default"] = createDebug;
    createDebug.coerce = coerce;
    createDebug.disable = disable;
    createDebug.enable = enable;
    createDebug.enabled = enabled;
    createDebug.humanize = __webpack_require__(32);
    Object.keys(env).forEach(function (key) {
      createDebug[key] = env[key];
    });
    /**
    * Active `debug` instances.
    */
  
    createDebug.instances = [];
    /**
    * The currently active debug mode names, and names to skip.
    */
  
    createDebug.names = [];
    createDebug.skips = [];
    /**
    * Map of special "%n" handling functions, for the debug "format" argument.
    *
    * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
    */
  
    createDebug.formatters = {};
    /**
    * Selects a color for a debug namespace
    * @param {String} namespace The namespace string for the for the debug instance to be colored
    * @return {Number|String} An ANSI color code for the given namespace
    * @api private
    */
  
    function selectColor(namespace) {
      var hash = 0;
  
      for (var i = 0; i < namespace.length; i++) {
        hash = (hash << 5) - hash + namespace.charCodeAt(i);
        hash |= 0; // Convert to 32bit integer
      }
  
      return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
    }
  
    createDebug.selectColor = selectColor;
    /**
    * Create a debugger with the given `namespace`.
    *
    * @param {String} namespace
    * @return {Function}
    * @api public
    */
  
    function createDebug(namespace) {
      var prevTime;
  
      function debug() {
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
  
        // Disabled?
        if (!debug.enabled) {
          return;
        }
  
        var self = debug; // Set `diff` timestamp
  
        var curr = Number(new Date());
        var ms = curr - (prevTime || curr);
        self.diff = ms;
        self.prev = prevTime;
        self.curr = curr;
        prevTime = curr;
        args[0] = createDebug.coerce(args[0]);
  
        if (typeof args[0] !== 'string') {
          // Anything else let's inspect with %O
          args.unshift('%O');
        } // Apply any `formatters` transformations
  
  
        var index = 0;
        args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
          // If we encounter an escaped % then don't increase the array index
          if (match === '%%') {
            return match;
          }
  
          index++;
          var formatter = createDebug.formatters[format];
  
          if (typeof formatter === 'function') {
            var val = args[index];
            match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
  
            args.splice(index, 1);
            index--;
          }
  
          return match;
        }); // Apply env-specific formatting (colors, etc.)
  
        createDebug.formatArgs.call(self, args);
        var logFn = self.log || createDebug.log;
        logFn.apply(self, args);
      }
  
      debug.namespace = namespace;
      debug.enabled = createDebug.enabled(namespace);
      debug.useColors = createDebug.useColors();
      debug.color = selectColor(namespace);
      debug.destroy = destroy;
      debug.extend = extend; // Debug.formatArgs = formatArgs;
      // debug.rawLog = rawLog;
      // env-specific initialization logic for debug instances
  
      if (typeof createDebug.init === 'function') {
        createDebug.init(debug);
      }
  
      createDebug.instances.push(debug);
      return debug;
    }
  
    function destroy() {
      var index = createDebug.instances.indexOf(this);
  
      if (index !== -1) {
        createDebug.instances.splice(index, 1);
        return true;
      }
  
      return false;
    }
  
    function extend(namespace, delimiter) {
      var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
      newDebug.log = this.log;
      return newDebug;
    }
    /**
    * Enables a debug mode by namespaces. This can include modes
    * separated by a colon and wildcards.
    *
    * @param {String} namespaces
    * @api public
    */
  
  
    function enable(namespaces) {
      createDebug.save(namespaces);
      createDebug.names = [];
      createDebug.skips = [];
      var i;
      var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
      var len = split.length;
  
      for (i = 0; i < len; i++) {
        if (!split[i]) {
          // ignore empty strings
          continue;
        }
  
        namespaces = split[i].replace(/\*/g, '.*?');
  
        if (namespaces[0] === '-') {
          createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
        } else {
          createDebug.names.push(new RegExp('^' + namespaces + '$'));
        }
      }
  
      for (i = 0; i < createDebug.instances.length; i++) {
        var instance = createDebug.instances[i];
        instance.enabled = createDebug.enabled(instance.namespace);
      }
    }
    /**
    * Disable debug output.
    *
    * @return {String} namespaces
    * @api public
    */
  
  
    function disable() {
      var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
        return '-' + namespace;
      }))).join(',');
      createDebug.enable('');
      return namespaces;
    }
    /**
    * Returns true if the given mode name is enabled, false otherwise.
    *
    * @param {String} name
    * @return {Boolean}
    * @api public
    */
  
  
    function enabled(name) {
      if (name[name.length - 1] === '*') {
        return true;
      }
  
      var i;
      var len;
  
      for (i = 0, len = createDebug.skips.length; i < len; i++) {
        if (createDebug.skips[i].test(name)) {
          return false;
        }
      }
  
      for (i = 0, len = createDebug.names.length; i < len; i++) {
        if (createDebug.names[i].test(name)) {
          return true;
        }
      }
  
      return false;
    }
    /**
    * Convert regexp to namespace
    *
    * @param {RegExp} regxep
    * @return {String} namespace
    * @api private
    */
  
  
    function toNamespace(regexp) {
      return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
    }
    /**
    * Coerce `val`.
    *
    * @param {Mixed} val
    * @return {Mixed}
    * @api private
    */
  
  
    function coerce(val) {
      if (val instanceof Error) {
        return val.stack || val.message;
      }
  
      return val;
    }
  
    createDebug.enable(createDebug.load());
    return createDebug;
  }
  
  module.exports = setup;
  
  /***/ }),
  /* 32 */
  /***/ (function(module, exports) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Helpers.
   */
  var s = 1000;
  var m = s * 60;
  var h = m * 60;
  var d = h * 24;
  var w = d * 7;
  var y = d * 365.25;
  /**
   * Parse or format the given `val`.
   *
   * Options:
   *
   *  - `long` verbose formatting [false]
   *
   * @param {String|Number} val
   * @param {Object} [options]
   * @throws {Error} throw an error if val is not a non-empty string or a number
   * @return {String|Number}
   * @api public
   */
  
  module.exports = function (val, options) {
    options = options || {};
  
    var type = _typeof(val);
  
    if (type === 'string' && val.length > 0) {
      return parse(val);
    } else if (type === 'number' && isFinite(val)) {
      return options["long"] ? fmtLong(val) : fmtShort(val);
    }
  
    throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  };
  /**
   * Parse the given `str` and return milliseconds.
   *
   * @param {String} str
   * @return {Number}
   * @api private
   */
  
  
  function parse(str) {
    str = String(str);
  
    if (str.length > 100) {
      return;
    }
  
    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);
  
    if (!match) {
      return;
    }
  
    var n = parseFloat(match[1]);
    var type = (match[2] || 'ms').toLowerCase();
  
    switch (type) {
      case 'years':
      case 'year':
      case 'yrs':
      case 'yr':
      case 'y':
        return n * y;
  
      case 'weeks':
      case 'week':
      case 'w':
        return n * w;
  
      case 'days':
      case 'day':
      case 'd':
        return n * d;
  
      case 'hours':
      case 'hour':
      case 'hrs':
      case 'hr':
      case 'h':
        return n * h;
  
      case 'minutes':
      case 'minute':
      case 'mins':
      case 'min':
      case 'm':
        return n * m;
  
      case 'seconds':
      case 'second':
      case 'secs':
      case 'sec':
      case 's':
        return n * s;
  
      case 'milliseconds':
      case 'millisecond':
      case 'msecs':
      case 'msec':
      case 'ms':
        return n;
  
      default:
        return undefined;
    }
  }
  /**
   * Short format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtShort(ms) {
    var msAbs = Math.abs(ms);
  
    if (msAbs >= d) {
      return Math.round(ms / d) + 'd';
    }
  
    if (msAbs >= h) {
      return Math.round(ms / h) + 'h';
    }
  
    if (msAbs >= m) {
      return Math.round(ms / m) + 'm';
    }
  
    if (msAbs >= s) {
      return Math.round(ms / s) + 's';
    }
  
    return ms + 'ms';
  }
  /**
   * Long format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtLong(ms) {
    var msAbs = Math.abs(ms);
  
    if (msAbs >= d) {
      return plural(ms, msAbs, d, 'day');
    }
  
    if (msAbs >= h) {
      return plural(ms, msAbs, h, 'hour');
    }
  
    if (msAbs >= m) {
      return plural(ms, msAbs, m, 'minute');
    }
  
    if (msAbs >= s) {
      return plural(ms, msAbs, s, 'second');
    }
  
    return ms + ' ms';
  }
  /**
   * Pluralization helper.
   */
  
  
  function plural(ms, msAbs, n, name) {
    var isPlural = msAbs >= n * 1.5;
    return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  }
  
  /***/ }),
  /* 33 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(process) {function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * This is the web browser implementation of `debug()`.
   *
   * Expose `debug()` as the module.
   */
  exports = module.exports = __webpack_require__(34);
  exports.log = log;
  exports.formatArgs = formatArgs;
  exports.save = save;
  exports.load = load;
  exports.useColors = useColors;
  exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
  /**
   * Colors.
   */
  
  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'];
  /**
   * Currently only WebKit-based Web Inspectors, Firefox >= v31,
   * and the Firebug extension (any Firefox version) are known
   * to support "%c" CSS customizations.
   *
   * TODO: add a `localStorage` variable to explicitly enable/disable colors
   */
  
  function useColors() {
    // NB: In an Electron preload script, document will be defined but not fully
    // initialized. Since we know we're in Chrome, we'll just detect this case
    // explicitly
    if (typeof window !== 'undefined' && window.process && window.process.type === 'renderer') {
      return true;
    } // Internet Explorer and Edge do not support colors.
  
  
    if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
      return false;
    } // is webkit? http://stackoverflow.com/a/16459606/376773
    // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
  
  
    return typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // is firebug? http://stackoverflow.com/a/398120/376773
    typeof window !== 'undefined' && window.console && (window.console.firebug || window.console.exception && window.console.table) || // is firefox >= v31?
    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31 || // double check webkit in userAgent just in case we are in a worker
    typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
  }
  /**
   * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
   */
  
  
  exports.formatters.j = function (v) {
    try {
      return JSON.stringify(v);
    } catch (err) {
      return '[UnexpectedJSONParseError]: ' + err.message;
    }
  };
  /**
   * Colorize log arguments if enabled.
   *
   * @api public
   */
  
  
  function formatArgs(args) {
    var useColors = this.useColors;
    args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
    if (!useColors) return;
    var c = 'color: ' + this.color;
    args.splice(1, 0, c, 'color: inherit'); // the final "%c" is somewhat tricky, because there could be other
    // arguments passed either before or after the %c, so we need to
    // figure out the correct index to insert the CSS into
  
    var index = 0;
    var lastC = 0;
    args[0].replace(/%[a-zA-Z%]/g, function (match) {
      if ('%%' === match) return;
      index++;
  
      if ('%c' === match) {
        // we only are interested in the *last* %c
        // (the user may have provided their own)
        lastC = index;
      }
    });
    args.splice(lastC, 0, c);
  }
  /**
   * Invokes `console.log()` when available.
   * No-op when `console.log` is not a "function".
   *
   * @api public
   */
  
  
  function log() {
    // this hackery is required for IE8/9, where
    // the `console.log` function doesn't have 'apply'
    return 'object' === (typeof console === "undefined" ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);
  }
  /**
   * Save `namespaces`.
   *
   * @param {String} namespaces
   * @api private
   */
  
  
  function save(namespaces) {
    try {
      if (null == namespaces) {
        exports.storage.removeItem('debug');
      } else {
        exports.storage.debug = namespaces;
      }
    } catch (e) {}
  }
  /**
   * Load `namespaces`.
   *
   * @return {String} returns the previously persisted debug modes
   * @api private
   */
  
  
  function load() {
    var r;
  
    try {
      r = exports.storage.debug;
    } catch (e) {} // If debug isn't set in LS, and we're in Electron, try to load $DEBUG
  
  
    if (!r && typeof process !== 'undefined' && 'env' in process) {
      r = process.env.DEBUG;
    }
  
    return r;
  }
  /**
   * Enable namespaces listed in `localStorage.debug` initially.
   */
  
  
  exports.enable(load());
  /**
   * Localstorage attempts to return the localstorage.
   *
   * This is necessary because safari throws
   * when a user disables cookies/localstorage
   * and you attempt to access it.
   *
   * @return {LocalStorage}
   * @api private
   */
  
  function localstorage() {
    try {
      return window.localStorage;
    } catch (e) {}
  }
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4)))
  
  /***/ }),
  /* 34 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /**
   * This is the common logic for both the Node.js and web browser
   * implementations of `debug()`.
   *
   * Expose `debug()` as the module.
   */
  exports = module.exports = createDebug.debug = createDebug['default'] = createDebug;
  exports.coerce = coerce;
  exports.disable = disable;
  exports.enable = enable;
  exports.enabled = enabled;
  exports.humanize = __webpack_require__(35);
  /**
   * Active `debug` instances.
   */
  
  exports.instances = [];
  /**
   * The currently active debug mode names, and names to skip.
   */
  
  exports.names = [];
  exports.skips = [];
  /**
   * Map of special "%n" handling functions, for the debug "format" argument.
   *
   * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
   */
  
  exports.formatters = {};
  /**
   * Select a color.
   * @param {String} namespace
   * @return {Number}
   * @api private
   */
  
  function selectColor(namespace) {
    var hash = 0,
        i;
  
    for (i in namespace) {
      hash = (hash << 5) - hash + namespace.charCodeAt(i);
      hash |= 0; // Convert to 32bit integer
    }
  
    return exports.colors[Math.abs(hash) % exports.colors.length];
  }
  /**
   * Create a debugger with the given `namespace`.
   *
   * @param {String} namespace
   * @return {Function}
   * @api public
   */
  
  
  function createDebug(namespace) {
    var prevTime;
  
    function debug() {
      // disabled?
      if (!debug.enabled) return;
      var self = debug; // set `diff` timestamp
  
      var curr = +new Date();
      var ms = curr - (prevTime || curr);
      self.diff = ms;
      self.prev = prevTime;
      self.curr = curr;
      prevTime = curr; // turn the `arguments` into a proper Array
  
      var args = new Array(arguments.length);
  
      for (var i = 0; i < args.length; i++) {
        args[i] = arguments[i];
      }
  
      args[0] = exports.coerce(args[0]);
  
      if ('string' !== typeof args[0]) {
        // anything else let's inspect with %O
        args.unshift('%O');
      } // apply any `formatters` transformations
  
  
      var index = 0;
      args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
        // if we encounter an escaped % then don't increase the array index
        if (match === '%%') return match;
        index++;
        var formatter = exports.formatters[format];
  
        if ('function' === typeof formatter) {
          var val = args[index];
          match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`
  
          args.splice(index, 1);
          index--;
        }
  
        return match;
      }); // apply env-specific formatting (colors, etc.)
  
      exports.formatArgs.call(self, args);
      var logFn = debug.log || exports.log || console.log.bind(console);
      logFn.apply(self, args);
    }
  
    debug.namespace = namespace;
    debug.enabled = exports.enabled(namespace);
    debug.useColors = exports.useColors();
    debug.color = selectColor(namespace);
    debug.destroy = destroy; // env-specific initialization logic for debug instances
  
    if ('function' === typeof exports.init) {
      exports.init(debug);
    }
  
    exports.instances.push(debug);
    return debug;
  }
  
  function destroy() {
    var index = exports.instances.indexOf(this);
  
    if (index !== -1) {
      exports.instances.splice(index, 1);
      return true;
    } else {
      return false;
    }
  }
  /**
   * Enables a debug mode by namespaces. This can include modes
   * separated by a colon and wildcards.
   *
   * @param {String} namespaces
   * @api public
   */
  
  
  function enable(namespaces) {
    exports.save(namespaces);
    exports.names = [];
    exports.skips = [];
    var i;
    var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
    var len = split.length;
  
    for (i = 0; i < len; i++) {
      if (!split[i]) continue; // ignore empty strings
  
      namespaces = split[i].replace(/\*/g, '.*?');
  
      if (namespaces[0] === '-') {
        exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
      } else {
        exports.names.push(new RegExp('^' + namespaces + '$'));
      }
    }
  
    for (i = 0; i < exports.instances.length; i++) {
      var instance = exports.instances[i];
      instance.enabled = exports.enabled(instance.namespace);
    }
  }
  /**
   * Disable debug output.
   *
   * @api public
   */
  
  
  function disable() {
    exports.enable('');
  }
  /**
   * Returns true if the given mode name is enabled, false otherwise.
   *
   * @param {String} name
   * @return {Boolean}
   * @api public
   */
  
  
  function enabled(name) {
    if (name[name.length - 1] === '*') {
      return true;
    }
  
    var i, len;
  
    for (i = 0, len = exports.skips.length; i < len; i++) {
      if (exports.skips[i].test(name)) {
        return false;
      }
    }
  
    for (i = 0, len = exports.names.length; i < len; i++) {
      if (exports.names[i].test(name)) {
        return true;
      }
    }
  
    return false;
  }
  /**
   * Coerce `val`.
   *
   * @param {Mixed} val
   * @return {Mixed}
   * @api private
   */
  
  
  function coerce(val) {
    if (val instanceof Error) return val.stack || val.message;
    return val;
  }
  
  /***/ }),
  /* 35 */
  /***/ (function(module, exports) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Helpers.
   */
  var s = 1000;
  var m = s * 60;
  var h = m * 60;
  var d = h * 24;
  var y = d * 365.25;
  /**
   * Parse or format the given `val`.
   *
   * Options:
   *
   *  - `long` verbose formatting [false]
   *
   * @param {String|Number} val
   * @param {Object} [options]
   * @throws {Error} throw an error if val is not a non-empty string or a number
   * @return {String|Number}
   * @api public
   */
  
  module.exports = function (val, options) {
    options = options || {};
  
    var type = _typeof(val);
  
    if (type === 'string' && val.length > 0) {
      return parse(val);
    } else if (type === 'number' && isNaN(val) === false) {
      return options["long"] ? fmtLong(val) : fmtShort(val);
    }
  
    throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  };
  /**
   * Parse the given `str` and return milliseconds.
   *
   * @param {String} str
   * @return {Number}
   * @api private
   */
  
  
  function parse(str) {
    str = String(str);
  
    if (str.length > 100) {
      return;
    }
  
    var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
  
    if (!match) {
      return;
    }
  
    var n = parseFloat(match[1]);
    var type = (match[2] || 'ms').toLowerCase();
  
    switch (type) {
      case 'years':
      case 'year':
      case 'yrs':
      case 'yr':
      case 'y':
        return n * y;
  
      case 'days':
      case 'day':
      case 'd':
        return n * d;
  
      case 'hours':
      case 'hour':
      case 'hrs':
      case 'hr':
      case 'h':
        return n * h;
  
      case 'minutes':
      case 'minute':
      case 'mins':
      case 'min':
      case 'm':
        return n * m;
  
      case 'seconds':
      case 'second':
      case 'secs':
      case 'sec':
      case 's':
        return n * s;
  
      case 'milliseconds':
      case 'millisecond':
      case 'msecs':
      case 'msec':
      case 'ms':
        return n;
  
      default:
        return undefined;
    }
  }
  /**
   * Short format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtShort(ms) {
    if (ms >= d) {
      return Math.round(ms / d) + 'd';
    }
  
    if (ms >= h) {
      return Math.round(ms / h) + 'h';
    }
  
    if (ms >= m) {
      return Math.round(ms / m) + 'm';
    }
  
    if (ms >= s) {
      return Math.round(ms / s) + 's';
    }
  
    return ms + 'ms';
  }
  /**
   * Long format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtLong(ms) {
    return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
  }
  /**
   * Pluralization helper.
   */
  
  
  function plural(ms, n, name) {
    if (ms < n) {
      return;
    }
  
    if (ms < n * 1.5) {
      return Math.floor(ms / n) + ' ' + name;
    }
  
    return Math.ceil(ms / n) + ' ' + name + 's';
  }
  
  /***/ }),
  /* 36 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /*global Blob,File*/
  
  /**
   * Module requirements
   */
  var isArray = __webpack_require__(13);
  
  var isBuf = __webpack_require__(14);
  
  var toString = Object.prototype.toString;
  var withNativeBlob = typeof Blob === 'function' || typeof Blob !== 'undefined' && toString.call(Blob) === '[object BlobConstructor]';
  var withNativeFile = typeof File === 'function' || typeof File !== 'undefined' && toString.call(File) === '[object FileConstructor]';
  /**
   * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.
   * Anything with blobs or files should be fed through removeBlobs before coming
   * here.
   *
   * @param {Object} packet - socket.io event packet
   * @return {Object} with deconstructed packet and list of buffers
   * @api public
   */
  
  exports.deconstructPacket = function (packet) {
    var buffers = [];
    var packetData = packet.data;
    var pack = packet;
    pack.data = _deconstructPacket(packetData, buffers);
    pack.attachments = buffers.length; // number of binary 'attachments'
  
    return {
      packet: pack,
      buffers: buffers
    };
  };
  
  function _deconstructPacket(data, buffers) {
    if (!data) return data;
  
    if (isBuf(data)) {
      var placeholder = {
        _placeholder: true,
        num: buffers.length
      };
      buffers.push(data);
      return placeholder;
    } else if (isArray(data)) {
      var newData = new Array(data.length);
  
      for (var i = 0; i < data.length; i++) {
        newData[i] = _deconstructPacket(data[i], buffers);
      }
  
      return newData;
    } else if (_typeof(data) === 'object' && !(data instanceof Date)) {
      var newData = {};
  
      for (var key in data) {
        newData[key] = _deconstructPacket(data[key], buffers);
      }
  
      return newData;
    }
  
    return data;
  }
  /**
   * Reconstructs a binary packet from its placeholder packet and buffers
   *
   * @param {Object} packet - event packet with placeholders
   * @param {Array} buffers - binary buffers to put in placeholder positions
   * @return {Object} reconstructed packet
   * @api public
   */
  
  
  exports.reconstructPacket = function (packet, buffers) {
    packet.data = _reconstructPacket(packet.data, buffers);
    packet.attachments = undefined; // no longer useful
  
    return packet;
  };
  
  function _reconstructPacket(data, buffers) {
    if (!data) return data;
  
    if (data && data._placeholder) {
      return buffers[data.num]; // appropriate buffer (should be natural order anyway)
    } else if (isArray(data)) {
      for (var i = 0; i < data.length; i++) {
        data[i] = _reconstructPacket(data[i], buffers);
      }
    } else if (_typeof(data) === 'object') {
      for (var key in data) {
        data[key] = _reconstructPacket(data[key], buffers);
      }
    }
  
    return data;
  }
  /**
   * Asynchronously removes Blobs or Files from data via
   * FileReader's readAsArrayBuffer method. Used before encoding
   * data as msgpack. Calls callback with the blobless data.
   *
   * @param {Object} data
   * @param {Function} callback
   * @api private
   */
  
  
  exports.removeBlobs = function (data, callback) {
    function _removeBlobs(obj, curKey, containingObject) {
      if (!obj) return obj; // convert any blob
  
      if (withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File) {
        pendingBlobs++; // async filereader
  
        var fileReader = new FileReader();
  
        fileReader.onload = function () {
          // this.result == arraybuffer
          if (containingObject) {
            containingObject[curKey] = this.result;
          } else {
            bloblessData = this.result;
          } // if nothing pending its callback time
  
  
          if (! --pendingBlobs) {
            callback(bloblessData);
          }
        };
  
        fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer
      } else if (isArray(obj)) {
        // handle array
        for (var i = 0; i < obj.length; i++) {
          _removeBlobs(obj[i], i, obj);
        }
      } else if (_typeof(obj) === 'object' && !isBuf(obj)) {
        // and object
        for (var key in obj) {
          _removeBlobs(obj[key], key, obj);
        }
      }
    }
  
    var pendingBlobs = 0;
    var bloblessData = data;
  
    _removeBlobs(bloblessData);
  
    if (!pendingBlobs) {
      callback(bloblessData);
    }
  };
  
  /***/ }),
  /* 37 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  
  
  exports.byteLength = byteLength;
  exports.toByteArray = toByteArray;
  exports.fromByteArray = fromByteArray;
  var lookup = [];
  var revLookup = [];
  var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
  var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  
  for (var i = 0, len = code.length; i < len; ++i) {
    lookup[i] = code[i];
    revLookup[code.charCodeAt(i)] = i;
  } // Support decoding URL-safe base64 strings, as Node.js does.
  // See: https://en.wikipedia.org/wiki/Base64#URL_applications
  
  
  revLookup['-'.charCodeAt(0)] = 62;
  revLookup['_'.charCodeAt(0)] = 63;
  
  function getLens(b64) {
    var len = b64.length;
  
    if (len % 4 > 0) {
      throw new Error('Invalid string. Length must be a multiple of 4');
    } // Trim off extra bytes after placeholder bytes are found
    // See: https://github.com/beatgammit/base64-js/issues/42
  
  
    var validLen = b64.indexOf('=');
    if (validLen === -1) validLen = len;
    var placeHoldersLen = validLen === len ? 0 : 4 - validLen % 4;
    return [validLen, placeHoldersLen];
  } // base64 is 4/3 + up to two characters of the original data
  
  
  function byteLength(b64) {
    var lens = getLens(b64);
    var validLen = lens[0];
    var placeHoldersLen = lens[1];
    return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  }
  
  function _byteLength(b64, validLen, placeHoldersLen) {
    return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
  }
  
  function toByteArray(b64) {
    var tmp;
    var lens = getLens(b64);
    var validLen = lens[0];
    var placeHoldersLen = lens[1];
    var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
    var curByte = 0; // if there are placeholders, only get up to the last complete 4 chars
  
    var len = placeHoldersLen > 0 ? validLen - 4 : validLen;
    var i;
  
    for (i = 0; i < len; i += 4) {
      tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
      arr[curByte++] = tmp >> 16 & 0xFF;
      arr[curByte++] = tmp >> 8 & 0xFF;
      arr[curByte++] = tmp & 0xFF;
    }
  
    if (placeHoldersLen === 2) {
      tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
      arr[curByte++] = tmp & 0xFF;
    }
  
    if (placeHoldersLen === 1) {
      tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
      arr[curByte++] = tmp >> 8 & 0xFF;
      arr[curByte++] = tmp & 0xFF;
    }
  
    return arr;
  }
  
  function tripletToBase64(num) {
    return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
  }
  
  function encodeChunk(uint8, start, end) {
    var tmp;
    var output = [];
  
    for (var i = start; i < end; i += 3) {
      tmp = (uint8[i] << 16 & 0xFF0000) + (uint8[i + 1] << 8 & 0xFF00) + (uint8[i + 2] & 0xFF);
      output.push(tripletToBase64(tmp));
    }
  
    return output.join('');
  }
  
  function fromByteArray(uint8) {
    var tmp;
    var len = uint8.length;
    var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
  
    var parts = [];
    var maxChunkLength = 16383; // must be multiple of 3
    // go through the array every three bytes, we'll deal with trailing stuff later
  
    for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
      parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
    } // pad the end with zeros, but make sure to not forget the extra bytes
  
  
    if (extraBytes === 1) {
      tmp = uint8[len - 1];
      parts.push(lookup[tmp >> 2] + lookup[tmp << 4 & 0x3F] + '==');
    } else if (extraBytes === 2) {
      tmp = (uint8[len - 2] << 8) + uint8[len - 1];
      parts.push(lookup[tmp >> 10] + lookup[tmp >> 4 & 0x3F] + lookup[tmp << 2 & 0x3F] + '=');
    }
  
    return parts.join('');
  }
  
  /***/ }),
  /* 38 */
  /***/ (function(module, exports) {
  
  exports.read = function (buffer, offset, isLE, mLen, nBytes) {
    var e, m;
    var eLen = nBytes * 8 - mLen - 1;
    var eMax = (1 << eLen) - 1;
    var eBias = eMax >> 1;
    var nBits = -7;
    var i = isLE ? nBytes - 1 : 0;
    var d = isLE ? -1 : 1;
    var s = buffer[offset + i];
    i += d;
    e = s & (1 << -nBits) - 1;
    s >>= -nBits;
    nBits += eLen;
  
    for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  
    m = e & (1 << -nBits) - 1;
    e >>= -nBits;
    nBits += mLen;
  
    for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  
    if (e === 0) {
      e = 1 - eBias;
    } else if (e === eMax) {
      return m ? NaN : (s ? -1 : 1) * Infinity;
    } else {
      m = m + Math.pow(2, mLen);
      e = e - eBias;
    }
  
    return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
  };
  
  exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
    var e, m, c;
    var eLen = nBytes * 8 - mLen - 1;
    var eMax = (1 << eLen) - 1;
    var eBias = eMax >> 1;
    var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
    var i = isLE ? 0 : nBytes - 1;
    var d = isLE ? 1 : -1;
    var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
    value = Math.abs(value);
  
    if (isNaN(value) || value === Infinity) {
      m = isNaN(value) ? 1 : 0;
      e = eMax;
    } else {
      e = Math.floor(Math.log(value) / Math.LN2);
  
      if (value * (c = Math.pow(2, -e)) < 1) {
        e--;
        c *= 2;
      }
  
      if (e + eBias >= 1) {
        value += rt / c;
      } else {
        value += rt * Math.pow(2, 1 - eBias);
      }
  
      if (value * c >= 2) {
        e++;
        c /= 2;
      }
  
      if (e + eBias >= eMax) {
        m = 0;
        e = eMax;
      } else if (e + eBias >= 1) {
        m = (value * c - 1) * Math.pow(2, mLen);
        e = e + eBias;
      } else {
        m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
        e = 0;
      }
    }
  
    for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  
    e = e << mLen | m;
    eLen += mLen;
  
    for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  
    buffer[offset + i - d] |= s * 128;
  };
  
  /***/ }),
  /* 39 */
  /***/ (function(module, exports) {
  
  var toString = {}.toString;
  
  module.exports = Array.isArray || function (arr) {
    return toString.call(arr) == '[object Array]';
  };
  
  /***/ }),
  /* 40 */
  /***/ (function(module, exports, __webpack_require__) {
  
  module.exports = __webpack_require__(41);
  /**
   * Exports parser
   *
   * @api public
   *
   */
  
  module.exports.parser = __webpack_require__(2);
  
  /***/ }),
  /* 41 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Module dependencies.
   */
  var transports = __webpack_require__(16);
  
  var Emitter = __webpack_require__(0);
  
  var debug = __webpack_require__(7)('engine.io-client:socket');
  
  var index = __webpack_require__(20);
  
  var parser = __webpack_require__(2);
  
  var parseuri = __webpack_require__(12);
  
  var parseqs = __webpack_require__(5);
  /**
   * Module exports.
   */
  
  
  module.exports = Socket;
  /**
   * Socket constructor.
   *
   * @param {String|Object} uri or options
   * @param {Object} options
   * @api public
   */
  
  function Socket(uri, opts) {
    if (!(this instanceof Socket)) return new Socket(uri, opts);
    opts = opts || {};
  
    if (uri && 'object' === _typeof(uri)) {
      opts = uri;
      uri = null;
    }
  
    if (uri) {
      uri = parseuri(uri);
      opts.hostname = uri.host;
      opts.secure = uri.protocol === 'https' || uri.protocol === 'wss';
      opts.port = uri.port;
      if (uri.query) opts.query = uri.query;
    } else if (opts.host) {
      opts.hostname = parseuri(opts.host).host;
    }
  
    this.secure = null != opts.secure ? opts.secure : typeof location !== 'undefined' && 'https:' === location.protocol;
  
    if (opts.hostname && !opts.port) {
      // if no port is specified manually, use the protocol default
      opts.port = this.secure ? '443' : '80';
    }
  
    this.agent = opts.agent || false;
    this.hostname = opts.hostname || (typeof location !== 'undefined' ? location.hostname : 'localhost');
    this.port = opts.port || (typeof location !== 'undefined' && location.port ? location.port : this.secure ? 443 : 80);
    this.query = opts.query || {};
    if ('string' === typeof this.query) this.query = parseqs.decode(this.query);
    this.upgrade = false !== opts.upgrade;
    this.path = (opts.path || '/engine.io').replace(/\/$/, '') + '/';
    this.forceJSONP = !!opts.forceJSONP;
    this.jsonp = false !== opts.jsonp;
    this.forceBase64 = !!opts.forceBase64;
    this.enablesXDR = !!opts.enablesXDR;
    this.withCredentials = false !== opts.withCredentials;
    this.timestampParam = opts.timestampParam || 't';
    this.timestampRequests = opts.timestampRequests;
    this.transports = opts.transports || ['polling', 'websocket'];
    this.transportOptions = opts.transportOptions || {};
    this.readyState = '';
    this.writeBuffer = [];
    this.prevBufferLen = 0;
    this.policyPort = opts.policyPort || 843;
    this.rememberUpgrade = opts.rememberUpgrade || false;
    this.binaryType = null;
    this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;
    this.perMessageDeflate = false !== opts.perMessageDeflate ? opts.perMessageDeflate || {} : false;
    if (true === this.perMessageDeflate) this.perMessageDeflate = {};
  
    if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {
      this.perMessageDeflate.threshold = 1024;
    } // SSL options for Node.js client
  
  
    this.pfx = opts.pfx || null;
    this.key = opts.key || null;
    this.passphrase = opts.passphrase || null;
    this.cert = opts.cert || null;
    this.ca = opts.ca || null;
    this.ciphers = opts.ciphers || null;
    this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;
    this.forceNode = !!opts.forceNode; // detect ReactNative environment
  
    this.isReactNative = typeof navigator !== 'undefined' && typeof navigator.product === 'string' && navigator.product.toLowerCase() === 'reactnative'; // other options for Node.js or ReactNative client
  
    if (typeof self === 'undefined' || this.isReactNative) {
      if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {
        this.extraHeaders = opts.extraHeaders;
      }
  
      if (opts.localAddress) {
        this.localAddress = opts.localAddress;
      }
    } // set on handshake
  
  
    this.id = null;
    this.upgrades = null;
    this.pingInterval = null;
    this.pingTimeout = null; // set on heartbeat
  
    this.pingIntervalTimer = null;
    this.pingTimeoutTimer = null;
    this.open();
  }
  
  Socket.priorWebsocketSuccess = false;
  /**
   * Mix in `Emitter`.
   */
  
  Emitter(Socket.prototype);
  /**
   * Protocol version.
   *
   * @api public
   */
  
  Socket.protocol = parser.protocol; // this is an int
  
  /**
   * Expose deps for legacy compatibility
   * and standalone browser access.
   */
  
  Socket.Socket = Socket;
  Socket.Transport = __webpack_require__(11);
  Socket.transports = __webpack_require__(16);
  Socket.parser = __webpack_require__(2);
  /**
   * Creates transport of the given type.
   *
   * @param {String} transport name
   * @return {Transport}
   * @api private
   */
  
  Socket.prototype.createTransport = function (name) {
    debug('creating transport "%s"', name);
    var query = clone(this.query); // append engine.io protocol identifier
  
    query.EIO = parser.protocol; // transport name
  
    query.transport = name; // per-transport options
  
    var options = this.transportOptions[name] || {}; // session id if we already have one
  
    if (this.id) query.sid = this.id;
    var transport = new transports[name]({
      query: query,
      socket: this,
      agent: options.agent || this.agent,
      hostname: options.hostname || this.hostname,
      port: options.port || this.port,
      secure: options.secure || this.secure,
      path: options.path || this.path,
      forceJSONP: options.forceJSONP || this.forceJSONP,
      jsonp: options.jsonp || this.jsonp,
      forceBase64: options.forceBase64 || this.forceBase64,
      enablesXDR: options.enablesXDR || this.enablesXDR,
      withCredentials: options.withCredentials || this.withCredentials,
      timestampRequests: options.timestampRequests || this.timestampRequests,
      timestampParam: options.timestampParam || this.timestampParam,
      policyPort: options.policyPort || this.policyPort,
      pfx: options.pfx || this.pfx,
      key: options.key || this.key,
      passphrase: options.passphrase || this.passphrase,
      cert: options.cert || this.cert,
      ca: options.ca || this.ca,
      ciphers: options.ciphers || this.ciphers,
      rejectUnauthorized: options.rejectUnauthorized || this.rejectUnauthorized,
      perMessageDeflate: options.perMessageDeflate || this.perMessageDeflate,
      extraHeaders: options.extraHeaders || this.extraHeaders,
      forceNode: options.forceNode || this.forceNode,
      localAddress: options.localAddress || this.localAddress,
      requestTimeout: options.requestTimeout || this.requestTimeout,
      protocols: options.protocols || void 0,
      isReactNative: this.isReactNative
    });
    return transport;
  };
  
  function clone(obj) {
    var o = {};
  
    for (var i in obj) {
      if (obj.hasOwnProperty(i)) {
        o[i] = obj[i];
      }
    }
  
    return o;
  }
  /**
   * Initializes transport to use and starts probe.
   *
   * @api private
   */
  
  
  Socket.prototype.open = function () {
    var transport;
  
    if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') !== -1) {
      transport = 'websocket';
    } else if (0 === this.transports.length) {
      // Emit error on next tick so it can be listened to
      var self = this;
      setTimeout(function () {
        self.emit('error', 'No transports available');
      }, 0);
      return;
    } else {
      transport = this.transports[0];
    }
  
    this.readyState = 'opening'; // Retry with the next transport if the transport is disabled (jsonp: false)
  
    try {
      transport = this.createTransport(transport);
    } catch (e) {
      this.transports.shift();
      this.open();
      return;
    }
  
    transport.open();
    this.setTransport(transport);
  };
  /**
   * Sets the current transport. Disables the existing one (if any).
   *
   * @api private
   */
  
  
  Socket.prototype.setTransport = function (transport) {
    debug('setting transport %s', transport.name);
    var self = this;
  
    if (this.transport) {
      debug('clearing existing transport %s', this.transport.name);
      this.transport.removeAllListeners();
    } // set up transport
  
  
    this.transport = transport; // set up transport listeners
  
    transport.on('drain', function () {
      self.onDrain();
    }).on('packet', function (packet) {
      self.onPacket(packet);
    }).on('error', function (e) {
      self.onError(e);
    }).on('close', function () {
      self.onClose('transport close');
    });
  };
  /**
   * Probes a transport.
   *
   * @param {String} transport name
   * @api private
   */
  
  
  Socket.prototype.probe = function (name) {
    debug('probing transport "%s"', name);
    var transport = this.createTransport(name, {
      probe: 1
    });
    var failed = false;
    var self = this;
    Socket.priorWebsocketSuccess = false;
  
    function onTransportOpen() {
      if (self.onlyBinaryUpgrades) {
        var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;
        failed = failed || upgradeLosesBinary;
      }
  
      if (failed) return;
      debug('probe transport "%s" opened', name);
      transport.send([{
        type: 'ping',
        data: 'probe'
      }]);
      transport.once('packet', function (msg) {
        if (failed) return;
  
        if ('pong' === msg.type && 'probe' === msg.data) {
          debug('probe transport "%s" pong', name);
          self.upgrading = true;
          self.emit('upgrading', transport);
          if (!transport) return;
          Socket.priorWebsocketSuccess = 'websocket' === transport.name;
          debug('pausing current transport "%s"', self.transport.name);
          self.transport.pause(function () {
            if (failed) return;
            if ('closed' === self.readyState) return;
            debug('changing transport and sending upgrade packet');
            cleanup();
            self.setTransport(transport);
            transport.send([{
              type: 'upgrade'
            }]);
            self.emit('upgrade', transport);
            transport = null;
            self.upgrading = false;
            self.flush();
          });
        } else {
          debug('probe transport "%s" failed', name);
          var err = new Error('probe error');
          err.transport = transport.name;
          self.emit('upgradeError', err);
        }
      });
    }
  
    function freezeTransport() {
      if (failed) return; // Any callback called by transport should be ignored since now
  
      failed = true;
      cleanup();
      transport.close();
      transport = null;
    } // Handle any error that happens while probing
  
  
    function onerror(err) {
      var error = new Error('probe error: ' + err);
      error.transport = transport.name;
      freezeTransport();
      debug('probe transport "%s" failed because of error: %s', name, err);
      self.emit('upgradeError', error);
    }
  
    function onTransportClose() {
      onerror('transport closed');
    } // When the socket is closed while we're probing
  
  
    function onclose() {
      onerror('socket closed');
    } // When the socket is upgraded while we're probing
  
  
    function onupgrade(to) {
      if (transport && to.name !== transport.name) {
        debug('"%s" works - aborting "%s"', to.name, transport.name);
        freezeTransport();
      }
    } // Remove all listeners on the transport and on self
  
  
    function cleanup() {
      transport.removeListener('open', onTransportOpen);
      transport.removeListener('error', onerror);
      transport.removeListener('close', onTransportClose);
      self.removeListener('close', onclose);
      self.removeListener('upgrading', onupgrade);
    }
  
    transport.once('open', onTransportOpen);
    transport.once('error', onerror);
    transport.once('close', onTransportClose);
    this.once('close', onclose);
    this.once('upgrading', onupgrade);
    transport.open();
  };
  /**
   * Called when connection is deemed open.
   *
   * @api public
   */
  
  
  Socket.prototype.onOpen = function () {
    debug('socket open');
    this.readyState = 'open';
    Socket.priorWebsocketSuccess = 'websocket' === this.transport.name;
    this.emit('open');
    this.flush(); // we check for `readyState` in case an `open`
    // listener already closed the socket
  
    if ('open' === this.readyState && this.upgrade && this.transport.pause) {
      debug('starting upgrade probes');
  
      for (var i = 0, l = this.upgrades.length; i < l; i++) {
        this.probe(this.upgrades[i]);
      }
    }
  };
  /**
   * Handles a packet.
   *
   * @api private
   */
  
  
  Socket.prototype.onPacket = function (packet) {
    if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
      debug('socket receive: type "%s", data "%s"', packet.type, packet.data);
      this.emit('packet', packet); // Socket is live - any packet counts
  
      this.emit('heartbeat');
  
      switch (packet.type) {
        case 'open':
          this.onHandshake(JSON.parse(packet.data));
          break;
  
        case 'pong':
          this.setPing();
          this.emit('pong');
          break;
  
        case 'error':
          var err = new Error('server error');
          err.code = packet.data;
          this.onError(err);
          break;
  
        case 'message':
          this.emit('data', packet.data);
          this.emit('message', packet.data);
          break;
      }
    } else {
      debug('packet received with socket readyState "%s"', this.readyState);
    }
  };
  /**
   * Called upon handshake completion.
   *
   * @param {Object} handshake obj
   * @api private
   */
  
  
  Socket.prototype.onHandshake = function (data) {
    this.emit('handshake', data);
    this.id = data.sid;
    this.transport.query.sid = data.sid;
    this.upgrades = this.filterUpgrades(data.upgrades);
    this.pingInterval = data.pingInterval;
    this.pingTimeout = data.pingTimeout;
    this.onOpen(); // In case open handler closes socket
  
    if ('closed' === this.readyState) return;
    this.setPing(); // Prolong liveness of socket on heartbeat
  
    this.removeListener('heartbeat', this.onHeartbeat);
    this.on('heartbeat', this.onHeartbeat);
  };
  /**
   * Resets ping timeout.
   *
   * @api private
   */
  
  
  Socket.prototype.onHeartbeat = function (timeout) {
    clearTimeout(this.pingTimeoutTimer);
    var self = this;
    self.pingTimeoutTimer = setTimeout(function () {
      if ('closed' === self.readyState) return;
      self.onClose('ping timeout');
    }, timeout || self.pingInterval + self.pingTimeout);
  };
  /**
   * Pings server every `this.pingInterval` and expects response
   * within `this.pingTimeout` or closes connection.
   *
   * @api private
   */
  
  
  Socket.prototype.setPing = function () {
    var self = this;
    clearTimeout(self.pingIntervalTimer);
    self.pingIntervalTimer = setTimeout(function () {
      debug('writing ping packet - expecting pong within %sms', self.pingTimeout);
      self.ping();
      self.onHeartbeat(self.pingTimeout);
    }, self.pingInterval);
  };
  /**
  * Sends a ping packet.
  *
  * @api private
  */
  
  
  Socket.prototype.ping = function () {
    var self = this;
    this.sendPacket('ping', function () {
      self.emit('ping');
    });
  };
  /**
   * Called on `drain` event
   *
   * @api private
   */
  
  
  Socket.prototype.onDrain = function () {
    this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important
    // for example, when upgrading, upgrade packet is sent over,
    // and a nonzero prevBufferLen could cause problems on `drain`
  
    this.prevBufferLen = 0;
  
    if (0 === this.writeBuffer.length) {
      this.emit('drain');
    } else {
      this.flush();
    }
  };
  /**
   * Flush write buffers.
   *
   * @api private
   */
  
  
  Socket.prototype.flush = function () {
    if ('closed' !== this.readyState && this.transport.writable && !this.upgrading && this.writeBuffer.length) {
      debug('flushing %d packets in socket', this.writeBuffer.length);
      this.transport.send(this.writeBuffer); // keep track of current length of writeBuffer
      // splice writeBuffer and callbackBuffer on `drain`
  
      this.prevBufferLen = this.writeBuffer.length;
      this.emit('flush');
    }
  };
  /**
   * Sends a message.
   *
   * @param {String} message.
   * @param {Function} callback function.
   * @param {Object} options.
   * @return {Socket} for chaining.
   * @api public
   */
  
  
  Socket.prototype.write = Socket.prototype.send = function (msg, options, fn) {
    this.sendPacket('message', msg, options, fn);
    return this;
  };
  /**
   * Sends a packet.
   *
   * @param {String} packet type.
   * @param {String} data.
   * @param {Object} options.
   * @param {Function} callback function.
   * @api private
   */
  
  
  Socket.prototype.sendPacket = function (type, data, options, fn) {
    if ('function' === typeof data) {
      fn = data;
      data = undefined;
    }
  
    if ('function' === typeof options) {
      fn = options;
      options = null;
    }
  
    if ('closing' === this.readyState || 'closed' === this.readyState) {
      return;
    }
  
    options = options || {};
    options.compress = false !== options.compress;
    var packet = {
      type: type,
      data: data,
      options: options
    };
    this.emit('packetCreate', packet);
    this.writeBuffer.push(packet);
    if (fn) this.once('flush', fn);
    this.flush();
  };
  /**
   * Closes the connection.
   *
   * @api private
   */
  
  
  Socket.prototype.close = function () {
    if ('opening' === this.readyState || 'open' === this.readyState) {
      this.readyState = 'closing';
      var self = this;
  
      if (this.writeBuffer.length) {
        this.once('drain', function () {
          if (this.upgrading) {
            waitForUpgrade();
          } else {
            close();
          }
        });
      } else if (this.upgrading) {
        waitForUpgrade();
      } else {
        close();
      }
    }
  
    function close() {
      self.onClose('forced close');
      debug('socket closing - telling transport to close');
      self.transport.close();
    }
  
    function cleanupAndClose() {
      self.removeListener('upgrade', cleanupAndClose);
      self.removeListener('upgradeError', cleanupAndClose);
      close();
    }
  
    function waitForUpgrade() {
      // wait for upgrade to finish since we can't send packets while pausing a transport
      self.once('upgrade', cleanupAndClose);
      self.once('upgradeError', cleanupAndClose);
    }
  
    return this;
  };
  /**
   * Called upon transport error
   *
   * @api private
   */
  
  
  Socket.prototype.onError = function (err) {
    debug('socket error %j', err);
    Socket.priorWebsocketSuccess = false;
    this.emit('error', err);
    this.onClose('transport error', err);
  };
  /**
   * Called upon transport close.
   *
   * @api private
   */
  
  
  Socket.prototype.onClose = function (reason, desc) {
    if ('opening' === this.readyState || 'open' === this.readyState || 'closing' === this.readyState) {
      debug('socket close with reason: "%s"', reason);
      var self = this; // clear timers
  
      clearTimeout(this.pingIntervalTimer);
      clearTimeout(this.pingTimeoutTimer); // stop event from firing again for transport
  
      this.transport.removeAllListeners('close'); // ensure transport won't stay open
  
      this.transport.close(); // ignore further transport communication
  
      this.transport.removeAllListeners(); // set ready state
  
      this.readyState = 'closed'; // clear session id
  
      this.id = null; // emit close event
  
      this.emit('close', reason, desc); // clean buffers after, so users can still
      // grab the buffers on `close` event
  
      self.writeBuffer = [];
      self.prevBufferLen = 0;
    }
  };
  /**
   * Filters upgrades, returning only those matching client transports.
   *
   * @param {Array} server upgrades
   * @api private
   *
   */
  
  
  Socket.prototype.filterUpgrades = function (upgrades) {
    var filteredUpgrades = [];
  
    for (var i = 0, j = upgrades.length; i < j; i++) {
      if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);
    }
  
    return filteredUpgrades;
  };
  
  /***/ }),
  /* 42 */
  /***/ (function(module, exports) {
  
  /**
   * Module exports.
   *
   * Logic borrowed from Modernizr:
   *
   *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js
   */
  try {
    module.exports = typeof XMLHttpRequest !== 'undefined' && 'withCredentials' in new XMLHttpRequest();
  } catch (err) {
    // if XMLHttp support is disabled in IE then it will throw
    // when trying to create
    module.exports = false;
  }
  
  /***/ }),
  /* 43 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* global attachEvent */
  
  /**
   * Module requirements.
   */
  var XMLHttpRequest = __webpack_require__(10);
  
  var Polling = __webpack_require__(17);
  
  var Emitter = __webpack_require__(0);
  
  var inherit = __webpack_require__(6);
  
  var debug = __webpack_require__(7)('engine.io-client:polling-xhr');
  /**
   * Module exports.
   */
  
  
  module.exports = XHR;
  module.exports.Request = Request;
  /**
   * Empty function
   */
  
  function empty() {}
  /**
   * XHR Polling constructor.
   *
   * @param {Object} opts
   * @api public
   */
  
  
  function XHR(opts) {
    Polling.call(this, opts);
    this.requestTimeout = opts.requestTimeout;
    this.extraHeaders = opts.extraHeaders;
  
    if (typeof location !== 'undefined') {
      var isSSL = 'https:' === location.protocol;
      var port = location.port; // some user agents have empty `location.port`
  
      if (!port) {
        port = isSSL ? 443 : 80;
      }
  
      this.xd = typeof location !== 'undefined' && opts.hostname !== location.hostname || port !== opts.port;
      this.xs = opts.secure !== isSSL;
    }
  }
  /**
   * Inherits from Polling.
   */
  
  
  inherit(XHR, Polling);
  /**
   * XHR supports binary
   */
  
  XHR.prototype.supportsBinary = true;
  /**
   * Creates a request.
   *
   * @param {String} method
   * @api private
   */
  
  XHR.prototype.request = function (opts) {
    opts = opts || {};
    opts.uri = this.uri();
    opts.xd = this.xd;
    opts.xs = this.xs;
    opts.agent = this.agent || false;
    opts.supportsBinary = this.supportsBinary;
    opts.enablesXDR = this.enablesXDR;
    opts.withCredentials = this.withCredentials; // SSL options for Node.js client
  
    opts.pfx = this.pfx;
    opts.key = this.key;
    opts.passphrase = this.passphrase;
    opts.cert = this.cert;
    opts.ca = this.ca;
    opts.ciphers = this.ciphers;
    opts.rejectUnauthorized = this.rejectUnauthorized;
    opts.requestTimeout = this.requestTimeout; // other options for Node.js client
  
    opts.extraHeaders = this.extraHeaders;
    return new Request(opts);
  };
  /**
   * Sends data.
   *
   * @param {String} data to send.
   * @param {Function} called upon flush.
   * @api private
   */
  
  
  XHR.prototype.doWrite = function (data, fn) {
    var isBinary = typeof data !== 'string' && data !== undefined;
    var req = this.request({
      method: 'POST',
      data: data,
      isBinary: isBinary
    });
    var self = this;
    req.on('success', fn);
    req.on('error', function (err) {
      self.onError('xhr post error', err);
    });
    this.sendXhr = req;
  };
  /**
   * Starts a poll cycle.
   *
   * @api private
   */
  
  
  XHR.prototype.doPoll = function () {
    debug('xhr poll');
    var req = this.request();
    var self = this;
    req.on('data', function (data) {
      self.onData(data);
    });
    req.on('error', function (err) {
      self.onError('xhr poll error', err);
    });
    this.pollXhr = req;
  };
  /**
   * Request constructor
   *
   * @param {Object} options
   * @api public
   */
  
  
  function Request(opts) {
    this.method = opts.method || 'GET';
    this.uri = opts.uri;
    this.xd = !!opts.xd;
    this.xs = !!opts.xs;
    this.async = false !== opts.async;
    this.data = undefined !== opts.data ? opts.data : null;
    this.agent = opts.agent;
    this.isBinary = opts.isBinary;
    this.supportsBinary = opts.supportsBinary;
    this.enablesXDR = opts.enablesXDR;
    this.withCredentials = opts.withCredentials;
    this.requestTimeout = opts.requestTimeout; // SSL options for Node.js client
  
    this.pfx = opts.pfx;
    this.key = opts.key;
    this.passphrase = opts.passphrase;
    this.cert = opts.cert;
    this.ca = opts.ca;
    this.ciphers = opts.ciphers;
    this.rejectUnauthorized = opts.rejectUnauthorized; // other options for Node.js client
  
    this.extraHeaders = opts.extraHeaders;
    this.create();
  }
  /**
   * Mix in `Emitter`.
   */
  
  
  Emitter(Request.prototype);
  /**
   * Creates the XHR object and sends the request.
   *
   * @api private
   */
  
  Request.prototype.create = function () {
    var opts = {
      agent: this.agent,
      xdomain: this.xd,
      xscheme: this.xs,
      enablesXDR: this.enablesXDR
    }; // SSL options for Node.js client
  
    opts.pfx = this.pfx;
    opts.key = this.key;
    opts.passphrase = this.passphrase;
    opts.cert = this.cert;
    opts.ca = this.ca;
    opts.ciphers = this.ciphers;
    opts.rejectUnauthorized = this.rejectUnauthorized;
    var xhr = this.xhr = new XMLHttpRequest(opts);
    var self = this;
  
    try {
      debug('xhr open %s: %s', this.method, this.uri);
      xhr.open(this.method, this.uri, this.async);
  
      try {
        if (this.extraHeaders) {
          xhr.setDisableHeaderCheck && xhr.setDisableHeaderCheck(true);
  
          for (var i in this.extraHeaders) {
            if (this.extraHeaders.hasOwnProperty(i)) {
              xhr.setRequestHeader(i, this.extraHeaders[i]);
            }
          }
        }
      } catch (e) {}
  
      if ('POST' === this.method) {
        try {
          if (this.isBinary) {
            xhr.setRequestHeader('Content-type', 'application/octet-stream');
          } else {
            xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');
          }
        } catch (e) {}
      }
  
      try {
        xhr.setRequestHeader('Accept', '*/*');
      } catch (e) {} // ie6 check
  
  
      if ('withCredentials' in xhr) {
        xhr.withCredentials = this.withCredentials;
      }
  
      if (this.requestTimeout) {
        xhr.timeout = this.requestTimeout;
      }
  
      if (this.hasXDR()) {
        xhr.onload = function () {
          self.onLoad();
        };
  
        xhr.onerror = function () {
          self.onError(xhr.responseText);
        };
      } else {
        xhr.onreadystatechange = function () {
          if (xhr.readyState === 2) {
            try {
              var contentType = xhr.getResponseHeader('Content-Type');
  
              if (self.supportsBinary && contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
                xhr.responseType = 'arraybuffer';
              }
            } catch (e) {}
          }
  
          if (4 !== xhr.readyState) return;
  
          if (200 === xhr.status || 1223 === xhr.status) {
            self.onLoad();
          } else {
            // make sure the `error` event handler that's user-set
            // does not throw in the same tick and gets caught here
            setTimeout(function () {
              self.onError(typeof xhr.status === 'number' ? xhr.status : 0);
            }, 0);
          }
        };
      }
  
      debug('xhr data %s', this.data);
      xhr.send(this.data);
    } catch (e) {
      // Need to defer since .create() is called directly fhrom the constructor
      // and thus the 'error' event can only be only bound *after* this exception
      // occurs.  Therefore, also, we cannot throw here at all.
      setTimeout(function () {
        self.onError(e);
      }, 0);
      return;
    }
  
    if (typeof document !== 'undefined') {
      this.index = Request.requestsCount++;
      Request.requests[this.index] = this;
    }
  };
  /**
   * Called upon successful response.
   *
   * @api private
   */
  
  
  Request.prototype.onSuccess = function () {
    this.emit('success');
    this.cleanup();
  };
  /**
   * Called if we have data.
   *
   * @api private
   */
  
  
  Request.prototype.onData = function (data) {
    this.emit('data', data);
    this.onSuccess();
  };
  /**
   * Called upon error.
   *
   * @api private
   */
  
  
  Request.prototype.onError = function (err) {
    this.emit('error', err);
    this.cleanup(true);
  };
  /**
   * Cleans up house.
   *
   * @api private
   */
  
  
  Request.prototype.cleanup = function (fromError) {
    if ('undefined' === typeof this.xhr || null === this.xhr) {
      return;
    } // xmlhttprequest
  
  
    if (this.hasXDR()) {
      this.xhr.onload = this.xhr.onerror = empty;
    } else {
      this.xhr.onreadystatechange = empty;
    }
  
    if (fromError) {
      try {
        this.xhr.abort();
      } catch (e) {}
    }
  
    if (typeof document !== 'undefined') {
      delete Request.requests[this.index];
    }
  
    this.xhr = null;
  };
  /**
   * Called upon load.
   *
   * @api private
   */
  
  
  Request.prototype.onLoad = function () {
    var data;
  
    try {
      var contentType;
  
      try {
        contentType = this.xhr.getResponseHeader('Content-Type');
      } catch (e) {}
  
      if (contentType === 'application/octet-stream' || contentType === 'application/octet-stream; charset=UTF-8') {
        data = this.xhr.response || this.xhr.responseText;
      } else {
        data = this.xhr.responseText;
      }
    } catch (e) {
      this.onError(e);
    }
  
    if (null != data) {
      this.onData(data);
    }
  };
  /**
   * Check if it has XDomainRequest.
   *
   * @api private
   */
  
  
  Request.prototype.hasXDR = function () {
    return typeof XDomainRequest !== 'undefined' && !this.xs && this.enablesXDR;
  };
  /**
   * Aborts the request.
   *
   * @api public
   */
  
  
  Request.prototype.abort = function () {
    this.cleanup();
  };
  /**
   * Aborts pending requests when unloading the window. This is needed to prevent
   * memory leaks (e.g. when using IE) and to ensure that no spurious error is
   * emitted.
   */
  
  
  Request.requestsCount = 0;
  Request.requests = {};
  
  if (typeof document !== 'undefined') {
    if (typeof attachEvent === 'function') {
      attachEvent('onunload', unloadHandler);
    } else if (typeof addEventListener === 'function') {
      var terminationEvent = 'onpagehide' in self ? 'pagehide' : 'unload';
      addEventListener(terminationEvent, unloadHandler, false);
    }
  }
  
  function unloadHandler() {
    for (var i in Request.requests) {
      if (Request.requests.hasOwnProperty(i)) {
        Request.requests[i].abort();
      }
    }
  }
  
  /***/ }),
  /* 44 */
  /***/ (function(module, exports) {
  
  /**
   * Gets the keys for an object.
   *
   * @return {Array} keys
   * @api private
   */
  module.exports = Object.keys || function keys(obj) {
    var arr = [];
    var has = Object.prototype.hasOwnProperty;
  
    for (var i in obj) {
      if (has.call(obj, i)) {
        arr.push(i);
      }
    }
  
    return arr;
  };
  
  /***/ }),
  /* 45 */
  /***/ (function(module, exports) {
  
  var toString = {}.toString;
  
  module.exports = Array.isArray || function (arr) {
    return toString.call(arr) == '[object Array]';
  };
  
  /***/ }),
  /* 46 */
  /***/ (function(module, exports) {
  
  /**
   * An abstraction for slicing an arraybuffer even when
   * ArrayBuffer.prototype.slice is not supported
   *
   * @api public
   */
  module.exports = function (arraybuffer, start, end) {
    var bytes = arraybuffer.byteLength;
    start = start || 0;
    end = end || bytes;
  
    if (arraybuffer.slice) {
      return arraybuffer.slice(start, end);
    }
  
    if (start < 0) {
      start += bytes;
    }
  
    if (end < 0) {
      end += bytes;
    }
  
    if (end > bytes) {
      end = bytes;
    }
  
    if (start >= bytes || start >= end || bytes === 0) {
      return new ArrayBuffer(0);
    }
  
    var abv = new Uint8Array(arraybuffer);
    var result = new Uint8Array(end - start);
  
    for (var i = start, ii = 0; i < end; i++, ii++) {
      result[ii] = abv[i];
    }
  
    return result.buffer;
  };
  
  /***/ }),
  /* 47 */
  /***/ (function(module, exports) {
  
  module.exports = after;
  
  function after(count, callback, err_cb) {
    var bail = false;
    err_cb = err_cb || noop;
    proxy.count = count;
    return count === 0 ? callback() : proxy;
  
    function proxy(err, result) {
      if (proxy.count <= 0) {
        throw new Error('after called too many times');
      }
  
      --proxy.count; // after first error, rest are passed to err_cb
  
      if (err) {
        bail = true;
        callback(err); // future error callbacks will go to error handler
  
        callback = err_cb;
      } else if (proxy.count === 0 && !bail) {
        callback(null, result);
      }
    }
  }
  
  function noop() {}
  
  /***/ }),
  /* 48 */
  /***/ (function(module, exports) {
  
  /*! https://mths.be/utf8js v2.1.2 by @mathias */
  var stringFromCharCode = String.fromCharCode; // Taken from https://mths.be/punycode
  
  function ucs2decode(string) {
    var output = [];
    var counter = 0;
    var length = string.length;
    var value;
    var extra;
  
    while (counter < length) {
      value = string.charCodeAt(counter++);
  
      if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
        // high surrogate, and there is a next character
        extra = string.charCodeAt(counter++);
  
        if ((extra & 0xFC00) == 0xDC00) {
          // low surrogate
          output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
        } else {
          // unmatched surrogate; only append this code unit, in case the next
          // code unit is the high surrogate of a surrogate pair
          output.push(value);
          counter--;
        }
      } else {
        output.push(value);
      }
    }
  
    return output;
  } // Taken from https://mths.be/punycode
  
  
  function ucs2encode(array) {
    var length = array.length;
    var index = -1;
    var value;
    var output = '';
  
    while (++index < length) {
      value = array[index];
  
      if (value > 0xFFFF) {
        value -= 0x10000;
        output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
        value = 0xDC00 | value & 0x3FF;
      }
  
      output += stringFromCharCode(value);
    }
  
    return output;
  }
  
  function checkScalarValue(codePoint, strict) {
    if (codePoint >= 0xD800 && codePoint <= 0xDFFF) {
      if (strict) {
        throw Error('Lone surrogate U+' + codePoint.toString(16).toUpperCase() + ' is not a scalar value');
      }
  
      return false;
    }
  
    return true;
  }
  /*--------------------------------------------------------------------------*/
  
  
  function createByte(codePoint, shift) {
    return stringFromCharCode(codePoint >> shift & 0x3F | 0x80);
  }
  
  function encodeCodePoint(codePoint, strict) {
    if ((codePoint & 0xFFFFFF80) == 0) {
      // 1-byte sequence
      return stringFromCharCode(codePoint);
    }
  
    var symbol = '';
  
    if ((codePoint & 0xFFFFF800) == 0) {
      // 2-byte sequence
      symbol = stringFromCharCode(codePoint >> 6 & 0x1F | 0xC0);
    } else if ((codePoint & 0xFFFF0000) == 0) {
      // 3-byte sequence
      if (!checkScalarValue(codePoint, strict)) {
        codePoint = 0xFFFD;
      }
  
      symbol = stringFromCharCode(codePoint >> 12 & 0x0F | 0xE0);
      symbol += createByte(codePoint, 6);
    } else if ((codePoint & 0xFFE00000) == 0) {
      // 4-byte sequence
      symbol = stringFromCharCode(codePoint >> 18 & 0x07 | 0xF0);
      symbol += createByte(codePoint, 12);
      symbol += createByte(codePoint, 6);
    }
  
    symbol += stringFromCharCode(codePoint & 0x3F | 0x80);
    return symbol;
  }
  
  function utf8encode(string, opts) {
    opts = opts || {};
    var strict = false !== opts.strict;
    var codePoints = ucs2decode(string);
    var length = codePoints.length;
    var index = -1;
    var codePoint;
    var byteString = '';
  
    while (++index < length) {
      codePoint = codePoints[index];
      byteString += encodeCodePoint(codePoint, strict);
    }
  
    return byteString;
  }
  /*--------------------------------------------------------------------------*/
  
  
  function readContinuationByte() {
    if (byteIndex >= byteCount) {
      throw Error('Invalid byte index');
    }
  
    var continuationByte = byteArray[byteIndex] & 0xFF;
    byteIndex++;
  
    if ((continuationByte & 0xC0) == 0x80) {
      return continuationByte & 0x3F;
    } // If we end up here, it’s not a continuation byte
  
  
    throw Error('Invalid continuation byte');
  }
  
  function decodeSymbol(strict) {
    var byte1;
    var byte2;
    var byte3;
    var byte4;
    var codePoint;
  
    if (byteIndex > byteCount) {
      throw Error('Invalid byte index');
    }
  
    if (byteIndex == byteCount) {
      return false;
    } // Read first byte
  
  
    byte1 = byteArray[byteIndex] & 0xFF;
    byteIndex++; // 1-byte sequence (no continuation bytes)
  
    if ((byte1 & 0x80) == 0) {
      return byte1;
    } // 2-byte sequence
  
  
    if ((byte1 & 0xE0) == 0xC0) {
      byte2 = readContinuationByte();
      codePoint = (byte1 & 0x1F) << 6 | byte2;
  
      if (codePoint >= 0x80) {
        return codePoint;
      } else {
        throw Error('Invalid continuation byte');
      }
    } // 3-byte sequence (may include unpaired surrogates)
  
  
    if ((byte1 & 0xF0) == 0xE0) {
      byte2 = readContinuationByte();
      byte3 = readContinuationByte();
      codePoint = (byte1 & 0x0F) << 12 | byte2 << 6 | byte3;
  
      if (codePoint >= 0x0800) {
        return checkScalarValue(codePoint, strict) ? codePoint : 0xFFFD;
      } else {
        throw Error('Invalid continuation byte');
      }
    } // 4-byte sequence
  
  
    if ((byte1 & 0xF8) == 0xF0) {
      byte2 = readContinuationByte();
      byte3 = readContinuationByte();
      byte4 = readContinuationByte();
      codePoint = (byte1 & 0x07) << 0x12 | byte2 << 0x0C | byte3 << 0x06 | byte4;
  
      if (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {
        return codePoint;
      }
    }
  
    throw Error('Invalid UTF-8 detected');
  }
  
  var byteArray;
  var byteCount;
  var byteIndex;
  
  function utf8decode(byteString, opts) {
    opts = opts || {};
    var strict = false !== opts.strict;
    byteArray = ucs2decode(byteString);
    byteCount = byteArray.length;
    byteIndex = 0;
    var codePoints = [];
    var tmp;
  
    while ((tmp = decodeSymbol(strict)) !== false) {
      codePoints.push(tmp);
    }
  
    return ucs2encode(codePoints);
  }
  
  module.exports = {
    version: '2.1.2',
    encode: utf8encode,
    decode: utf8decode
  };
  
  /***/ }),
  /* 49 */
  /***/ (function(module, exports) {
  
  /*
   * base64-arraybuffer
   * https://github.com/niklasvh/base64-arraybuffer
   *
   * Copyright (c) 2012 Niklas von Hertzen
   * Licensed under the MIT license.
   */
  (function () {
    "use strict";
  
    var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // Use a lookup table to find the index.
  
    var lookup = new Uint8Array(256);
  
    for (var i = 0; i < chars.length; i++) {
      lookup[chars.charCodeAt(i)] = i;
    }
  
    exports.encode = function (arraybuffer) {
      var bytes = new Uint8Array(arraybuffer),
          i,
          len = bytes.length,
          base64 = "";
  
      for (i = 0; i < len; i += 3) {
        base64 += chars[bytes[i] >> 2];
        base64 += chars[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];
        base64 += chars[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];
        base64 += chars[bytes[i + 2] & 63];
      }
  
      if (len % 3 === 2) {
        base64 = base64.substring(0, base64.length - 1) + "=";
      } else if (len % 3 === 1) {
        base64 = base64.substring(0, base64.length - 2) + "==";
      }
  
      return base64;
    };
  
    exports.decode = function (base64) {
      var bufferLength = base64.length * 0.75,
          len = base64.length,
          i,
          p = 0,
          encoded1,
          encoded2,
          encoded3,
          encoded4;
  
      if (base64[base64.length - 1] === "=") {
        bufferLength--;
  
        if (base64[base64.length - 2] === "=") {
          bufferLength--;
        }
      }
  
      var arraybuffer = new ArrayBuffer(bufferLength),
          bytes = new Uint8Array(arraybuffer);
  
      for (i = 0; i < len; i += 4) {
        encoded1 = lookup[base64.charCodeAt(i)];
        encoded2 = lookup[base64.charCodeAt(i + 1)];
        encoded3 = lookup[base64.charCodeAt(i + 2)];
        encoded4 = lookup[base64.charCodeAt(i + 3)];
        bytes[p++] = encoded1 << 2 | encoded2 >> 4;
        bytes[p++] = (encoded2 & 15) << 4 | encoded3 >> 2;
        bytes[p++] = (encoded3 & 3) << 6 | encoded4 & 63;
      }
  
      return arraybuffer;
    };
  })();
  
  /***/ }),
  /* 50 */
  /***/ (function(module, exports) {
  
  /**
   * Create a blob builder even when vendor prefixes exist
   */
  var BlobBuilder = typeof BlobBuilder !== 'undefined' ? BlobBuilder : typeof WebKitBlobBuilder !== 'undefined' ? WebKitBlobBuilder : typeof MSBlobBuilder !== 'undefined' ? MSBlobBuilder : typeof MozBlobBuilder !== 'undefined' ? MozBlobBuilder : false;
  /**
   * Check if Blob constructor is supported
   */
  
  var blobSupported = function () {
    try {
      var a = new Blob(['hi']);
      return a.size === 2;
    } catch (e) {
      return false;
    }
  }();
  /**
   * Check if Blob constructor supports ArrayBufferViews
   * Fails in Safari 6, so we need to map to ArrayBuffers there.
   */
  
  
  var blobSupportsArrayBufferView = blobSupported && function () {
    try {
      var b = new Blob([new Uint8Array([1, 2])]);
      return b.size === 2;
    } catch (e) {
      return false;
    }
  }();
  /**
   * Check if BlobBuilder is supported
   */
  
  
  var blobBuilderSupported = BlobBuilder && BlobBuilder.prototype.append && BlobBuilder.prototype.getBlob;
  /**
   * Helper function that maps ArrayBufferViews to ArrayBuffers
   * Used by BlobBuilder constructor and old browsers that didn't
   * support it in the Blob constructor.
   */
  
  function mapArrayBufferViews(ary) {
    return ary.map(function (chunk) {
      if (chunk.buffer instanceof ArrayBuffer) {
        var buf = chunk.buffer; // if this is a subarray, make a copy so we only
        // include the subarray region from the underlying buffer
  
        if (chunk.byteLength !== buf.byteLength) {
          var copy = new Uint8Array(chunk.byteLength);
          copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));
          buf = copy.buffer;
        }
  
        return buf;
      }
  
      return chunk;
    });
  }
  
  function BlobBuilderConstructor(ary, options) {
    options = options || {};
    var bb = new BlobBuilder();
    mapArrayBufferViews(ary).forEach(function (part) {
      bb.append(part);
    });
    return options.type ? bb.getBlob(options.type) : bb.getBlob();
  }
  
  ;
  
  function BlobConstructor(ary, options) {
    return new Blob(mapArrayBufferViews(ary), options || {});
  }
  
  ;
  
  if (typeof Blob !== 'undefined') {
    BlobBuilderConstructor.prototype = Blob.prototype;
    BlobConstructor.prototype = Blob.prototype;
  }
  
  module.exports = function () {
    if (blobSupported) {
      return blobSupportsArrayBufferView ? Blob : BlobConstructor;
    } else if (blobBuilderSupported) {
      return BlobBuilderConstructor;
    } else {
      return undefined;
    }
  }();
  
  /***/ }),
  /* 51 */
  /***/ (function(module, exports, __webpack_require__) {
  
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
  
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
  
  function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
  
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
  
  /**
   * This is the common logic for both the Node.js and web browser
   * implementations of `debug()`.
   */
  function setup(env) {
    createDebug.debug = createDebug;
    createDebug["default"] = createDebug;
    createDebug.coerce = coerce;
    createDebug.disable = disable;
    createDebug.enable = enable;
    createDebug.enabled = enabled;
    createDebug.humanize = __webpack_require__(52);
    Object.keys(env).forEach(function (key) {
      createDebug[key] = env[key];
    });
    /**
    * Active `debug` instances.
    */
  
    createDebug.instances = [];
    /**
    * The currently active debug mode names, and names to skip.
    */
  
    createDebug.names = [];
    createDebug.skips = [];
    /**
    * Map of special "%n" handling functions, for the debug "format" argument.
    *
    * Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
    */
  
    createDebug.formatters = {};
    /**
    * Selects a color for a debug namespace
    * @param {String} namespace The namespace string for the for the debug instance to be colored
    * @return {Number|String} An ANSI color code for the given namespace
    * @api private
    */
  
    function selectColor(namespace) {
      var hash = 0;
  
      for (var i = 0; i < namespace.length; i++) {
        hash = (hash << 5) - hash + namespace.charCodeAt(i);
        hash |= 0; // Convert to 32bit integer
      }
  
      return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
    }
  
    createDebug.selectColor = selectColor;
    /**
    * Create a debugger with the given `namespace`.
    *
    * @param {String} namespace
    * @return {Function}
    * @api public
    */
  
    function createDebug(namespace) {
      var prevTime;
  
      function debug() {
        for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
          args[_key] = arguments[_key];
        }
  
        // Disabled?
        if (!debug.enabled) {
          return;
        }
  
        var self = debug; // Set `diff` timestamp
  
        var curr = Number(new Date());
        var ms = curr - (prevTime || curr);
        self.diff = ms;
        self.prev = prevTime;
        self.curr = curr;
        prevTime = curr;
        args[0] = createDebug.coerce(args[0]);
  
        if (typeof args[0] !== 'string') {
          // Anything else let's inspect with %O
          args.unshift('%O');
        } // Apply any `formatters` transformations
  
  
        var index = 0;
        args[0] = args[0].replace(/%([a-zA-Z%])/g, function (match, format) {
          // If we encounter an escaped % then don't increase the array index
          if (match === '%%') {
            return match;
          }
  
          index++;
          var formatter = createDebug.formatters[format];
  
          if (typeof formatter === 'function') {
            var val = args[index];
            match = formatter.call(self, val); // Now we need to remove `args[index]` since it's inlined in the `format`
  
            args.splice(index, 1);
            index--;
          }
  
          return match;
        }); // Apply env-specific formatting (colors, etc.)
  
        createDebug.formatArgs.call(self, args);
        var logFn = self.log || createDebug.log;
        logFn.apply(self, args);
      }
  
      debug.namespace = namespace;
      debug.enabled = createDebug.enabled(namespace);
      debug.useColors = createDebug.useColors();
      debug.color = selectColor(namespace);
      debug.destroy = destroy;
      debug.extend = extend; // Debug.formatArgs = formatArgs;
      // debug.rawLog = rawLog;
      // env-specific initialization logic for debug instances
  
      if (typeof createDebug.init === 'function') {
        createDebug.init(debug);
      }
  
      createDebug.instances.push(debug);
      return debug;
    }
  
    function destroy() {
      var index = createDebug.instances.indexOf(this);
  
      if (index !== -1) {
        createDebug.instances.splice(index, 1);
        return true;
      }
  
      return false;
    }
  
    function extend(namespace, delimiter) {
      var newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
      newDebug.log = this.log;
      return newDebug;
    }
    /**
    * Enables a debug mode by namespaces. This can include modes
    * separated by a colon and wildcards.
    *
    * @param {String} namespaces
    * @api public
    */
  
  
    function enable(namespaces) {
      createDebug.save(namespaces);
      createDebug.names = [];
      createDebug.skips = [];
      var i;
      var split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
      var len = split.length;
  
      for (i = 0; i < len; i++) {
        if (!split[i]) {
          // ignore empty strings
          continue;
        }
  
        namespaces = split[i].replace(/\*/g, '.*?');
  
        if (namespaces[0] === '-') {
          createDebug.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
        } else {
          createDebug.names.push(new RegExp('^' + namespaces + '$'));
        }
      }
  
      for (i = 0; i < createDebug.instances.length; i++) {
        var instance = createDebug.instances[i];
        instance.enabled = createDebug.enabled(instance.namespace);
      }
    }
    /**
    * Disable debug output.
    *
    * @return {String} namespaces
    * @api public
    */
  
  
    function disable() {
      var namespaces = [].concat(_toConsumableArray(createDebug.names.map(toNamespace)), _toConsumableArray(createDebug.skips.map(toNamespace).map(function (namespace) {
        return '-' + namespace;
      }))).join(',');
      createDebug.enable('');
      return namespaces;
    }
    /**
    * Returns true if the given mode name is enabled, false otherwise.
    *
    * @param {String} name
    * @return {Boolean}
    * @api public
    */
  
  
    function enabled(name) {
      if (name[name.length - 1] === '*') {
        return true;
      }
  
      var i;
      var len;
  
      for (i = 0, len = createDebug.skips.length; i < len; i++) {
        if (createDebug.skips[i].test(name)) {
          return false;
        }
      }
  
      for (i = 0, len = createDebug.names.length; i < len; i++) {
        if (createDebug.names[i].test(name)) {
          return true;
        }
      }
  
      return false;
    }
    /**
    * Convert regexp to namespace
    *
    * @param {RegExp} regxep
    * @return {String} namespace
    * @api private
    */
  
  
    function toNamespace(regexp) {
      return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, '*');
    }
    /**
    * Coerce `val`.
    *
    * @param {Mixed} val
    * @return {Mixed}
    * @api private
    */
  
  
    function coerce(val) {
      if (val instanceof Error) {
        return val.stack || val.message;
      }
  
      return val;
    }
  
    createDebug.enable(createDebug.load());
    return createDebug;
  }
  
  module.exports = setup;
  
  /***/ }),
  /* 52 */
  /***/ (function(module, exports) {
  
  function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  /**
   * Helpers.
   */
  var s = 1000;
  var m = s * 60;
  var h = m * 60;
  var d = h * 24;
  var w = d * 7;
  var y = d * 365.25;
  /**
   * Parse or format the given `val`.
   *
   * Options:
   *
   *  - `long` verbose formatting [false]
   *
   * @param {String|Number} val
   * @param {Object} [options]
   * @throws {Error} throw an error if val is not a non-empty string or a number
   * @return {String|Number}
   * @api public
   */
  
  module.exports = function (val, options) {
    options = options || {};
  
    var type = _typeof(val);
  
    if (type === 'string' && val.length > 0) {
      return parse(val);
    } else if (type === 'number' && isFinite(val)) {
      return options["long"] ? fmtLong(val) : fmtShort(val);
    }
  
    throw new Error('val is not a non-empty string or a valid number. val=' + JSON.stringify(val));
  };
  /**
   * Parse the given `str` and return milliseconds.
   *
   * @param {String} str
   * @return {Number}
   * @api private
   */
  
  
  function parse(str) {
    str = String(str);
  
    if (str.length > 100) {
      return;
    }
  
    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);
  
    if (!match) {
      return;
    }
  
    var n = parseFloat(match[1]);
    var type = (match[2] || 'ms').toLowerCase();
  
    switch (type) {
      case 'years':
      case 'year':
      case 'yrs':
      case 'yr':
      case 'y':
        return n * y;
  
      case 'weeks':
      case 'week':
      case 'w':
        return n * w;
  
      case 'days':
      case 'day':
      case 'd':
        return n * d;
  
      case 'hours':
      case 'hour':
      case 'hrs':
      case 'hr':
      case 'h':
        return n * h;
  
      case 'minutes':
      case 'minute':
      case 'mins':
      case 'min':
      case 'm':
        return n * m;
  
      case 'seconds':
      case 'second':
      case 'secs':
      case 'sec':
      case 's':
        return n * s;
  
      case 'milliseconds':
      case 'millisecond':
      case 'msecs':
      case 'msec':
      case 'ms':
        return n;
  
      default:
        return undefined;
    }
  }
  /**
   * Short format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtShort(ms) {
    var msAbs = Math.abs(ms);
  
    if (msAbs >= d) {
      return Math.round(ms / d) + 'd';
    }
  
    if (msAbs >= h) {
      return Math.round(ms / h) + 'h';
    }
  
    if (msAbs >= m) {
      return Math.round(ms / m) + 'm';
    }
  
    if (msAbs >= s) {
      return Math.round(ms / s) + 's';
    }
  
    return ms + 'ms';
  }
  /**
   * Long format for `ms`.
   *
   * @param {Number} ms
   * @return {String}
   * @api private
   */
  
  
  function fmtLong(ms) {
    var msAbs = Math.abs(ms);
  
    if (msAbs >= d) {
      return plural(ms, msAbs, d, 'day');
    }
  
    if (msAbs >= h) {
      return plural(ms, msAbs, h, 'hour');
    }
  
    if (msAbs >= m) {
      return plural(ms, msAbs, m, 'minute');
    }
  
    if (msAbs >= s) {
      return plural(ms, msAbs, s, 'second');
    }
  
    return ms + ' ms';
  }
  /**
   * Pluralization helper.
   */
  
  
  function plural(ms, msAbs, n, name) {
    var isPlural = msAbs >= n * 1.5;
    return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
  }
  
  /***/ }),
  /* 53 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global) {/**
   * Module requirements.
   */
  var Polling = __webpack_require__(17);
  
  var inherit = __webpack_require__(6);
  /**
   * Module exports.
   */
  
  
  module.exports = JSONPPolling;
  /**
   * Cached regular expressions.
   */
  
  var rNewline = /\n/g;
  var rEscapedNewline = /\\n/g;
  /**
   * Global JSONP callbacks.
   */
  
  var callbacks;
  /**
   * Noop.
   */
  
  function empty() {}
  /**
   * Until https://github.com/tc39/proposal-global is shipped.
   */
  
  
  function glob() {
    return typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : {};
  }
  /**
   * JSONP Polling constructor.
   *
   * @param {Object} opts.
   * @api public
   */
  
  
  function JSONPPolling(opts) {
    Polling.call(this, opts);
    this.query = this.query || {}; // define global callbacks array if not present
    // we do this here (lazily) to avoid unneeded global pollution
  
    if (!callbacks) {
      // we need to consider multiple engines in the same page
      var global = glob();
      callbacks = global.___eio = global.___eio || [];
    } // callback identifier
  
  
    this.index = callbacks.length; // add callback to jsonp global
  
    var self = this;
    callbacks.push(function (msg) {
      self.onData(msg);
    }); // append to query string
  
    this.query.j = this.index; // prevent spurious errors from being emitted when the window is unloaded
  
    if (typeof addEventListener === 'function') {
      addEventListener('beforeunload', function () {
        if (self.script) self.script.onerror = empty;
      }, false);
    }
  }
  /**
   * Inherits from Polling.
   */
  
  
  inherit(JSONPPolling, Polling);
  /*
   * JSONP only supports binary as base64 encoded strings
   */
  
  JSONPPolling.prototype.supportsBinary = false;
  /**
   * Closes the socket.
   *
   * @api private
   */
  
  JSONPPolling.prototype.doClose = function () {
    if (this.script) {
      this.script.parentNode.removeChild(this.script);
      this.script = null;
    }
  
    if (this.form) {
      this.form.parentNode.removeChild(this.form);
      this.form = null;
      this.iframe = null;
    }
  
    Polling.prototype.doClose.call(this);
  };
  /**
   * Starts a poll cycle.
   *
   * @api private
   */
  
  
  JSONPPolling.prototype.doPoll = function () {
    var self = this;
    var script = document.createElement('script');
  
    if (this.script) {
      this.script.parentNode.removeChild(this.script);
      this.script = null;
    }
  
    script.async = true;
    script.src = this.uri();
  
    script.onerror = function (e) {
      self.onError('jsonp poll error', e);
    };
  
    var insertAt = document.getElementsByTagName('script')[0];
  
    if (insertAt) {
      insertAt.parentNode.insertBefore(script, insertAt);
    } else {
      (document.head || document.body).appendChild(script);
    }
  
    this.script = script;
    var isUAgecko = 'undefined' !== typeof navigator && /gecko/i.test(navigator.userAgent);
  
    if (isUAgecko) {
      setTimeout(function () {
        var iframe = document.createElement('iframe');
        document.body.appendChild(iframe);
        document.body.removeChild(iframe);
      }, 100);
    }
  };
  /**
   * Writes with a hidden iframe.
   *
   * @param {String} data to send
   * @param {Function} called upon flush.
   * @api private
   */
  
  
  JSONPPolling.prototype.doWrite = function (data, fn) {
    var self = this;
  
    if (!this.form) {
      var form = document.createElement('form');
      var area = document.createElement('textarea');
      var id = this.iframeId = 'eio_iframe_' + this.index;
      var iframe;
      form.className = 'socketio';
      form.style.position = 'absolute';
      form.style.top = '-1000px';
      form.style.left = '-1000px';
      form.target = id;
      form.method = 'POST';
      form.setAttribute('accept-charset', 'utf-8');
      area.name = 'd';
      form.appendChild(area);
      document.body.appendChild(form);
      this.form = form;
      this.area = area;
    }
  
    this.form.action = this.uri();
  
    function complete() {
      initIframe();
      fn();
    }
  
    function initIframe() {
      if (self.iframe) {
        try {
          self.form.removeChild(self.iframe);
        } catch (e) {
          self.onError('jsonp polling iframe removal error', e);
        }
      }
  
      try {
        // ie6 dynamic iframes with target="" support (thanks Chris Lambacher)
        var html = '<iframe src="javascript:0" name="' + self.iframeId + '">';
        iframe = document.createElement(html);
      } catch (e) {
        iframe = document.createElement('iframe');
        iframe.name = self.iframeId;
        iframe.src = 'javascript:0';
      }
  
      iframe.id = self.iframeId;
      self.form.appendChild(iframe);
      self.iframe = iframe;
    }
  
    initIframe(); // escape \n to prevent it from being converted into \r\n by some UAs
    // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side
  
    data = data.replace(rEscapedNewline, '\\\n');
    this.area.value = data.replace(rNewline, '\\n');
  
    try {
      this.form.submit();
    } catch (e) {}
  
    if (this.iframe.attachEvent) {
      this.iframe.onreadystatechange = function () {
        if (self.iframe.readyState === 'complete') {
          complete();
        }
      };
    } else {
      this.iframe.onload = complete;
    }
  };
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
  
  /***/ }),
  /* 54 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(Buffer) {/**
   * Module dependencies.
   */
  var Transport = __webpack_require__(11);
  
  var parser = __webpack_require__(2);
  
  var parseqs = __webpack_require__(5);
  
  var inherit = __webpack_require__(6);
  
  var yeast = __webpack_require__(19);
  
  var debug = __webpack_require__(7)('engine.io-client:websocket');
  
  var BrowserWebSocket, NodeWebSocket;
  
  if (typeof WebSocket !== 'undefined') {
    BrowserWebSocket = WebSocket;
  } else if (typeof self !== 'undefined') {
    BrowserWebSocket = self.WebSocket || self.MozWebSocket;
  }
  
  if (typeof window === 'undefined') {
    try {
      NodeWebSocket = __webpack_require__(55);
    } catch (e) {}
  }
  /**
   * Get either the `WebSocket` or `MozWebSocket` globals
   * in the browser or try to resolve WebSocket-compatible
   * interface exposed by `ws` for Node-like environment.
   */
  
  
  var WebSocketImpl = BrowserWebSocket || NodeWebSocket;
  /**
   * Module exports.
   */
  
  module.exports = WS;
  /**
   * WebSocket transport constructor.
   *
   * @api {Object} connection options
   * @api public
   */
  
  function WS(opts) {
    var forceBase64 = opts && opts.forceBase64;
  
    if (forceBase64) {
      this.supportsBinary = false;
    }
  
    this.perMessageDeflate = opts.perMessageDeflate;
    this.usingBrowserWebSocket = BrowserWebSocket && !opts.forceNode;
    this.protocols = opts.protocols;
  
    if (!this.usingBrowserWebSocket) {
      WebSocketImpl = NodeWebSocket;
    }
  
    Transport.call(this, opts);
  }
  /**
   * Inherits from Transport.
   */
  
  
  inherit(WS, Transport);
  /**
   * Transport name.
   *
   * @api public
   */
  
  WS.prototype.name = 'websocket';
  /*
   * WebSockets support binary
   */
  
  WS.prototype.supportsBinary = true;
  /**
   * Opens socket.
   *
   * @api private
   */
  
  WS.prototype.doOpen = function () {
    if (!this.check()) {
      // let probe timeout
      return;
    }
  
    var uri = this.uri();
    var protocols = this.protocols;
    var opts = {
      agent: this.agent,
      perMessageDeflate: this.perMessageDeflate
    }; // SSL options for Node.js client
  
    opts.pfx = this.pfx;
    opts.key = this.key;
    opts.passphrase = this.passphrase;
    opts.cert = this.cert;
    opts.ca = this.ca;
    opts.ciphers = this.ciphers;
    opts.rejectUnauthorized = this.rejectUnauthorized;
  
    if (this.extraHeaders) {
      opts.headers = this.extraHeaders;
    }
  
    if (this.localAddress) {
      opts.localAddress = this.localAddress;
    }
  
    try {
      this.ws = this.usingBrowserWebSocket && !this.isReactNative ? protocols ? new WebSocketImpl(uri, protocols) : new WebSocketImpl(uri) : new WebSocketImpl(uri, protocols, opts);
    } catch (err) {
      return this.emit('error', err);
    }
  
    if (this.ws.binaryType === undefined) {
      this.supportsBinary = false;
    }
  
    if (this.ws.supports && this.ws.supports.binary) {
      this.supportsBinary = true;
      this.ws.binaryType = 'nodebuffer';
    } else {
      this.ws.binaryType = 'arraybuffer';
    }
  
    this.addEventListeners();
  };
  /**
   * Adds event listeners to the socket
   *
   * @api private
   */
  
  
  WS.prototype.addEventListeners = function () {
    var self = this;
  
    this.ws.onopen = function () {
      self.onOpen();
    };
  
    this.ws.onclose = function () {
      self.onClose();
    };
  
    this.ws.onmessage = function (ev) {
      self.onData(ev.data);
    };
  
    this.ws.onerror = function (e) {
      self.onError('websocket error', e);
    };
  };
  /**
   * Writes data to socket.
   *
   * @param {Array} array of packets.
   * @api private
   */
  
  
  WS.prototype.write = function (packets) {
    var self = this;
    this.writable = false; // encodePacket efficient as it uses WS framing
    // no need for encodePayload
  
    var total = packets.length;
  
    for (var i = 0, l = total; i < l; i++) {
      (function (packet) {
        parser.encodePacket(packet, self.supportsBinary, function (data) {
          if (!self.usingBrowserWebSocket) {
            // always create a new object (GH-437)
            var opts = {};
  
            if (packet.options) {
              opts.compress = packet.options.compress;
            }
  
            if (self.perMessageDeflate) {
              var len = 'string' === typeof data ? Buffer.byteLength(data) : data.length;
  
              if (len < self.perMessageDeflate.threshold) {
                opts.compress = false;
              }
            }
          } // Sometimes the websocket has already been closed but the browser didn't
          // have a chance of informing us about it yet, in that case send will
          // throw an error
  
  
          try {
            if (self.usingBrowserWebSocket) {
              // TypeError is thrown when passing the second argument on Safari
              self.ws.send(data);
            } else {
              self.ws.send(data, opts);
            }
          } catch (e) {
            debug('websocket closed before onclose event');
          }
  
          --total || done();
        });
      })(packets[i]);
    }
  
    function done() {
      self.emit('flush'); // fake drain
      // defer to next tick to allow Socket to clear writeBuffer
  
      setTimeout(function () {
        self.writable = true;
        self.emit('drain');
      }, 0);
    }
  };
  /**
   * Called upon close
   *
   * @api private
   */
  
  
  WS.prototype.onClose = function () {
    Transport.prototype.onClose.call(this);
  };
  /**
   * Closes socket.
   *
   * @api private
   */
  
  
  WS.prototype.doClose = function () {
    if (typeof this.ws !== 'undefined') {
      this.ws.close();
    }
  };
  /**
   * Generates uri for connection.
   *
   * @api private
   */
  
  
  WS.prototype.uri = function () {
    var query = this.query || {};
    var schema = this.secure ? 'wss' : 'ws';
    var port = ''; // avoid port if default for schema
  
    if (this.port && ('wss' === schema && Number(this.port) !== 443 || 'ws' === schema && Number(this.port) !== 80)) {
      port = ':' + this.port;
    } // append timestamp to URI
  
  
    if (this.timestampRequests) {
      query[this.timestampParam] = yeast();
    } // communicate binary support capabilities
  
  
    if (!this.supportsBinary) {
      query.b64 = 1;
    }
  
    query = parseqs.encode(query); // prepend ? to query
  
    if (query.length) {
      query = '?' + query;
    }
  
    var ipv6 = this.hostname.indexOf(':') !== -1;
    return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;
  };
  /**
   * Feature detection for WebSocket.
   *
   * @return {Boolean} whether this transport is available.
   * @api public
   */
  
  
  WS.prototype.check = function () {
    return !!WebSocketImpl && !('__initialize' in WebSocketImpl && this.name === WS.prototype.name);
  };
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(9).Buffer))
  
  /***/ }),
  /* 55 */
  /***/ (function(module, exports) {
  
  /* (ignored) */
  
  /***/ }),
  /* 56 */
  /***/ (function(module, exports) {
  
  module.exports = toArray;
  
  function toArray(list, index) {
    var array = [];
    index = index || 0;
  
    for (var i = index || 0; i < list.length; i++) {
      array[i - index] = list[i];
    }
  
    return array;
  }
  
  /***/ }),
  /* 57 */
  /***/ (function(module, exports) {
  
  /**
   * Expose `Backoff`.
   */
  module.exports = Backoff;
  /**
   * Initialize backoff timer with `opts`.
   *
   * - `min` initial timeout in milliseconds [100]
   * - `max` max timeout [10000]
   * - `jitter` [0]
   * - `factor` [2]
   *
   * @param {Object} opts
   * @api public
   */
  
  function Backoff(opts) {
    opts = opts || {};
    this.ms = opts.min || 100;
    this.max = opts.max || 10000;
    this.factor = opts.factor || 2;
    this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
    this.attempts = 0;
  }
  /**
   * Return the backoff duration.
   *
   * @return {Number}
   * @api public
   */
  
  
  Backoff.prototype.duration = function () {
    var ms = this.ms * Math.pow(this.factor, this.attempts++);
  
    if (this.jitter) {
      var rand = Math.random();
      var deviation = Math.floor(rand * this.jitter * ms);
      ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
    }
  
    return Math.min(ms, this.max) | 0;
  };
  /**
   * Reset the number of attempts.
   *
   * @api public
   */
  
  
  Backoff.prototype.reset = function () {
    this.attempts = 0;
  };
  /**
   * Set the minimum duration
   *
   * @api public
   */
  
  
  Backoff.prototype.setMin = function (min) {
    this.ms = min;
  };
  /**
   * Set the maximum duration
   *
   * @api public
   */
  
  
  Backoff.prototype.setMax = function (max) {
    this.max = max;
  };
  /**
   * Set the jitter
   *
   * @api public
   */
  
  
  Backoff.prototype.setJitter = function (jitter) {
    this.jitter = jitter;
  };
  
  /***/ }),
  /* 58 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global, setImmediate) {var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;var require;var require;function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
  
  (function (f) {
    if (( false ? "undefined" : _typeof(exports)) === "object" && typeof module !== "undefined") {
      module.exports = f();
    } else if (true) {
      !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (f),
  				__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?
  				(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),
  				__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));
    } else {
      var g;
  
      if (typeof window !== "undefined") {
        g = window;
      } else if (typeof global !== "undefined") {
        g = global;
      } else if (typeof self !== "undefined") {
        g = self;
      } else {
        g = this;
      }
  
      g.ss = f();
    }
  })(function () {
    var define, module, exports;
    return function e(t, n, r) {
      function s(o, u) {
        if (!n[o]) {
          if (!t[o]) {
            var a = typeof require == "function" && require;
            if (!u && a) return require(o, !0);
            if (i) return i(o, !0);
            var f = new Error("Cannot find module '" + o + "'");
            throw f.code = "MODULE_NOT_FOUND", f;
          }
  
          var l = n[o] = {
            exports: {}
          };
          t[o][0].call(l.exports, function (e) {
            var n = t[o][1][e];
            return s(n ? n : e);
          }, l, l.exports, e, t, n, r);
        }
  
        return n[o].exports;
      }
  
      var i = typeof require == "function" && require;
  
      for (var o = 0; o < r.length; o++) {
        s(r[o]);
      }
  
      return s;
    }({
      1: [function (require, module, exports) {
        module.exports = require('./lib');
      }, {
        "./lib": 3
      }],
      2: [function (require, module, exports) {
        (function (Buffer) {
          var util = require('util');
  
          var Readable = require('stream').Readable;
  
          var bind = require('component-bind');
  
          module.exports = BlobReadStream;
          util.inherits(BlobReadStream, Readable);
          /**
           * Readable stream for Blob and File on browser.
           *
           * @param {Object} options
           * @api private
           */
  
          function BlobReadStream(blob, options) {
            if (!(this instanceof BlobReadStream)) {
              return new BlobReadStream(blob, options);
            }
  
            Readable.call(this, options);
            options = options || {};
            this.blob = blob;
            this.slice = blob.slice || blob.webkitSlice || blob.mozSlice;
            this.start = 0;
            this.sync = options.synchronous || false;
            var fileReader;
  
            if (options.synchronous) {
              fileReader = this.fileReader = new FileReaderSync();
            } else {
              fileReader = this.fileReader = new FileReader();
            }
  
            fileReader.onload = bind(this, '_onload');
            fileReader.onerror = bind(this, '_onerror');
          }
  
          BlobReadStream.prototype._read = function (size) {
            var start = this.start;
            var end = this.start = this.start + size;
            var chunk = this.slice.call(this.blob, start, end);
  
            if (chunk.size) {
              if (this.sync) {
                var bufferChunk = new Buffer(new Uint8Array(this.fileReader.readAsArrayBuffer(chunk)));
                this.push(bufferChunk);
              } else {
                this.fileReader.readAsArrayBuffer(chunk);
              }
            } else {
              this.push(null);
            }
          };
  
          BlobReadStream.prototype._onload = function (e) {
            var chunk = new Buffer(new Uint8Array(e.target.result));
            this.push(chunk);
          };
  
          BlobReadStream.prototype._onerror = function (e) {
            var err = e.target.error;
            this.emit('error', err);
          };
        }).call(this, require("buffer").Buffer);
      }, {
        "buffer": 11,
        "component-bind": 12,
        "stream": 35,
        "util": 40
      }],
      3: [function (require, module, exports) {
        (function (Buffer) {
          var Socket = require('./socket');
  
          var IOStream = require('./iostream');
  
          var BlobReadStream = require('./blob-read-stream');
  
          exports = module.exports = lookup;
          /**
           * Expose Node Buffer for browser.
           *
           * @api public
           */
  
          exports.Buffer = Buffer;
          /**
           * Expose Socket constructor.
           *
           * @api public
           */
  
          exports.Socket = Socket;
          /**
           * Expose IOStream constructor.
           *
           * @api public
           */
  
          exports.IOStream = IOStream;
          /**
           * Forces base 64 encoding when emitting. Must be set to true for Socket.IO v0.9 or lower.
           *
           * @api public
           */
  
          exports.forceBase64 = false;
          /**
           * Look up an existing Socket.
           *
           * @param {socket.io#Socket} socket.io
           * @param {Object} options
           * @return {Socket} Socket instance
           * @api public
           */
  
          function lookup(sio, options) {
            options = options || {};
  
            if (null == options.forceBase64) {
              options.forceBase64 = exports.forceBase64;
            }
  
            if (!sio._streamSocket) {
              sio._streamSocket = new Socket(sio, options);
            }
  
            return sio._streamSocket;
          }
          /**
           * Creates a new duplex stream.
           *
           * @param {Object} options
           * @return {IOStream} duplex stream
           * @api public
           */
  
  
          exports.createStream = function (options) {
            return new IOStream(options);
          };
          /**
           * Creates a new readable stream for Blob/File on browser.
           *
           * @param {Blob} blob
           * @param {Object} options
           * @return {BlobReadStream} stream
           * @api public
           */
  
  
          exports.createBlobReadStream = function (blob, options) {
            return new BlobReadStream(blob, options);
          };
        }).call(this, require("buffer").Buffer);
      }, {
        "./blob-read-stream": 2,
        "./iostream": 4,
        "./socket": 6,
        "buffer": 11
      }],
      4: [function (require, module, exports) {
        var util = require('util');
  
        var Duplex = require('stream').Duplex;
  
        var bind = require('component-bind');
  
        var uuid = require('./uuid');
  
        var debug = require('debug')('socket.io-stream:iostream');
  
        module.exports = IOStream;
        util.inherits(IOStream, Duplex);
        /**
         * Duplex
         *
         * @param {Object} options
         * @api private
         */
  
        function IOStream(options) {
          if (!(this instanceof IOStream)) {
            return new IOStream(options);
          }
  
          IOStream.super_.call(this, options);
          this.options = options;
          this.id = uuid();
          this.socket = null; // Buffers
  
          this.pushBuffer = [];
          this.writeBuffer = []; // Op states
  
          this._readable = false;
          this._writable = false;
          this.destroyed = false; // default to *not* allowing half open sockets
  
          this.allowHalfOpen = options && options.allowHalfOpen || false;
          this.on('finish', this._onfinish);
          this.on('end', this._onend);
          this.on('error', this._onerror);
        }
        /**
         * Ensures that no more I/O activity happens on this stream.
         * Not necessary in the usual case.
         *
         * @api public
         */
  
  
        IOStream.prototype.destroy = function () {
          debug('destroy');
  
          if (this.destroyed) {
            debug('already destroyed');
            return;
          }
  
          this.readable = this.writable = false;
  
          if (this.socket) {
            debug('clean up');
            this.socket.cleanup(this.id);
            this.socket = null;
          }
  
          this.destroyed = true;
        };
        /**
         * Local read
         *
         * @api private
         */
  
  
        IOStream.prototype._read = function (size) {
          var push; // We can not read from the socket if it's destroyed obviously ...
  
          if (this.destroyed) return;
  
          if (this.pushBuffer.length) {
            // flush buffer and end if it exists.
            while (push = this.pushBuffer.shift()) {
              if (!push()) break;
            }
  
            return;
          }
  
          this._readable = true; // Go get data from remote stream
          // Calls
          // ._onread remotely
          // then
          // ._onwrite locally
  
          this.socket._read(this.id, size);
        };
        /**
         * Read from remote stream
         *
         * @api private
         */
  
  
        IOStream.prototype._onread = function (size) {
          var write = this.writeBuffer.shift();
          if (write) return write();
          this._writable = true;
        };
        /**
         * Write local data to remote stream
         * Calls
         * remtote ._onwrite
         *
         * @api private
         */
  
  
        IOStream.prototype._write = function (chunk, encoding, callback) {
          var self = this;
  
          function write() {
            // We can not write to the socket if it's destroyed obviously ...
            if (self.destroyed) return;
            self._writable = false;
  
            self.socket._write(self.id, chunk, encoding, callback);
          }
  
          if (this._writable) {
            write();
          } else {
            this.writeBuffer.push(write);
          }
        };
        /**
         * Write the data fetched remotely
         * so that we can now read locally
         *
         * @api private
         */
  
  
        IOStream.prototype._onwrite = function (chunk, encoding, callback) {
          var self = this;
  
          function push() {
            self._readable = false;
            var ret = self.push(chunk || '', encoding);
            callback();
            return ret;
          }
  
          if (this._readable) {
            push();
          } else {
            this.pushBuffer.push(push);
          }
        };
        /**
         * When ending send 'end' event to remote stream
         *
         * @api private
         */
  
  
        IOStream.prototype._end = function () {
          if (this.pushBuffer.length) {
            // end after flushing buffer.
            this.pushBuffer.push(bind(this, '_done'));
          } else {
            this._done();
          }
        };
        /**
         * Remote stream just ended
         *
         * @api private
         */
  
  
        IOStream.prototype._done = function () {
          this._readable = false; // signal the end of the data.
  
          return this.push(null);
        };
        /**
         * the user has called .end(), and all the bytes have been
         * sent out to the other side.
         * If allowHalfOpen is false, or if the readable side has
         * ended already, then destroy.
         * If allowHalfOpen is true, then we need to set writable false,
         * so that only the writable side will be cleaned up.
         *
         * @api private
         */
  
  
        IOStream.prototype._onfinish = function () {
          debug('_onfinish'); // Local socket just finished
          // send 'end' event to remote
  
          if (this.socket) {
            this.socket._end(this.id);
          }
  
          this.writable = false;
          this._writableState.ended = true;
  
          if (!this.readable || this._readableState.ended) {
            debug('_onfinish: ended, destroy %s', this._readableState);
            return this.destroy();
          }
  
          debug('_onfinish: not ended');
  
          if (!this.allowHalfOpen) {
            this.push(null); // just in case we're waiting for an EOF.
  
            if (this.readable && !this._readableState.endEmitted) {
              this.read(0);
            }
          }
        };
        /**
         * the EOF has been received, and no more bytes are coming.
         * if the writable side has ended already, then clean everything
         * up.
         *
         * @api private
         */
  
  
        IOStream.prototype._onend = function () {
          debug('_onend');
          this.readable = false;
          this._readableState.ended = true;
  
          if (!this.writable || this._writableState.finished) {
            debug('_onend: %s', this._writableState);
            return this.destroy();
          }
  
          debug('_onend: not finished');
  
          if (!this.allowHalfOpen) {
            this.end();
          }
        };
        /**
         * When error in local stream
         * notyify remote
         * if err.remote = true
         * then error happened on remote stream
         *
         * @api private
         */
  
  
        IOStream.prototype._onerror = function (err) {
          // check if the error came from remote stream.
          if (!err.remote && this.socket) {
            // notify the error to the corresponding remote stream.
            this.socket._error(this.id, err);
          }
  
          this.destroy();
        };
      }, {
        "./uuid": 7,
        "component-bind": 12,
        "debug": 14,
        "stream": 35,
        "util": 40
      }],
      5: [function (require, module, exports) {
        var util = require('util');
  
        var EventEmitter = require('events').EventEmitter;
  
        var IOStream = require('./iostream');
  
        var slice = Array.prototype.slice;
        exports.Encoder = Encoder;
        exports.Decoder = Decoder;
        util.inherits(Encoder, EventEmitter);
  
        function Encoder() {
          EventEmitter.call(this);
        }
        /**
         * Encode streams to placeholder objects.
         *
         * @api public
         */
  
  
        Encoder.prototype.encode = function (v) {
          if (v instanceof IOStream) {
            return this.encodeStream(v);
          } else if (util.isArray(v)) {
            return this.encodeArray(v);
          } else if (v && 'object' == _typeof(v)) {
            return this.encodeObject(v);
          }
  
          return v;
        };
  
        Encoder.prototype.encodeStream = function (stream) {
          this.emit('stream', stream); // represent a stream in an object.
  
          var v = {
            $stream: stream.id
          };
  
          if (stream.options) {
            v.options = stream.options;
          }
  
          return v;
        };
  
        Encoder.prototype.encodeArray = function (arr) {
          var v = [];
  
          for (var i = 0, len = arr.length; i < len; i++) {
            v.push(this.encode(arr[i]));
          }
  
          return v;
        };
  
        Encoder.prototype.encodeObject = function (obj) {
          var v = {};
  
          for (var k in obj) {
            if (obj.hasOwnProperty(k)) {
              v[k] = this.encode(obj[k]);
            }
          }
  
          return v;
        };
  
        util.inherits(Decoder, EventEmitter);
  
        function Decoder() {
          EventEmitter.call(this);
        }
        /**
         * Decode placeholder objects to streams.
         *
         * @api public
         */
  
  
        Decoder.prototype.decode = function (v) {
          if (v && v.$stream) {
            return this.decodeStream(v);
          } else if (util.isArray(v)) {
            return this.decodeArray(v);
          } else if (v && 'object' == _typeof(v)) {
            return this.decodeObject(v);
          }
  
          return v;
        };
  
        Decoder.prototype.decodeStream = function (obj) {
          var stream = new IOStream(obj.options);
          stream.id = obj.$stream;
          this.emit('stream', stream);
          return stream;
        };
  
        Decoder.prototype.decodeArray = function (arr) {
          var v = [];
  
          for (var i = 0, len = arr.length; i < len; i++) {
            v.push(this.decode(arr[i]));
          }
  
          return v;
        };
  
        Decoder.prototype.decodeObject = function (obj) {
          var v = {};
  
          for (var k in obj) {
            if (obj.hasOwnProperty(k)) {
              v[k] = this.decode(obj[k]);
            }
          }
  
          return v;
        };
      }, {
        "./iostream": 4,
        "events": 16,
        "util": 40
      }],
      6: [function (require, module, exports) {
        (function (global, Buffer) {
          var util = require('util');
  
          var EventEmitter = require('events').EventEmitter;
  
          var bind = require('component-bind');
  
          var IOStream = require('./iostream');
  
          var parser = require('./parser');
  
          var debug = require('debug')('socket.io-stream:socket');
  
          var emit = EventEmitter.prototype.emit;
          var on = EventEmitter.prototype.on;
          var slice = Array.prototype.slice;
          exports = module.exports = Socket;
          /**
           * Base event name for messaging.
           *
           * @api public
           */
  
          exports.event = '$stream';
          exports.events = ['error', 'newListener', 'removeListener'];
          util.inherits(Socket, EventEmitter);
          /**
           * Bidirectional stream socket which wraps Socket.IO.
           *
           * @param {socket.io#Socket} socket.io
           * @api public
           */
  
          function Socket(sio, options) {
            if (!(this instanceof Socket)) {
              return new Socket(sio, options);
            }
  
            EventEmitter.call(this);
            options = options || {};
            this.sio = sio;
            this.forceBase64 = !!options.forceBase64;
            this.streams = {};
            this.encoder = new parser.Encoder();
            this.decoder = new parser.Decoder();
            var eventName = exports.event;
            sio.on(eventName, bind(this, emit));
            sio.on(eventName + '-read', bind(this, '_onread'));
            sio.on(eventName + '-write', bind(this, '_onwrite'));
            sio.on(eventName + '-end', bind(this, '_onend'));
            sio.on(eventName + '-error', bind(this, '_onerror'));
            sio.on('error', bind(this, emit, 'error'));
            sio.on('disconnect', bind(this, '_ondisconnect'));
            this.encoder.on('stream', bind(this, '_onencode'));
            this.decoder.on('stream', bind(this, '_ondecode'));
          }
          /**
           * Original emit function.
           *
           * @api private
           */
  
  
          Socket.prototype.$emit = emit;
          /**
           * Emits streams to this corresponding server/client.
           *
           * @return {Socket} self
           * @api public
           */
  
          Socket.prototype.emit = function (type) {
            if (~exports.events.indexOf(type)) {
              return emit.apply(this, arguments);
            }
  
            this._stream.apply(this, arguments);
  
            return this;
          };
  
          Socket.prototype.on = function (type, listener) {
            if (~exports.events.indexOf(type)) {
              return on.apply(this, arguments);
            }
  
            this._onstream(type, listener);
  
            return this;
          };
          /**
           * Sends a new stream request.
           *
           * @param {String} event type
           * @api private
           */
  
  
          Socket.prototype._stream = function (type) {
            debug('sending new streams');
            var self = this;
            var args = slice.call(arguments, 1);
            var ack = args[args.length - 1];
  
            if ('function' == typeof ack) {
              args[args.length - 1] = function () {
                var args = slice.call(arguments);
                args = self.decoder.decode(args);
                ack.apply(this, args);
              };
            }
  
            args = this.encoder.encode(args);
            var sio = this.sio;
            sio.emit.apply(sio, [exports.event, type].concat(args));
          };
          /**
           * Notifies the read event.
           *
           * @api private
           */
  
  
          Socket.prototype._read = function (id, size) {
            this.sio.emit(exports.event + '-read', id, size);
          };
          /**
           * Requests to write a chunk.
           *
           * @api private
           */
  
  
          Socket.prototype._write = function (id, chunk, encoding, callback) {
            if (Buffer.isBuffer(chunk)) {
              if (this.forceBase64) {
                encoding = 'base64';
                chunk = chunk.toString(encoding);
              } else if (!global.Buffer) {
                // socket.io can't handle Buffer when using browserify.
                if (chunk.toArrayBuffer) {
                  chunk = chunk.toArrayBuffer();
                } else {
                  chunk = chunk.buffer;
                }
              }
            }
  
            this.sio.emit(exports.event + '-write', id, chunk, encoding, callback);
          };
  
          Socket.prototype._end = function (id) {
            this.sio.emit(exports.event + '-end', id);
          };
  
          Socket.prototype._error = function (id, err) {
            this.sio.emit(exports.event + '-error', id, err.message || err);
          };
          /**
           * Handles a new stream request.
           *
           * @param {String} event type
           * @param {Function} listener
           *
           * @api private
           */
  
  
          Socket.prototype._onstream = function (type, listener) {
            if ('function' != typeof listener) {
              throw TypeError('listener must be a function');
            }
  
            function onstream() {
              debug('new streams');
              var self = this;
              var args = slice.call(arguments);
              var ack = args[args.length - 1];
  
              if ('function' == typeof ack) {
                args[args.length - 1] = function () {
                  var args = slice.call(arguments);
                  args = self.encoder.encode(args);
                  ack.apply(this, args);
                };
              }
  
              args = this.decoder.decode(args);
              listener.apply(this, args);
            } // for removeListener
  
  
            onstream.listener = listener;
            on.call(this, type, onstream);
          };
  
          Socket.prototype._onread = function (id, size) {
            debug('read: "%s"', id);
            var stream = this.streams[id];
  
            if (stream) {
              stream._onread(size);
            } else {
              debug('ignore invalid stream id');
            }
          };
  
          Socket.prototype._onwrite = function (id, chunk, encoding, callback) {
            debug('write: "%s"', id);
            var stream = this.streams[id];
  
            if (!stream) {
              callback('invalid stream id: ' + id);
              return;
            }
  
            if (global.ArrayBuffer && chunk instanceof ArrayBuffer) {
              // make sure that chunk is a buffer for stream
              chunk = new Buffer(new Uint8Array(chunk));
            }
  
            stream._onwrite(chunk, encoding, callback);
          };
  
          Socket.prototype._onend = function (id) {
            debug('end: "%s"', id);
            var stream = this.streams[id];
  
            if (!stream) {
              debug('ignore non-existent stream id: "%s"', id);
              return;
            }
  
            stream._end();
          };
  
          Socket.prototype._onerror = function (id, message) {
            debug('error: "%s", "%s"', id, message);
            var stream = this.streams[id];
  
            if (!stream) {
              debug('invalid stream id: "%s"', id);
              return;
            }
  
            var err = new Error(message);
            err.remote = true;
            stream.emit('error', err);
          };
  
          Socket.prototype._ondisconnect = function () {
            var stream;
  
            for (var id in this.streams) {
              stream = this.streams[id];
              stream.destroy(); // Close streams when the underlaying
              // socket.io connection is closed (regardless why)
  
              stream.emit('close');
              stream.emit('error', new Error('Connection aborted'));
            }
          };
  
          Socket.prototype._onencode = function (stream) {
            if (stream.socket || stream.destroyed) {
              throw new Error('stream has already been sent.');
            }
  
            var id = stream.id;
  
            if (this.streams[id]) {
              throw new Error('Encoded stream already exists: ' + id);
            }
  
            this.streams[id] = stream;
            stream.socket = this;
          };
  
          Socket.prototype._ondecode = function (stream) {
            var id = stream.id;
  
            if (this.streams[id]) {
              this._error(id, new Error('Decoded stream already exists: ' + id));
  
              return;
            }
  
            this.streams[id] = stream;
            stream.socket = this;
          };
  
          Socket.prototype.cleanup = function (id) {
            delete this.streams[id];
          };
        }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}, require("buffer").Buffer);
      }, {
        "./iostream": 4,
        "./parser": 5,
        "buffer": 11,
        "component-bind": 12,
        "debug": 14,
        "events": 16,
        "util": 40
      }],
      7: [function (require, module, exports) {
        // UUID function from https://gist.github.com/jed/982883
        // More lightweight than node-uuid
        function b(a // placeholder
        ) {
          return a // if the placeholder was passed, return
          ? (a ^ // unless b is 8,
          Math.random() // in which case
          * 16 // a random number from
          >> a / 4 // 8 to 11
          ).toString(16) // in hexadecimal
          : ([1e7] + // 10000000 +
          -1e3 + // -1000 +
          -4e3 + // -4000 +
          -8e3 + // -80000000 +
          -1e11 // -100000000000,
          ).replace( // replacing
          /[018]/g, // zeroes, ones, and eights with
          b // random hex digits
          );
        }
  
        module.exports = b;
      }, {}],
      8: [function (require, module, exports) {
        'use strict';
  
        exports.byteLength = byteLength;
        exports.toByteArray = toByteArray;
        exports.fromByteArray = fromByteArray;
        var lookup = [];
        var revLookup = [];
        var Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array;
        var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
  
        for (var i = 0, len = code.length; i < len; ++i) {
          lookup[i] = code[i];
          revLookup[code.charCodeAt(i)] = i;
        }
  
        revLookup['-'.charCodeAt(0)] = 62;
        revLookup['_'.charCodeAt(0)] = 63;
  
        function placeHoldersCount(b64) {
          var len = b64.length;
  
          if (len % 4 > 0) {
            throw new Error('Invalid string. Length must be a multiple of 4');
          } // the number of equal signs (place holders)
          // if there are two placeholders, than the two characters before it
          // represent one byte
          // if there is only one, then the three characters before it represent 2 bytes
          // this is just a cheap hack to not do indexOf twice
  
  
          return b64[len - 2] === '=' ? 2 : b64[len - 1] === '=' ? 1 : 0;
        }
  
        function byteLength(b64) {
          // base64 is 4/3 + up to two characters of the original data
          return b64.length * 3 / 4 - placeHoldersCount(b64);
        }
  
        function toByteArray(b64) {
          var i, j, l, tmp, placeHolders, arr;
          var len = b64.length;
          placeHolders = placeHoldersCount(b64);
          arr = new Arr(len * 3 / 4 - placeHolders); // if there are placeholders, only get up to the last complete 4 chars
  
          l = placeHolders > 0 ? len - 4 : len;
          var L = 0;
  
          for (i = 0, j = 0; i < l; i += 4, j += 3) {
            tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
            arr[L++] = tmp >> 16 & 0xFF;
            arr[L++] = tmp >> 8 & 0xFF;
            arr[L++] = tmp & 0xFF;
          }
  
          if (placeHolders === 2) {
            tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
            arr[L++] = tmp & 0xFF;
          } else if (placeHolders === 1) {
            tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
            arr[L++] = tmp >> 8 & 0xFF;
            arr[L++] = tmp & 0xFF;
          }
  
          return arr;
        }
  
        function tripletToBase64(num) {
          return lookup[num >> 18 & 0x3F] + lookup[num >> 12 & 0x3F] + lookup[num >> 6 & 0x3F] + lookup[num & 0x3F];
        }
  
        function encodeChunk(uint8, start, end) {
          var tmp;
          var output = [];
  
          for (var i = start; i < end; i += 3) {
            tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
            output.push(tripletToBase64(tmp));
          }
  
          return output.join('');
        }
  
        function fromByteArray(uint8) {
          var tmp;
          var len = uint8.length;
          var extraBytes = len % 3; // if we have 1 byte left, pad 2 bytes
  
          var output = '';
          var parts = [];
          var maxChunkLength = 16383; // must be multiple of 3
          // go through the array every three bytes, we'll deal with trailing stuff later
  
          for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
            parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength));
          } // pad the end with zeros, but make sure to not forget the extra bytes
  
  
          if (extraBytes === 1) {
            tmp = uint8[len - 1];
            output += lookup[tmp >> 2];
            output += lookup[tmp << 4 & 0x3F];
            output += '==';
          } else if (extraBytes === 2) {
            tmp = (uint8[len - 2] << 8) + uint8[len - 1];
            output += lookup[tmp >> 10];
            output += lookup[tmp >> 4 & 0x3F];
            output += lookup[tmp << 2 & 0x3F];
            output += '=';
          }
  
          parts.push(output);
          return parts.join('');
        }
      }, {}],
      9: [function (require, module, exports) {}, {}],
      10: [function (require, module, exports) {
        (function (global) {
          'use strict';
  
          var buffer = require('buffer');
  
          var Buffer = buffer.Buffer;
          var SlowBuffer = buffer.SlowBuffer;
          var MAX_LEN = buffer.kMaxLength || 2147483647;
  
          exports.alloc = function alloc(size, fill, encoding) {
            if (typeof Buffer.alloc === 'function') {
              return Buffer.alloc(size, fill, encoding);
            }
  
            if (typeof encoding === 'number') {
              throw new TypeError('encoding must not be number');
            }
  
            if (typeof size !== 'number') {
              throw new TypeError('size must be a number');
            }
  
            if (size > MAX_LEN) {
              throw new RangeError('size is too large');
            }
  
            var enc = encoding;
            var _fill = fill;
  
            if (_fill === undefined) {
              enc = undefined;
              _fill = 0;
            }
  
            var buf = new Buffer(size);
  
            if (typeof _fill === 'string') {
              var fillBuf = new Buffer(_fill, enc);
              var flen = fillBuf.length;
              var i = -1;
  
              while (++i < size) {
                buf[i] = fillBuf[i % flen];
              }
            } else {
              buf.fill(_fill);
            }
  
            return buf;
          };
  
          exports.allocUnsafe = function allocUnsafe(size) {
            if (typeof Buffer.allocUnsafe === 'function') {
              return Buffer.allocUnsafe(size);
            }
  
            if (typeof size !== 'number') {
              throw new TypeError('size must be a number');
            }
  
            if (size > MAX_LEN) {
              throw new RangeError('size is too large');
            }
  
            return new Buffer(size);
          };
  
          exports.from = function from(value, encodingOrOffset, length) {
            if (typeof Buffer.from === 'function' && (!global.Uint8Array || Uint8Array.from !== Buffer.from)) {
              return Buffer.from(value, encodingOrOffset, length);
            }
  
            if (typeof value === 'number') {
              throw new TypeError('"value" argument must not be a number');
            }
  
            if (typeof value === 'string') {
              return new Buffer(value, encodingOrOffset);
            }
  
            if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
              var offset = encodingOrOffset;
  
              if (arguments.length === 1) {
                return new Buffer(value);
              }
  
              if (typeof offset === 'undefined') {
                offset = 0;
              }
  
              var len = length;
  
              if (typeof len === 'undefined') {
                len = value.byteLength - offset;
              }
  
              if (offset >= value.byteLength) {
                throw new RangeError('\'offset\' is out of bounds');
              }
  
              if (len > value.byteLength - offset) {
                throw new RangeError('\'length\' is out of bounds');
              }
  
              return new Buffer(value.slice(offset, offset + len));
            }
  
            if (Buffer.isBuffer(value)) {
              var out = new Buffer(value.length);
              value.copy(out, 0, 0, value.length);
              return out;
            }
  
            if (value) {
              if (Array.isArray(value) || typeof ArrayBuffer !== 'undefined' && value.buffer instanceof ArrayBuffer || 'length' in value) {
                return new Buffer(value);
              }
  
              if (value.type === 'Buffer' && Array.isArray(value.data)) {
                return new Buffer(value.data);
              }
            }
  
            throw new TypeError('First argument must be a string, Buffer, ' + 'ArrayBuffer, Array, or array-like object.');
          };
  
          exports.allocUnsafeSlow = function allocUnsafeSlow(size) {
            if (typeof Buffer.allocUnsafeSlow === 'function') {
              return Buffer.allocUnsafeSlow(size);
            }
  
            if (typeof size !== 'number') {
              throw new TypeError('size must be a number');
            }
  
            if (size >= MAX_LEN) {
              throw new RangeError('size is too large');
            }
  
            return new SlowBuffer(size);
          };
        }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
      }, {
        "buffer": 11
      }],
      11: [function (require, module, exports) {
        (function (global) {
          /*!
           * The buffer module from node.js, for the browser.
           *
           * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
           * @license  MIT
           */
  
          /* eslint-disable no-proto */
          'use strict';
  
          var base64 = require('base64-js');
  
          var ieee754 = require('ieee754');
  
          var isArray = require('isarray');
  
          exports.Buffer = Buffer;
          exports.SlowBuffer = SlowBuffer;
          exports.INSPECT_MAX_BYTES = 50;
          /**
           * If `Buffer.TYPED_ARRAY_SUPPORT`:
           *   === true    Use Uint8Array implementation (fastest)
           *   === false   Use Object implementation (most compatible, even IE6)
           *
           * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,
           * Opera 11.6+, iOS 4.2+.
           *
           * Due to various browser bugs, sometimes the Object implementation will be used even
           * when the browser supports typed arrays.
           *
           * Note:
           *
           *   - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,
           *     See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.
           *
           *   - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.
           *
           *   - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of
           *     incorrect length in some situations.
          
           * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they
           * get the Object implementation, which is slower but behaves correctly.
           */
  
          Buffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined ? global.TYPED_ARRAY_SUPPORT : typedArraySupport();
          /*
           * Export kMaxLength after typed array support is determined.
           */
  
          exports.kMaxLength = kMaxLength();
  
          function typedArraySupport() {
            try {
              var arr = new Uint8Array(1);
              arr.__proto__ = {
                __proto__: Uint8Array.prototype,
                foo: function foo() {
                  return 42;
                }
              };
              return arr.foo() === 42 && // typed array instances can be augmented
              typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`
              arr.subarray(1, 1).byteLength === 0; // ie10 has broken `subarray`
            } catch (e) {
              return false;
            }
          }
  
          function kMaxLength() {
            return Buffer.TYPED_ARRAY_SUPPORT ? 0x7fffffff : 0x3fffffff;
          }
  
          function createBuffer(that, length) {
            if (kMaxLength() < length) {
              throw new RangeError('Invalid typed array length');
            }
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              // Return an augmented `Uint8Array` instance, for best performance
              that = new Uint8Array(length);
              that.__proto__ = Buffer.prototype;
            } else {
              // Fallback: Return an object instance of the Buffer class
              if (that === null) {
                that = new Buffer(length);
              }
  
              that.length = length;
            }
  
            return that;
          }
          /**
           * The Buffer constructor returns instances of `Uint8Array` that have their
           * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of
           * `Uint8Array`, so the returned instances will have all the node `Buffer` methods
           * and the `Uint8Array` methods. Square bracket notation works as expected -- it
           * returns a single octet.
           *
           * The `Uint8Array` prototype remains unmodified.
           */
  
  
          function Buffer(arg, encodingOrOffset, length) {
            if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {
              return new Buffer(arg, encodingOrOffset, length);
            } // Common case.
  
  
            if (typeof arg === 'number') {
              if (typeof encodingOrOffset === 'string') {
                throw new Error('If encoding is specified then the first argument must be a string');
              }
  
              return allocUnsafe(this, arg);
            }
  
            return from(this, arg, encodingOrOffset, length);
          }
  
          Buffer.poolSize = 8192; // not used by this implementation
          // TODO: Legacy, not needed anymore. Remove in next major version.
  
          Buffer._augment = function (arr) {
            arr.__proto__ = Buffer.prototype;
            return arr;
          };
  
          function from(that, value, encodingOrOffset, length) {
            if (typeof value === 'number') {
              throw new TypeError('"value" argument must not be a number');
            }
  
            if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {
              return fromArrayBuffer(that, value, encodingOrOffset, length);
            }
  
            if (typeof value === 'string') {
              return fromString(that, value, encodingOrOffset);
            }
  
            return fromObject(that, value);
          }
          /**
           * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError
           * if value is a number.
           * Buffer.from(str[, encoding])
           * Buffer.from(array)
           * Buffer.from(buffer)
           * Buffer.from(arrayBuffer[, byteOffset[, length]])
           **/
  
  
          Buffer.from = function (value, encodingOrOffset, length) {
            return from(null, value, encodingOrOffset, length);
          };
  
          if (Buffer.TYPED_ARRAY_SUPPORT) {
            Buffer.prototype.__proto__ = Uint8Array.prototype;
            Buffer.__proto__ = Uint8Array;
  
            if (typeof Symbol !== 'undefined' && Symbol.species && Buffer[Symbol.species] === Buffer) {
              // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97
              Object.defineProperty(Buffer, Symbol.species, {
                value: null,
                configurable: true
              });
            }
          }
  
          function assertSize(size) {
            if (typeof size !== 'number') {
              throw new TypeError('"size" argument must be a number');
            } else if (size < 0) {
              throw new RangeError('"size" argument must not be negative');
            }
          }
  
          function alloc(that, size, fill, encoding) {
            assertSize(size);
  
            if (size <= 0) {
              return createBuffer(that, size);
            }
  
            if (fill !== undefined) {
              // Only pay attention to encoding if it's a string. This
              // prevents accidentally sending in a number that would
              // be interpretted as a start offset.
              return typeof encoding === 'string' ? createBuffer(that, size).fill(fill, encoding) : createBuffer(that, size).fill(fill);
            }
  
            return createBuffer(that, size);
          }
          /**
           * Creates a new filled Buffer instance.
           * alloc(size[, fill[, encoding]])
           **/
  
  
          Buffer.alloc = function (size, fill, encoding) {
            return alloc(null, size, fill, encoding);
          };
  
          function allocUnsafe(that, size) {
            assertSize(size);
            that = createBuffer(that, size < 0 ? 0 : checked(size) | 0);
  
            if (!Buffer.TYPED_ARRAY_SUPPORT) {
              for (var i = 0; i < size; ++i) {
                that[i] = 0;
              }
            }
  
            return that;
          }
          /**
           * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.
           * */
  
  
          Buffer.allocUnsafe = function (size) {
            return allocUnsafe(null, size);
          };
          /**
           * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.
           */
  
  
          Buffer.allocUnsafeSlow = function (size) {
            return allocUnsafe(null, size);
          };
  
          function fromString(that, string, encoding) {
            if (typeof encoding !== 'string' || encoding === '') {
              encoding = 'utf8';
            }
  
            if (!Buffer.isEncoding(encoding)) {
              throw new TypeError('"encoding" must be a valid string encoding');
            }
  
            var length = byteLength(string, encoding) | 0;
            that = createBuffer(that, length);
            var actual = that.write(string, encoding);
  
            if (actual !== length) {
              // Writing a hex string, for example, that contains invalid characters will
              // cause everything after the first invalid character to be ignored. (e.g.
              // 'abxxcd' will be treated as 'ab')
              that = that.slice(0, actual);
            }
  
            return that;
          }
  
          function fromArrayLike(that, array) {
            var length = array.length < 0 ? 0 : checked(array.length) | 0;
            that = createBuffer(that, length);
  
            for (var i = 0; i < length; i += 1) {
              that[i] = array[i] & 255;
            }
  
            return that;
          }
  
          function fromArrayBuffer(that, array, byteOffset, length) {
            array.byteLength; // this throws if `array` is not a valid ArrayBuffer
  
            if (byteOffset < 0 || array.byteLength < byteOffset) {
              throw new RangeError('\'offset\' is out of bounds');
            }
  
            if (array.byteLength < byteOffset + (length || 0)) {
              throw new RangeError('\'length\' is out of bounds');
            }
  
            if (byteOffset === undefined && length === undefined) {
              array = new Uint8Array(array);
            } else if (length === undefined) {
              array = new Uint8Array(array, byteOffset);
            } else {
              array = new Uint8Array(array, byteOffset, length);
            }
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              // Return an augmented `Uint8Array` instance, for best performance
              that = array;
              that.__proto__ = Buffer.prototype;
            } else {
              // Fallback: Return an object instance of the Buffer class
              that = fromArrayLike(that, array);
            }
  
            return that;
          }
  
          function fromObject(that, obj) {
            if (Buffer.isBuffer(obj)) {
              var len = checked(obj.length) | 0;
              that = createBuffer(that, len);
  
              if (that.length === 0) {
                return that;
              }
  
              obj.copy(that, 0, 0, len);
              return that;
            }
  
            if (obj) {
              if (typeof ArrayBuffer !== 'undefined' && obj.buffer instanceof ArrayBuffer || 'length' in obj) {
                if (typeof obj.length !== 'number' || isnan(obj.length)) {
                  return createBuffer(that, 0);
                }
  
                return fromArrayLike(that, obj);
              }
  
              if (obj.type === 'Buffer' && isArray(obj.data)) {
                return fromArrayLike(that, obj.data);
              }
            }
  
            throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.');
          }
  
          function checked(length) {
            // Note: cannot use `length < kMaxLength()` here because that fails when
            // length is NaN (which is otherwise coerced to zero.)
            if (length >= kMaxLength()) {
              throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + kMaxLength().toString(16) + ' bytes');
            }
  
            return length | 0;
          }
  
          function SlowBuffer(length) {
            if (+length != length) {
              length = 0;
            }
  
            return Buffer.alloc(+length);
          }
  
          Buffer.isBuffer = function isBuffer(b) {
            return !!(b != null && b._isBuffer);
          };
  
          Buffer.compare = function compare(a, b) {
            if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
              throw new TypeError('Arguments must be Buffers');
            }
  
            if (a === b) return 0;
            var x = a.length;
            var y = b.length;
  
            for (var i = 0, len = Math.min(x, y); i < len; ++i) {
              if (a[i] !== b[i]) {
                x = a[i];
                y = b[i];
                break;
              }
            }
  
            if (x < y) return -1;
            if (y < x) return 1;
            return 0;
          };
  
          Buffer.isEncoding = function isEncoding(encoding) {
            switch (String(encoding).toLowerCase()) {
              case 'hex':
              case 'utf8':
              case 'utf-8':
              case 'ascii':
              case 'latin1':
              case 'binary':
              case 'base64':
              case 'ucs2':
              case 'ucs-2':
              case 'utf16le':
              case 'utf-16le':
                return true;
  
              default:
                return false;
            }
          };
  
          Buffer.concat = function concat(list, length) {
            if (!isArray(list)) {
              throw new TypeError('"list" argument must be an Array of Buffers');
            }
  
            if (list.length === 0) {
              return Buffer.alloc(0);
            }
  
            var i;
  
            if (length === undefined) {
              length = 0;
  
              for (i = 0; i < list.length; ++i) {
                length += list[i].length;
              }
            }
  
            var buffer = Buffer.allocUnsafe(length);
            var pos = 0;
  
            for (i = 0; i < list.length; ++i) {
              var buf = list[i];
  
              if (!Buffer.isBuffer(buf)) {
                throw new TypeError('"list" argument must be an Array of Buffers');
              }
  
              buf.copy(buffer, pos);
              pos += buf.length;
            }
  
            return buffer;
          };
  
          function byteLength(string, encoding) {
            if (Buffer.isBuffer(string)) {
              return string.length;
            }
  
            if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' && (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {
              return string.byteLength;
            }
  
            if (typeof string !== 'string') {
              string = '' + string;
            }
  
            var len = string.length;
            if (len === 0) return 0; // Use a for loop to avoid recursion
  
            var loweredCase = false;
  
            for (;;) {
              switch (encoding) {
                case 'ascii':
                case 'latin1':
                case 'binary':
                  return len;
  
                case 'utf8':
                case 'utf-8':
                case undefined:
                  return utf8ToBytes(string).length;
  
                case 'ucs2':
                case 'ucs-2':
                case 'utf16le':
                case 'utf-16le':
                  return len * 2;
  
                case 'hex':
                  return len >>> 1;
  
                case 'base64':
                  return base64ToBytes(string).length;
  
                default:
                  if (loweredCase) return utf8ToBytes(string).length; // assume utf8
  
                  encoding = ('' + encoding).toLowerCase();
                  loweredCase = true;
              }
            }
          }
  
          Buffer.byteLength = byteLength;
  
          function slowToString(encoding, start, end) {
            var loweredCase = false; // No need to verify that "this.length <= MAX_UINT32" since it's a read-only
            // property of a typed array.
            // This behaves neither like String nor Uint8Array in that we set start/end
            // to their upper/lower bounds if the value passed is out of range.
            // undefined is handled specially as per ECMA-262 6th Edition,
            // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.
  
            if (start === undefined || start < 0) {
              start = 0;
            } // Return early if start > this.length. Done here to prevent potential uint32
            // coercion fail below.
  
  
            if (start > this.length) {
              return '';
            }
  
            if (end === undefined || end > this.length) {
              end = this.length;
            }
  
            if (end <= 0) {
              return '';
            } // Force coersion to uint32. This will also coerce falsey/NaN values to 0.
  
  
            end >>>= 0;
            start >>>= 0;
  
            if (end <= start) {
              return '';
            }
  
            if (!encoding) encoding = 'utf8';
  
            while (true) {
              switch (encoding) {
                case 'hex':
                  return hexSlice(this, start, end);
  
                case 'utf8':
                case 'utf-8':
                  return utf8Slice(this, start, end);
  
                case 'ascii':
                  return asciiSlice(this, start, end);
  
                case 'latin1':
                case 'binary':
                  return latin1Slice(this, start, end);
  
                case 'base64':
                  return base64Slice(this, start, end);
  
                case 'ucs2':
                case 'ucs-2':
                case 'utf16le':
                case 'utf-16le':
                  return utf16leSlice(this, start, end);
  
                default:
                  if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
                  encoding = (encoding + '').toLowerCase();
                  loweredCase = true;
              }
            }
          } // The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect
          // Buffer instances.
  
  
          Buffer.prototype._isBuffer = true;
  
          function swap(b, n, m) {
            var i = b[n];
            b[n] = b[m];
            b[m] = i;
          }
  
          Buffer.prototype.swap16 = function swap16() {
            var len = this.length;
  
            if (len % 2 !== 0) {
              throw new RangeError('Buffer size must be a multiple of 16-bits');
            }
  
            for (var i = 0; i < len; i += 2) {
              swap(this, i, i + 1);
            }
  
            return this;
          };
  
          Buffer.prototype.swap32 = function swap32() {
            var len = this.length;
  
            if (len % 4 !== 0) {
              throw new RangeError('Buffer size must be a multiple of 32-bits');
            }
  
            for (var i = 0; i < len; i += 4) {
              swap(this, i, i + 3);
              swap(this, i + 1, i + 2);
            }
  
            return this;
          };
  
          Buffer.prototype.swap64 = function swap64() {
            var len = this.length;
  
            if (len % 8 !== 0) {
              throw new RangeError('Buffer size must be a multiple of 64-bits');
            }
  
            for (var i = 0; i < len; i += 8) {
              swap(this, i, i + 7);
              swap(this, i + 1, i + 6);
              swap(this, i + 2, i + 5);
              swap(this, i + 3, i + 4);
            }
  
            return this;
          };
  
          Buffer.prototype.toString = function toString() {
            var length = this.length | 0;
            if (length === 0) return '';
            if (arguments.length === 0) return utf8Slice(this, 0, length);
            return slowToString.apply(this, arguments);
          };
  
          Buffer.prototype.equals = function equals(b) {
            if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer');
            if (this === b) return true;
            return Buffer.compare(this, b) === 0;
          };
  
          Buffer.prototype.inspect = function inspect() {
            var str = '';
            var max = exports.INSPECT_MAX_BYTES;
  
            if (this.length > 0) {
              str = this.toString('hex', 0, max).match(/.{2}/g).join(' ');
              if (this.length > max) str += ' ... ';
            }
  
            return '<Buffer ' + str + '>';
          };
  
          Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
            if (!Buffer.isBuffer(target)) {
              throw new TypeError('Argument must be a Buffer');
            }
  
            if (start === undefined) {
              start = 0;
            }
  
            if (end === undefined) {
              end = target ? target.length : 0;
            }
  
            if (thisStart === undefined) {
              thisStart = 0;
            }
  
            if (thisEnd === undefined) {
              thisEnd = this.length;
            }
  
            if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
              throw new RangeError('out of range index');
            }
  
            if (thisStart >= thisEnd && start >= end) {
              return 0;
            }
  
            if (thisStart >= thisEnd) {
              return -1;
            }
  
            if (start >= end) {
              return 1;
            }
  
            start >>>= 0;
            end >>>= 0;
            thisStart >>>= 0;
            thisEnd >>>= 0;
            if (this === target) return 0;
            var x = thisEnd - thisStart;
            var y = end - start;
            var len = Math.min(x, y);
            var thisCopy = this.slice(thisStart, thisEnd);
            var targetCopy = target.slice(start, end);
  
            for (var i = 0; i < len; ++i) {
              if (thisCopy[i] !== targetCopy[i]) {
                x = thisCopy[i];
                y = targetCopy[i];
                break;
              }
            }
  
            if (x < y) return -1;
            if (y < x) return 1;
            return 0;
          }; // Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,
          // OR the last index of `val` in `buffer` at offset <= `byteOffset`.
          //
          // Arguments:
          // - buffer - a Buffer to search
          // - val - a string, Buffer, or number
          // - byteOffset - an index into `buffer`; will be clamped to an int32
          // - encoding - an optional encoding, relevant is val is a string
          // - dir - true for indexOf, false for lastIndexOf
  
  
          function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
            // Empty buffer means no match
            if (buffer.length === 0) return -1; // Normalize byteOffset
  
            if (typeof byteOffset === 'string') {
              encoding = byteOffset;
              byteOffset = 0;
            } else if (byteOffset > 0x7fffffff) {
              byteOffset = 0x7fffffff;
            } else if (byteOffset < -0x80000000) {
              byteOffset = -0x80000000;
            }
  
            byteOffset = +byteOffset; // Coerce to Number.
  
            if (isNaN(byteOffset)) {
              // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer
              byteOffset = dir ? 0 : buffer.length - 1;
            } // Normalize byteOffset: negative offsets start from the end of the buffer
  
  
            if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
  
            if (byteOffset >= buffer.length) {
              if (dir) return -1;else byteOffset = buffer.length - 1;
            } else if (byteOffset < 0) {
              if (dir) byteOffset = 0;else return -1;
            } // Normalize val
  
  
            if (typeof val === 'string') {
              val = Buffer.from(val, encoding);
            } // Finally, search either indexOf (if dir is true) or lastIndexOf
  
  
            if (Buffer.isBuffer(val)) {
              // Special case: looking for empty string/buffer always fails
              if (val.length === 0) {
                return -1;
              }
  
              return arrayIndexOf(buffer, val, byteOffset, encoding, dir);
            } else if (typeof val === 'number') {
              val = val & 0xFF; // Search for a byte value [0-255]
  
              if (Buffer.TYPED_ARRAY_SUPPORT && typeof Uint8Array.prototype.indexOf === 'function') {
                if (dir) {
                  return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset);
                } else {
                  return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset);
                }
              }
  
              return arrayIndexOf(buffer, [val], byteOffset, encoding, dir);
            }
  
            throw new TypeError('val must be string, number or Buffer');
          }
  
          function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
            var indexSize = 1;
            var arrLength = arr.length;
            var valLength = val.length;
  
            if (encoding !== undefined) {
              encoding = String(encoding).toLowerCase();
  
              if (encoding === 'ucs2' || encoding === 'ucs-2' || encoding === 'utf16le' || encoding === 'utf-16le') {
                if (arr.length < 2 || val.length < 2) {
                  return -1;
                }
  
                indexSize = 2;
                arrLength /= 2;
                valLength /= 2;
                byteOffset /= 2;
              }
            }
  
            function read(buf, i) {
              if (indexSize === 1) {
                return buf[i];
              } else {
                return buf.readUInt16BE(i * indexSize);
              }
            }
  
            var i;
  
            if (dir) {
              var foundIndex = -1;
  
              for (i = byteOffset; i < arrLength; i++) {
                if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
                  if (foundIndex === -1) foundIndex = i;
                  if (i - foundIndex + 1 === valLength) return foundIndex * indexSize;
                } else {
                  if (foundIndex !== -1) i -= i - foundIndex;
                  foundIndex = -1;
                }
              }
            } else {
              if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
  
              for (i = byteOffset; i >= 0; i--) {
                var found = true;
  
                for (var j = 0; j < valLength; j++) {
                  if (read(arr, i + j) !== read(val, j)) {
                    found = false;
                    break;
                  }
                }
  
                if (found) return i;
              }
            }
  
            return -1;
          }
  
          Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
            return this.indexOf(val, byteOffset, encoding) !== -1;
          };
  
          Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
            return bidirectionalIndexOf(this, val, byteOffset, encoding, true);
          };
  
          Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
            return bidirectionalIndexOf(this, val, byteOffset, encoding, false);
          };
  
          function hexWrite(buf, string, offset, length) {
            offset = Number(offset) || 0;
            var remaining = buf.length - offset;
  
            if (!length) {
              length = remaining;
            } else {
              length = Number(length);
  
              if (length > remaining) {
                length = remaining;
              }
            } // must be an even number of digits
  
  
            var strLen = string.length;
            if (strLen % 2 !== 0) throw new TypeError('Invalid hex string');
  
            if (length > strLen / 2) {
              length = strLen / 2;
            }
  
            for (var i = 0; i < length; ++i) {
              var parsed = parseInt(string.substr(i * 2, 2), 16);
              if (isNaN(parsed)) return i;
              buf[offset + i] = parsed;
            }
  
            return i;
          }
  
          function utf8Write(buf, string, offset, length) {
            return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length);
          }
  
          function asciiWrite(buf, string, offset, length) {
            return blitBuffer(asciiToBytes(string), buf, offset, length);
          }
  
          function latin1Write(buf, string, offset, length) {
            return asciiWrite(buf, string, offset, length);
          }
  
          function base64Write(buf, string, offset, length) {
            return blitBuffer(base64ToBytes(string), buf, offset, length);
          }
  
          function ucs2Write(buf, string, offset, length) {
            return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length);
          }
  
          Buffer.prototype.write = function write(string, offset, length, encoding) {
            // Buffer#write(string)
            if (offset === undefined) {
              encoding = 'utf8';
              length = this.length;
              offset = 0; // Buffer#write(string, encoding)
            } else if (length === undefined && typeof offset === 'string') {
              encoding = offset;
              length = this.length;
              offset = 0; // Buffer#write(string, offset[, length][, encoding])
            } else if (isFinite(offset)) {
              offset = offset | 0;
  
              if (isFinite(length)) {
                length = length | 0;
                if (encoding === undefined) encoding = 'utf8';
              } else {
                encoding = length;
                length = undefined;
              } // legacy write(string, encoding, offset, length) - remove in v0.13
  
            } else {
              throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported');
            }
  
            var remaining = this.length - offset;
            if (length === undefined || length > remaining) length = remaining;
  
            if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
              throw new RangeError('Attempt to write outside buffer bounds');
            }
  
            if (!encoding) encoding = 'utf8';
            var loweredCase = false;
  
            for (;;) {
              switch (encoding) {
                case 'hex':
                  return hexWrite(this, string, offset, length);
  
                case 'utf8':
                case 'utf-8':
                  return utf8Write(this, string, offset, length);
  
                case 'ascii':
                  return asciiWrite(this, string, offset, length);
  
                case 'latin1':
                case 'binary':
                  return latin1Write(this, string, offset, length);
  
                case 'base64':
                  // Warning: maxLength not taken into account in base64Write
                  return base64Write(this, string, offset, length);
  
                case 'ucs2':
                case 'ucs-2':
                case 'utf16le':
                case 'utf-16le':
                  return ucs2Write(this, string, offset, length);
  
                default:
                  if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding);
                  encoding = ('' + encoding).toLowerCase();
                  loweredCase = true;
              }
            }
          };
  
          Buffer.prototype.toJSON = function toJSON() {
            return {
              type: 'Buffer',
              data: Array.prototype.slice.call(this._arr || this, 0)
            };
          };
  
          function base64Slice(buf, start, end) {
            if (start === 0 && end === buf.length) {
              return base64.fromByteArray(buf);
            } else {
              return base64.fromByteArray(buf.slice(start, end));
            }
          }
  
          function utf8Slice(buf, start, end) {
            end = Math.min(buf.length, end);
            var res = [];
            var i = start;
  
            while (i < end) {
              var firstByte = buf[i];
              var codePoint = null;
              var bytesPerSequence = firstByte > 0xEF ? 4 : firstByte > 0xDF ? 3 : firstByte > 0xBF ? 2 : 1;
  
              if (i + bytesPerSequence <= end) {
                var secondByte, thirdByte, fourthByte, tempCodePoint;
  
                switch (bytesPerSequence) {
                  case 1:
                    if (firstByte < 0x80) {
                      codePoint = firstByte;
                    }
  
                    break;
  
                  case 2:
                    secondByte = buf[i + 1];
  
                    if ((secondByte & 0xC0) === 0x80) {
                      tempCodePoint = (firstByte & 0x1F) << 0x6 | secondByte & 0x3F;
  
                      if (tempCodePoint > 0x7F) {
                        codePoint = tempCodePoint;
                      }
                    }
  
                    break;
  
                  case 3:
                    secondByte = buf[i + 1];
                    thirdByte = buf[i + 2];
  
                    if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {
                      tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | thirdByte & 0x3F;
  
                      if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {
                        codePoint = tempCodePoint;
                      }
                    }
  
                    break;
  
                  case 4:
                    secondByte = buf[i + 1];
                    thirdByte = buf[i + 2];
                    fourthByte = buf[i + 3];
  
                    if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {
                      tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | fourthByte & 0x3F;
  
                      if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {
                        codePoint = tempCodePoint;
                      }
                    }
  
                }
              }
  
              if (codePoint === null) {
                // we did not generate a valid codePoint so insert a
                // replacement char (U+FFFD) and advance only 1 byte
                codePoint = 0xFFFD;
                bytesPerSequence = 1;
              } else if (codePoint > 0xFFFF) {
                // encode to utf16 (surrogate pair dance)
                codePoint -= 0x10000;
                res.push(codePoint >>> 10 & 0x3FF | 0xD800);
                codePoint = 0xDC00 | codePoint & 0x3FF;
              }
  
              res.push(codePoint);
              i += bytesPerSequence;
            }
  
            return decodeCodePointsArray(res);
          } // Based on http://stackoverflow.com/a/22747272/680742, the browser with
          // the lowest limit is Chrome, with 0x10000 args.
          // We go 1 magnitude less, for safety
  
  
          var MAX_ARGUMENTS_LENGTH = 0x1000;
  
          function decodeCodePointsArray(codePoints) {
            var len = codePoints.length;
  
            if (len <= MAX_ARGUMENTS_LENGTH) {
              return String.fromCharCode.apply(String, codePoints); // avoid extra slice()
            } // Decode in chunks to avoid "call stack size exceeded".
  
  
            var res = '';
            var i = 0;
  
            while (i < len) {
              res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH));
            }
  
            return res;
          }
  
          function asciiSlice(buf, start, end) {
            var ret = '';
            end = Math.min(buf.length, end);
  
            for (var i = start; i < end; ++i) {
              ret += String.fromCharCode(buf[i] & 0x7F);
            }
  
            return ret;
          }
  
          function latin1Slice(buf, start, end) {
            var ret = '';
            end = Math.min(buf.length, end);
  
            for (var i = start; i < end; ++i) {
              ret += String.fromCharCode(buf[i]);
            }
  
            return ret;
          }
  
          function hexSlice(buf, start, end) {
            var len = buf.length;
            if (!start || start < 0) start = 0;
            if (!end || end < 0 || end > len) end = len;
            var out = '';
  
            for (var i = start; i < end; ++i) {
              out += toHex(buf[i]);
            }
  
            return out;
          }
  
          function utf16leSlice(buf, start, end) {
            var bytes = buf.slice(start, end);
            var res = '';
  
            for (var i = 0; i < bytes.length; i += 2) {
              res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256);
            }
  
            return res;
          }
  
          Buffer.prototype.slice = function slice(start, end) {
            var len = this.length;
            start = ~~start;
            end = end === undefined ? len : ~~end;
  
            if (start < 0) {
              start += len;
              if (start < 0) start = 0;
            } else if (start > len) {
              start = len;
            }
  
            if (end < 0) {
              end += len;
              if (end < 0) end = 0;
            } else if (end > len) {
              end = len;
            }
  
            if (end < start) end = start;
            var newBuf;
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              newBuf = this.subarray(start, end);
              newBuf.__proto__ = Buffer.prototype;
            } else {
              var sliceLen = end - start;
              newBuf = new Buffer(sliceLen, undefined);
  
              for (var i = 0; i < sliceLen; ++i) {
                newBuf[i] = this[i + start];
              }
            }
  
            return newBuf;
          };
          /*
           * Need to make sure that buffer isn't trying to write out of bounds.
           */
  
  
          function checkOffset(offset, ext, length) {
            if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint');
            if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length');
          }
  
          Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
            offset = offset | 0;
            byteLength = byteLength | 0;
            if (!noAssert) checkOffset(offset, byteLength, this.length);
            var val = this[offset];
            var mul = 1;
            var i = 0;
  
            while (++i < byteLength && (mul *= 0x100)) {
              val += this[offset + i] * mul;
            }
  
            return val;
          };
  
          Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
            offset = offset | 0;
            byteLength = byteLength | 0;
  
            if (!noAssert) {
              checkOffset(offset, byteLength, this.length);
            }
  
            var val = this[offset + --byteLength];
            var mul = 1;
  
            while (byteLength > 0 && (mul *= 0x100)) {
              val += this[offset + --byteLength] * mul;
            }
  
            return val;
          };
  
          Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 1, this.length);
            return this[offset];
          };
  
          Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 2, this.length);
            return this[offset] | this[offset + 1] << 8;
          };
  
          Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 2, this.length);
            return this[offset] << 8 | this[offset + 1];
          };
  
          Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 0x1000000;
          };
  
          Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return this[offset] * 0x1000000 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]);
          };
  
          Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
            offset = offset | 0;
            byteLength = byteLength | 0;
            if (!noAssert) checkOffset(offset, byteLength, this.length);
            var val = this[offset];
            var mul = 1;
            var i = 0;
  
            while (++i < byteLength && (mul *= 0x100)) {
              val += this[offset + i] * mul;
            }
  
            mul *= 0x80;
            if (val >= mul) val -= Math.pow(2, 8 * byteLength);
            return val;
          };
  
          Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
            offset = offset | 0;
            byteLength = byteLength | 0;
            if (!noAssert) checkOffset(offset, byteLength, this.length);
            var i = byteLength;
            var mul = 1;
            var val = this[offset + --i];
  
            while (i > 0 && (mul *= 0x100)) {
              val += this[offset + --i] * mul;
            }
  
            mul *= 0x80;
            if (val >= mul) val -= Math.pow(2, 8 * byteLength);
            return val;
          };
  
          Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 1, this.length);
            if (!(this[offset] & 0x80)) return this[offset];
            return (0xff - this[offset] + 1) * -1;
          };
  
          Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 2, this.length);
            var val = this[offset] | this[offset + 1] << 8;
            return val & 0x8000 ? val | 0xFFFF0000 : val;
          };
  
          Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 2, this.length);
            var val = this[offset + 1] | this[offset] << 8;
            return val & 0x8000 ? val | 0xFFFF0000 : val;
          };
  
          Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24;
          };
  
          Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3];
          };
  
          Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return ieee754.read(this, offset, true, 23, 4);
          };
  
          Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 4, this.length);
            return ieee754.read(this, offset, false, 23, 4);
          };
  
          Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 8, this.length);
            return ieee754.read(this, offset, true, 52, 8);
          };
  
          Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
            if (!noAssert) checkOffset(offset, 8, this.length);
            return ieee754.read(this, offset, false, 52, 8);
          };
  
          function checkInt(buf, value, offset, ext, max, min) {
            if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
            if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
            if (offset + ext > buf.length) throw new RangeError('Index out of range');
          }
  
          Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
            value = +value;
            offset = offset | 0;
            byteLength = byteLength | 0;
  
            if (!noAssert) {
              var maxBytes = Math.pow(2, 8 * byteLength) - 1;
              checkInt(this, value, offset, byteLength, maxBytes, 0);
            }
  
            var mul = 1;
            var i = 0;
            this[offset] = value & 0xFF;
  
            while (++i < byteLength && (mul *= 0x100)) {
              this[offset + i] = value / mul & 0xFF;
            }
  
            return offset + byteLength;
          };
  
          Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
            value = +value;
            offset = offset | 0;
            byteLength = byteLength | 0;
  
            if (!noAssert) {
              var maxBytes = Math.pow(2, 8 * byteLength) - 1;
              checkInt(this, value, offset, byteLength, maxBytes, 0);
            }
  
            var i = byteLength - 1;
            var mul = 1;
            this[offset + i] = value & 0xFF;
  
            while (--i >= 0 && (mul *= 0x100)) {
              this[offset + i] = value / mul & 0xFF;
            }
  
            return offset + byteLength;
          };
  
          Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0);
            if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
            this[offset] = value & 0xff;
            return offset + 1;
          };
  
          function objectWriteUInt16(buf, value, offset, littleEndian) {
            if (value < 0) value = 0xffff + value + 1;
  
            for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {
              buf[offset + i] = (value & 0xff << 8 * (littleEndian ? i : 1 - i)) >>> (littleEndian ? i : 1 - i) * 8;
            }
          }
  
          Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value & 0xff;
              this[offset + 1] = value >>> 8;
            } else {
              objectWriteUInt16(this, value, offset, true);
            }
  
            return offset + 2;
          };
  
          Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value >>> 8;
              this[offset + 1] = value & 0xff;
            } else {
              objectWriteUInt16(this, value, offset, false);
            }
  
            return offset + 2;
          };
  
          function objectWriteUInt32(buf, value, offset, littleEndian) {
            if (value < 0) value = 0xffffffff + value + 1;
  
            for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {
              buf[offset + i] = value >>> (littleEndian ? i : 3 - i) * 8 & 0xff;
            }
          }
  
          Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset + 3] = value >>> 24;
              this[offset + 2] = value >>> 16;
              this[offset + 1] = value >>> 8;
              this[offset] = value & 0xff;
            } else {
              objectWriteUInt32(this, value, offset, true);
            }
  
            return offset + 4;
          };
  
          Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value >>> 24;
              this[offset + 1] = value >>> 16;
              this[offset + 2] = value >>> 8;
              this[offset + 3] = value & 0xff;
            } else {
              objectWriteUInt32(this, value, offset, false);
            }
  
            return offset + 4;
          };
  
          Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
            value = +value;
            offset = offset | 0;
  
            if (!noAssert) {
              var limit = Math.pow(2, 8 * byteLength - 1);
              checkInt(this, value, offset, byteLength, limit - 1, -limit);
            }
  
            var i = 0;
            var mul = 1;
            var sub = 0;
            this[offset] = value & 0xFF;
  
            while (++i < byteLength && (mul *= 0x100)) {
              if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
                sub = 1;
              }
  
              this[offset + i] = (value / mul >> 0) - sub & 0xFF;
            }
  
            return offset + byteLength;
          };
  
          Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
            value = +value;
            offset = offset | 0;
  
            if (!noAssert) {
              var limit = Math.pow(2, 8 * byteLength - 1);
              checkInt(this, value, offset, byteLength, limit - 1, -limit);
            }
  
            var i = byteLength - 1;
            var mul = 1;
            var sub = 0;
            this[offset + i] = value & 0xFF;
  
            while (--i >= 0 && (mul *= 0x100)) {
              if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
                sub = 1;
              }
  
              this[offset + i] = (value / mul >> 0) - sub & 0xFF;
            }
  
            return offset + byteLength;
          };
  
          Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80);
            if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value);
            if (value < 0) value = 0xff + value + 1;
            this[offset] = value & 0xff;
            return offset + 1;
          };
  
          Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value & 0xff;
              this[offset + 1] = value >>> 8;
            } else {
              objectWriteUInt16(this, value, offset, true);
            }
  
            return offset + 2;
          };
  
          Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value >>> 8;
              this[offset + 1] = value & 0xff;
            } else {
              objectWriteUInt16(this, value, offset, false);
            }
  
            return offset + 2;
          };
  
          Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value & 0xff;
              this[offset + 1] = value >>> 8;
              this[offset + 2] = value >>> 16;
              this[offset + 3] = value >>> 24;
            } else {
              objectWriteUInt32(this, value, offset, true);
            }
  
            return offset + 4;
          };
  
          Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
            value = +value;
            offset = offset | 0;
            if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000);
            if (value < 0) value = 0xffffffff + value + 1;
  
            if (Buffer.TYPED_ARRAY_SUPPORT) {
              this[offset] = value >>> 24;
              this[offset + 1] = value >>> 16;
              this[offset + 2] = value >>> 8;
              this[offset + 3] = value & 0xff;
            } else {
              objectWriteUInt32(this, value, offset, false);
            }
  
            return offset + 4;
          };
  
          function checkIEEE754(buf, value, offset, ext, max, min) {
            if (offset + ext > buf.length) throw new RangeError('Index out of range');
            if (offset < 0) throw new RangeError('Index out of range');
          }
  
          function writeFloat(buf, value, offset, littleEndian, noAssert) {
            if (!noAssert) {
              checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38);
            }
  
            ieee754.write(buf, value, offset, littleEndian, 23, 4);
            return offset + 4;
          }
  
          Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
            return writeFloat(this, value, offset, true, noAssert);
          };
  
          Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
            return writeFloat(this, value, offset, false, noAssert);
          };
  
          function writeDouble(buf, value, offset, littleEndian, noAssert) {
            if (!noAssert) {
              checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308);
            }
  
            ieee754.write(buf, value, offset, littleEndian, 52, 8);
            return offset + 8;
          }
  
          Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
            return writeDouble(this, value, offset, true, noAssert);
          };
  
          Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
            return writeDouble(this, value, offset, false, noAssert);
          }; // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
  
  
          Buffer.prototype.copy = function copy(target, targetStart, start, end) {
            if (!start) start = 0;
            if (!end && end !== 0) end = this.length;
            if (targetStart >= target.length) targetStart = target.length;
            if (!targetStart) targetStart = 0;
            if (end > 0 && end < start) end = start; // Copy 0 bytes; we're done
  
            if (end === start) return 0;
            if (target.length === 0 || this.length === 0) return 0; // Fatal error conditions
  
            if (targetStart < 0) {
              throw new RangeError('targetStart out of bounds');
            }
  
            if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds');
            if (end < 0) throw new RangeError('sourceEnd out of bounds'); // Are we oob?
  
            if (end > this.length) end = this.length;
  
            if (target.length - targetStart < end - start) {
              end = target.length - targetStart + start;
            }
  
            var len = end - start;
            var i;
  
            if (this === target && start < targetStart && targetStart < end) {
              // descending copy from end
              for (i = len - 1; i >= 0; --i) {
                target[i + targetStart] = this[i + start];
              }
            } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {
              // ascending copy from start
              for (i = 0; i < len; ++i) {
                target[i + targetStart] = this[i + start];
              }
            } else {
              Uint8Array.prototype.set.call(target, this.subarray(start, start + len), targetStart);
            }
  
            return len;
          }; // Usage:
          //    buffer.fill(number[, offset[, end]])
          //    buffer.fill(buffer[, offset[, end]])
          //    buffer.fill(string[, offset[, end]][, encoding])
  
  
          Buffer.prototype.fill = function fill(val, start, end, encoding) {
            // Handle string cases:
            if (typeof val === 'string') {
              if (typeof start === 'string') {
                encoding = start;
                start = 0;
                end = this.length;
              } else if (typeof end === 'string') {
                encoding = end;
                end = this.length;
              }
  
              if (val.length === 1) {
                var code = val.charCodeAt(0);
  
                if (code < 256) {
                  val = code;
                }
              }
  
              if (encoding !== undefined && typeof encoding !== 'string') {
                throw new TypeError('encoding must be a string');
              }
  
              if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {
                throw new TypeError('Unknown encoding: ' + encoding);
              }
            } else if (typeof val === 'number') {
              val = val & 255;
            } // Invalid ranges are not set to a default, so can range check early.
  
  
            if (start < 0 || this.length < start || this.length < end) {
              throw new RangeError('Out of range index');
            }
  
            if (end <= start) {
              return this;
            }
  
            start = start >>> 0;
            end = end === undefined ? this.length : end >>> 0;
            if (!val) val = 0;
            var i;
  
            if (typeof val === 'number') {
              for (i = start; i < end; ++i) {
                this[i] = val;
              }
            } else {
              var bytes = Buffer.isBuffer(val) ? val : utf8ToBytes(new Buffer(val, encoding).toString());
              var len = bytes.length;
  
              for (i = 0; i < end - start; ++i) {
                this[i + start] = bytes[i % len];
              }
            }
  
            return this;
          }; // HELPER FUNCTIONS
          // ================
  
  
          var INVALID_BASE64_RE = /[^+\/0-9A-Za-z-_]/g;
  
          function base64clean(str) {
            // Node strips out invalid characters like \n and \t from the string, base64-js does not
            str = stringtrim(str).replace(INVALID_BASE64_RE, ''); // Node converts strings with length < 2 to ''
  
            if (str.length < 2) return ''; // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
  
            while (str.length % 4 !== 0) {
              str = str + '=';
            }
  
            return str;
          }
  
          function stringtrim(str) {
            if (str.trim) return str.trim();
            return str.replace(/^\s+|\s+$/g, '');
          }
  
          function toHex(n) {
            if (n < 16) return '0' + n.toString(16);
            return n.toString(16);
          }
  
          function utf8ToBytes(string, units) {
            units = units || Infinity;
            var codePoint;
            var length = string.length;
            var leadSurrogate = null;
            var bytes = [];
  
            for (var i = 0; i < length; ++i) {
              codePoint = string.charCodeAt(i); // is surrogate component
  
              if (codePoint > 0xD7FF && codePoint < 0xE000) {
                // last char was a lead
                if (!leadSurrogate) {
                  // no lead yet
                  if (codePoint > 0xDBFF) {
                    // unexpected trail
                    if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
                    continue;
                  } else if (i + 1 === length) {
                    // unpaired lead
                    if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
                    continue;
                  } // valid lead
  
  
                  leadSurrogate = codePoint;
                  continue;
                } // 2 leads in a row
  
  
                if (codePoint < 0xDC00) {
                  if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
                  leadSurrogate = codePoint;
                  continue;
                } // valid surrogate pair
  
  
                codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000;
              } else if (leadSurrogate) {
                // valid bmp char, but last char was a lead
                if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD);
              }
  
              leadSurrogate = null; // encode utf8
  
              if (codePoint < 0x80) {
                if ((units -= 1) < 0) break;
                bytes.push(codePoint);
              } else if (codePoint < 0x800) {
                if ((units -= 2) < 0) break;
                bytes.push(codePoint >> 0x6 | 0xC0, codePoint & 0x3F | 0x80);
              } else if (codePoint < 0x10000) {
                if ((units -= 3) < 0) break;
                bytes.push(codePoint >> 0xC | 0xE0, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
              } else if (codePoint < 0x110000) {
                if ((units -= 4) < 0) break;
                bytes.push(codePoint >> 0x12 | 0xF0, codePoint >> 0xC & 0x3F | 0x80, codePoint >> 0x6 & 0x3F | 0x80, codePoint & 0x3F | 0x80);
              } else {
                throw new Error('Invalid code point');
              }
            }
  
            return bytes;
          }
  
          function asciiToBytes(str) {
            var byteArray = [];
  
            for (var i = 0; i < str.length; ++i) {
              // Node's code seems to be doing this and not & 0x7F..
              byteArray.push(str.charCodeAt(i) & 0xFF);
            }
  
            return byteArray;
          }
  
          function utf16leToBytes(str, units) {
            var c, hi, lo;
            var byteArray = [];
  
            for (var i = 0; i < str.length; ++i) {
              if ((units -= 2) < 0) break;
              c = str.charCodeAt(i);
              hi = c >> 8;
              lo = c % 256;
              byteArray.push(lo);
              byteArray.push(hi);
            }
  
            return byteArray;
          }
  
          function base64ToBytes(str) {
            return base64.toByteArray(base64clean(str));
          }
  
          function blitBuffer(src, dst, offset, length) {
            for (var i = 0; i < length; ++i) {
              if (i + offset >= dst.length || i >= src.length) break;
              dst[i + offset] = src[i];
            }
  
            return i;
          }
  
          function isnan(val) {
            return val !== val; // eslint-disable-line no-self-compare
          }
        }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
      }, {
        "base64-js": 8,
        "ieee754": 17,
        "isarray": 20
      }],
      12: [function (require, module, exports) {
        /**
         * Slice reference.
         */
        var slice = [].slice;
        /**
         * Bind `obj` to `fn`.
         *
         * @param {Object} obj
         * @param {Function|String} fn or string
         * @return {Function}
         * @api public
         */
  
        module.exports = function (obj, fn) {
          if ('string' == typeof fn) fn = obj[fn];
          if ('function' != typeof fn) throw new Error('bind() requires a function');
          var args = slice.call(arguments, 2);
          return function () {
            return fn.apply(obj, args.concat(slice.call(arguments)));
          };
        };
      }, {}],
      13: [function (require, module, exports) {
        (function (Buffer) {
          // Copyright Joyent, Inc. and other Node contributors.
          //
          // Permission is hereby granted, free of charge, to any person obtaining a
          // copy of this software and associated documentation files (the
          // "Software"), to deal in the Software without restriction, including
          // without limitation the rights to use, copy, modify, merge, publish,
          // distribute, sublicense, and/or sell copies of the Software, and to permit
          // persons to whom the Software is furnished to do so, subject to the
          // following conditions:
          //
          // The above copyright notice and this permission notice shall be included
          // in all copies or substantial portions of the Software.
          //
          // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
          // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
          // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
          // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
          // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
          // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
          // USE OR OTHER DEALINGS IN THE SOFTWARE.
          // NOTE: These type checking functions intentionally don't use `instanceof`
          // because it is fragile and can be easily faked with `Object.create()`.
          function isArray(arg) {
            if (Array.isArray) {
              return Array.isArray(arg);
            }
  
            return objectToString(arg) === '[object Array]';
          }
  
          exports.isArray = isArray;
  
          function isBoolean(arg) {
            return typeof arg === 'boolean';
          }
  
          exports.isBoolean = isBoolean;
  
          function isNull(arg) {
            return arg === null;
          }
  
          exports.isNull = isNull;
  
          function isNullOrUndefined(arg) {
            return arg == null;
          }
  
          exports.isNullOrUndefined = isNullOrUndefined;
  
          function isNumber(arg) {
            return typeof arg === 'number';
          }
  
          exports.isNumber = isNumber;
  
          function isString(arg) {
            return typeof arg === 'string';
          }
  
          exports.isString = isString;
  
          function isSymbol(arg) {
            return _typeof(arg) === 'symbol';
          }
  
          exports.isSymbol = isSymbol;
  
          function isUndefined(arg) {
            return arg === void 0;
          }
  
          exports.isUndefined = isUndefined;
  
          function isRegExp(re) {
            return objectToString(re) === '[object RegExp]';
          }
  
          exports.isRegExp = isRegExp;
  
          function isObject(arg) {
            return _typeof(arg) === 'object' && arg !== null;
          }
  
          exports.isObject = isObject;
  
          function isDate(d) {
            return objectToString(d) === '[object Date]';
          }
  
          exports.isDate = isDate;
  
          function isError(e) {
            return objectToString(e) === '[object Error]' || e instanceof Error;
          }
  
          exports.isError = isError;
  
          function isFunction(arg) {
            return typeof arg === 'function';
          }
  
          exports.isFunction = isFunction;
  
          function isPrimitive(arg) {
            return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || _typeof(arg) === 'symbol' || // ES6 symbol
            typeof arg === 'undefined';
          }
  
          exports.isPrimitive = isPrimitive;
          exports.isBuffer = Buffer.isBuffer;
  
          function objectToString(o) {
            return Object.prototype.toString.call(o);
          }
        }).call(this, {
          "isBuffer": require("../../is-buffer/index.js")
        });
      }, {
        "../../is-buffer/index.js": 19
      }],
      14: [function (require, module, exports) {
        /**
         * This is the web browser implementation of `debug()`.
         *
         * Expose `debug()` as the module.
         */
        exports = module.exports = require('./debug');
        exports.log = log;
        exports.formatArgs = formatArgs;
        exports.save = save;
        exports.load = load;
        exports.useColors = useColors;
        exports.storage = 'undefined' != typeof chrome && 'undefined' != typeof chrome.storage ? chrome.storage.local : localstorage();
        /**
         * Colors.
         */
  
        exports.colors = ['lightseagreen', 'forestgreen', 'goldenrod', 'dodgerblue', 'darkorchid', 'crimson'];
        /**
         * Currently only WebKit-based Web Inspectors, Firefox >= v31,
         * and the Firebug extension (any Firefox version) are known
         * to support "%c" CSS customizations.
         *
         * TODO: add a `localStorage` variable to explicitly enable/disable colors
         */
  
        function useColors() {
          // is webkit? http://stackoverflow.com/a/16459606/376773
          return 'WebkitAppearance' in document.documentElement.style || // is firebug? http://stackoverflow.com/a/398120/376773
          window.console && (console.firebug || console.exception && console.table) || // is firefox >= v31?
          // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
          navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31;
        }
        /**
         * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
         */
  
  
        exports.formatters.j = function (v) {
          return JSON.stringify(v);
        };
        /**
         * Colorize log arguments if enabled.
         *
         * @api public
         */
  
  
        function formatArgs() {
          var args = arguments;
          var useColors = this.useColors;
          args[0] = (useColors ? '%c' : '') + this.namespace + (useColors ? ' %c' : ' ') + args[0] + (useColors ? '%c ' : ' ') + '+' + exports.humanize(this.diff);
          if (!useColors) return args;
          var c = 'color: ' + this.color;
          args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1)); // the final "%c" is somewhat tricky, because there could be other
          // arguments passed either before or after the %c, so we need to
          // figure out the correct index to insert the CSS into
  
          var index = 0;
          var lastC = 0;
          args[0].replace(/%[a-z%]/g, function (match) {
            if ('%%' === match) return;
            index++;
  
            if ('%c' === match) {
              // we only are interested in the *last* %c
              // (the user may have provided their own)
              lastC = index;
            }
          });
          args.splice(lastC, 0, c);
          return args;
        }
        /**
         * Invokes `console.log()` when available.
         * No-op when `console.log` is not a "function".
         *
         * @api public
         */
  
  
        function log() {
          // this hackery is required for IE8/9, where
          // the `console.log` function doesn't have 'apply'
          return 'object' === (typeof console === "undefined" ? "undefined" : _typeof(console)) && console.log && Function.prototype.apply.call(console.log, console, arguments);
        }
        /**
         * Save `namespaces`.
         *
         * @param {String} namespaces
         * @api private
         */
  
  
        function save(namespaces) {
          try {
            if (null == namespaces) {
              exports.storage.removeItem('debug');
            } else {
              exports.storage.debug = namespaces;
            }
          } catch (e) {}
        }
        /**
         * Load `namespaces`.
         *
         * @return {String} returns the previously persisted debug modes
         * @api private
         */
  
  
        function load() {
          var r;
  
          try {
            r = exports.storage.debug;
          } catch (e) {}
  
          return r;
        }
        /**
         * Enable namespaces listed in `localStorage.debug` initially.
         */
  
  
        exports.enable(load());
        /**
         * Localstorage attempts to return the localstorage.
         *
         * This is necessary because safari throws
         * when a user disables cookies/localstorage
         * and you attempt to access it.
         *
         * @return {LocalStorage}
         * @api private
         */
  
        function localstorage() {
          try {
            return window.localStorage;
          } catch (e) {}
        }
      }, {
        "./debug": 15
      }],
      15: [function (require, module, exports) {
        /**
         * This is the common logic for both the Node.js and web browser
         * implementations of `debug()`.
         *
         * Expose `debug()` as the module.
         */
        exports = module.exports = debug;
        exports.coerce = coerce;
        exports.disable = disable;
        exports.enable = enable;
        exports.enabled = enabled;
        exports.humanize = require('ms');
        /**
         * The currently active debug mode names, and names to skip.
         */
  
        exports.names = [];
        exports.skips = [];
        /**
         * Map of special "%n" handling functions, for the debug "format" argument.
         *
         * Valid key names are a single, lowercased letter, i.e. "n".
         */
  
        exports.formatters = {};
        /**
         * Previously assigned color.
         */
  
        var prevColor = 0;
        /**
         * Previous log timestamp.
         */
  
        var prevTime;
        /**
         * Select a color.
         *
         * @return {Number}
         * @api private
         */
  
        function selectColor() {
          return exports.colors[prevColor++ % exports.colors.length];
        }
        /**
         * Create a debugger with the given `namespace`.
         *
         * @param {String} namespace
         * @return {Function}
         * @api public
         */
  
  
        function debug(namespace) {
          // define the `disabled` version
          function disabled() {}
  
          disabled.enabled = false; // define the `enabled` version
  
          function enabled() {
            var self = enabled; // set `diff` timestamp
  
            var curr = +new Date();
            var ms = curr - (prevTime || curr);
            self.diff = ms;
            self.prev = prevTime;
            self.curr = curr;
            prevTime = curr; // add the `color` if not set
  
            if (null == self.useColors) self.useColors = exports.useColors();
            if (null == self.color && self.useColors) self.color = selectColor();
            var args = Array.prototype.slice.call(arguments);
            args[0] = exports.coerce(args[0]);
  
            if ('string' !== typeof args[0]) {
              // anything else let's inspect with %o
              args = ['%o'].concat(args);
            } // apply any `formatters` transformations
  
  
            var index = 0;
            args[0] = args[0].replace(/%([a-z%])/g, function (match, format) {
              // if we encounter an escaped % then don't increase the array index
              if (match === '%%') return match;
              index++;
              var formatter = exports.formatters[format];
  
              if ('function' === typeof formatter) {
                var val = args[index];
                match = formatter.call(self, val); // now we need to remove `args[index]` since it's inlined in the `format`
  
                args.splice(index, 1);
                index--;
              }
  
              return match;
            });
  
            if ('function' === typeof exports.formatArgs) {
              args = exports.formatArgs.apply(self, args);
            }
  
            var logFn = enabled.log || exports.log || console.log.bind(console);
            logFn.apply(self, args);
          }
  
          enabled.enabled = true;
          var fn = exports.enabled(namespace) ? enabled : disabled;
          fn.namespace = namespace;
          return fn;
        }
        /**
         * Enables a debug mode by namespaces. This can include modes
         * separated by a colon and wildcards.
         *
         * @param {String} namespaces
         * @api public
         */
  
  
        function enable(namespaces) {
          exports.save(namespaces);
          var split = (namespaces || '').split(/[\s,]+/);
          var len = split.length;
  
          for (var i = 0; i < len; i++) {
            if (!split[i]) continue; // ignore empty strings
  
            namespaces = split[i].replace(/\*/g, '.*?');
  
            if (namespaces[0] === '-') {
              exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));
            } else {
              exports.names.push(new RegExp('^' + namespaces + '$'));
            }
          }
        }
        /**
         * Disable debug output.
         *
         * @api public
         */
  
  
        function disable() {
          exports.enable('');
        }
        /**
         * Returns true if the given mode name is enabled, false otherwise.
         *
         * @param {String} name
         * @return {Boolean}
         * @api public
         */
  
  
        function enabled(name) {
          var i, len;
  
          for (i = 0, len = exports.skips.length; i < len; i++) {
            if (exports.skips[i].test(name)) {
              return false;
            }
          }
  
          for (i = 0, len = exports.names.length; i < len; i++) {
            if (exports.names[i].test(name)) {
              return true;
            }
          }
  
          return false;
        }
        /**
         * Coerce `val`.
         *
         * @param {Mixed} val
         * @return {Mixed}
         * @api private
         */
  
  
        function coerce(val) {
          if (val instanceof Error) return val.stack || val.message;
          return val;
        }
      }, {
        "ms": 21
      }],
      16: [function (require, module, exports) {
        // Copyright Joyent, Inc. and other Node contributors.
        //
        // Permission is hereby granted, free of charge, to any person obtaining a
        // copy of this software and associated documentation files (the
        // "Software"), to deal in the Software without restriction, including
        // without limitation the rights to use, copy, modify, merge, publish,
        // distribute, sublicense, and/or sell copies of the Software, and to permit
        // persons to whom the Software is furnished to do so, subject to the
        // following conditions:
        //
        // The above copyright notice and this permission notice shall be included
        // in all copies or substantial portions of the Software.
        //
        // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
        // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
        // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
        // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
        // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
        // USE OR OTHER DEALINGS IN THE SOFTWARE.
        function EventEmitter() {
          this._events = this._events || {};
          this._maxListeners = this._maxListeners || undefined;
        }
  
        module.exports = EventEmitter; // Backwards-compat with node 0.10.x
  
        EventEmitter.EventEmitter = EventEmitter;
        EventEmitter.prototype._events = undefined;
        EventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are
        // added to it. This is a useful default which helps finding memory leaks.
  
        EventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows
        // that to be increased. Set to zero for unlimited.
  
        EventEmitter.prototype.setMaxListeners = function (n) {
          if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');
          this._maxListeners = n;
          return this;
        };
  
        EventEmitter.prototype.emit = function (type) {
          var er, handler, len, args, i, listeners;
          if (!this._events) this._events = {}; // If there is no 'error' event listener then throw.
  
          if (type === 'error') {
            if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {
              er = arguments[1];
  
              if (er instanceof Error) {
                throw er; // Unhandled 'error' event
              } else {
                // At least give some kind of context to the user
                var err = new Error('Uncaught, unspecified "error" event. (' + er + ')');
                err.context = er;
                throw err;
              }
            }
          }
  
          handler = this._events[type];
          if (isUndefined(handler)) return false;
  
          if (isFunction(handler)) {
            switch (arguments.length) {
              // fast cases
              case 1:
                handler.call(this);
                break;
  
              case 2:
                handler.call(this, arguments[1]);
                break;
  
              case 3:
                handler.call(this, arguments[1], arguments[2]);
                break;
              // slower
  
              default:
                args = Array.prototype.slice.call(arguments, 1);
                handler.apply(this, args);
            }
          } else if (isObject(handler)) {
            args = Array.prototype.slice.call(arguments, 1);
            listeners = handler.slice();
            len = listeners.length;
  
            for (i = 0; i < len; i++) {
              listeners[i].apply(this, args);
            }
          }
  
          return true;
        };
  
        EventEmitter.prototype.addListener = function (type, listener) {
          var m;
          if (!isFunction(listener)) throw TypeError('listener must be a function');
          if (!this._events) this._events = {}; // To avoid recursion in the case that type === "newListener"! Before
          // adding it to the listeners, first emit "newListener".
  
          if (this._events.newListener) this.emit('newListener', type, isFunction(listener.listener) ? listener.listener : listener);
          if (!this._events[type]) // Optimize the case of one listener. Don't need the extra array object.
            this._events[type] = listener;else if (isObject(this._events[type])) // If we've already got an array, just append.
            this._events[type].push(listener);else // Adding the second element, need to change to array.
            this._events[type] = [this._events[type], listener]; // Check for listener leak
  
          if (isObject(this._events[type]) && !this._events[type].warned) {
            if (!isUndefined(this._maxListeners)) {
              m = this._maxListeners;
            } else {
              m = EventEmitter.defaultMaxListeners;
            }
  
            if (m && m > 0 && this._events[type].length > m) {
              this._events[type].warned = true;
              console.error('(node) warning: possible EventEmitter memory ' + 'leak detected. %d listeners added. ' + 'Use emitter.setMaxListeners() to increase limit.', this._events[type].length);
  
              if (typeof console.trace === 'function') {
                // not supported in IE 10
                console.trace();
              }
            }
          }
  
          return this;
        };
  
        EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  
        EventEmitter.prototype.once = function (type, listener) {
          if (!isFunction(listener)) throw TypeError('listener must be a function');
          var fired = false;
  
          function g() {
            this.removeListener(type, g);
  
            if (!fired) {
              fired = true;
              listener.apply(this, arguments);
            }
          }
  
          g.listener = listener;
          this.on(type, g);
          return this;
        }; // emits a 'removeListener' event iff the listener was removed
  
  
        EventEmitter.prototype.removeListener = function (type, listener) {
          var list, position, length, i;
          if (!isFunction(listener)) throw TypeError('listener must be a function');
          if (!this._events || !this._events[type]) return this;
          list = this._events[type];
          length = list.length;
          position = -1;
  
          if (list === listener || isFunction(list.listener) && list.listener === listener) {
            delete this._events[type];
            if (this._events.removeListener) this.emit('removeListener', type, listener);
          } else if (isObject(list)) {
            for (i = length; i-- > 0;) {
              if (list[i] === listener || list[i].listener && list[i].listener === listener) {
                position = i;
                break;
              }
            }
  
            if (position < 0) return this;
  
            if (list.length === 1) {
              list.length = 0;
              delete this._events[type];
            } else {
              list.splice(position, 1);
            }
  
            if (this._events.removeListener) this.emit('removeListener', type, listener);
          }
  
          return this;
        };
  
        EventEmitter.prototype.removeAllListeners = function (type) {
          var key, listeners;
          if (!this._events) return this; // not listening for removeListener, no need to emit
  
          if (!this._events.removeListener) {
            if (arguments.length === 0) this._events = {};else if (this._events[type]) delete this._events[type];
            return this;
          } // emit removeListener for all listeners on all events
  
  
          if (arguments.length === 0) {
            for (key in this._events) {
              if (key === 'removeListener') continue;
              this.removeAllListeners(key);
            }
  
            this.removeAllListeners('removeListener');
            this._events = {};
            return this;
          }
  
          listeners = this._events[type];
  
          if (isFunction(listeners)) {
            this.removeListener(type, listeners);
          } else if (listeners) {
            // LIFO order
            while (listeners.length) {
              this.removeListener(type, listeners[listeners.length - 1]);
            }
          }
  
          delete this._events[type];
          return this;
        };
  
        EventEmitter.prototype.listeners = function (type) {
          var ret;
          if (!this._events || !this._events[type]) ret = [];else if (isFunction(this._events[type])) ret = [this._events[type]];else ret = this._events[type].slice();
          return ret;
        };
  
        EventEmitter.prototype.listenerCount = function (type) {
          if (this._events) {
            var evlistener = this._events[type];
            if (isFunction(evlistener)) return 1;else if (evlistener) return evlistener.length;
          }
  
          return 0;
        };
  
        EventEmitter.listenerCount = function (emitter, type) {
          return emitter.listenerCount(type);
        };
  
        function isFunction(arg) {
          return typeof arg === 'function';
        }
  
        function isNumber(arg) {
          return typeof arg === 'number';
        }
  
        function isObject(arg) {
          return _typeof(arg) === 'object' && arg !== null;
        }
  
        function isUndefined(arg) {
          return arg === void 0;
        }
      }, {}],
      17: [function (require, module, exports) {
        exports.read = function (buffer, offset, isLE, mLen, nBytes) {
          var e, m;
          var eLen = nBytes * 8 - mLen - 1;
          var eMax = (1 << eLen) - 1;
          var eBias = eMax >> 1;
          var nBits = -7;
          var i = isLE ? nBytes - 1 : 0;
          var d = isLE ? -1 : 1;
          var s = buffer[offset + i];
          i += d;
          e = s & (1 << -nBits) - 1;
          s >>= -nBits;
          nBits += eLen;
  
          for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  
          m = e & (1 << -nBits) - 1;
          e >>= -nBits;
          nBits += mLen;
  
          for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  
          if (e === 0) {
            e = 1 - eBias;
          } else if (e === eMax) {
            return m ? NaN : (s ? -1 : 1) * Infinity;
          } else {
            m = m + Math.pow(2, mLen);
            e = e - eBias;
          }
  
          return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
        };
  
        exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
          var e, m, c;
          var eLen = nBytes * 8 - mLen - 1;
          var eMax = (1 << eLen) - 1;
          var eBias = eMax >> 1;
          var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
          var i = isLE ? 0 : nBytes - 1;
          var d = isLE ? 1 : -1;
          var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
          value = Math.abs(value);
  
          if (isNaN(value) || value === Infinity) {
            m = isNaN(value) ? 1 : 0;
            e = eMax;
          } else {
            e = Math.floor(Math.log(value) / Math.LN2);
  
            if (value * (c = Math.pow(2, -e)) < 1) {
              e--;
              c *= 2;
            }
  
            if (e + eBias >= 1) {
              value += rt / c;
            } else {
              value += rt * Math.pow(2, 1 - eBias);
            }
  
            if (value * c >= 2) {
              e++;
              c /= 2;
            }
  
            if (e + eBias >= eMax) {
              m = 0;
              e = eMax;
            } else if (e + eBias >= 1) {
              m = (value * c - 1) * Math.pow(2, mLen);
              e = e + eBias;
            } else {
              m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
              e = 0;
            }
          }
  
          for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}
  
          e = e << mLen | m;
          eLen += mLen;
  
          for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}
  
          buffer[offset + i - d] |= s * 128;
        };
      }, {}],
      18: [function (require, module, exports) {
        if (typeof Object.create === 'function') {
          // implementation from standard node.js 'util' module
          module.exports = function inherits(ctor, superCtor) {
            ctor.super_ = superCtor;
            ctor.prototype = Object.create(superCtor.prototype, {
              constructor: {
                value: ctor,
                enumerable: false,
                writable: true,
                configurable: true
              }
            });
          };
        } else {
          // old school shim for old browsers
          module.exports = function inherits(ctor, superCtor) {
            ctor.super_ = superCtor;
  
            var TempCtor = function TempCtor() {};
  
            TempCtor.prototype = superCtor.prototype;
            ctor.prototype = new TempCtor();
            ctor.prototype.constructor = ctor;
          };
        }
      }, {}],
      19: [function (require, module, exports) {
        /*!
         * Determine if an object is a Buffer
         *
         * @author   Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
         * @license  MIT
         */
        // The _isBuffer check is for Safari 5-7 support, because it's missing
        // Object.prototype.constructor. Remove this eventually
        module.exports = function (obj) {
          return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer);
        };
  
        function isBuffer(obj) {
          return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj);
        } // For Node v0.10 support. Remove this eventually.
  
  
        function isSlowBuffer(obj) {
          return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0));
        }
      }, {}],
      20: [function (require, module, exports) {
        var toString = {}.toString;
  
        module.exports = Array.isArray || function (arr) {
          return toString.call(arr) == '[object Array]';
        };
      }, {}],
      21: [function (require, module, exports) {
        /**
         * Helpers.
         */
        var s = 1000;
        var m = s * 60;
        var h = m * 60;
        var d = h * 24;
        var y = d * 365.25;
        /**
         * Parse or format the given `val`.
         *
         * Options:
         *
         *  - `long` verbose formatting [false]
         *
         * @param {String|Number} val
         * @param {Object} options
         * @return {String|Number}
         * @api public
         */
  
        module.exports = function (val, options) {
          options = options || {};
          if ('string' == typeof val) return parse(val);
          return options["long"] ? _long(val) : _short(val);
        };
        /**
         * Parse the given `str` and return milliseconds.
         *
         * @param {String} str
         * @return {Number}
         * @api private
         */
  
  
        function parse(str) {
          str = '' + str;
          if (str.length > 10000) return;
          var match = /^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);
          if (!match) return;
          var n = parseFloat(match[1]);
          var type = (match[2] || 'ms').toLowerCase();
  
          switch (type) {
            case 'years':
            case 'year':
            case 'yrs':
            case 'yr':
            case 'y':
              return n * y;
  
            case 'days':
            case 'day':
            case 'd':
              return n * d;
  
            case 'hours':
            case 'hour':
            case 'hrs':
            case 'hr':
            case 'h':
              return n * h;
  
            case 'minutes':
            case 'minute':
            case 'mins':
            case 'min':
            case 'm':
              return n * m;
  
            case 'seconds':
            case 'second':
            case 'secs':
            case 'sec':
            case 's':
              return n * s;
  
            case 'milliseconds':
            case 'millisecond':
            case 'msecs':
            case 'msec':
            case 'ms':
              return n;
          }
        }
        /**
         * Short format for `ms`.
         *
         * @param {Number} ms
         * @return {String}
         * @api private
         */
  
  
        function _short(ms) {
          if (ms >= d) return Math.round(ms / d) + 'd';
          if (ms >= h) return Math.round(ms / h) + 'h';
          if (ms >= m) return Math.round(ms / m) + 'm';
          if (ms >= s) return Math.round(ms / s) + 's';
          return ms + 'ms';
        }
        /**
         * Long format for `ms`.
         *
         * @param {Number} ms
         * @return {String}
         * @api private
         */
  
  
        function _long(ms) {
          return plural(ms, d, 'day') || plural(ms, h, 'hour') || plural(ms, m, 'minute') || plural(ms, s, 'second') || ms + ' ms';
        }
        /**
         * Pluralization helper.
         */
  
  
        function plural(ms, n, name) {
          if (ms < n) return;
          if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
          return Math.ceil(ms / n) + ' ' + name + 's';
        }
      }, {}],
      22: [function (require, module, exports) {
        (function (process) {
          'use strict';
  
          if (!process.version || process.version.indexOf('v0.') === 0 || process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) {
            module.exports = nextTick;
          } else {
            module.exports = process.nextTick;
          }
  
          function nextTick(fn, arg1, arg2, arg3) {
            if (typeof fn !== 'function') {
              throw new TypeError('"callback" argument must be a function');
            }
  
            var len = arguments.length;
            var args, i;
  
            switch (len) {
              case 0:
              case 1:
                return process.nextTick(fn);
  
              case 2:
                return process.nextTick(function afterTickOne() {
                  fn.call(null, arg1);
                });
  
              case 3:
                return process.nextTick(function afterTickTwo() {
                  fn.call(null, arg1, arg2);
                });
  
              case 4:
                return process.nextTick(function afterTickThree() {
                  fn.call(null, arg1, arg2, arg3);
                });
  
              default:
                args = new Array(len - 1);
                i = 0;
  
                while (i < args.length) {
                  args[i++] = arguments[i];
                }
  
                return process.nextTick(function afterTick() {
                  fn.apply(null, args);
                });
            }
          }
        }).call(this, require('_process'));
      }, {
        "_process": 23
      }],
      23: [function (require, module, exports) {
        // shim for using process in browser
        var process = module.exports = {}; // cached from whatever global is present so that test runners that stub it
        // don't break things.  But we need to wrap it in a try catch in case it is
        // wrapped in strict mode code which doesn't define any globals.  It's inside a
        // function because try/catches deoptimize in certain engines.
  
        var cachedSetTimeout;
        var cachedClearTimeout;
  
        function defaultSetTimout() {
          throw new Error('setTimeout has not been defined');
        }
  
        function defaultClearTimeout() {
          throw new Error('clearTimeout has not been defined');
        }
  
        (function () {
          try {
            if (typeof setTimeout === 'function') {
              cachedSetTimeout = setTimeout;
            } else {
              cachedSetTimeout = defaultSetTimout;
            }
          } catch (e) {
            cachedSetTimeout = defaultSetTimout;
          }
  
          try {
            if (typeof clearTimeout === 'function') {
              cachedClearTimeout = clearTimeout;
            } else {
              cachedClearTimeout = defaultClearTimeout;
            }
          } catch (e) {
            cachedClearTimeout = defaultClearTimeout;
          }
        })();
  
        function runTimeout(fun) {
          if (cachedSetTimeout === setTimeout) {
            //normal enviroments in sane situations
            return setTimeout(fun, 0);
          } // if setTimeout wasn't available but was latter defined
  
  
          if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
            cachedSetTimeout = setTimeout;
            return setTimeout(fun, 0);
          }
  
          try {
            // when when somebody has screwed with setTimeout but no I.E. maddness
            return cachedSetTimeout(fun, 0);
          } catch (e) {
            try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally
              return cachedSetTimeout.call(null, fun, 0);
            } catch (e) {
              // 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
              return cachedSetTimeout.call(this, fun, 0);
            }
          }
        }
  
        function runClearTimeout(marker) {
          if (cachedClearTimeout === clearTimeout) {
            //normal enviroments in sane situations
            return clearTimeout(marker);
          } // if clearTimeout wasn't available but was latter defined
  
  
          if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
            cachedClearTimeout = clearTimeout;
            return clearTimeout(marker);
          }
  
          try {
            // when when somebody has screwed with setTimeout but no I.E. maddness
            return cachedClearTimeout(marker);
          } catch (e) {
            try {
              // When we are in I.E. but the script has been evaled so I.E. doesn't  trust the global object when called normally
              return cachedClearTimeout.call(null, marker);
            } catch (e) {
              // 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.
              // Some versions of I.E. have different rules for clearTimeout vs setTimeout
              return cachedClearTimeout.call(this, marker);
            }
          }
        }
  
        var queue = [];
        var draining = false;
        var currentQueue;
        var queueIndex = -1;
  
        function cleanUpNextTick() {
          if (!draining || !currentQueue) {
            return;
          }
  
          draining = false;
  
          if (currentQueue.length) {
            queue = currentQueue.concat(queue);
          } else {
            queueIndex = -1;
          }
  
          if (queue.length) {
            drainQueue();
          }
        }
  
        function drainQueue() {
          if (draining) {
            return;
          }
  
          var timeout = runTimeout(cleanUpNextTick);
          draining = true;
          var len = queue.length;
  
          while (len) {
            currentQueue = queue;
            queue = [];
  
            while (++queueIndex < len) {
              if (currentQueue) {
                currentQueue[queueIndex].run();
              }
            }
  
            queueIndex = -1;
            len = queue.length;
          }
  
          currentQueue = null;
          draining = false;
          runClearTimeout(timeout);
        }
  
        process.nextTick = function (fun) {
          var args = new Array(arguments.length - 1);
  
          if (arguments.length > 1) {
            for (var i = 1; i < arguments.length; i++) {
              args[i - 1] = arguments[i];
            }
          }
  
          queue.push(new Item(fun, args));
  
          if (queue.length === 1 && !draining) {
            runTimeout(drainQueue);
          }
        }; // v8 likes predictible objects
  
  
        function Item(fun, array) {
          this.fun = fun;
          this.array = array;
        }
  
        Item.prototype.run = function () {
          this.fun.apply(null, this.array);
        };
  
        process.title = 'browser';
        process.browser = true;
        process.env = {};
        process.argv = [];
        process.version = ''; // empty string to avoid regexp issues
  
        process.versions = {};
  
        function noop() {}
  
        process.on = noop;
        process.addListener = noop;
        process.once = noop;
        process.off = noop;
        process.removeListener = noop;
        process.removeAllListeners = noop;
        process.emit = noop;
  
        process.binding = function (name) {
          throw new Error('process.binding is not supported');
        };
  
        process.cwd = function () {
          return '/';
        };
  
        process.chdir = function (dir) {
          throw new Error('process.chdir is not supported');
        };
  
        process.umask = function () {
          return 0;
        };
      }, {}],
      24: [function (require, module, exports) {
        module.exports = require("./lib/_stream_duplex.js");
      }, {
        "./lib/_stream_duplex.js": 25
      }],
      25: [function (require, module, exports) {
        // a duplex stream is just a stream that is both readable and writable.
        // Since JS doesn't have multiple prototypal inheritance, this class
        // prototypally inherits from Readable, and then parasitically from
        // Writable.
        'use strict';
        /*<replacement>*/
  
        var objectKeys = Object.keys || function (obj) {
          var keys = [];
  
          for (var key in obj) {
            keys.push(key);
          }
  
          return keys;
        };
        /*</replacement>*/
  
  
        module.exports = Duplex;
        /*<replacement>*/
  
        var processNextTick = require('process-nextick-args');
        /*</replacement>*/
  
        /*<replacement>*/
  
  
        var util = require('core-util-is');
  
        util.inherits = require('inherits');
        /*</replacement>*/
  
        var Readable = require('./_stream_readable');
  
        var Writable = require('./_stream_writable');
  
        util.inherits(Duplex, Readable);
        var keys = objectKeys(Writable.prototype);
  
        for (var v = 0; v < keys.length; v++) {
          var method = keys[v];
          if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method];
        }
  
        function Duplex(options) {
          if (!(this instanceof Duplex)) return new Duplex(options);
          Readable.call(this, options);
          Writable.call(this, options);
          if (options && options.readable === false) this.readable = false;
          if (options && options.writable === false) this.writable = false;
          this.allowHalfOpen = true;
          if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
          this.once('end', onend);
        } // the no-half-open enforcer
  
  
        function onend() {
          // if we allow half-open state, or if the writable side ended,
          // then we're ok.
          if (this.allowHalfOpen || this._writableState.ended) return; // no more data can be written.
          // But allow more writes to happen in this tick.
  
          processNextTick(onEndNT, this);
        }
  
        function onEndNT(self) {
          self.end();
        }
  
        function forEach(xs, f) {
          for (var i = 0, l = xs.length; i < l; i++) {
            f(xs[i], i);
          }
        }
      }, {
        "./_stream_readable": 27,
        "./_stream_writable": 29,
        "core-util-is": 13,
        "inherits": 18,
        "process-nextick-args": 22
      }],
      26: [function (require, module, exports) {
        // a passthrough stream.
        // basically just the most minimal sort of Transform stream.
        // Every written chunk gets output as-is.
        'use strict';
  
        module.exports = PassThrough;
  
        var Transform = require('./_stream_transform');
        /*<replacement>*/
  
  
        var util = require('core-util-is');
  
        util.inherits = require('inherits');
        /*</replacement>*/
  
        util.inherits(PassThrough, Transform);
  
        function PassThrough(options) {
          if (!(this instanceof PassThrough)) return new PassThrough(options);
          Transform.call(this, options);
        }
  
        PassThrough.prototype._transform = function (chunk, encoding, cb) {
          cb(null, chunk);
        };
      }, {
        "./_stream_transform": 28,
        "core-util-is": 13,
        "inherits": 18
      }],
      27: [function (require, module, exports) {
        (function (process) {
          'use strict';
  
          module.exports = Readable;
          /*<replacement>*/
  
          var processNextTick = require('process-nextick-args');
          /*</replacement>*/
  
          /*<replacement>*/
  
  
          var isArray = require('isarray');
          /*</replacement>*/
  
  
          Readable.ReadableState = ReadableState;
          /*<replacement>*/
  
          var EE = require('events').EventEmitter;
  
          var EElistenerCount = function EElistenerCount(emitter, type) {
            return emitter.listeners(type).length;
          };
          /*</replacement>*/
  
          /*<replacement>*/
  
  
          var Stream;
  
          (function () {
            try {
              Stream = require('st' + 'ream');
            } catch (_) {} finally {
              if (!Stream) Stream = require('events').EventEmitter;
            }
          })();
          /*</replacement>*/
  
  
          var Buffer = require('buffer').Buffer;
          /*<replacement>*/
  
  
          var bufferShim = require('buffer-shims');
          /*</replacement>*/
  
          /*<replacement>*/
  
  
          var util = require('core-util-is');
  
          util.inherits = require('inherits');
          /*</replacement>*/
  
          /*<replacement>*/
  
          var debugUtil = require('util');
  
          var debug = void 0;
  
          if (debugUtil && debugUtil.debuglog) {
            debug = debugUtil.debuglog('stream');
          } else {
            debug = function debug() {};
          }
          /*</replacement>*/
  
  
          var BufferList = require('./internal/streams/BufferList');
  
          var StringDecoder;
          util.inherits(Readable, Stream);
  
          function prependListener(emitter, event, fn) {
            if (typeof emitter.prependListener === 'function') {
              return emitter.prependListener(event, fn);
            } else {
              // This is a hack to make sure that our error handler is attached before any
              // userland ones.  NEVER DO THIS. This is here only because this code needs
              // to continue to work with older versions of Node.js that do not include
              // the prependListener() method. The goal is to eventually remove this hack.
              if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]];
            }
          }
  
          var Duplex;
  
          function ReadableState(options, stream) {
            Duplex = Duplex || require('./_stream_duplex');
            options = options || {}; // object stream flag. Used to make read(n) ignore n and to
            // make all the buffer merging and length checks go away
  
            this.objectMode = !!options.objectMode;
            if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; // the point at which it stops calling _read() to fill the buffer
            // Note: 0 is a valid value, means "don't call _read preemptively ever"
  
            var hwm = options.highWaterMark;
            var defaultHwm = this.objectMode ? 16 : 16 * 1024;
            this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints.
  
            this.highWaterMark = ~~this.highWaterMark; // A linked list is used to store data chunks instead of an array because the
            // linked list can remove elements from the beginning faster than
            // array.shift()
  
            this.buffer = new BufferList();
            this.length = 0;
            this.pipes = null;
            this.pipesCount = 0;
            this.flowing = null;
            this.ended = false;
            this.endEmitted = false;
            this.reading = false; // a flag to be able to tell if the onwrite cb is called immediately,
            // or on a later tick.  We set this to true at first, because any
            // actions that shouldn't happen until "later" should generally also
            // not happen before the first write call.
  
            this.sync = true; // whenever we return null, then we set a flag to say
            // that we're awaiting a 'readable' event emission.
  
            this.needReadable = false;
            this.emittedReadable = false;
            this.readableListening = false;
            this.resumeScheduled = false; // Crypto is kind of old and crusty.  Historically, its default string
            // encoding is 'binary' so we have to make this configurable.
            // Everything else in the universe uses 'utf8', though.
  
            this.defaultEncoding = options.defaultEncoding || 'utf8'; // when piping, we only care about 'readable' events that happen
            // after read()ing all the bytes and not getting any pushback.
  
            this.ranOut = false; // the number of writers that are awaiting a drain event in .pipe()s
  
            this.awaitDrain = 0; // if true, a maybeReadMore has been scheduled
  
            this.readingMore = false;
            this.decoder = null;
            this.encoding = null;
  
            if (options.encoding) {
              if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
              this.decoder = new StringDecoder(options.encoding);
              this.encoding = options.encoding;
            }
          }
  
          var Duplex;
  
          function Readable(options) {
            Duplex = Duplex || require('./_stream_duplex');
            if (!(this instanceof Readable)) return new Readable(options);
            this._readableState = new ReadableState(options, this); // legacy
  
            this.readable = true;
            if (options && typeof options.read === 'function') this._read = options.read;
            Stream.call(this);
          } // Manually shove something into the read() buffer.
          // This returns true if the highWaterMark has not been hit yet,
          // similar to how Writable.write() returns true if you should
          // write() some more.
  
  
          Readable.prototype.push = function (chunk, encoding) {
            var state = this._readableState;
  
            if (!state.objectMode && typeof chunk === 'string') {
              encoding = encoding || state.defaultEncoding;
  
              if (encoding !== state.encoding) {
                chunk = bufferShim.from(chunk, encoding);
                encoding = '';
              }
            }
  
            return readableAddChunk(this, state, chunk, encoding, false);
          }; // Unshift should *always* be something directly out of read()
  
  
          Readable.prototype.unshift = function (chunk) {
            var state = this._readableState;
            return readableAddChunk(this, state, chunk, '', true);
          };
  
          Readable.prototype.isPaused = function () {
            return this._readableState.flowing === false;
          };
  
          function readableAddChunk(stream, state, chunk, encoding, addToFront) {
            var er = chunkInvalid(state, chunk);
  
            if (er) {
              stream.emit('error', er);
            } else if (chunk === null) {
              state.reading = false;
              onEofChunk(stream, state);
            } else if (state.objectMode || chunk && chunk.length > 0) {
              if (state.ended && !addToFront) {
                var e = new Error('stream.push() after EOF');
                stream.emit('error', e);
              } else if (state.endEmitted && addToFront) {
                var _e = new Error('stream.unshift() after end event');
  
                stream.emit('error', _e);
              } else {
                var skipAdd;
  
                if (state.decoder && !addToFront && !encoding) {
                  chunk = state.decoder.write(chunk);
                  skipAdd = !state.objectMode && chunk.length === 0;
                }
  
                if (!addToFront) state.reading = false; // Don't add to the buffer if we've decoded to an empty string chunk and
                // we're not in object mode
  
                if (!skipAdd) {
                  // if we want the data now, just emit it.
                  if (state.flowing && state.length === 0 && !state.sync) {
                    stream.emit('data', chunk);
                    stream.read(0);
                  } else {
                    // update the buffer info.
                    state.length += state.objectMode ? 1 : chunk.length;
                    if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk);
                    if (state.needReadable) emitReadable(stream);
                  }
                }
  
                maybeReadMore(stream, state);
              }
            } else if (!addToFront) {
              state.reading = false;
            }
  
            return needMoreData(state);
          } // if it's past the high water mark, we can push in some more.
          // Also, if we have no data yet, we can stand some
          // more bytes.  This is to work around cases where hwm=0,
          // such as the repl.  Also, if the push() triggered a
          // readable event, and the user called read(largeNumber) such that
          // needReadable was set, then we ought to push more, so that another
          // 'readable' event will be triggered.
  
  
          function needMoreData(state) {
            return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0);
          } // backwards compatibility.
  
  
          Readable.prototype.setEncoding = function (enc) {
            if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder;
            this._readableState.decoder = new StringDecoder(enc);
            this._readableState.encoding = enc;
            return this;
          }; // Don't raise the hwm > 8MB
  
  
          var MAX_HWM = 0x800000;
  
          function computeNewHighWaterMark(n) {
            if (n >= MAX_HWM) {
              n = MAX_HWM;
            } else {
              // Get the next highest power of 2 to prevent increasing hwm excessively in
              // tiny amounts
              n--;
              n |= n >>> 1;
              n |= n >>> 2;
              n |= n >>> 4;
              n |= n >>> 8;
              n |= n >>> 16;
              n++;
            }
  
            return n;
          } // This function is designed to be inlinable, so please take care when making
          // changes to the function body.
  
  
          function howMuchToRead(n, state) {
            if (n <= 0 || state.length === 0 && state.ended) return 0;
            if (state.objectMode) return 1;
  
            if (n !== n) {
              // Only flow one buffer at a time
              if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length;
            } // If we're asking for more than the current hwm, then raise the hwm.
  
  
            if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
            if (n <= state.length) return n; // Don't have enough
  
            if (!state.ended) {
              state.needReadable = true;
              return 0;
            }
  
            return state.length;
          } // you can override either this method, or the async _read(n) below.
  
  
          Readable.prototype.read = function (n) {
            debug('read', n);
            n = parseInt(n, 10);
            var state = this._readableState;
            var nOrig = n;
            if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we
            // already have a bunch of data in the buffer, then just trigger
            // the 'readable' event and move on.
  
            if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
              debug('read: emitReadable', state.length, state.ended);
              if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this);
              return null;
            }
  
            n = howMuchToRead(n, state); // if we've ended, and we're now clear, then finish it up.
  
            if (n === 0 && state.ended) {
              if (state.length === 0) endReadable(this);
              return null;
            } // All the actual chunk generation logic needs to be
            // *below* the call to _read.  The reason is that in certain
            // synthetic stream cases, such as passthrough streams, _read
            // may be a completely synchronous operation which may change
            // the state of the read buffer, providing enough data when
            // before there was *not* enough.
            //
            // So, the steps are:
            // 1. Figure out what the state of things will be after we do
            // a read from the buffer.
            //
            // 2. If that resulting state will trigger a _read, then call _read.
            // Note that this may be asynchronous, or synchronous.  Yes, it is
            // deeply ugly to write APIs this way, but that still doesn't mean
            // that the Readable class should behave improperly, as streams are
            // designed to be sync/async agnostic.
            // Take note if the _read call is sync or async (ie, if the read call
            // has returned yet), so that we know whether or not it's safe to emit
            // 'readable' etc.
            //
            // 3. Actually pull the requested chunks out of the buffer and return.
            // if we need a readable event, then we need to do some reading.
  
  
            var doRead = state.needReadable;
            debug('need readable', doRead); // if we currently have less than the highWaterMark, then also read some
  
            if (state.length === 0 || state.length - n < state.highWaterMark) {
              doRead = true;
              debug('length less than watermark', doRead);
            } // however, if we've ended, then there's no point, and if we're already
            // reading, then it's unnecessary.
  
  
            if (state.ended || state.reading) {
              doRead = false;
              debug('reading or ended', doRead);
            } else if (doRead) {
              debug('do read');
              state.reading = true;
              state.sync = true; // if the length is currently zero, then we *need* a readable event.
  
              if (state.length === 0) state.needReadable = true; // call internal read method
  
              this._read(state.highWaterMark);
  
              state.sync = false; // If _read pushed data synchronously, then `reading` will be false,
              // and we need to re-evaluate how much data we can return to the user.
  
              if (!state.reading) n = howMuchToRead(nOrig, state);
            }
  
            var ret;
            if (n > 0) ret = fromList(n, state);else ret = null;
  
            if (ret === null) {
              state.needReadable = true;
              n = 0;
            } else {
              state.length -= n;
            }
  
            if (state.length === 0) {
              // If we have nothing in the buffer, then we want to know
              // as soon as we *do* get something into the buffer.
              if (!state.ended) state.needReadable = true; // If we tried to read() past the EOF, then emit end on the next tick.
  
              if (nOrig !== n && state.ended) endReadable(this);
            }
  
            if (ret !== null) this.emit('data', ret);
            return ret;
          };
  
          function chunkInvalid(state, chunk) {
            var er = null;
  
            if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) {
              er = new TypeError('Invalid non-string/buffer chunk');
            }
  
            return er;
          }
  
          function onEofChunk(stream, state) {
            if (state.ended) return;
  
            if (state.decoder) {
              var chunk = state.decoder.end();
  
              if (chunk && chunk.length) {
                state.buffer.push(chunk);
                state.length += state.objectMode ? 1 : chunk.length;
              }
            }
  
            state.ended = true; // emit 'readable' now to make sure it gets picked up.
  
            emitReadable(stream);
          } // Don't emit readable right away in sync mode, because this can trigger
          // another read() call => stack overflow.  This way, it might trigger
          // a nextTick recursion warning, but that's not so bad.
  
  
          function emitReadable(stream) {
            var state = stream._readableState;
            state.needReadable = false;
  
            if (!state.emittedReadable) {
              debug('emitReadable', state.flowing);
              state.emittedReadable = true;
              if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream);
            }
          }
  
          function emitReadable_(stream) {
            debug('emit readable');
            stream.emit('readable');
            flow(stream);
          } // at this point, the user has presumably seen the 'readable' event,
          // and called read() to consume some data.  that may have triggered
          // in turn another _read(n) call, in which case reading = true if
          // it's in progress.
          // However, if we're not ended, or reading, and the length < hwm,
          // then go ahead and try to read some more preemptively.
  
  
          function maybeReadMore(stream, state) {
            if (!state.readingMore) {
              state.readingMore = true;
              processNextTick(maybeReadMore_, stream, state);
            }
          }
  
          function maybeReadMore_(stream, state) {
            var len = state.length;
  
            while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
              debug('maybeReadMore read 0');
              stream.read(0);
              if (len === state.length) // didn't get any data, stop spinning.
                break;else len = state.length;
            }
  
            state.readingMore = false;
          } // abstract method.  to be overridden in specific implementation classes.
          // call cb(er, data) where data is <= n in length.
          // for virtual (non-string, non-buffer) streams, "length" is somewhat
          // arbitrary, and perhaps not very meaningful.
  
  
          Readable.prototype._read = function (n) {
            this.emit('error', new Error('not implemented'));
          };
  
          Readable.prototype.pipe = function (dest, pipeOpts) {
            var src = this;
            var state = this._readableState;
  
            switch (state.pipesCount) {
              case 0:
                state.pipes = dest;
                break;
  
              case 1:
                state.pipes = [state.pipes, dest];
                break;
  
              default:
                state.pipes.push(dest);
                break;
            }
  
            state.pipesCount += 1;
            debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts);
            var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
            var endFn = doEnd ? onend : cleanup;
            if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn);
            dest.on('unpipe', onunpipe);
  
            function onunpipe(readable) {
              debug('onunpipe');
  
              if (readable === src) {
                cleanup();
              }
            }
  
            function onend() {
              debug('onend');
              dest.end();
            } // when the dest drains, it reduces the awaitDrain counter
            // on the source.  This would be more elegant with a .once()
            // handler in flow(), but adding and removing repeatedly is
            // too slow.
  
  
            var ondrain = pipeOnDrain(src);
            dest.on('drain', ondrain);
            var cleanedUp = false;
  
            function cleanup() {
              debug('cleanup'); // cleanup event handlers once the pipe is broken
  
              dest.removeListener('close', onclose);
              dest.removeListener('finish', onfinish);
              dest.removeListener('drain', ondrain);
              dest.removeListener('error', onerror);
              dest.removeListener('unpipe', onunpipe);
              src.removeListener('end', onend);
              src.removeListener('end', cleanup);
              src.removeListener('data', ondata);
              cleanedUp = true; // if the reader is waiting for a drain event from this
              // specific writer, then it would cause it to never start
              // flowing again.
              // So, if this is awaiting a drain, then we just call it now.
              // If we don't know, then assume that we are waiting for one.
  
              if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain();
            } // If the user pushes more data while we're writing to dest then we'll end up
            // in ondata again. However, we only want to increase awaitDrain once because
            // dest will only emit one 'drain' event for the multiple writes.
            // => Introduce a guard on increasing awaitDrain.
  
  
            var increasedAwaitDrain = false;
            src.on('data', ondata);
  
            function ondata(chunk) {
              debug('ondata');
              increasedAwaitDrain = false;
              var ret = dest.write(chunk);
  
              if (false === ret && !increasedAwaitDrain) {
                // If the user unpiped during `dest.write()`, it is possible
                // to get stuck in a permanently paused state if that write
                // also returned false.
                // => Check whether `dest` is still a piping destination.
                if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
                  debug('false write response, pause', src._readableState.awaitDrain);
                  src._readableState.awaitDrain++;
                  increasedAwaitDrain = true;
                }
  
                src.pause();
              }
            } // if the dest has an error, then stop piping into it.
            // however, don't suppress the throwing behavior for this.
  
  
            function onerror(er) {
              debug('onerror', er);
              unpipe();
              dest.removeListener('error', onerror);
              if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er);
            } // Make sure our error handler is attached before userland ones.
  
  
            prependListener(dest, 'error', onerror); // Both close and finish should trigger unpipe, but only once.
  
            function onclose() {
              dest.removeListener('finish', onfinish);
              unpipe();
            }
  
            dest.once('close', onclose);
  
            function onfinish() {
              debug('onfinish');
              dest.removeListener('close', onclose);
              unpipe();
            }
  
            dest.once('finish', onfinish);
  
            function unpipe() {
              debug('unpipe');
              src.unpipe(dest);
            } // tell the dest that it's being piped to
  
  
            dest.emit('pipe', src); // start the flow if it hasn't been started already.
  
            if (!state.flowing) {
              debug('pipe resume');
              src.resume();
            }
  
            return dest;
          };
  
          function pipeOnDrain(src) {
            return function () {
              var state = src._readableState;
              debug('pipeOnDrain', state.awaitDrain);
              if (state.awaitDrain) state.awaitDrain--;
  
              if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) {
                state.flowing = true;
                flow(src);
              }
            };
          }
  
          Readable.prototype.unpipe = function (dest) {
            var state = this._readableState; // if we're not piping anywhere, then do nothing.
  
            if (state.pipesCount === 0) return this; // just one destination.  most common case.
  
            if (state.pipesCount === 1) {
              // passed in one, but it's not the right one.
              if (dest && dest !== state.pipes) return this;
              if (!dest) dest = state.pipes; // got a match.
  
              state.pipes = null;
              state.pipesCount = 0;
              state.flowing = false;
              if (dest) dest.emit('unpipe', this);
              return this;
            } // slow case. multiple pipe destinations.
  
  
            if (!dest) {
              // remove all.
              var dests = state.pipes;
              var len = state.pipesCount;
              state.pipes = null;
              state.pipesCount = 0;
              state.flowing = false;
  
              for (var _i = 0; _i < len; _i++) {
                dests[_i].emit('unpipe', this);
              }
  
              return this;
            } // try to find the right one.
  
  
            var i = indexOf(state.pipes, dest);
            if (i === -1) return this;
            state.pipes.splice(i, 1);
            state.pipesCount -= 1;
            if (state.pipesCount === 1) state.pipes = state.pipes[0];
            dest.emit('unpipe', this);
            return this;
          }; // set up data events if they are asked for
          // Ensure readable listeners eventually get something
  
  
          Readable.prototype.on = function (ev, fn) {
            var res = Stream.prototype.on.call(this, ev, fn);
  
            if (ev === 'data') {
              // Start flowing on next tick if stream isn't explicitly paused
              if (this._readableState.flowing !== false) this.resume();
            } else if (ev === 'readable') {
              var state = this._readableState;
  
              if (!state.endEmitted && !state.readableListening) {
                state.readableListening = state.needReadable = true;
                state.emittedReadable = false;
  
                if (!state.reading) {
                  processNextTick(nReadingNextTick, this);
                } else if (state.length) {
                  emitReadable(this, state);
                }
              }
            }
  
            return res;
          };
  
          Readable.prototype.addListener = Readable.prototype.on;
  
          function nReadingNextTick(self) {
            debug('readable nexttick read 0');
            self.read(0);
          } // pause() and resume() are remnants of the legacy readable stream API
          // If the user uses them, then switch into old mode.
  
  
          Readable.prototype.resume = function () {
            var state = this._readableState;
  
            if (!state.flowing) {
              debug('resume');
              state.flowing = true;
              resume(this, state);
            }
  
            return this;
          };
  
          function resume(stream, state) {
            if (!state.resumeScheduled) {
              state.resumeScheduled = true;
              processNextTick(resume_, stream, state);
            }
          }
  
          function resume_(stream, state) {
            if (!state.reading) {
              debug('resume read 0');
              stream.read(0);
            }
  
            state.resumeScheduled = false;
            state.awaitDrain = 0;
            stream.emit('resume');
            flow(stream);
            if (state.flowing && !state.reading) stream.read(0);
          }
  
          Readable.prototype.pause = function () {
            debug('call pause flowing=%j', this._readableState.flowing);
  
            if (false !== this._readableState.flowing) {
              debug('pause');
              this._readableState.flowing = false;
              this.emit('pause');
            }
  
            return this;
          };
  
          function flow(stream) {
            var state = stream._readableState;
            debug('flow', state.flowing);
  
            while (state.flowing && stream.read() !== null) {}
          } // wrap an old-style stream as the async data source.
          // This is *not* part of the readable stream interface.
          // It is an ugly unfortunate mess of history.
  
  
          Readable.prototype.wrap = function (stream) {
            var state = this._readableState;
            var paused = false;
            var self = this;
            stream.on('end', function () {
              debug('wrapped end');
  
              if (state.decoder && !state.ended) {
                var chunk = state.decoder.end();
                if (chunk && chunk.length) self.push(chunk);
              }
  
              self.push(null);
            });
            stream.on('data', function (chunk) {
              debug('wrapped data');
              if (state.decoder) chunk = state.decoder.write(chunk); // don't skip over falsy values in objectMode
  
              if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return;
              var ret = self.push(chunk);
  
              if (!ret) {
                paused = true;
                stream.pause();
              }
            }); // proxy all the other methods.
            // important when wrapping filters and duplexes.
  
            for (var i in stream) {
              if (this[i] === undefined && typeof stream[i] === 'function') {
                this[i] = function (method) {
                  return function () {
                    return stream[method].apply(stream, arguments);
                  };
                }(i);
              }
            } // proxy certain important events.
  
  
            var events = ['error', 'close', 'destroy', 'pause', 'resume'];
            forEach(events, function (ev) {
              stream.on(ev, self.emit.bind(self, ev));
            }); // when we try to consume some more bytes, simply unpause the
            // underlying stream.
  
            self._read = function (n) {
              debug('wrapped _read', n);
  
              if (paused) {
                paused = false;
                stream.resume();
              }
            };
  
            return self;
          }; // exposed for testing purposes only.
  
  
          Readable._fromList = fromList; // Pluck off n bytes from an array of buffers.
          // Length is the combined lengths of all the buffers in the list.
          // This function is designed to be inlinable, so please take care when making
          // changes to the function body.
  
          function fromList(n, state) {
            // nothing buffered
            if (state.length === 0) return null;
            var ret;
            if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) {
              // read it all, truncate the list
              if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length);
              state.buffer.clear();
            } else {
              // read part of list
              ret = fromListPartial(n, state.buffer, state.decoder);
            }
            return ret;
          } // Extracts only enough buffered data to satisfy the amount requested.
          // This function is designed to be inlinable, so please take care when making
          // changes to the function body.
  
  
          function fromListPartial(n, list, hasStrings) {
            var ret;
  
            if (n < list.head.data.length) {
              // slice is the same for buffers and strings
              ret = list.head.data.slice(0, n);
              list.head.data = list.head.data.slice(n);
            } else if (n === list.head.data.length) {
              // first chunk is a perfect match
              ret = list.shift();
            } else {
              // result spans more than one buffer
              ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list);
            }
  
            return ret;
          } // Copies a specified amount of characters from the list of buffered data
          // chunks.
          // This function is designed to be inlinable, so please take care when making
          // changes to the function body.
  
  
          function copyFromBufferString(n, list) {
            var p = list.head;
            var c = 1;
            var ret = p.data;
            n -= ret.length;
  
            while (p = p.next) {
              var str = p.data;
              var nb = n > str.length ? str.length : n;
              if (nb === str.length) ret += str;else ret += str.slice(0, n);
              n -= nb;
  
              if (n === 0) {
                if (nb === str.length) {
                  ++c;
                  if (p.next) list.head = p.next;else list.head = list.tail = null;
                } else {
                  list.head = p;
                  p.data = str.slice(nb);
                }
  
                break;
              }
  
              ++c;
            }
  
            list.length -= c;
            return ret;
          } // Copies a specified amount of bytes from the list of buffered data chunks.
          // This function is designed to be inlinable, so please take care when making
          // changes to the function body.
  
  
          function copyFromBuffer(n, list) {
            var ret = bufferShim.allocUnsafe(n);
            var p = list.head;
            var c = 1;
            p.data.copy(ret);
            n -= p.data.length;
  
            while (p = p.next) {
              var buf = p.data;
              var nb = n > buf.length ? buf.length : n;
              buf.copy(ret, ret.length - n, 0, nb);
              n -= nb;
  
              if (n === 0) {
                if (nb === buf.length) {
                  ++c;
                  if (p.next) list.head = p.next;else list.head = list.tail = null;
                } else {
                  list.head = p;
                  p.data = buf.slice(nb);
                }
  
                break;
              }
  
              ++c;
            }
  
            list.length -= c;
            return ret;
          }
  
          function endReadable(stream) {
            var state = stream._readableState; // If we get here before consuming all the bytes, then that is a
            // bug in node.  Should never happen.
  
            if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  
            if (!state.endEmitted) {
              state.ended = true;
              processNextTick(endReadableNT, state, stream);
            }
          }
  
          function endReadableNT(state, stream) {
            // Check that we didn't get one last unshift.
            if (!state.endEmitted && state.length === 0) {
              state.endEmitted = true;
              stream.readable = false;
              stream.emit('end');
            }
          }
  
          function forEach(xs, f) {
            for (var i = 0, l = xs.length; i < l; i++) {
              f(xs[i], i);
            }
          }
  
          function indexOf(xs, x) {
            for (var i = 0, l = xs.length; i < l; i++) {
              if (xs[i] === x) return i;
            }
  
            return -1;
          }
        }).call(this, require('_process'));
      }, {
        "./_stream_duplex": 25,
        "./internal/streams/BufferList": 30,
        "_process": 23,
        "buffer": 11,
        "buffer-shims": 10,
        "core-util-is": 13,
        "events": 16,
        "inherits": 18,
        "isarray": 20,
        "process-nextick-args": 22,
        "string_decoder/": 36,
        "util": 9
      }],
      28: [function (require, module, exports) {
        // a transform stream is a readable/writable stream where you do
        // something with the data.  Sometimes it's called a "filter",
        // but that's not a great name for it, since that implies a thing where
        // some bits pass through, and others are simply ignored.  (That would
        // be a valid example of a transform, of course.)
        //
        // While the output is causally related to the input, it's not a
        // necessarily symmetric or synchronous transformation.  For example,
        // a zlib stream might take multiple plain-text writes(), and then
        // emit a single compressed chunk some time in the future.
        //
        // Here's how this works:
        //
        // The Transform stream has all the aspects of the readable and writable
        // stream classes.  When you write(chunk), that calls _write(chunk,cb)
        // internally, and returns false if there's a lot of pending writes
        // buffered up.  When you call read(), that calls _read(n) until
        // there's enough pending readable data buffered up.
        //
        // In a transform stream, the written data is placed in a buffer.  When
        // _read(n) is called, it transforms the queued up data, calling the
        // buffered _write cb's as it consumes chunks.  If consuming a single
        // written chunk would result in multiple output chunks, then the first
        // outputted bit calls the readcb, and subsequent chunks just go into
        // the read buffer, and will cause it to emit 'readable' if necessary.
        //
        // This way, back-pressure is actually determined by the reading side,
        // since _read has to be called to start processing a new chunk.  However,
        // a pathological inflate type of transform can cause excessive buffering
        // here.  For example, imagine a stream where every byte of input is
        // interpreted as an integer from 0-255, and then results in that many
        // bytes of output.  Writing the 4 bytes {ff,ff,ff,ff} would result in
        // 1kb of data being output.  In this case, you could write a very small
        // amount of input, and end up with a very large amount of output.  In
        // such a pathological inflating mechanism, there'd be no way to tell
        // the system to stop doing the transform.  A single 4MB write could
        // cause the system to run out of memory.
        //
        // However, even in such a pathological case, only a single written chunk
        // would be consumed, and then the rest would wait (un-transformed) until
        // the results of the previous transformed chunk were consumed.
        'use strict';
  
        module.exports = Transform;
  
        var Duplex = require('./_stream_duplex');
        /*<replacement>*/
  
  
        var util = require('core-util-is');
  
        util.inherits = require('inherits');
        /*</replacement>*/
  
        util.inherits(Transform, Duplex);
  
        function TransformState(stream) {
          this.afterTransform = function (er, data) {
            return afterTransform(stream, er, data);
          };
  
          this.needTransform = false;
          this.transforming = false;
          this.writecb = null;
          this.writechunk = null;
          this.writeencoding = null;
        }
  
        function afterTransform(stream, er, data) {
          var ts = stream._transformState;
          ts.transforming = false;
          var cb = ts.writecb;
          if (!cb) return stream.emit('error', new Error('no writecb in Transform class'));
          ts.writechunk = null;
          ts.writecb = null;
          if (data !== null && data !== undefined) stream.push(data);
          cb(er);
          var rs = stream._readableState;
          rs.reading = false;
  
          if (rs.needReadable || rs.length < rs.highWaterMark) {
            stream._read(rs.highWaterMark);
          }
        }
  
        function Transform(options) {
          if (!(this instanceof Transform)) return new Transform(options);
          Duplex.call(this, options);
          this._transformState = new TransformState(this); // when the writable side finishes, then flush out anything remaining.
  
          var stream = this; // start out asking for a readable event once data is transformed.
  
          this._readableState.needReadable = true; // we have implemented the _read method, and done the other things
          // that Readable wants before the first _read call, so unset the
          // sync guard flag.
  
          this._readableState.sync = false;
  
          if (options) {
            if (typeof options.transform === 'function') this._transform = options.transform;
            if (typeof options.flush === 'function') this._flush = options.flush;
          }
  
          this.once('prefinish', function () {
            if (typeof this._flush === 'function') this._flush(function (er) {
              done(stream, er);
            });else done(stream);
          });
        }
  
        Transform.prototype.push = function (chunk, encoding) {
          this._transformState.needTransform = false;
          return Duplex.prototype.push.call(this, chunk, encoding);
        }; // This is the part where you do stuff!
        // override this function in implementation classes.
        // 'chunk' is an input chunk.
        //
        // Call `push(newChunk)` to pass along transformed output
        // to the readable side.  You may call 'push' zero or more times.
        //
        // Call `cb(err)` when you are done with this chunk.  If you pass
        // an error, then that'll put the hurt on the whole operation.  If you
        // never call cb(), then you'll never get another chunk.
  
  
        Transform.prototype._transform = function (chunk, encoding, cb) {
          throw new Error('Not implemented');
        };
  
        Transform.prototype._write = function (chunk, encoding, cb) {
          var ts = this._transformState;
          ts.writecb = cb;
          ts.writechunk = chunk;
          ts.writeencoding = encoding;
  
          if (!ts.transforming) {
            var rs = this._readableState;
            if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark);
          }
        }; // Doesn't matter what the args are here.
        // _transform does all the work.
        // That we got here means that the readable side wants more data.
  
  
        Transform.prototype._read = function (n) {
          var ts = this._transformState;
  
          if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
            ts.transforming = true;
  
            this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform);
          } else {
            // mark that we need a transform, so that any data that comes in
            // will get processed, now that we've asked for it.
            ts.needTransform = true;
          }
        };
  
        function done(stream, er) {
          if (er) return stream.emit('error', er); // if there's nothing in the write buffer, then that means
          // that nothing more will ever be provided
  
          var ws = stream._writableState;
          var ts = stream._transformState;
          if (ws.length) throw new Error('Calling transform done when ws.length != 0');
          if (ts.transforming) throw new Error('Calling transform done when still transforming');
          return stream.push(null);
        }
      }, {
        "./_stream_duplex": 25,
        "core-util-is": 13,
        "inherits": 18
      }],
      29: [function (require, module, exports) {
        (function (process) {
          // A bit simpler than readable streams.
          // Implement an async ._write(chunk, encoding, cb), and it'll handle all
          // the drain event emission and buffering.
          'use strict';
  
          module.exports = Writable;
          /*<replacement>*/
  
          var processNextTick = require('process-nextick-args');
          /*</replacement>*/
  
          /*<replacement>*/
  
  
          var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick;
          /*</replacement>*/
  
          Writable.WritableState = WritableState;
          /*<replacement>*/
  
          var util = require('core-util-is');
  
          util.inherits = require('inherits');
          /*</replacement>*/
  
          /*<replacement>*/
  
          var internalUtil = {
            deprecate: require('util-deprecate')
          };
          /*</replacement>*/
  
          /*<replacement>*/
  
          var Stream;
  
          (function () {
            try {
              Stream = require('st' + 'ream');
            } catch (_) {} finally {
              if (!Stream) Stream = require('events').EventEmitter;
            }
          })();
          /*</replacement>*/
  
  
          var Buffer = require('buffer').Buffer;
          /*<replacement>*/
  
  
          var bufferShim = require('buffer-shims');
          /*</replacement>*/
  
  
          util.inherits(Writable, Stream);
  
          function nop() {}
  
          function WriteReq(chunk, encoding, cb) {
            this.chunk = chunk;
            this.encoding = encoding;
            this.callback = cb;
            this.next = null;
          }
  
          var Duplex;
  
          function WritableState(options, stream) {
            Duplex = Duplex || require('./_stream_duplex');
            options = options || {}; // object stream flag to indicate whether or not this stream
            // contains buffers or objects.
  
            this.objectMode = !!options.objectMode;
            if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; // the point at which write() starts returning false
            // Note: 0 is a valid value, means that we always return false if
            // the entire buffer is not flushed immediately on write()
  
            var hwm = options.highWaterMark;
            var defaultHwm = this.objectMode ? 16 : 16 * 1024;
            this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; // cast to ints.
  
            this.highWaterMark = ~~this.highWaterMark;
            this.needDrain = false; // at the start of calling end()
  
            this.ending = false; // when end() has been called, and returned
  
            this.ended = false; // when 'finish' is emitted
  
            this.finished = false; // should we decode strings into buffers before passing to _write?
            // this is here so that some node-core streams can optimize string
            // handling at a lower level.
  
            var noDecode = options.decodeStrings === false;
            this.decodeStrings = !noDecode; // Crypto is kind of old and crusty.  Historically, its default string
            // encoding is 'binary' so we have to make this configurable.
            // Everything else in the universe uses 'utf8', though.
  
            this.defaultEncoding = options.defaultEncoding || 'utf8'; // not an actual buffer we keep track of, but a measurement
            // of how much we're waiting to get pushed to some underlying
            // socket or file.
  
            this.length = 0; // a flag to see when we're in the middle of a write.
  
            this.writing = false; // when true all writes will be buffered until .uncork() call
  
            this.corked = 0; // a flag to be able to tell if the onwrite cb is called immediately,
            // or on a later tick.  We set this to true at first, because any
            // actions that shouldn't happen until "later" should generally also
            // not happen before the first write call.
  
            this.sync = true; // a flag to know if we're processing previously buffered items, which
            // may call the _write() callback in the same tick, so that we don't
            // end up in an overlapped onwrite situation.
  
            this.bufferProcessing = false; // the callback that's passed to _write(chunk,cb)
  
            this.onwrite = function (er) {
              onwrite(stream, er);
            }; // the callback that the user supplies to write(chunk,encoding,cb)
  
  
            this.writecb = null; // the amount that is being written when _write is called.
  
            this.writelen = 0;
            this.bufferedRequest = null;
            this.lastBufferedRequest = null; // number of pending user-supplied write callbacks
            // this must be 0 before 'finish' can be emitted
  
            this.pendingcb = 0; // emit prefinish if the only thing we're waiting for is _write cbs
            // This is relevant for synchronous Transform streams
  
            this.prefinished = false; // True if the error was already emitted and should not be thrown again
  
            this.errorEmitted = false; // count buffered requests
  
            this.bufferedRequestCount = 0; // allocate the first CorkedRequest, there is always
            // one allocated and free to use, and we maintain at most two
  
            this.corkedRequestsFree = new CorkedRequest(this);
          }
  
          WritableState.prototype.getBuffer = function writableStateGetBuffer() {
            var current = this.bufferedRequest;
            var out = [];
  
            while (current) {
              out.push(current);
              current = current.next;
            }
  
            return out;
          };
  
          (function () {
            try {
              Object.defineProperty(WritableState.prototype, 'buffer', {
                get: internalUtil.deprecate(function () {
                  return this.getBuffer();
                }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.')
              });
            } catch (_) {}
          })();
  
          var Duplex;
  
          function Writable(options) {
            Duplex = Duplex || require('./_stream_duplex'); // Writable ctor is applied to Duplexes, though they're not
            // instanceof Writable, they're instanceof Readable.
  
            if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options);
            this._writableState = new WritableState(options, this); // legacy.
  
            this.writable = true;
  
            if (options) {
              if (typeof options.write === 'function') this._write = options.write;
              if (typeof options.writev === 'function') this._writev = options.writev;
            }
  
            Stream.call(this);
          } // Otherwise people can pipe Writable streams, which is just wrong.
  
  
          Writable.prototype.pipe = function () {
            this.emit('error', new Error('Cannot pipe, not readable'));
          };
  
          function writeAfterEnd(stream, cb) {
            var er = new Error('write after end'); // TODO: defer error events consistently everywhere, not just the cb
  
            stream.emit('error', er);
            processNextTick(cb, er);
          } // If we get something that is not a buffer, string, null, or undefined,
          // and we're not in objectMode, then that's an error.
          // Otherwise stream chunks are all considered to be of length=1, and the
          // watermarks determine how many objects to keep in the buffer, rather than
          // how many bytes or characters.
  
  
          function validChunk(stream, state, chunk, cb) {
            var valid = true;
            var er = false; // Always throw error if a null is written
            // if we are not in object mode then throw
            // if it is not a buffer, string, or undefined.
  
            if (chunk === null) {
              er = new TypeError('May not write null values to stream');
            } else if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) {
              er = new TypeError('Invalid non-string/buffer chunk');
            }
  
            if (er) {
              stream.emit('error', er);
              processNextTick(cb, er);
              valid = false;
            }
  
            return valid;
          }
  
          Writable.prototype.write = function (chunk, encoding, cb) {
            var state = this._writableState;
            var ret = false;
  
            if (typeof encoding === 'function') {
              cb = encoding;
              encoding = null;
            }
  
            if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding;
            if (typeof cb !== 'function') cb = nop;
            if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) {
              state.pendingcb++;
              ret = writeOrBuffer(this, state, chunk, encoding, cb);
            }
            return ret;
          };
  
          Writable.prototype.cork = function () {
            var state = this._writableState;
            state.corked++;
          };
  
          Writable.prototype.uncork = function () {
            var state = this._writableState;
  
            if (state.corked) {
              state.corked--;
              if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state);
            }
          };
  
          Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
            // node::ParseEncoding() requires lower case.
            if (typeof encoding === 'string') encoding = encoding.toLowerCase();
            if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding);
            this._writableState.defaultEncoding = encoding;
            return this;
          };
  
          function decodeChunk(state, chunk, encoding) {
            if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') {
              chunk = bufferShim.from(chunk, encoding);
            }
  
            return chunk;
          } // if we're already writing something, then just put this
          // in the queue, and wait our turn.  Otherwise, call _write
          // If we return false, then we need a drain event, so set that flag.
  
  
          function writeOrBuffer(stream, state, chunk, encoding, cb) {
            chunk = decodeChunk(state, chunk, encoding);
            if (Buffer.isBuffer(chunk)) encoding = 'buffer';
            var len = state.objectMode ? 1 : chunk.length;
            state.length += len;
            var ret = state.length < state.highWaterMark; // we must ensure that previous needDrain will not be reset to false.
  
            if (!ret) state.needDrain = true;
  
            if (state.writing || state.corked) {
              var last = state.lastBufferedRequest;
              state.lastBufferedRequest = new WriteReq(chunk, encoding, cb);
  
              if (last) {
                last.next = state.lastBufferedRequest;
              } else {
                state.bufferedRequest = state.lastBufferedRequest;
              }
  
              state.bufferedRequestCount += 1;
            } else {
              doWrite(stream, state, false, len, chunk, encoding, cb);
            }
  
            return ret;
          }
  
          function doWrite(stream, state, writev, len, chunk, encoding, cb) {
            state.writelen = len;
            state.writecb = cb;
            state.writing = true;
            state.sync = true;
            if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite);
            state.sync = false;
          }
  
          function onwriteError(stream, state, sync, er, cb) {
            --state.pendingcb;
            if (sync) processNextTick(cb, er);else cb(er);
            stream._writableState.errorEmitted = true;
            stream.emit('error', er);
          }
  
          function onwriteStateUpdate(state) {
            state.writing = false;
            state.writecb = null;
            state.length -= state.writelen;
            state.writelen = 0;
          }
  
          function onwrite(stream, er) {
            var state = stream._writableState;
            var sync = state.sync;
            var cb = state.writecb;
            onwriteStateUpdate(state);
            if (er) onwriteError(stream, state, sync, er, cb);else {
              // Check if we're actually ready to finish, but don't emit yet
              var finished = needFinish(state);
  
              if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
                clearBuffer(stream, state);
              }
  
              if (sync) {
                /*<replacement>*/
                asyncWrite(afterWrite, stream, state, finished, cb);
                /*</replacement>*/
              } else {
                afterWrite(stream, state, finished, cb);
              }
            }
          }
  
          function afterWrite(stream, state, finished, cb) {
            if (!finished) onwriteDrain(stream, state);
            state.pendingcb--;
            cb();
            finishMaybe(stream, state);
          } // Must force callback to be called on nextTick, so that we don't
          // emit 'drain' before the write() consumer gets the 'false' return
          // value, and has a chance to attach a 'drain' listener.
  
  
          function onwriteDrain(stream, state) {
            if (state.length === 0 && state.needDrain) {
              state.needDrain = false;
              stream.emit('drain');
            }
          } // if there's something in the buffer waiting, then process it
  
  
          function clearBuffer(stream, state) {
            state.bufferProcessing = true;
            var entry = state.bufferedRequest;
  
            if (stream._writev && entry && entry.next) {
              // Fast case, write everything using _writev()
              var l = state.bufferedRequestCount;
              var buffer = new Array(l);
              var holder = state.corkedRequestsFree;
              holder.entry = entry;
              var count = 0;
  
              while (entry) {
                buffer[count] = entry;
                entry = entry.next;
                count += 1;
              }
  
              doWrite(stream, state, true, state.length, buffer, '', holder.finish); // doWrite is almost always async, defer these to save a bit of time
              // as the hot path ends with doWrite
  
              state.pendingcb++;
              state.lastBufferedRequest = null;
  
              if (holder.next) {
                state.corkedRequestsFree = holder.next;
                holder.next = null;
              } else {
                state.corkedRequestsFree = new CorkedRequest(state);
              }
            } else {
              // Slow case, write chunks one-by-one
              while (entry) {
                var chunk = entry.chunk;
                var encoding = entry.encoding;
                var cb = entry.callback;
                var len = state.objectMode ? 1 : chunk.length;
                doWrite(stream, state, false, len, chunk, encoding, cb);
                entry = entry.next; // if we didn't call the onwrite immediately, then
                // it means that we need to wait until it does.
                // also, that means that the chunk and cb are currently
                // being processed, so move the buffer counter past them.
  
                if (state.writing) {
                  break;
                }
              }
  
              if (entry === null) state.lastBufferedRequest = null;
            }
  
            state.bufferedRequestCount = 0;
            state.bufferedRequest = entry;
            state.bufferProcessing = false;
          }
  
          Writable.prototype._write = function (chunk, encoding, cb) {
            cb(new Error('not implemented'));
          };
  
          Writable.prototype._writev = null;
  
          Writable.prototype.end = function (chunk, encoding, cb) {
            var state = this._writableState;
  
            if (typeof chunk === 'function') {
              cb = chunk;
              chunk = null;
              encoding = null;
            } else if (typeof encoding === 'function') {
              cb = encoding;
              encoding = null;
            }
  
            if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); // .end() fully uncorks
  
            if (state.corked) {
              state.corked = 1;
              this.uncork();
            } // ignore unnecessary end() calls.
  
  
            if (!state.ending && !state.finished) endWritable(this, state, cb);
          };
  
          function needFinish(state) {
            return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing;
          }
  
          function prefinish(stream, state) {
            if (!state.prefinished) {
              state.prefinished = true;
              stream.emit('prefinish');
            }
          }
  
          function finishMaybe(stream, state) {
            var need = needFinish(state);
  
            if (need) {
              if (state.pendingcb === 0) {
                prefinish(stream, state);
                state.finished = true;
                stream.emit('finish');
              } else {
                prefinish(stream, state);
              }
            }
  
            return need;
          }
  
          function endWritable(stream, state, cb) {
            state.ending = true;
            finishMaybe(stream, state);
  
            if (cb) {
              if (state.finished) processNextTick(cb);else stream.once('finish', cb);
            }
  
            state.ended = true;
            stream.writable = false;
          } // It seems a linked list but it is not
          // there will be only 2 of these for each stream
  
  
          function CorkedRequest(state) {
            var _this = this;
  
            this.next = null;
            this.entry = null;
  
            this.finish = function (err) {
              var entry = _this.entry;
              _this.entry = null;
  
              while (entry) {
                var cb = entry.callback;
                state.pendingcb--;
                cb(err);
                entry = entry.next;
              }
  
              if (state.corkedRequestsFree) {
                state.corkedRequestsFree.next = _this;
              } else {
                state.corkedRequestsFree = _this;
              }
            };
          }
        }).call(this, require('_process'));
      }, {
        "./_stream_duplex": 25,
        "_process": 23,
        "buffer": 11,
        "buffer-shims": 10,
        "core-util-is": 13,
        "events": 16,
        "inherits": 18,
        "process-nextick-args": 22,
        "util-deprecate": 37
      }],
      30: [function (require, module, exports) {
        'use strict';
  
        var Buffer = require('buffer').Buffer;
        /*<replacement>*/
  
  
        var bufferShim = require('buffer-shims');
        /*</replacement>*/
  
  
        module.exports = BufferList;
  
        function BufferList() {
          this.head = null;
          this.tail = null;
          this.length = 0;
        }
  
        BufferList.prototype.push = function (v) {
          var entry = {
            data: v,
            next: null
          };
          if (this.length > 0) this.tail.next = entry;else this.head = entry;
          this.tail = entry;
          ++this.length;
        };
  
        BufferList.prototype.unshift = function (v) {
          var entry = {
            data: v,
            next: this.head
          };
          if (this.length === 0) this.tail = entry;
          this.head = entry;
          ++this.length;
        };
  
        BufferList.prototype.shift = function () {
          if (this.length === 0) return;
          var ret = this.head.data;
          if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next;
          --this.length;
          return ret;
        };
  
        BufferList.prototype.clear = function () {
          this.head = this.tail = null;
          this.length = 0;
        };
  
        BufferList.prototype.join = function (s) {
          if (this.length === 0) return '';
          var p = this.head;
          var ret = '' + p.data;
  
          while (p = p.next) {
            ret += s + p.data;
          }
  
          return ret;
        };
  
        BufferList.prototype.concat = function (n) {
          if (this.length === 0) return bufferShim.alloc(0);
          if (this.length === 1) return this.head.data;
          var ret = bufferShim.allocUnsafe(n >>> 0);
          var p = this.head;
          var i = 0;
  
          while (p) {
            p.data.copy(ret, i);
            i += p.data.length;
            p = p.next;
          }
  
          return ret;
        };
      }, {
        "buffer": 11,
        "buffer-shims": 10
      }],
      31: [function (require, module, exports) {
        module.exports = require("./lib/_stream_passthrough.js");
      }, {
        "./lib/_stream_passthrough.js": 26
      }],
      32: [function (require, module, exports) {
        (function (process) {
          var Stream = function () {
            try {
              return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify
            } catch (_) {}
          }();
  
          exports = module.exports = require('./lib/_stream_readable.js');
          exports.Stream = Stream || exports;
          exports.Readable = exports;
          exports.Writable = require('./lib/_stream_writable.js');
          exports.Duplex = require('./lib/_stream_duplex.js');
          exports.Transform = require('./lib/_stream_transform.js');
          exports.PassThrough = require('./lib/_stream_passthrough.js');
  
          if (!process.browser && process.env.READABLE_STREAM === 'disable' && Stream) {
            module.exports = Stream;
          }
        }).call(this, require('_process'));
      }, {
        "./lib/_stream_duplex.js": 25,
        "./lib/_stream_passthrough.js": 26,
        "./lib/_stream_readable.js": 27,
        "./lib/_stream_transform.js": 28,
        "./lib/_stream_writable.js": 29,
        "_process": 23
      }],
      33: [function (require, module, exports) {
        module.exports = require("./lib/_stream_transform.js");
      }, {
        "./lib/_stream_transform.js": 28
      }],
      34: [function (require, module, exports) {
        module.exports = require("./lib/_stream_writable.js");
      }, {
        "./lib/_stream_writable.js": 29
      }],
      35: [function (require, module, exports) {
        // Copyright Joyent, Inc. and other Node contributors.
        //
        // Permission is hereby granted, free of charge, to any person obtaining a
        // copy of this software and associated documentation files (the
        // "Software"), to deal in the Software without restriction, including
        // without limitation the rights to use, copy, modify, merge, publish,
        // distribute, sublicense, and/or sell copies of the Software, and to permit
        // persons to whom the Software is furnished to do so, subject to the
        // following conditions:
        //
        // The above copyright notice and this permission notice shall be included
        // in all copies or substantial portions of the Software.
        //
        // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
        // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
        // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
        // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
        // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
        // USE OR OTHER DEALINGS IN THE SOFTWARE.
        module.exports = Stream;
  
        var EE = require('events').EventEmitter;
  
        var inherits = require('inherits');
  
        inherits(Stream, EE);
        Stream.Readable = require('readable-stream/readable.js');
        Stream.Writable = require('readable-stream/writable.js');
        Stream.Duplex = require('readable-stream/duplex.js');
        Stream.Transform = require('readable-stream/transform.js');
        Stream.PassThrough = require('readable-stream/passthrough.js'); // Backwards-compat with node 0.4.x
  
        Stream.Stream = Stream; // old-style streams.  Note that the pipe method (the only relevant
        // part of this class) is overridden in the Readable class.
  
        function Stream() {
          EE.call(this);
        }
  
        Stream.prototype.pipe = function (dest, options) {
          var source = this;
  
          function ondata(chunk) {
            if (dest.writable) {
              if (false === dest.write(chunk) && source.pause) {
                source.pause();
              }
            }
          }
  
          source.on('data', ondata);
  
          function ondrain() {
            if (source.readable && source.resume) {
              source.resume();
            }
          }
  
          dest.on('drain', ondrain); // If the 'end' option is not supplied, dest.end() will be called when
          // source gets the 'end' or 'close' events.  Only dest.end() once.
  
          if (!dest._isStdio && (!options || options.end !== false)) {
            source.on('end', onend);
            source.on('close', onclose);
          }
  
          var didOnEnd = false;
  
          function onend() {
            if (didOnEnd) return;
            didOnEnd = true;
            dest.end();
          }
  
          function onclose() {
            if (didOnEnd) return;
            didOnEnd = true;
            if (typeof dest.destroy === 'function') dest.destroy();
          } // don't leave dangling pipes when there are errors.
  
  
          function onerror(er) {
            cleanup();
  
            if (EE.listenerCount(this, 'error') === 0) {
              throw er; // Unhandled stream error in pipe.
            }
          }
  
          source.on('error', onerror);
          dest.on('error', onerror); // remove all the event listeners that were added.
  
          function cleanup() {
            source.removeListener('data', ondata);
            dest.removeListener('drain', ondrain);
            source.removeListener('end', onend);
            source.removeListener('close', onclose);
            source.removeListener('error', onerror);
            dest.removeListener('error', onerror);
            source.removeListener('end', cleanup);
            source.removeListener('close', cleanup);
            dest.removeListener('close', cleanup);
          }
  
          source.on('end', cleanup);
          source.on('close', cleanup);
          dest.on('close', cleanup);
          dest.emit('pipe', source); // Allow for unix-like usage: A.pipe(B).pipe(C)
  
          return dest;
        };
      }, {
        "events": 16,
        "inherits": 18,
        "readable-stream/duplex.js": 24,
        "readable-stream/passthrough.js": 31,
        "readable-stream/readable.js": 32,
        "readable-stream/transform.js": 33,
        "readable-stream/writable.js": 34
      }],
      36: [function (require, module, exports) {
        // Copyright Joyent, Inc. and other Node contributors.
        //
        // Permission is hereby granted, free of charge, to any person obtaining a
        // copy of this software and associated documentation files (the
        // "Software"), to deal in the Software without restriction, including
        // without limitation the rights to use, copy, modify, merge, publish,
        // distribute, sublicense, and/or sell copies of the Software, and to permit
        // persons to whom the Software is furnished to do so, subject to the
        // following conditions:
        //
        // The above copyright notice and this permission notice shall be included
        // in all copies or substantial portions of the Software.
        //
        // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
        // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
        // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
        // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
        // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
        // USE OR OTHER DEALINGS IN THE SOFTWARE.
        var Buffer = require('buffer').Buffer;
  
        var isBufferEncoding = Buffer.isEncoding || function (encoding) {
          switch (encoding && encoding.toLowerCase()) {
            case 'hex':
            case 'utf8':
            case 'utf-8':
            case 'ascii':
            case 'binary':
            case 'base64':
            case 'ucs2':
            case 'ucs-2':
            case 'utf16le':
            case 'utf-16le':
            case 'raw':
              return true;
  
            default:
              return false;
          }
        };
  
        function assertEncoding(encoding) {
          if (encoding && !isBufferEncoding(encoding)) {
            throw new Error('Unknown encoding: ' + encoding);
          }
        } // StringDecoder provides an interface for efficiently splitting a series of
        // buffers into a series of JS strings without breaking apart multi-byte
        // characters. CESU-8 is handled as part of the UTF-8 encoding.
        //
        // @TODO Handling all encodings inside a single object makes it very difficult
        // to reason about this code, so it should be split up in the future.
        // @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code
        // points as used by CESU-8.
  
  
        var StringDecoder = exports.StringDecoder = function (encoding) {
          this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, '');
          assertEncoding(encoding);
  
          switch (this.encoding) {
            case 'utf8':
              // CESU-8 represents each of Surrogate Pair by 3-bytes
              this.surrogateSize = 3;
              break;
  
            case 'ucs2':
            case 'utf16le':
              // UTF-16 represents each of Surrogate Pair by 2-bytes
              this.surrogateSize = 2;
              this.detectIncompleteChar = utf16DetectIncompleteChar;
              break;
  
            case 'base64':
              // Base-64 stores 3 bytes in 4 chars, and pads the remainder.
              this.surrogateSize = 3;
              this.detectIncompleteChar = base64DetectIncompleteChar;
              break;
  
            default:
              this.write = passThroughWrite;
              return;
          } // Enough space to store all bytes of a single character. UTF-8 needs 4
          // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate).
  
  
          this.charBuffer = new Buffer(6); // Number of bytes received for the current incomplete multi-byte character.
  
          this.charReceived = 0; // Number of bytes expected for the current incomplete multi-byte character.
  
          this.charLength = 0;
        }; // write decodes the given buffer and returns it as JS string that is
        // guaranteed to not contain any partial multi-byte characters. Any partial
        // character found at the end of the buffer is buffered up, and will be
        // returned when calling write again with the remaining bytes.
        //
        // Note: Converting a Buffer containing an orphan surrogate to a String
        // currently works, but converting a String to a Buffer (via `new Buffer`, or
        // Buffer#write) will replace incomplete surrogates with the unicode
        // replacement character. See https://codereview.chromium.org/121173009/ .
  
  
        StringDecoder.prototype.write = function (buffer) {
          var charStr = ''; // if our last write ended with an incomplete multibyte character
  
          while (this.charLength) {
            // determine how many remaining bytes this buffer has to offer for this char
            var available = buffer.length >= this.charLength - this.charReceived ? this.charLength - this.charReceived : buffer.length; // add the new bytes to the char buffer
  
            buffer.copy(this.charBuffer, this.charReceived, 0, available);
            this.charReceived += available;
  
            if (this.charReceived < this.charLength) {
              // still not enough chars in this buffer? wait for more ...
              return '';
            } // remove bytes belonging to the current character from the buffer
  
  
            buffer = buffer.slice(available, buffer.length); // get the character that was split
  
            charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  
            var charCode = charStr.charCodeAt(charStr.length - 1);
  
            if (charCode >= 0xD800 && charCode <= 0xDBFF) {
              this.charLength += this.surrogateSize;
              charStr = '';
              continue;
            }
  
            this.charReceived = this.charLength = 0; // if there are no more bytes in this buffer, just emit our char
  
            if (buffer.length === 0) {
              return charStr;
            }
  
            break;
          } // determine and set charLength / charReceived
  
  
          this.detectIncompleteChar(buffer);
          var end = buffer.length;
  
          if (this.charLength) {
            // buffer the incomplete character bytes we got
            buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end);
            end -= this.charReceived;
          }
  
          charStr += buffer.toString(this.encoding, 0, end);
          var end = charStr.length - 1;
          var charCode = charStr.charCodeAt(end); // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character
  
          if (charCode >= 0xD800 && charCode <= 0xDBFF) {
            var size = this.surrogateSize;
            this.charLength += size;
            this.charReceived += size;
            this.charBuffer.copy(this.charBuffer, size, 0, size);
            buffer.copy(this.charBuffer, 0, 0, size);
            return charStr.substring(0, end);
          } // or just emit the charStr
  
  
          return charStr;
        }; // detectIncompleteChar determines if there is an incomplete UTF-8 character at
        // the end of the given buffer. If so, it sets this.charLength to the byte
        // length that character, and sets this.charReceived to the number of bytes
        // that are available for this character.
  
  
        StringDecoder.prototype.detectIncompleteChar = function (buffer) {
          // determine how many bytes we have to check at the end of this buffer
          var i = buffer.length >= 3 ? 3 : buffer.length; // Figure out if one of the last i bytes of our buffer announces an
          // incomplete char.
  
          for (; i > 0; i--) {
            var c = buffer[buffer.length - i]; // See http://en.wikipedia.org/wiki/UTF-8#Description
            // 110XXXXX
  
            if (i == 1 && c >> 5 == 0x06) {
              this.charLength = 2;
              break;
            } // 1110XXXX
  
  
            if (i <= 2 && c >> 4 == 0x0E) {
              this.charLength = 3;
              break;
            } // 11110XXX
  
  
            if (i <= 3 && c >> 3 == 0x1E) {
              this.charLength = 4;
              break;
            }
          }
  
          this.charReceived = i;
        };
  
        StringDecoder.prototype.end = function (buffer) {
          var res = '';
          if (buffer && buffer.length) res = this.write(buffer);
  
          if (this.charReceived) {
            var cr = this.charReceived;
            var buf = this.charBuffer;
            var enc = this.encoding;
            res += buf.slice(0, cr).toString(enc);
          }
  
          return res;
        };
  
        function passThroughWrite(buffer) {
          return buffer.toString(this.encoding);
        }
  
        function utf16DetectIncompleteChar(buffer) {
          this.charReceived = buffer.length % 2;
          this.charLength = this.charReceived ? 2 : 0;
        }
  
        function base64DetectIncompleteChar(buffer) {
          this.charReceived = buffer.length % 3;
          this.charLength = this.charReceived ? 3 : 0;
        }
      }, {
        "buffer": 11
      }],
      37: [function (require, module, exports) {
        (function (global) {
          /**
           * Module exports.
           */
          module.exports = deprecate;
          /**
           * Mark that a method should not be used.
           * Returns a modified function which warns once by default.
           *
           * If `localStorage.noDeprecation = true` is set, then it is a no-op.
           *
           * If `localStorage.throwDeprecation = true` is set, then deprecated functions
           * will throw an Error when invoked.
           *
           * If `localStorage.traceDeprecation = true` is set, then deprecated functions
           * will invoke `console.trace()` instead of `console.error()`.
           *
           * @param {Function} fn - the function to deprecate
           * @param {String} msg - the string to print to the console when `fn` is invoked
           * @returns {Function} a new "deprecated" version of `fn`
           * @api public
           */
  
          function deprecate(fn, msg) {
            if (config('noDeprecation')) {
              return fn;
            }
  
            var warned = false;
  
            function deprecated() {
              if (!warned) {
                if (config('throwDeprecation')) {
                  throw new Error(msg);
                } else if (config('traceDeprecation')) {
                  console.trace(msg);
                } else {
                  console.warn(msg);
                }
  
                warned = true;
              }
  
              return fn.apply(this, arguments);
            }
  
            return deprecated;
          }
          /**
           * Checks `localStorage` for boolean values for the given `name`.
           *
           * @param {String} name
           * @returns {Boolean}
           * @api private
           */
  
  
          function config(name) {
            // accessing global.localStorage can trigger a DOMException in sandboxed iframes
            try {
              if (!global.localStorage) return false;
            } catch (_) {
              return false;
            }
  
            var val = global.localStorage[name];
            if (null == val) return false;
            return String(val).toLowerCase() === 'true';
          }
        }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
      }, {}],
      38: [function (require, module, exports) {
        arguments[4][18][0].apply(exports, arguments);
      }, {
        "dup": 18
      }],
      39: [function (require, module, exports) {
        module.exports = function isBuffer(arg) {
          return arg && _typeof(arg) === 'object' && typeof arg.copy === 'function' && typeof arg.fill === 'function' && typeof arg.readUInt8 === 'function';
        };
      }, {}],
      40: [function (require, module, exports) {
        (function (process, global) {
          // Copyright Joyent, Inc. and other Node contributors.
          //
          // Permission is hereby granted, free of charge, to any person obtaining a
          // copy of this software and associated documentation files (the
          // "Software"), to deal in the Software without restriction, including
          // without limitation the rights to use, copy, modify, merge, publish,
          // distribute, sublicense, and/or sell copies of the Software, and to permit
          // persons to whom the Software is furnished to do so, subject to the
          // following conditions:
          //
          // The above copyright notice and this permission notice shall be included
          // in all copies or substantial portions of the Software.
          //
          // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
          // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
          // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
          // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
          // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
          // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
          // USE OR OTHER DEALINGS IN THE SOFTWARE.
          var formatRegExp = /%[sdj%]/g;
  
          exports.format = function (f) {
            if (!isString(f)) {
              var objects = [];
  
              for (var i = 0; i < arguments.length; i++) {
                objects.push(inspect(arguments[i]));
              }
  
              return objects.join(' ');
            }
  
            var i = 1;
            var args = arguments;
            var len = args.length;
            var str = String(f).replace(formatRegExp, function (x) {
              if (x === '%%') return '%';
              if (i >= len) return x;
  
              switch (x) {
                case '%s':
                  return String(args[i++]);
  
                case '%d':
                  return Number(args[i++]);
  
                case '%j':
                  try {
                    return JSON.stringify(args[i++]);
                  } catch (_) {
                    return '[Circular]';
                  }
  
                default:
                  return x;
              }
            });
  
            for (var x = args[i]; i < len; x = args[++i]) {
              if (isNull(x) || !isObject(x)) {
                str += ' ' + x;
              } else {
                str += ' ' + inspect(x);
              }
            }
  
            return str;
          }; // Mark that a method should not be used.
          // Returns a modified function which warns once by default.
          // If --no-deprecation is set, then it is a no-op.
  
  
          exports.deprecate = function (fn, msg) {
            // Allow for deprecating things in the process of starting up.
            if (isUndefined(global.process)) {
              return function () {
                return exports.deprecate(fn, msg).apply(this, arguments);
              };
            }
  
            if (process.noDeprecation === true) {
              return fn;
            }
  
            var warned = false;
  
            function deprecated() {
              if (!warned) {
                if (process.throwDeprecation) {
                  throw new Error(msg);
                } else if (process.traceDeprecation) {
                  console.trace(msg);
                } else {
                  console.error(msg);
                }
  
                warned = true;
              }
  
              return fn.apply(this, arguments);
            }
  
            return deprecated;
          };
  
          var debugs = {};
          var debugEnviron;
  
          exports.debuglog = function (set) {
            if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || '';
            set = set.toUpperCase();
  
            if (!debugs[set]) {
              if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
                var pid = process.pid;
  
                debugs[set] = function () {
                  var msg = exports.format.apply(exports, arguments);
                  console.error('%s %d: %s', set, pid, msg);
                };
              } else {
                debugs[set] = function () {};
              }
            }
  
            return debugs[set];
          };
          /**
           * Echos the value of a value. Trys to print the value out
           * in the best way possible given the different types.
           *
           * @param {Object} obj The object to print out.
           * @param {Object} opts Optional options object that alters the output.
           */
  
          /* legacy: obj, showHidden, depth, colors*/
  
  
          function inspect(obj, opts) {
            // default options
            var ctx = {
              seen: [],
              stylize: stylizeNoColor
            }; // legacy...
  
            if (arguments.length >= 3) ctx.depth = arguments[2];
            if (arguments.length >= 4) ctx.colors = arguments[3];
  
            if (isBoolean(opts)) {
              // legacy...
              ctx.showHidden = opts;
            } else if (opts) {
              // got an "options" object
              exports._extend(ctx, opts);
            } // set default options
  
  
            if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
            if (isUndefined(ctx.depth)) ctx.depth = 2;
            if (isUndefined(ctx.colors)) ctx.colors = false;
            if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
            if (ctx.colors) ctx.stylize = stylizeWithColor;
            return formatValue(ctx, obj, ctx.depth);
          }
  
          exports.inspect = inspect; // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
  
          inspect.colors = {
            'bold': [1, 22],
            'italic': [3, 23],
            'underline': [4, 24],
            'inverse': [7, 27],
            'white': [37, 39],
            'grey': [90, 39],
            'black': [30, 39],
            'blue': [34, 39],
            'cyan': [36, 39],
            'green': [32, 39],
            'magenta': [35, 39],
            'red': [31, 39],
            'yellow': [33, 39]
          }; // Don't use 'blue' not visible on cmd.exe
  
          inspect.styles = {
            'special': 'cyan',
            'number': 'yellow',
            'boolean': 'yellow',
            'undefined': 'grey',
            'null': 'bold',
            'string': 'green',
            'date': 'magenta',
            // "name": intentionally not styling
            'regexp': 'red'
          };
  
          function stylizeWithColor(str, styleType) {
            var style = inspect.styles[styleType];
  
            if (style) {
              return "\x1B[" + inspect.colors[style][0] + 'm' + str + "\x1B[" + inspect.colors[style][1] + 'm';
            } else {
              return str;
            }
          }
  
          function stylizeNoColor(str, styleType) {
            return str;
          }
  
          function arrayToHash(array) {
            var hash = {};
            array.forEach(function (val, idx) {
              hash[val] = true;
            });
            return hash;
          }
  
          function formatValue(ctx, value, recurseTimes) {
            // Provide a hook for user-specified inspect functions.
            // Check that value is an object with an inspect function on it
            if (ctx.customInspect && value && isFunction(value.inspect) && // Filter out the util module, it's inspect function is special
            value.inspect !== exports.inspect && // Also filter out any prototype objects using the circular check.
            !(value.constructor && value.constructor.prototype === value)) {
              var ret = value.inspect(recurseTimes, ctx);
  
              if (!isString(ret)) {
                ret = formatValue(ctx, ret, recurseTimes);
              }
  
              return ret;
            } // Primitive types cannot have properties
  
  
            var primitive = formatPrimitive(ctx, value);
  
            if (primitive) {
              return primitive;
            } // Look up the keys of the object.
  
  
            var keys = Object.keys(value);
            var visibleKeys = arrayToHash(keys);
  
            if (ctx.showHidden) {
              keys = Object.getOwnPropertyNames(value);
            } // IE doesn't make error fields non-enumerable
            // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
  
  
            if (isError(value) && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
              return formatError(value);
            } // Some type of object without properties can be shortcutted.
  
  
            if (keys.length === 0) {
              if (isFunction(value)) {
                var name = value.name ? ': ' + value.name : '';
                return ctx.stylize('[Function' + name + ']', 'special');
              }
  
              if (isRegExp(value)) {
                return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
              }
  
              if (isDate(value)) {
                return ctx.stylize(Date.prototype.toString.call(value), 'date');
              }
  
              if (isError(value)) {
                return formatError(value);
              }
            }
  
            var base = '',
                array = false,
                braces = ['{', '}']; // Make Array say that they are Array
  
            if (isArray(value)) {
              array = true;
              braces = ['[', ']'];
            } // Make functions say that they are functions
  
  
            if (isFunction(value)) {
              var n = value.name ? ': ' + value.name : '';
              base = ' [Function' + n + ']';
            } // Make RegExps say that they are RegExps
  
  
            if (isRegExp(value)) {
              base = ' ' + RegExp.prototype.toString.call(value);
            } // Make dates with properties first say the date
  
  
            if (isDate(value)) {
              base = ' ' + Date.prototype.toUTCString.call(value);
            } // Make error with message first say the error
  
  
            if (isError(value)) {
              base = ' ' + formatError(value);
            }
  
            if (keys.length === 0 && (!array || value.length == 0)) {
              return braces[0] + base + braces[1];
            }
  
            if (recurseTimes < 0) {
              if (isRegExp(value)) {
                return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
              } else {
                return ctx.stylize('[Object]', 'special');
              }
            }
  
            ctx.seen.push(value);
            var output;
  
            if (array) {
              output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
            } else {
              output = keys.map(function (key) {
                return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
              });
            }
  
            ctx.seen.pop();
            return reduceToSingleString(output, base, braces);
          }
  
          function formatPrimitive(ctx, value) {
            if (isUndefined(value)) return ctx.stylize('undefined', 'undefined');
  
            if (isString(value)) {
              var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\'';
              return ctx.stylize(simple, 'string');
            }
  
            if (isNumber(value)) return ctx.stylize('' + value, 'number');
            if (isBoolean(value)) return ctx.stylize('' + value, 'boolean'); // For some reason typeof null is "object", so special case here.
  
            if (isNull(value)) return ctx.stylize('null', 'null');
          }
  
          function formatError(value) {
            return '[' + Error.prototype.toString.call(value) + ']';
          }
  
          function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
            var output = [];
  
            for (var i = 0, l = value.length; i < l; ++i) {
              if (hasOwnProperty(value, String(i))) {
                output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true));
              } else {
                output.push('');
              }
            }
  
            keys.forEach(function (key) {
              if (!key.match(/^\d+$/)) {
                output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true));
              }
            });
            return output;
          }
  
          function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
            var name, str, desc;
            desc = Object.getOwnPropertyDescriptor(value, key) || {
              value: value[key]
            };
  
            if (desc.get) {
              if (desc.set) {
                str = ctx.stylize('[Getter/Setter]', 'special');
              } else {
                str = ctx.stylize('[Getter]', 'special');
              }
            } else {
              if (desc.set) {
                str = ctx.stylize('[Setter]', 'special');
              }
            }
  
            if (!hasOwnProperty(visibleKeys, key)) {
              name = '[' + key + ']';
            }
  
            if (!str) {
              if (ctx.seen.indexOf(desc.value) < 0) {
                if (isNull(recurseTimes)) {
                  str = formatValue(ctx, desc.value, null);
                } else {
                  str = formatValue(ctx, desc.value, recurseTimes - 1);
                }
  
                if (str.indexOf('\n') > -1) {
                  if (array) {
                    str = str.split('\n').map(function (line) {
                      return '  ' + line;
                    }).join('\n').substr(2);
                  } else {
                    str = '\n' + str.split('\n').map(function (line) {
                      return '   ' + line;
                    }).join('\n');
                  }
                }
              } else {
                str = ctx.stylize('[Circular]', 'special');
              }
            }
  
            if (isUndefined(name)) {
              if (array && key.match(/^\d+$/)) {
                return str;
              }
  
              name = JSON.stringify('' + key);
  
              if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
                name = name.substr(1, name.length - 2);
                name = ctx.stylize(name, 'name');
              } else {
                name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
                name = ctx.stylize(name, 'string');
              }
            }
  
            return name + ': ' + str;
          }
  
          function reduceToSingleString(output, base, braces) {
            var numLinesEst = 0;
            var length = output.reduce(function (prev, cur) {
              numLinesEst++;
              if (cur.indexOf('\n') >= 0) numLinesEst++;
              return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
            }, 0);
  
            if (length > 60) {
              return braces[0] + (base === '' ? '' : base + '\n ') + ' ' + output.join(',\n  ') + ' ' + braces[1];
            }
  
            return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
          } // NOTE: These type checking functions intentionally don't use `instanceof`
          // because it is fragile and can be easily faked with `Object.create()`.
  
  
          function isArray(ar) {
            return Array.isArray(ar);
          }
  
          exports.isArray = isArray;
  
          function isBoolean(arg) {
            return typeof arg === 'boolean';
          }
  
          exports.isBoolean = isBoolean;
  
          function isNull(arg) {
            return arg === null;
          }
  
          exports.isNull = isNull;
  
          function isNullOrUndefined(arg) {
            return arg == null;
          }
  
          exports.isNullOrUndefined = isNullOrUndefined;
  
          function isNumber(arg) {
            return typeof arg === 'number';
          }
  
          exports.isNumber = isNumber;
  
          function isString(arg) {
            return typeof arg === 'string';
          }
  
          exports.isString = isString;
  
          function isSymbol(arg) {
            return _typeof(arg) === 'symbol';
          }
  
          exports.isSymbol = isSymbol;
  
          function isUndefined(arg) {
            return arg === void 0;
          }
  
          exports.isUndefined = isUndefined;
  
          function isRegExp(re) {
            return isObject(re) && objectToString(re) === '[object RegExp]';
          }
  
          exports.isRegExp = isRegExp;
  
          function isObject(arg) {
            return _typeof(arg) === 'object' && arg !== null;
          }
  
          exports.isObject = isObject;
  
          function isDate(d) {
            return isObject(d) && objectToString(d) === '[object Date]';
          }
  
          exports.isDate = isDate;
  
          function isError(e) {
            return isObject(e) && (objectToString(e) === '[object Error]' || e instanceof Error);
          }
  
          exports.isError = isError;
  
          function isFunction(arg) {
            return typeof arg === 'function';
          }
  
          exports.isFunction = isFunction;
  
          function isPrimitive(arg) {
            return arg === null || typeof arg === 'boolean' || typeof arg === 'number' || typeof arg === 'string' || _typeof(arg) === 'symbol' || // ES6 symbol
            typeof arg === 'undefined';
          }
  
          exports.isPrimitive = isPrimitive;
          exports.isBuffer = require('./support/isBuffer');
  
          function objectToString(o) {
            return Object.prototype.toString.call(o);
          }
  
          function pad(n) {
            return n < 10 ? '0' + n.toString(10) : n.toString(10);
          }
  
          var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']; // 26 Feb 16:19:34
  
          function timestamp() {
            var d = new Date();
            var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(':');
            return [d.getDate(), months[d.getMonth()], time].join(' ');
          } // log is just a thin wrapper to console.log that prepends a timestamp
  
  
          exports.log = function () {
            console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
          };
          /**
           * Inherit the prototype methods from one constructor into another.
           *
           * The Function.prototype.inherits from lang.js rewritten as a standalone
           * function (not on Function.prototype). NOTE: If this file is to be loaded
           * during bootstrapping this function needs to be rewritten using some native
           * functions as prototype setup using normal JavaScript does not work as
           * expected during bootstrapping (see mirror.js in r114903).
           *
           * @param {function} ctor Constructor function which needs to inherit the
           *     prototype.
           * @param {function} superCtor Constructor function to inherit prototype from.
           */
  
  
          exports.inherits = require('inherits');
  
          exports._extend = function (origin, add) {
            // Don't do anything if add isn't an object
            if (!add || !isObject(add)) return origin;
            var keys = Object.keys(add);
            var i = keys.length;
  
            while (i--) {
              origin[keys[i]] = add[keys[i]];
            }
  
            return origin;
          };
  
          function hasOwnProperty(obj, prop) {
            return Object.prototype.hasOwnProperty.call(obj, prop);
          }
        }).call(this, require('_process'), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {});
      }, {
        "./support/isBuffer": 39,
        "_process": 23,
        "inherits": 38
      }]
    }, {}, [1])(1);
  });
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(59).setImmediate))
  
  /***/ }),
  /* 59 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global) {var scope = typeof global !== "undefined" && global || typeof self !== "undefined" && self || window;
  var apply = Function.prototype.apply; // DOM APIs, for completeness
  
  exports.setTimeout = function () {
    return new Timeout(apply.call(setTimeout, scope, arguments), clearTimeout);
  };
  
  exports.setInterval = function () {
    return new Timeout(apply.call(setInterval, scope, arguments), clearInterval);
  };
  
  exports.clearTimeout = exports.clearInterval = function (timeout) {
    if (timeout) {
      timeout.close();
    }
  };
  
  function Timeout(id, clearFn) {
    this._id = id;
    this._clearFn = clearFn;
  }
  
  Timeout.prototype.unref = Timeout.prototype.ref = function () {};
  
  Timeout.prototype.close = function () {
    this._clearFn.call(scope, this._id);
  }; // Does not start the time, just sets up the members needed.
  
  
  exports.enroll = function (item, msecs) {
    clearTimeout(item._idleTimeoutId);
    item._idleTimeout = msecs;
  };
  
  exports.unenroll = function (item) {
    clearTimeout(item._idleTimeoutId);
    item._idleTimeout = -1;
  };
  
  exports._unrefActive = exports.active = function (item) {
    clearTimeout(item._idleTimeoutId);
    var msecs = item._idleTimeout;
  
    if (msecs >= 0) {
      item._idleTimeoutId = setTimeout(function onTimeout() {
        if (item._onTimeout) item._onTimeout();
      }, msecs);
    }
  }; // setimmediate attaches itself to the global object
  
  
  __webpack_require__(60); // On some exotic environments, it's not clear which object `setimmediate` was
  // able to install onto.  Search each possibility in the same order as the
  // `setimmediate` library.
  
  
  exports.setImmediate = typeof self !== "undefined" && self.setImmediate || typeof global !== "undefined" && global.setImmediate || this && this.setImmediate;
  exports.clearImmediate = typeof self !== "undefined" && self.clearImmediate || typeof global !== "undefined" && global.clearImmediate || this && this.clearImmediate;
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
  
  /***/ }),
  /* 60 */
  /***/ (function(module, exports, __webpack_require__) {
  
  /* WEBPACK VAR INJECTION */(function(global, process) {(function (global, undefined) {
    "use strict";
  
    if (global.setImmediate) {
      return;
    }
  
    var nextHandle = 1; // Spec says greater than zero
  
    var tasksByHandle = {};
    var currentlyRunningATask = false;
    var doc = global.document;
    var registerImmediate;
  
    function setImmediate(callback) {
      // Callback can either be a function or a string
      if (typeof callback !== "function") {
        callback = new Function("" + callback);
      } // Copy function arguments
  
  
      var args = new Array(arguments.length - 1);
  
      for (var i = 0; i < args.length; i++) {
        args[i] = arguments[i + 1];
      } // Store and register the task
  
  
      var task = {
        callback: callback,
        args: args
      };
      tasksByHandle[nextHandle] = task;
      registerImmediate(nextHandle);
      return nextHandle++;
    }
  
    function clearImmediate(handle) {
      delete tasksByHandle[handle];
    }
  
    function run(task) {
      var callback = task.callback;
      var args = task.args;
  
      switch (args.length) {
        case 0:
          callback();
          break;
  
        case 1:
          callback(args[0]);
          break;
  
        case 2:
          callback(args[0], args[1]);
          break;
  
        case 3:
          callback(args[0], args[1], args[2]);
          break;
  
        default:
          callback.apply(undefined, args);
          break;
      }
    }
  
    function runIfPresent(handle) {
      // From the spec: "Wait until any invocations of this algorithm started before this one have completed."
      // So if we're currently running a task, we'll need to delay this invocation.
      if (currentlyRunningATask) {
        // Delay by doing a setTimeout. setImmediate was tried instead, but in Firefox 7 it generated a
        // "too much recursion" error.
        setTimeout(runIfPresent, 0, handle);
      } else {
        var task = tasksByHandle[handle];
  
        if (task) {
          currentlyRunningATask = true;
  
          try {
            run(task);
          } finally {
            clearImmediate(handle);
            currentlyRunningATask = false;
          }
        }
      }
    }
  
    function installNextTickImplementation() {
      registerImmediate = function registerImmediate(handle) {
        process.nextTick(function () {
          runIfPresent(handle);
        });
      };
    }
  
    function canUsePostMessage() {
      // The test against `importScripts` prevents this implementation from being installed inside a web worker,
      // where `global.postMessage` means something completely different and can't be used for this purpose.
      if (global.postMessage && !global.importScripts) {
        var postMessageIsAsynchronous = true;
        var oldOnMessage = global.onmessage;
  
        global.onmessage = function () {
          postMessageIsAsynchronous = false;
        };
  
        global.postMessage("", "*");
        global.onmessage = oldOnMessage;
        return postMessageIsAsynchronous;
      }
    }
  
    function installPostMessageImplementation() {
      // Installs an event handler on `global` for the `message` event: see
      // * https://developer.mozilla.org/en/DOM/window.postMessage
      // * http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html#crossDocumentMessages
      var messagePrefix = "setImmediate$" + Math.random() + "$";
  
      var onGlobalMessage = function onGlobalMessage(event) {
        if (event.source === global && typeof event.data === "string" && event.data.indexOf(messagePrefix) === 0) {
          runIfPresent(+event.data.slice(messagePrefix.length));
        }
      };
  
      if (global.addEventListener) {
        global.addEventListener("message", onGlobalMessage, false);
      } else {
        global.attachEvent("onmessage", onGlobalMessage);
      }
  
      registerImmediate = function registerImmediate(handle) {
        global.postMessage(messagePrefix + handle, "*");
      };
    }
  
    function installMessageChannelImplementation() {
      var channel = new MessageChannel();
  
      channel.port1.onmessage = function (event) {
        var handle = event.data;
        runIfPresent(handle);
      };
  
      registerImmediate = function registerImmediate(handle) {
        channel.port2.postMessage(handle);
      };
    }
  
    function installReadyStateChangeImplementation() {
      var html = doc.documentElement;
  
      registerImmediate = function registerImmediate(handle) {
        // Create a <script> element; its readystatechange event will be fired asynchronously once it is inserted
        // into the document. Do so, thus queuing up the task. Remember to clean up once it's been called.
        var script = doc.createElement("script");
  
        script.onreadystatechange = function () {
          runIfPresent(handle);
          script.onreadystatechange = null;
          html.removeChild(script);
          script = null;
        };
  
        html.appendChild(script);
      };
    }
  
    function installSetTimeoutImplementation() {
      registerImmediate = function registerImmediate(handle) {
        setTimeout(runIfPresent, 0, handle);
      };
    } // If supported, we should attach to the prototype of global, since that is where setTimeout et al. live.
  
  
    var attachTo = Object.getPrototypeOf && Object.getPrototypeOf(global);
    attachTo = attachTo && attachTo.setTimeout ? attachTo : global; // Don't get fooled by e.g. browserify environments.
  
    if ({}.toString.call(global.process) === "[object process]") {
      // For Node.js before 0.9
      installNextTickImplementation();
    } else if (canUsePostMessage()) {
      // For non-IE10 modern browsers
      installPostMessageImplementation();
    } else if (global.MessageChannel) {
      // For web workers, where supported
      installMessageChannelImplementation();
    } else if (doc && "onreadystatechange" in doc.createElement("script")) {
      // For IE 6–8
      installReadyStateChangeImplementation();
    } else {
      // For older browsers
      installSetTimeoutImplementation();
    }
  
    attachTo.setImmediate = setImmediate;
    attachTo.clearImmediate = clearImmediate;
  })(typeof self === "undefined" ? typeof global === "undefined" ? this : global : self);
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(4)))
  
  /***/ }),
  /* 61 */
  /***/ (function(module, exports, __webpack_require__) {
  
  "use strict";
  /* WEBPACK VAR INJECTION */(function(global) {
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  var WORKER_ENABLED = !!(global === global.window && global.URL && global.Blob && global.Worker);
  
  function InlineWorker(func, self) {
    var _this = this;
  
    var functionBody;
    self = self || {};
  
    if (WORKER_ENABLED) {
      functionBody = func.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1];
      return new global.Worker(global.URL.createObjectURL(new global.Blob([functionBody], {
        type: "text/javascript"
      })));
    }
  
    function postMessage(data) {
      setTimeout(function () {
        _this.onmessage({
          data: data
        });
      }, 0);
    }
  
    this.self = self;
    this.self.postMessage = postMessage;
    setTimeout(func.bind(self, self), 0);
  }
  
  InlineWorker.prototype.postMessage = function postMessage(data) {
    var _this = this;
  
    setTimeout(function () {
      _this.self.onmessage({
        data: data
      });
    }, 0);
  };
  
  exports["default"] = InlineWorker;
  /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1)))
  
  /***/ })
  /******/ ]);
  //# sourceMappingURL=deepspeech.sdk.bundle.js.map