[
  {
    "path": ".babelrc",
    "content": "{\n  \"presets\": [\"react\", \"es2015\"],\n}\n"
  },
  {
    "path": ".bowerrc",
    "content": "{\n  \"directory\": \"client/lib\"\n}\n"
  },
  {
    "path": ".eslintrc",
    "content": "{\n  \"extends\": \"airbnb\",\n  \"rules\": {\n    \"no-use-before-define\": 0,\n    \"no-param-reassign\": 0,\n    \"no-console\": 0\n  },\n  \"globals\": {\n    \"imperio\": true,\n    \"Hammer\": true\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": ".DS_Store\n# Logs\nlogs\n*.log\nnpm-debug.log*\nimperio.js.map\nimperio.min.js.map\n\n# Runtime data\npids\n*.pid\n*.seed\n\n# Directory for instrumented libs generated by jscoverage/JSCover\nlib-cov\n\n# Coverage directory used by tools like istanbul\ncoverage\n\n# nyc test coverage\n.nyc_output\n\n# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)\n.grunt\n\n# node-waf configuration\n.lock-wscript\n\n# Compiled binary addons (http://nodejs.org/api/addons.html)\nbuild/Release\n\n# Dependency directories\nnode_modules\njspm_packages\nclient/lib\n\n# Optional npm cache directory\n.npm\n\n# Optional REPL history\n.node_repl_history\n"
  },
  {
    "path": "README.md",
    "content": "# [imperio](https://www.imperiojs.com)\nimperio is an open source JavaScript library that enables developers to build web applications that harness the power of mobile devices communicating sensor and gesture data to other devices in real-time. imperio provides developers an easy-to-use API, configurable middleware to easily set up device communication rules, and automatically initiates optimal data-streams based on browser compatibility with minimal code to get started.\n\nCheck out our website for a glimpse at what is possible with [imperio](https://www.imperiojs.com).\n\n## Version\n[![npm version](https://badge.fury.io/js/imperio.svg)](https://www.npmjs.com/package/imperio)\n\n## Features\n#### Front-end API\n* Sensor event data:\n  * Accelerometer\n  * Gyroscope\n  * Geolocation\n* Gesture event data:\n  * Pan\n  * Pinch\n  * Press\n  * Rotate\n  * Swipe\n  * Tap\n* Peer client ID information\n* Room information\n\n#### Real-time Communication\n* Initiate streaming communication using WebSockets\n* Automatically switch to WebRTC DataChannels as appropriate with one line of code\n\n#### Authenticate\n* Configurable middleware automatically creates and manages data streaming rooms for clients\n* Clients connect with short, randomly generated passwords provided to room initiator\n* Peristent client room connections\n\n## Installation\nInstall via npm:\n```bash\nnpm install --save imperio\n```\n\n## Get Started\nGetting started with imperio is simple: add a few lines in your frontend and server code.  Below is some code to get a basic example running.  For all available functionality, check out our [API ](https://github.com/imperiojs/imperio/wiki/API) docs.\n\nCheck out the full code for the sample implementation [here](https://github.com/imperiojs/getting-started).\n\n#### Client Side Implementation\nUse imperio in your client-side code to emit and receive a wide range of sensor and gesture events and data.\n\nimperio is attached to the window object and is accessible by `imperio` once you add the script tag to your html files.\n\n```javascript\n<script src='./dist/imperio.min.js'></script>\n```\nListenerRoomSetup starts the socket room connection and listens for incoming data from other connected clients. This is generally, but not necessarily, on a desktop/main browser.\n```javascript\nimperio.listenerRoomSetup();\n```\n\nThe emitter(s), generally mobile devices, will connect to the room established above.\n```javascript\nimperio.emitRoomSetup();\n```\n\nThe `imperio.gesture()` method gives developers access to all gesture events on a touch screen enabled device. Check out the [API wiki page](https://github.com/imperiojs/imperio/wiki/API) to see the full suite of features available.\n\n```javascript\nvar swipeBox = document.getElementById('swipe-box');\nimperio.gesture('swipe', swipeBox);\n```\n\n#### Server Side Implementation\n\nimperio provides connection and authentication functionality on the server via an Express middleware.\n```bash\nnpm install --save express\n```\nJust require the module and pass it the server object of your app\n```javascript\nconst imperio = require('imperio')(server);\n```\n\nTo correctly route the front-end request for the imperio bundle, include the following static route.\n```javascript\napp.use(express.static(path.join(`${__dirname}/../node_modules/imperio`)));\n```\n\n Include <code>imperio.init()</code> as middleware in your desired express route.\n\n```javascript\napp.get('/:nonce', imperio.init(),\n  (req, res) => {\n    if (req.imperio.isDesktop) {\n      res.sendFile(path.join(`${__dirname}/../client/desktop.html`));\n    } else {\n      if (req.imperio.connected) {\n        res.sendFile(path.join(`${__dirname}/../client/mobile.html`));\n      } else {\n        res.sendFile(path.join(`${__dirname}/../client/mobileLogin.html`));\n      }\n    }\n  }\n);\n```\n\nAnd that's it! This application will now stream swipe data from client to client, with a just a few lines of front end code and one line of middleware. Now go forth and build awesome things.\n\n### Examples\nOther examples using imperio can be found in the other repos under the imperio organization and on our [example](https://github.com/imperiojs/imperio/wiki/example) page.\n\n### Contributors\n[Michael Blanchard](https://github.com/miblanchard)\n\n[Austin Lyon](https://github.com/austinlyon)\n\n[Matt McLaughlin](https://github.com/mclaugmg)\n\n[Austin Nwaukoni](https://github.com/anwaukoni) \n\n### License\nMIT\n"
  },
  {
    "path": "dist/imperio.js",
    "content": "/*! Copyright Imperiojs */\n/******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict'; // eslint-disable-line\n\t// initialize library storage object\n\t\n\tvar imperio = {};\n\tvar Hammer = __webpack_require__(52);\n\t// import our getCookie function which we will use to pull\n\t// out the roomID and nonce cookie for socket connection and display on client\n\tvar getCookie = __webpack_require__(51);\n\t// import io from 'socket.io';\n\t__webpack_require__(82);\n\tvar io = __webpack_require__(75);\n\t// instantiate our shared socket\n\timperio.socket = io(); // eslint-disable-line\n\t// store roomID to pass to server for room creation and correctly routing the emissions\n\timperio.room = getCookie('roomId');\n\t// store nonce to use to display and show emit user how to connect\n\timperio.nonce = getCookie('nonce');\n\timperio.myID = null;\n\timperio.otherIDs = null;\n\t// check if webRTC is supported by client imperio.webRTCSupport will be true or false\n\timperio.webRTCSupport = __webpack_require__(14);\n\t// ICE server config, will remove\n\t// TODO: set this to ENV variables\n\timperio.webRTCConfiguration = { iceServers: [{ url: 'stun:stun.l.google.com:19302' }] };\n\t// determines if current connection is socket or rtc\n\timperio.connectionType = null;\n\t// initiate webRTC connection\n\timperio.webRTCConnect = __webpack_require__(57);\n\t// will store the dataChannel where webRTC data will be passed\n\timperio.dataChannel = null;\n\t// peerConnection stored on imperio\n\timperio.peerConnection = null;\n\t// storage place for pointers to callback functions passed into handler functions\n\timperio.callbacks = {};\n\t// sets up listener for motion data and emits object containing x,y,z coords\n\timperio.emitAcceleration = __webpack_require__(29);\n\t// sets up a listener for location data and emits object containing coordinates and time\n\timperio.emitGeoLocation = __webpack_require__(31);\n\t// sets up a listener for orientation data and emits object containing alpha, beta, and gamma data\n\timperio.emitGyroscope = __webpack_require__(32);\n\t// establishes connection to socket and shares room it should connnect to\n\timperio.emitRoomSetup = __webpack_require__(33);\n\t// emit any data you want\n\timperio.emitData = __webpack_require__(30);\n\t// emits socket event to request nonce timeout data\n\timperio.requestNonceTimeout = __webpack_require__(42);\n\t// sets up listener for tap event on listener\n\timperio.tapListener = __webpack_require__(49);\n\t// sets up listener for accel event/data on listener\n\timperio.geoLocationListener = __webpack_require__(45);\n\t// sets up listener for location event/data on listener\n\timperio.accelerationListener = __webpack_require__(43);\n\t// sets up listener for gyro event/data on listener\n\timperio.gyroscopeListener = __webpack_require__(46);\n\t// establishes connection to socket and shares room it should connnect to\n\timperio.listenerRoomSetup = __webpack_require__(47);\n\t// listen for data event\n\timperio.dataListener = __webpack_require__(44);\n\t\n\timperio.gesture = __webpack_require__(34);\n\tvar events = ['pan', 'pinch', 'press', 'pressUp', 'rotate', 'swipe'];\n\tevents.forEach(function (event) {\n\t  var eventHandler = event + 'Listener';\n\t  imperio[eventHandler] = function (callback) {\n\t    imperio.callbacks[event] = callback;\n\t    imperio.socket.on(event, function (eventObject) {\n\t      if (callback) callback(eventObject);\n\t    });\n\t  };\n\t});\n\t// sets up listener for changes to client connections to the room\n\timperio.roomUpdate = __webpack_require__(53);\n\t// sends updates on nonce timeouts to the browser\n\timperio.nonceTimeoutUpdate = __webpack_require__(48);\n\t// attaches our library object to the window so it is accessible when we use the script tag\n\twindow.imperio = imperio;\n\n/***/ },\n/* 1 */\n/***/ function(module, exports) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\t\n\tvar logDisabled_ = true;\n\t\n\t// Utility methods.\n\tvar utils = {\n\t  disableLog: function(bool) {\n\t    if (typeof bool !== 'boolean') {\n\t      return new Error('Argument type: ' + typeof bool +\n\t          '. Please use a boolean.');\n\t    }\n\t    logDisabled_ = bool;\n\t    return (bool) ? 'adapter.js logging disabled' :\n\t        'adapter.js logging enabled';\n\t  },\n\t\n\t  log: function() {\n\t    if (typeof window === 'object') {\n\t      if (logDisabled_) {\n\t        return;\n\t      }\n\t      if (typeof console !== 'undefined' && typeof console.log === 'function') {\n\t        console.log.apply(console, arguments);\n\t      }\n\t    }\n\t  },\n\t\n\t  /**\n\t   * Extract browser version out of the provided user agent string.\n\t   *\n\t   * @param {!string} uastring userAgent string.\n\t   * @param {!string} expr Regular expression used as match criteria.\n\t   * @param {!number} pos position in the version string to be returned.\n\t   * @return {!number} browser version.\n\t   */\n\t  extractVersion: function(uastring, expr, pos) {\n\t    var match = uastring.match(expr);\n\t    return match && match.length >= pos && parseInt(match[pos], 10);\n\t  },\n\t\n\t  /**\n\t   * Browser detector.\n\t   *\n\t   * @return {object} result containing browser, version and minVersion\n\t   *     properties.\n\t   */\n\t  detectBrowser: function() {\n\t    // Returned result object.\n\t    var result = {};\n\t    result.browser = null;\n\t    result.version = null;\n\t    result.minVersion = null;\n\t\n\t    // Fail early if it's not a browser\n\t    if (typeof window === 'undefined' || !window.navigator) {\n\t      result.browser = 'Not a browser.';\n\t      return result;\n\t    }\n\t\n\t    // Firefox.\n\t    if (navigator.mozGetUserMedia) {\n\t      result.browser = 'firefox';\n\t      result.version = this.extractVersion(navigator.userAgent,\n\t          /Firefox\\/([0-9]+)\\./, 1);\n\t      result.minVersion = 31;\n\t\n\t    // all webkit-based browsers\n\t    } else if (navigator.webkitGetUserMedia) {\n\t      // Chrome, Chromium, Webview, Opera, all use the chrome shim for now\n\t      if (window.webkitRTCPeerConnection) {\n\t        result.browser = 'chrome';\n\t        result.version = this.extractVersion(navigator.userAgent,\n\t          /Chrom(e|ium)\\/([0-9]+)\\./, 2);\n\t        result.minVersion = 38;\n\t\n\t      // Safari or unknown webkit-based\n\t      // for the time being Safari has support for MediaStreams but not webRTC\n\t      } else {\n\t        // Safari UA substrings of interest for reference:\n\t        // - webkit version:           AppleWebKit/602.1.25 (also used in Op,Cr)\n\t        // - safari UI version:        Version/9.0.3 (unique to Safari)\n\t        // - safari UI webkit version: Safari/601.4.4 (also used in Op,Cr)\n\t        //\n\t        // if the webkit version and safari UI webkit versions are equals,\n\t        // ... this is a stable version.\n\t        //\n\t        // only the internal webkit version is important today to know if\n\t        // media streams are supported\n\t        //\n\t        if (navigator.userAgent.match(/Version\\/(\\d+).(\\d+)/)) {\n\t          result.browser = 'safari';\n\t          result.version = this.extractVersion(navigator.userAgent,\n\t            /AppleWebKit\\/([0-9]+)\\./, 1);\n\t          result.minVersion = 602;\n\t\n\t        // unknown webkit-based browser\n\t        } else {\n\t          result.browser = 'Unsupported webkit-based browser ' +\n\t              'with GUM support but no WebRTC support.';\n\t          return result;\n\t        }\n\t      }\n\t\n\t    // Edge.\n\t    } else if (navigator.mediaDevices &&\n\t        navigator.userAgent.match(/Edge\\/(\\d+).(\\d+)$/)) {\n\t      result.browser = 'edge';\n\t      result.version = this.extractVersion(navigator.userAgent,\n\t          /Edge\\/(\\d+).(\\d+)$/, 2);\n\t      result.minVersion = 10547;\n\t\n\t    // Default fallthrough: not supported.\n\t    } else {\n\t      result.browser = 'Not a supported browser.';\n\t      return result;\n\t    }\n\t\n\t    // Warn if version is less than minVersion.\n\t    if (result.version < result.minVersion) {\n\t      utils.log('Browser: ' + result.browser + ' Version: ' + result.version +\n\t          ' < minimum supported version: ' + result.minVersion +\n\t          '\\n some things might not work!');\n\t    }\n\t\n\t    return result;\n\t  }\n\t};\n\t\n\t// Export.\n\tmodule.exports = {\n\t  log: utils.log,\n\t  disableLog: utils.disableLog,\n\t  browserDetails: utils.detectBrowser(),\n\t  extractVersion: utils.extractVersion\n\t};\n\n\n/***/ },\n/* 2 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * This is the web browser implementation of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\t\n\texports = module.exports = __webpack_require__(61);\n\texports.log = log;\n\texports.formatArgs = formatArgs;\n\texports.save = save;\n\texports.load = load;\n\texports.useColors = useColors;\n\texports.storage = 'undefined' != typeof chrome\n\t               && 'undefined' != typeof chrome.storage\n\t                  ? chrome.storage.local\n\t                  : localstorage();\n\t\n\t/**\n\t * Colors.\n\t */\n\t\n\texports.colors = [\n\t  'lightseagreen',\n\t  'forestgreen',\n\t  'goldenrod',\n\t  'dodgerblue',\n\t  'darkorchid',\n\t  'crimson'\n\t];\n\t\n\t/**\n\t * Currently only WebKit-based Web Inspectors, Firefox >= v31,\n\t * and the Firebug extension (any Firefox version) are known\n\t * to support \"%c\" CSS customizations.\n\t *\n\t * TODO: add a `localStorage` variable to explicitly enable/disable colors\n\t */\n\t\n\tfunction useColors() {\n\t  // is webkit? http://stackoverflow.com/a/16459606/376773\n\t  return ('WebkitAppearance' in document.documentElement.style) ||\n\t    // is firebug? http://stackoverflow.com/a/398120/376773\n\t    (window.console && (console.firebug || (console.exception && console.table))) ||\n\t    // is firefox >= v31?\n\t    // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages\n\t    (navigator.userAgent.toLowerCase().match(/firefox\\/(\\d+)/) && parseInt(RegExp.$1, 10) >= 31);\n\t}\n\t\n\t/**\n\t * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.\n\t */\n\t\n\texports.formatters.j = function(v) {\n\t  return JSON.stringify(v);\n\t};\n\t\n\t\n\t/**\n\t * Colorize log arguments if enabled.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction formatArgs() {\n\t  var args = arguments;\n\t  var useColors = this.useColors;\n\t\n\t  args[0] = (useColors ? '%c' : '')\n\t    + this.namespace\n\t    + (useColors ? ' %c' : ' ')\n\t    + args[0]\n\t    + (useColors ? '%c ' : ' ')\n\t    + '+' + exports.humanize(this.diff);\n\t\n\t  if (!useColors) return args;\n\t\n\t  var c = 'color: ' + this.color;\n\t  args = [args[0], c, 'color: inherit'].concat(Array.prototype.slice.call(args, 1));\n\t\n\t  // the final \"%c\" is somewhat tricky, because there could be other\n\t  // arguments passed either before or after the %c, so we need to\n\t  // figure out the correct index to insert the CSS into\n\t  var index = 0;\n\t  var lastC = 0;\n\t  args[0].replace(/%[a-z%]/g, function(match) {\n\t    if ('%%' === match) return;\n\t    index++;\n\t    if ('%c' === match) {\n\t      // we only are interested in the *last* %c\n\t      // (the user may have provided their own)\n\t      lastC = index;\n\t    }\n\t  });\n\t\n\t  args.splice(lastC, 0, c);\n\t  return args;\n\t}\n\t\n\t/**\n\t * Invokes `console.log()` when available.\n\t * No-op when `console.log` is not a \"function\".\n\t *\n\t * @api public\n\t */\n\t\n\tfunction log() {\n\t  // this hackery is required for IE8/9, where\n\t  // the `console.log` function doesn't have 'apply'\n\t  return 'object' === typeof console\n\t    && console.log\n\t    && Function.prototype.apply.call(console.log, console, arguments);\n\t}\n\t\n\t/**\n\t * Save `namespaces`.\n\t *\n\t * @param {String} namespaces\n\t * @api private\n\t */\n\t\n\tfunction save(namespaces) {\n\t  try {\n\t    if (null == namespaces) {\n\t      exports.storage.removeItem('debug');\n\t    } else {\n\t      exports.storage.debug = namespaces;\n\t    }\n\t  } catch(e) {}\n\t}\n\t\n\t/**\n\t * Load `namespaces`.\n\t *\n\t * @return {String} returns the previously persisted debug modes\n\t * @api private\n\t */\n\t\n\tfunction load() {\n\t  var r;\n\t  try {\n\t    r = exports.storage.debug;\n\t  } catch(e) {}\n\t  return r;\n\t}\n\t\n\t/**\n\t * Enable namespaces listed in `localStorage.debug` initially.\n\t */\n\t\n\texports.enable(load());\n\t\n\t/**\n\t * Localstorage attempts to return the localstorage.\n\t *\n\t * This is necessary because safari throws\n\t * when a user disables cookies/localstorage\n\t * and you attempt to access it.\n\t *\n\t * @return {LocalStorage}\n\t * @api private\n\t */\n\t\n\tfunction localstorage(){\n\t  try {\n\t    return window.localStorage;\n\t  } catch (e) {}\n\t}\n\n\n/***/ },\n/* 3 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar keys = __webpack_require__(68);\n\tvar hasBinary = __webpack_require__(69);\n\tvar sliceBuffer = __webpack_require__(28);\n\tvar base64encoder = __webpack_require__(59);\n\tvar after = __webpack_require__(27);\n\tvar utf8 = __webpack_require__(80);\n\t\n\t/**\n\t * Check if we are running an android browser. That requires us to use\n\t * ArrayBuffer with polling transports...\n\t *\n\t * http://ghinda.net/jpeg-blob-ajax-android/\n\t */\n\t\n\tvar isAndroid = navigator.userAgent.match(/Android/i);\n\t\n\t/**\n\t * Check if we are running in PhantomJS.\n\t * Uploading a Blob with PhantomJS does not work correctly, as reported here:\n\t * https://github.com/ariya/phantomjs/issues/11395\n\t * @type boolean\n\t */\n\tvar isPhantomJS = /PhantomJS/i.test(navigator.userAgent);\n\t\n\t/**\n\t * When true, avoids using Blobs to encode payloads.\n\t * @type boolean\n\t */\n\tvar dontSendBlobs = isAndroid || isPhantomJS;\n\t\n\t/**\n\t * Current protocol version.\n\t */\n\t\n\texports.protocol = 3;\n\t\n\t/**\n\t * Packet types.\n\t */\n\t\n\tvar packets = exports.packets = {\n\t    open:     0    // non-ws\n\t  , close:    1    // non-ws\n\t  , ping:     2\n\t  , pong:     3\n\t  , message:  4\n\t  , upgrade:  5\n\t  , noop:     6\n\t};\n\t\n\tvar packetslist = keys(packets);\n\t\n\t/**\n\t * Premade error packet.\n\t */\n\t\n\tvar err = { type: 'error', data: 'parser error' };\n\t\n\t/**\n\t * Create a blob api even for blob builder when vendor prefixes exist\n\t */\n\t\n\tvar Blob = __webpack_require__(60);\n\t\n\t/**\n\t * Encodes a packet.\n\t *\n\t *     <packet type id> [ <data> ]\n\t *\n\t * Example:\n\t *\n\t *     5hello world\n\t *     3\n\t *     4\n\t *\n\t * Binary is encoded in an identical principle\n\t *\n\t * @api private\n\t */\n\t\n\texports.encodePacket = function (packet, supportsBinary, utf8encode, callback) {\n\t  if ('function' == typeof supportsBinary) {\n\t    callback = supportsBinary;\n\t    supportsBinary = false;\n\t  }\n\t\n\t  if ('function' == typeof utf8encode) {\n\t    callback = utf8encode;\n\t    utf8encode = null;\n\t  }\n\t\n\t  var data = (packet.data === undefined)\n\t    ? undefined\n\t    : packet.data.buffer || packet.data;\n\t\n\t  if (global.ArrayBuffer && data instanceof ArrayBuffer) {\n\t    return encodeArrayBuffer(packet, supportsBinary, callback);\n\t  } else if (Blob && data instanceof global.Blob) {\n\t    return encodeBlob(packet, supportsBinary, callback);\n\t  }\n\t\n\t  // might be an object with { base64: true, data: dataAsBase64String }\n\t  if (data && data.base64) {\n\t    return encodeBase64Object(packet, callback);\n\t  }\n\t\n\t  // Sending data as a utf-8 string\n\t  var encoded = packets[packet.type];\n\t\n\t  // data fragment is optional\n\t  if (undefined !== packet.data) {\n\t    encoded += utf8encode ? utf8.encode(String(packet.data)) : String(packet.data);\n\t  }\n\t\n\t  return callback('' + encoded);\n\t\n\t};\n\t\n\tfunction encodeBase64Object(packet, callback) {\n\t  // packet data is an object { base64: true, data: dataAsBase64String }\n\t  var message = 'b' + exports.packets[packet.type] + packet.data.data;\n\t  return callback(message);\n\t}\n\t\n\t/**\n\t * Encode packet helpers for binary types\n\t */\n\t\n\tfunction encodeArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var data = packet.data;\n\t  var contentArray = new Uint8Array(data);\n\t  var resultBuffer = new Uint8Array(1 + data.byteLength);\n\t\n\t  resultBuffer[0] = packets[packet.type];\n\t  for (var i = 0; i < contentArray.length; i++) {\n\t    resultBuffer[i+1] = contentArray[i];\n\t  }\n\t\n\t  return callback(resultBuffer.buffer);\n\t}\n\t\n\tfunction encodeBlobAsArrayBuffer(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  var fr = new FileReader();\n\t  fr.onload = function() {\n\t    packet.data = fr.result;\n\t    exports.encodePacket(packet, supportsBinary, true, callback);\n\t  };\n\t  return fr.readAsArrayBuffer(packet.data);\n\t}\n\t\n\tfunction encodeBlob(packet, supportsBinary, callback) {\n\t  if (!supportsBinary) {\n\t    return exports.encodeBase64Packet(packet, callback);\n\t  }\n\t\n\t  if (dontSendBlobs) {\n\t    return encodeBlobAsArrayBuffer(packet, supportsBinary, callback);\n\t  }\n\t\n\t  var length = new Uint8Array(1);\n\t  length[0] = packets[packet.type];\n\t  var blob = new Blob([length.buffer, packet.data]);\n\t\n\t  return callback(blob);\n\t}\n\t\n\t/**\n\t * Encodes a packet with binary data in a base64 string\n\t *\n\t * @param {Object} packet, has `type` and `data`\n\t * @return {String} base64 encoded message\n\t */\n\t\n\texports.encodeBase64Packet = function(packet, callback) {\n\t  var message = 'b' + exports.packets[packet.type];\n\t  if (Blob && packet.data instanceof global.Blob) {\n\t    var fr = new FileReader();\n\t    fr.onload = function() {\n\t      var b64 = fr.result.split(',')[1];\n\t      callback(message + b64);\n\t    };\n\t    return fr.readAsDataURL(packet.data);\n\t  }\n\t\n\t  var b64data;\n\t  try {\n\t    b64data = String.fromCharCode.apply(null, new Uint8Array(packet.data));\n\t  } catch (e) {\n\t    // iPhone Safari doesn't let you apply with typed arrays\n\t    var typed = new Uint8Array(packet.data);\n\t    var basic = new Array(typed.length);\n\t    for (var i = 0; i < typed.length; i++) {\n\t      basic[i] = typed[i];\n\t    }\n\t    b64data = String.fromCharCode.apply(null, basic);\n\t  }\n\t  message += global.btoa(b64data);\n\t  return callback(message);\n\t};\n\t\n\t/**\n\t * Decodes a packet. Changes format to Blob if requested.\n\t *\n\t * @return {Object} with `type` and `data` (if any)\n\t * @api private\n\t */\n\t\n\texports.decodePacket = function (data, binaryType, utf8decode) {\n\t  // String data\n\t  if (typeof data == 'string' || data === undefined) {\n\t    if (data.charAt(0) == 'b') {\n\t      return exports.decodeBase64Packet(data.substr(1), binaryType);\n\t    }\n\t\n\t    if (utf8decode) {\n\t      try {\n\t        data = utf8.decode(data);\n\t      } catch (e) {\n\t        return err;\n\t      }\n\t    }\n\t    var type = data.charAt(0);\n\t\n\t    if (Number(type) != type || !packetslist[type]) {\n\t      return err;\n\t    }\n\t\n\t    if (data.length > 1) {\n\t      return { type: packetslist[type], data: data.substring(1) };\n\t    } else {\n\t      return { type: packetslist[type] };\n\t    }\n\t  }\n\t\n\t  var asArray = new Uint8Array(data);\n\t  var type = asArray[0];\n\t  var rest = sliceBuffer(data, 1);\n\t  if (Blob && binaryType === 'blob') {\n\t    rest = new Blob([rest]);\n\t  }\n\t  return { type: packetslist[type], data: rest };\n\t};\n\t\n\t/**\n\t * Decodes a packet encoded in a base64 string\n\t *\n\t * @param {String} base64 encoded message\n\t * @return {Object} with `type` and `data` (if any)\n\t */\n\t\n\texports.decodeBase64Packet = function(msg, binaryType) {\n\t  var type = packetslist[msg.charAt(0)];\n\t  if (!global.ArrayBuffer) {\n\t    return { type: type, data: { base64: true, data: msg.substr(1) } };\n\t  }\n\t\n\t  var data = base64encoder.decode(msg.substr(1));\n\t\n\t  if (binaryType === 'blob' && Blob) {\n\t    data = new Blob([data]);\n\t  }\n\t\n\t  return { type: type, data: data };\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload).\n\t *\n\t *     <length>:data\n\t *\n\t * Example:\n\t *\n\t *     11:hello world2:hi\n\t *\n\t * If any contents are binary, they will be encoded as base64 strings. Base64\n\t * encoded strings are marked with a b before the length specifier\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\texports.encodePayload = function (packets, supportsBinary, callback) {\n\t  if (typeof supportsBinary == 'function') {\n\t    callback = supportsBinary;\n\t    supportsBinary = null;\n\t  }\n\t\n\t  var isBinary = hasBinary(packets);\n\t\n\t  if (supportsBinary && isBinary) {\n\t    if (Blob && !dontSendBlobs) {\n\t      return exports.encodePayloadAsBlob(packets, callback);\n\t    }\n\t\n\t    return exports.encodePayloadAsArrayBuffer(packets, callback);\n\t  }\n\t\n\t  if (!packets.length) {\n\t    return callback('0:');\n\t  }\n\t\n\t  function setLengthHeader(message) {\n\t    return message.length + ':' + message;\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, !isBinary ? false : supportsBinary, true, function(message) {\n\t      doneCallback(null, setLengthHeader(message));\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(results.join(''));\n\t  });\n\t};\n\t\n\t/**\n\t * Async array map using after\n\t */\n\t\n\tfunction map(ary, each, done) {\n\t  var result = new Array(ary.length);\n\t  var next = after(ary.length, done);\n\t\n\t  var eachWithIndex = function(i, el, cb) {\n\t    each(el, function(error, msg) {\n\t      result[i] = msg;\n\t      cb(error, result);\n\t    });\n\t  };\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    eachWithIndex(i, ary[i], next);\n\t  }\n\t}\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Possible binary contents are\n\t * decoded from their base64 representation\n\t *\n\t * @param {String} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayload = function (data, binaryType, callback) {\n\t  if (typeof data != 'string') {\n\t    return exports.decodePayloadAsBinary(data, binaryType, callback);\n\t  }\n\t\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var packet;\n\t  if (data == '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t  var length = ''\n\t    , n, msg;\n\t\n\t  for (var i = 0, l = data.length; i < l; i++) {\n\t    var chr = data.charAt(i);\n\t\n\t    if (':' != chr) {\n\t      length += chr;\n\t    } else {\n\t      if ('' == length || (length != (n = Number(length)))) {\n\t        // parser error - ignoring payload\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      msg = data.substr(i + 1, n);\n\t\n\t      if (length != msg.length) {\n\t        // parser error - ignoring payload\n\t        return callback(err, 0, 1);\n\t      }\n\t\n\t      if (msg.length) {\n\t        packet = exports.decodePacket(msg, binaryType, true);\n\t\n\t        if (err.type == packet.type && err.data == packet.data) {\n\t          // parser error in individual packet - ignoring payload\n\t          return callback(err, 0, 1);\n\t        }\n\t\n\t        var ret = callback(packet, i + n, l);\n\t        if (false === ret) return;\n\t      }\n\t\n\t      // advance cursor\n\t      i += n;\n\t      length = '';\n\t    }\n\t  }\n\t\n\t  if (length != '') {\n\t    // parser error - ignoring payload\n\t    return callback(err, 0, 1);\n\t  }\n\t\n\t};\n\t\n\t/**\n\t * Encodes multiple messages (payload) as binary.\n\t *\n\t * <1 = binary, 0 = string><number from 0-9><number from 0-9>[...]<number\n\t * 255><data>\n\t *\n\t * Example:\n\t * 1 3 255 1 2 3, if the binary contents are interpreted as 8 bit integers\n\t *\n\t * @param {Array} packets\n\t * @return {ArrayBuffer} encoded payload\n\t * @api private\n\t */\n\t\n\texports.encodePayloadAsArrayBuffer = function(packets, callback) {\n\t  if (!packets.length) {\n\t    return callback(new ArrayBuffer(0));\n\t  }\n\t\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(data) {\n\t      return doneCallback(null, data);\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, encodedPackets) {\n\t    var totalLength = encodedPackets.reduce(function(acc, p) {\n\t      var len;\n\t      if (typeof p === 'string'){\n\t        len = p.length;\n\t      } else {\n\t        len = p.byteLength;\n\t      }\n\t      return acc + len.toString().length + len + 2; // string/binary identifier + separator = 2\n\t    }, 0);\n\t\n\t    var resultArray = new Uint8Array(totalLength);\n\t\n\t    var bufferIndex = 0;\n\t    encodedPackets.forEach(function(p) {\n\t      var isString = typeof p === 'string';\n\t      var ab = p;\n\t      if (isString) {\n\t        var view = new Uint8Array(p.length);\n\t        for (var i = 0; i < p.length; i++) {\n\t          view[i] = p.charCodeAt(i);\n\t        }\n\t        ab = view.buffer;\n\t      }\n\t\n\t      if (isString) { // not true binary\n\t        resultArray[bufferIndex++] = 0;\n\t      } else { // true binary\n\t        resultArray[bufferIndex++] = 1;\n\t      }\n\t\n\t      var lenStr = ab.byteLength.toString();\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        resultArray[bufferIndex++] = parseInt(lenStr[i]);\n\t      }\n\t      resultArray[bufferIndex++] = 255;\n\t\n\t      var view = new Uint8Array(ab);\n\t      for (var i = 0; i < view.length; i++) {\n\t        resultArray[bufferIndex++] = view[i];\n\t      }\n\t    });\n\t\n\t    return callback(resultArray.buffer);\n\t  });\n\t};\n\t\n\t/**\n\t * Encode as Blob\n\t */\n\t\n\texports.encodePayloadAsBlob = function(packets, callback) {\n\t  function encodeOne(packet, doneCallback) {\n\t    exports.encodePacket(packet, true, true, function(encoded) {\n\t      var binaryIdentifier = new Uint8Array(1);\n\t      binaryIdentifier[0] = 1;\n\t      if (typeof encoded === 'string') {\n\t        var view = new Uint8Array(encoded.length);\n\t        for (var i = 0; i < encoded.length; i++) {\n\t          view[i] = encoded.charCodeAt(i);\n\t        }\n\t        encoded = view.buffer;\n\t        binaryIdentifier[0] = 0;\n\t      }\n\t\n\t      var len = (encoded instanceof ArrayBuffer)\n\t        ? encoded.byteLength\n\t        : encoded.size;\n\t\n\t      var lenStr = len.toString();\n\t      var lengthAry = new Uint8Array(lenStr.length + 1);\n\t      for (var i = 0; i < lenStr.length; i++) {\n\t        lengthAry[i] = parseInt(lenStr[i]);\n\t      }\n\t      lengthAry[lenStr.length] = 255;\n\t\n\t      if (Blob) {\n\t        var blob = new Blob([binaryIdentifier.buffer, lengthAry.buffer, encoded]);\n\t        doneCallback(null, blob);\n\t      }\n\t    });\n\t  }\n\t\n\t  map(packets, encodeOne, function(err, results) {\n\t    return callback(new Blob(results));\n\t  });\n\t};\n\t\n\t/*\n\t * Decodes data when a payload is maybe expected. Strings are decoded by\n\t * interpreting each byte as a key code for entries marked to start with 0. See\n\t * description of encodePayloadAsBinary\n\t *\n\t * @param {ArrayBuffer} data, callback method\n\t * @api public\n\t */\n\t\n\texports.decodePayloadAsBinary = function (data, binaryType, callback) {\n\t  if (typeof binaryType === 'function') {\n\t    callback = binaryType;\n\t    binaryType = null;\n\t  }\n\t\n\t  var bufferTail = data;\n\t  var buffers = [];\n\t\n\t  var numberTooLong = false;\n\t  while (bufferTail.byteLength > 0) {\n\t    var tailArray = new Uint8Array(bufferTail);\n\t    var isString = tailArray[0] === 0;\n\t    var msgLength = '';\n\t\n\t    for (var i = 1; ; i++) {\n\t      if (tailArray[i] == 255) break;\n\t\n\t      if (msgLength.length > 310) {\n\t        numberTooLong = true;\n\t        break;\n\t      }\n\t\n\t      msgLength += tailArray[i];\n\t    }\n\t\n\t    if(numberTooLong) return callback(err, 0, 1);\n\t\n\t    bufferTail = sliceBuffer(bufferTail, 2 + msgLength.length);\n\t    msgLength = parseInt(msgLength);\n\t\n\t    var msg = sliceBuffer(bufferTail, 0, msgLength);\n\t    if (isString) {\n\t      try {\n\t        msg = String.fromCharCode.apply(null, new Uint8Array(msg));\n\t      } catch (e) {\n\t        // iPhone Safari doesn't let you apply to typed arrays\n\t        var typed = new Uint8Array(msg);\n\t        msg = '';\n\t        for (var i = 0; i < typed.length; i++) {\n\t          msg += String.fromCharCode(typed[i]);\n\t        }\n\t      }\n\t    }\n\t\n\t    buffers.push(msg);\n\t    bufferTail = sliceBuffer(bufferTail, msgLength);\n\t  }\n\t\n\t  var total = buffers.length;\n\t  buffers.forEach(function(buffer, i) {\n\t    callback(exports.decodePacket(buffer, binaryType, true), i, total);\n\t  });\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 4 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Expose `Emitter`.\n\t */\n\t\n\tmodule.exports = Emitter;\n\t\n\t/**\n\t * Initialize a new `Emitter`.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Emitter(obj) {\n\t  if (obj) return mixin(obj);\n\t};\n\t\n\t/**\n\t * Mixin the emitter properties.\n\t *\n\t * @param {Object} obj\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\tfunction mixin(obj) {\n\t  for (var key in Emitter.prototype) {\n\t    obj[key] = Emitter.prototype[key];\n\t  }\n\t  return obj;\n\t}\n\t\n\t/**\n\t * Listen on the given `event` with `fn`.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.on =\n\tEmitter.prototype.addEventListener = function(event, fn){\n\t  this._callbacks = this._callbacks || {};\n\t  (this._callbacks[event] = this._callbacks[event] || [])\n\t    .push(fn);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Adds an `event` listener that will be invoked a single\n\t * time then automatically removed.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.once = function(event, fn){\n\t  var self = this;\n\t  this._callbacks = this._callbacks || {};\n\t\n\t  function on() {\n\t    self.off(event, on);\n\t    fn.apply(this, arguments);\n\t  }\n\t\n\t  on.fn = fn;\n\t  this.on(event, on);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Remove the given callback for `event` or all\n\t * registered callbacks.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.off =\n\tEmitter.prototype.removeListener =\n\tEmitter.prototype.removeAllListeners =\n\tEmitter.prototype.removeEventListener = function(event, fn){\n\t  this._callbacks = this._callbacks || {};\n\t\n\t  // all\n\t  if (0 == arguments.length) {\n\t    this._callbacks = {};\n\t    return this;\n\t  }\n\t\n\t  // specific event\n\t  var callbacks = this._callbacks[event];\n\t  if (!callbacks) return this;\n\t\n\t  // remove all handlers\n\t  if (1 == arguments.length) {\n\t    delete this._callbacks[event];\n\t    return this;\n\t  }\n\t\n\t  // remove specific handler\n\t  var cb;\n\t  for (var i = 0; i < callbacks.length; i++) {\n\t    cb = callbacks[i];\n\t    if (cb === fn || cb.fn === fn) {\n\t      callbacks.splice(i, 1);\n\t      break;\n\t    }\n\t  }\n\t  return this;\n\t};\n\t\n\t/**\n\t * Emit `event` with the given args.\n\t *\n\t * @param {String} event\n\t * @param {Mixed} ...\n\t * @return {Emitter}\n\t */\n\t\n\tEmitter.prototype.emit = function(event){\n\t  this._callbacks = this._callbacks || {};\n\t  var args = [].slice.call(arguments, 1)\n\t    , callbacks = this._callbacks[event];\n\t\n\t  if (callbacks) {\n\t    callbacks = callbacks.slice(0);\n\t    for (var i = 0, len = callbacks.length; i < len; ++i) {\n\t      callbacks[i].apply(this, args);\n\t    }\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Return array of callbacks for `event`.\n\t *\n\t * @param {String} event\n\t * @return {Array}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.listeners = function(event){\n\t  this._callbacks = this._callbacks || {};\n\t  return this._callbacks[event] || [];\n\t};\n\t\n\t/**\n\t * Check if this emitter has `event` handlers.\n\t *\n\t * @param {String} event\n\t * @return {Boolean}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.hasListeners = function(event){\n\t  return !! this.listeners(event).length;\n\t};\n\n\n/***/ },\n/* 5 */\n/***/ function(module, exports) {\n\n\t\n\tmodule.exports = function(a, b){\n\t  var fn = function(){};\n\t  fn.prototype = b.prototype;\n\t  a.prototype = new fn;\n\t  a.prototype.constructor = a;\n\t};\n\n/***/ },\n/* 6 */\n/***/ function(module, exports) {\n\n\tmodule.exports = Array.isArray || function (arr) {\n\t  return Object.prototype.toString.call(arr) == '[object Array]';\n\t};\n\n\n/***/ },\n/* 7 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tmodule.exports = function (err) {\n\t  return console.log(err.toString(), err);\n\t};\n\n/***/ },\n/* 8 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(3);\n\tvar Emitter = __webpack_require__(4);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Transport;\n\t\n\t/**\n\t * Transport abstract constructor.\n\t *\n\t * @param {Object} options.\n\t * @api private\n\t */\n\t\n\tfunction Transport (opts) {\n\t  this.path = opts.path;\n\t  this.hostname = opts.hostname;\n\t  this.port = opts.port;\n\t  this.secure = opts.secure;\n\t  this.query = opts.query;\n\t  this.timestampParam = opts.timestampParam;\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.readyState = '';\n\t  this.agent = opts.agent || false;\n\t  this.socket = opts.socket;\n\t  this.enablesXDR = opts.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Transport.prototype);\n\t\n\t/**\n\t * Emits an error.\n\t *\n\t * @param {String} str\n\t * @return {Transport} for chaining\n\t * @api public\n\t */\n\t\n\tTransport.prototype.onError = function (msg, desc) {\n\t  var err = new Error(msg);\n\t  err.type = 'TransportError';\n\t  err.description = desc;\n\t  this.emit('error', err);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Opens the transport.\n\t *\n\t * @api public\n\t */\n\t\n\tTransport.prototype.open = function () {\n\t  if ('closed' == this.readyState || '' == this.readyState) {\n\t    this.readyState = 'opening';\n\t    this.doOpen();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Closes the transport.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.close = function () {\n\t  if ('opening' == this.readyState || 'open' == this.readyState) {\n\t    this.doClose();\n\t    this.onClose();\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends multiple packets.\n\t *\n\t * @param {Array} packets\n\t * @api private\n\t */\n\t\n\tTransport.prototype.send = function(packets){\n\t  if ('open' == this.readyState) {\n\t    this.write(packets);\n\t  } else {\n\t    throw new Error('Transport not open');\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon open\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onOpen = function () {\n\t  this.readyState = 'open';\n\t  this.writable = true;\n\t  this.emit('open');\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @param {String} data\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onData = function(data){\n\t  var packet = parser.decodePacket(data, this.socket.binaryType);\n\t  this.onPacket(packet);\n\t};\n\t\n\t/**\n\t * Called with a decoded packet.\n\t */\n\t\n\tTransport.prototype.onPacket = function (packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon close.\n\t *\n\t * @api private\n\t */\n\t\n\tTransport.prototype.onClose = function () {\n\t  this.readyState = 'closed';\n\t  this.emit('close');\n\t};\n\n\n/***/ },\n/* 9 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t// browser shim for xmlhttprequest module\n\tvar hasCORS = __webpack_require__(71);\n\t\n\tmodule.exports = function(opts) {\n\t  var xdomain = opts.xdomain;\n\t\n\t  // scheme must be same when usign XDomainRequest\n\t  // http://blogs.msdn.com/b/ieinternals/archive/2010/05/13/xdomainrequest-restrictions-limitations-and-workarounds.aspx\n\t  var xscheme = opts.xscheme;\n\t\n\t  // XDomainRequest has a flow of not sending cookie, therefore it should be disabled as a default.\n\t  // https://github.com/Automattic/engine.io-client/pull/217\n\t  var enablesXDR = opts.enablesXDR;\n\t\n\t  // XMLHttpRequest can be disabled on IE\n\t  try {\n\t    if ('undefined' != typeof XMLHttpRequest && (!xdomain || hasCORS)) {\n\t      return new XMLHttpRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  // Use XDomainRequest for IE8 if enablesXDR is true\n\t  // because loading bar keeps flashing when using jsonp-polling\n\t  // https://github.com/yujiosaka/socke.io-ie8-loading-example\n\t  try {\n\t    if ('undefined' != typeof XDomainRequest && !xscheme && enablesXDR) {\n\t      return new XDomainRequest();\n\t    }\n\t  } catch (e) { }\n\t\n\t  if (!xdomain) {\n\t    try {\n\t      return new ActiveXObject('Microsoft.XMLHTTP');\n\t    } catch(e) { }\n\t  }\n\t}\n\n\n/***/ },\n/* 10 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Compiles a querystring\n\t * Returns string representation of the object\n\t *\n\t * @param {Object}\n\t * @api private\n\t */\n\t\n\texports.encode = function (obj) {\n\t  var str = '';\n\t\n\t  for (var i in obj) {\n\t    if (obj.hasOwnProperty(i)) {\n\t      if (str.length) str += '&';\n\t      str += encodeURIComponent(i) + '=' + encodeURIComponent(obj[i]);\n\t    }\n\t  }\n\t\n\t  return str;\n\t};\n\t\n\t/**\n\t * Parses a simple querystring into an object\n\t *\n\t * @param {String} qs\n\t * @api private\n\t */\n\t\n\texports.decode = function(qs){\n\t  var qry = {};\n\t  var pairs = qs.split('&');\n\t  for (var i = 0, l = pairs.length; i < l; i++) {\n\t    var pair = pairs[i].split('=');\n\t    qry[decodeURIComponent(pair[0])] = decodeURIComponent(pair[1]);\n\t  }\n\t  return qry;\n\t};\n\n\n/***/ },\n/* 11 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar debug = __webpack_require__(2)('socket.io-parser');\n\tvar json = __webpack_require__(78);\n\tvar isArray = __webpack_require__(6);\n\tvar Emitter = __webpack_require__(4);\n\tvar binary = __webpack_require__(77);\n\tvar isBuf = __webpack_require__(24);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = 4;\n\t\n\t/**\n\t * Packet types.\n\t *\n\t * @api public\n\t */\n\t\n\texports.types = [\n\t  'CONNECT',\n\t  'DISCONNECT',\n\t  'EVENT',\n\t  'ACK',\n\t  'ERROR',\n\t  'BINARY_EVENT',\n\t  'BINARY_ACK'\n\t];\n\t\n\t/**\n\t * Packet type `connect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.CONNECT = 0;\n\t\n\t/**\n\t * Packet type `disconnect`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.DISCONNECT = 1;\n\t\n\t/**\n\t * Packet type `event`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.EVENT = 2;\n\t\n\t/**\n\t * Packet type `ack`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ACK = 3;\n\t\n\t/**\n\t * Packet type `error`.\n\t *\n\t * @api public\n\t */\n\t\n\texports.ERROR = 4;\n\t\n\t/**\n\t * Packet type 'binary event'\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_EVENT = 5;\n\t\n\t/**\n\t * Packet type `binary ack`. For acks with binary arguments.\n\t *\n\t * @api public\n\t */\n\t\n\texports.BINARY_ACK = 6;\n\t\n\t/**\n\t * Encoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Encoder = Encoder;\n\t\n\t/**\n\t * Decoder constructor.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Decoder = Decoder;\n\t\n\t/**\n\t * A socket.io Encoder instance\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Encoder() {}\n\t\n\t/**\n\t * Encode a packet as a single string if non-binary, or as a\n\t * buffer sequence, depending on packet type.\n\t *\n\t * @param {Object} obj - packet object\n\t * @param {Function} callback - function to handle encodings (likely engine.write)\n\t * @return Calls callback with Array of encodings\n\t * @api public\n\t */\n\t\n\tEncoder.prototype.encode = function(obj, callback){\n\t  debug('encoding packet %j', obj);\n\t\n\t  if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n\t    encodeAsBinary(obj, callback);\n\t  }\n\t  else {\n\t    var encoding = encodeAsString(obj);\n\t    callback([encoding]);\n\t  }\n\t};\n\t\n\t/**\n\t * Encode packet as string.\n\t *\n\t * @param {Object} packet\n\t * @return {String} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsString(obj) {\n\t  var str = '';\n\t  var nsp = false;\n\t\n\t  // first is type\n\t  str += obj.type;\n\t\n\t  // attachments if we have them\n\t  if (exports.BINARY_EVENT == obj.type || exports.BINARY_ACK == obj.type) {\n\t    str += obj.attachments;\n\t    str += '-';\n\t  }\n\t\n\t  // if we have a namespace other than `/`\n\t  // we append it followed by a comma `,`\n\t  if (obj.nsp && '/' != obj.nsp) {\n\t    nsp = true;\n\t    str += obj.nsp;\n\t  }\n\t\n\t  // immediately followed by the id\n\t  if (null != obj.id) {\n\t    if (nsp) {\n\t      str += ',';\n\t      nsp = false;\n\t    }\n\t    str += obj.id;\n\t  }\n\t\n\t  // json data\n\t  if (null != obj.data) {\n\t    if (nsp) str += ',';\n\t    str += json.stringify(obj.data);\n\t  }\n\t\n\t  debug('encoded %j as %s', obj, str);\n\t  return str;\n\t}\n\t\n\t/**\n\t * Encode packet as 'buffer sequence' by removing blobs, and\n\t * deconstructing packet into object with placeholders and\n\t * a list of buffers.\n\t *\n\t * @param {Object} packet\n\t * @return {Buffer} encoded\n\t * @api private\n\t */\n\t\n\tfunction encodeAsBinary(obj, callback) {\n\t\n\t  function writeEncoding(bloblessData) {\n\t    var deconstruction = binary.deconstructPacket(bloblessData);\n\t    var pack = encodeAsString(deconstruction.packet);\n\t    var buffers = deconstruction.buffers;\n\t\n\t    buffers.unshift(pack); // add packet info to beginning of data list\n\t    callback(buffers); // write all the buffers\n\t  }\n\t\n\t  binary.removeBlobs(obj, writeEncoding);\n\t}\n\t\n\t/**\n\t * A socket.io Decoder instance\n\t *\n\t * @return {Object} decoder\n\t * @api public\n\t */\n\t\n\tfunction Decoder() {\n\t  this.reconstructor = null;\n\t}\n\t\n\t/**\n\t * Mix in `Emitter` with Decoder.\n\t */\n\t\n\tEmitter(Decoder.prototype);\n\t\n\t/**\n\t * Decodes an ecoded packet string into packet JSON.\n\t *\n\t * @param {String} obj - encoded packet\n\t * @return {Object} packet\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.add = function(obj) {\n\t  var packet;\n\t  if ('string' == typeof obj) {\n\t    packet = decodeString(obj);\n\t    if (exports.BINARY_EVENT == packet.type || exports.BINARY_ACK == packet.type) { // binary packet's json\n\t      this.reconstructor = new BinaryReconstructor(packet);\n\t\n\t      // no attachments, labeled binary but no binary data to follow\n\t      if (this.reconstructor.reconPack.attachments === 0) {\n\t        this.emit('decoded', packet);\n\t      }\n\t    } else { // non-binary full packet\n\t      this.emit('decoded', packet);\n\t    }\n\t  }\n\t  else if (isBuf(obj) || obj.base64) { // raw binary data\n\t    if (!this.reconstructor) {\n\t      throw new Error('got binary data when not reconstructing a packet');\n\t    } else {\n\t      packet = this.reconstructor.takeBinaryData(obj);\n\t      if (packet) { // received final buffer\n\t        this.reconstructor = null;\n\t        this.emit('decoded', packet);\n\t      }\n\t    }\n\t  }\n\t  else {\n\t    throw new Error('Unknown type: ' + obj);\n\t  }\n\t};\n\t\n\t/**\n\t * Decode a packet String (JSON data)\n\t *\n\t * @param {String} str\n\t * @return {Object} packet\n\t * @api private\n\t */\n\t\n\tfunction decodeString(str) {\n\t  var p = {};\n\t  var i = 0;\n\t\n\t  // look up type\n\t  p.type = Number(str.charAt(0));\n\t  if (null == exports.types[p.type]) return error();\n\t\n\t  // look up attachments if type binary\n\t  if (exports.BINARY_EVENT == p.type || exports.BINARY_ACK == p.type) {\n\t    var buf = '';\n\t    while (str.charAt(++i) != '-') {\n\t      buf += str.charAt(i);\n\t      if (i == str.length) break;\n\t    }\n\t    if (buf != Number(buf) || str.charAt(i) != '-') {\n\t      throw new Error('Illegal attachments');\n\t    }\n\t    p.attachments = Number(buf);\n\t  }\n\t\n\t  // look up namespace (if any)\n\t  if ('/' == str.charAt(i + 1)) {\n\t    p.nsp = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (',' == c) break;\n\t      p.nsp += c;\n\t      if (i == str.length) break;\n\t    }\n\t  } else {\n\t    p.nsp = '/';\n\t  }\n\t\n\t  // look up id\n\t  var next = str.charAt(i + 1);\n\t  if ('' !== next && Number(next) == next) {\n\t    p.id = '';\n\t    while (++i) {\n\t      var c = str.charAt(i);\n\t      if (null == c || Number(c) != c) {\n\t        --i;\n\t        break;\n\t      }\n\t      p.id += str.charAt(i);\n\t      if (i == str.length) break;\n\t    }\n\t    p.id = Number(p.id);\n\t  }\n\t\n\t  // look up json data\n\t  if (str.charAt(++i)) {\n\t    try {\n\t      p.data = json.parse(str.substr(i));\n\t    } catch(e){\n\t      return error();\n\t    }\n\t  }\n\t\n\t  debug('decoded %s as %j', str, p);\n\t  return p;\n\t}\n\t\n\t/**\n\t * Deallocates a parser's resources\n\t *\n\t * @api public\n\t */\n\t\n\tDecoder.prototype.destroy = function() {\n\t  if (this.reconstructor) {\n\t    this.reconstructor.finishedReconstruction();\n\t  }\n\t};\n\t\n\t/**\n\t * A manager of a binary event's 'buffer sequence'. Should\n\t * be constructed whenever a packet of type BINARY_EVENT is\n\t * decoded.\n\t *\n\t * @param {Object} packet\n\t * @return {BinaryReconstructor} initialized reconstructor\n\t * @api private\n\t */\n\t\n\tfunction BinaryReconstructor(packet) {\n\t  this.reconPack = packet;\n\t  this.buffers = [];\n\t}\n\t\n\t/**\n\t * Method to be called when binary data received from connection\n\t * after a BINARY_EVENT packet.\n\t *\n\t * @param {Buffer | ArrayBuffer} binData - the raw binary data received\n\t * @return {null | Object} returns null if more binary data is expected or\n\t *   a reconstructed packet object if all buffers have been received.\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.takeBinaryData = function(binData) {\n\t  this.buffers.push(binData);\n\t  if (this.buffers.length == this.reconPack.attachments) { // done with buffer list\n\t    var packet = binary.reconstructPacket(this.reconPack, this.buffers);\n\t    this.finishedReconstruction();\n\t    return packet;\n\t  }\n\t  return null;\n\t};\n\t\n\t/**\n\t * Cleans up binary packet reconstruction variables.\n\t *\n\t * @api private\n\t */\n\t\n\tBinaryReconstructor.prototype.finishedReconstruction = function() {\n\t  this.reconPack = null;\n\t  this.buffers = [];\n\t};\n\t\n\tfunction error(data){\n\t  return {\n\t    type: exports.ERROR,\n\t    data: 'parser error'\n\t  };\n\t}\n\n\n/***/ },\n/* 12 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar sendMessage = __webpack_require__(13);\n\tvar logError = __webpack_require__(7);\n\t\n\tvar onLocalSessionCreated = function onLocalSessionCreated(desc) {\n\t  imperio.peerConnection.setLocalDescription(desc, function () {\n\t    sendMessage(imperio.peerConnection.localDescription);\n\t  }, logError);\n\t};\n\t\n\tmodule.exports = onLocalSessionCreated;\n\n/***/ },\n/* 13 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar sendMessage = function sendMessage(message) {\n\t  console.log('Client sending message: ' + message);\n\t  imperio.socket.emit('message', message, imperio.room);\n\t};\n\t\n\tmodule.exports = sendMessage;\n\n/***/ },\n/* 14 */\n/***/ function(module, exports) {\n\n\t\"use strict\";\n\t\n\tvar peerConnectionSupported = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;\n\tvar getUserMediaSupported = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia;\n\t\n\t// export whether the browser supports peerconnection and dataConnection\n\tmodule.exports = !!peerConnectionSupported && !!getUserMediaSupported;\n\n/***/ },\n/* 15 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Slice reference.\n\t */\n\t\n\tvar slice = [].slice;\n\t\n\t/**\n\t * Bind `obj` to `fn`.\n\t *\n\t * @param {Object} obj\n\t * @param {Function|String} fn or string\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(obj, fn){\n\t  if ('string' == typeof fn) fn = obj[fn];\n\t  if ('function' != typeof fn) throw new Error('bind() requires a function');\n\t  var args = slice.call(arguments, 2);\n\t  return function(){\n\t    return fn.apply(obj, args.concat(slice.call(arguments)));\n\t  }\n\t};\n\n\n/***/ },\n/* 16 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(9);\n\tvar XHR = __webpack_require__(66);\n\tvar JSONP = __webpack_require__(65);\n\tvar websocket = __webpack_require__(67);\n\t\n\t/**\n\t * Export transports.\n\t */\n\t\n\texports.polling = polling;\n\texports.websocket = websocket;\n\t\n\t/**\n\t * Polling transport polymorphic constructor.\n\t * Decides on xhr vs jsonp based on feature detection.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction polling(opts){\n\t  var xhr;\n\t  var xd = false;\n\t  var xs = false;\n\t  var jsonp = false !== opts.jsonp;\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' == location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    xd = opts.hostname != location.hostname || port != opts.port;\n\t    xs = opts.secure != isSSL;\n\t  }\n\t\n\t  opts.xdomain = xd;\n\t  opts.xscheme = xs;\n\t  xhr = new XMLHttpRequest(opts);\n\t\n\t  if ('open' in xhr && !opts.forceJSONP) {\n\t    return new XHR(opts);\n\t  } else {\n\t    if (!jsonp) throw new Error('JSONP disabled');\n\t    return new JSONP(opts);\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 17 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(8);\n\tvar parseqs = __webpack_require__(10);\n\tvar parser = __webpack_require__(3);\n\tvar inherit = __webpack_require__(5);\n\tvar yeast = __webpack_require__(26);\n\tvar debug = __webpack_require__(2)('engine.io-client:polling');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Polling;\n\t\n\t/**\n\t * Is XHR2 supported?\n\t */\n\t\n\tvar hasXHR2 = (function() {\n\t  var XMLHttpRequest = __webpack_require__(9);\n\t  var xhr = new XMLHttpRequest({ xdomain: false });\n\t  return null != xhr.responseType;\n\t})();\n\t\n\t/**\n\t * Polling interface.\n\t *\n\t * @param {Object} opts\n\t * @api private\n\t */\n\t\n\tfunction Polling(opts){\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (!hasXHR2 || forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(Polling, Transport);\n\t\n\t/**\n\t * Transport name.\n\t */\n\t\n\tPolling.prototype.name = 'polling';\n\t\n\t/**\n\t * Opens the socket (triggers polling). We write a PING message to determine\n\t * when the transport is open.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doOpen = function(){\n\t  this.poll();\n\t};\n\t\n\t/**\n\t * Pauses polling.\n\t *\n\t * @param {Function} callback upon buffers are flushed and transport is paused\n\t * @api private\n\t */\n\t\n\tPolling.prototype.pause = function(onPause){\n\t  var pending = 0;\n\t  var self = this;\n\t\n\t  this.readyState = 'pausing';\n\t\n\t  function pause(){\n\t    debug('paused');\n\t    self.readyState = 'paused';\n\t    onPause();\n\t  }\n\t\n\t  if (this.polling || !this.writable) {\n\t    var total = 0;\n\t\n\t    if (this.polling) {\n\t      debug('we are currently polling - waiting to pause');\n\t      total++;\n\t      this.once('pollComplete', function(){\n\t        debug('pre-pause polling complete');\n\t        --total || pause();\n\t      });\n\t    }\n\t\n\t    if (!this.writable) {\n\t      debug('we are currently writing - waiting to pause');\n\t      total++;\n\t      this.once('drain', function(){\n\t        debug('pre-pause writing complete');\n\t        --total || pause();\n\t      });\n\t    }\n\t  } else {\n\t    pause();\n\t  }\n\t};\n\t\n\t/**\n\t * Starts polling cycle.\n\t *\n\t * @api public\n\t */\n\t\n\tPolling.prototype.poll = function(){\n\t  debug('polling');\n\t  this.polling = true;\n\t  this.doPoll();\n\t  this.emit('poll');\n\t};\n\t\n\t/**\n\t * Overloads onData to detect payloads.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.onData = function(data){\n\t  var self = this;\n\t  debug('polling got data %s', data);\n\t  var callback = function(packet, index, total) {\n\t    // if its the first message we consider the transport open\n\t    if ('opening' == self.readyState) {\n\t      self.onOpen();\n\t    }\n\t\n\t    // if its a close packet, we close the ongoing requests\n\t    if ('close' == packet.type) {\n\t      self.onClose();\n\t      return false;\n\t    }\n\t\n\t    // otherwise bypass onData and handle the message\n\t    self.onPacket(packet);\n\t  };\n\t\n\t  // decode payload\n\t  parser.decodePayload(data, this.socket.binaryType, callback);\n\t\n\t  // if an event did not trigger closing\n\t  if ('closed' != this.readyState) {\n\t    // if we got data we're not polling\n\t    this.polling = false;\n\t    this.emit('pollComplete');\n\t\n\t    if ('open' == this.readyState) {\n\t      this.poll();\n\t    } else {\n\t      debug('ignoring poll - transport state \"%s\"', this.readyState);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * For polling, send a close packet.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.doClose = function(){\n\t  var self = this;\n\t\n\t  function close(){\n\t    debug('writing close packet');\n\t    self.write([{ type: 'close' }]);\n\t  }\n\t\n\t  if ('open' == this.readyState) {\n\t    debug('transport open - closing');\n\t    close();\n\t  } else {\n\t    // in case we're trying to close while\n\t    // handshaking is in progress (GH-164)\n\t    debug('transport not open - deferring close');\n\t    this.once('open', close);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes a packets payload.\n\t *\n\t * @param {Array} data packets\n\t * @param {Function} drain callback\n\t * @api private\n\t */\n\t\n\tPolling.prototype.write = function(packets){\n\t  var self = this;\n\t  this.writable = false;\n\t  var callbackfn = function() {\n\t    self.writable = true;\n\t    self.emit('drain');\n\t  };\n\t\n\t  var self = this;\n\t  parser.encodePayload(packets, this.supportsBinary, function(data) {\n\t    self.doWrite(data, callbackfn);\n\t  });\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tPolling.prototype.uri = function(){\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'https' : 'http';\n\t  var port = '';\n\t\n\t  // cache busting is forced\n\t  if (false !== this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  if (!this.supportsBinary && !query.sid) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('https' == schema && this.port != 443) ||\n\t     ('http' == schema && this.port != 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\n\n/***/ },\n/* 18 */\n/***/ function(module, exports) {\n\n\t\n\tvar indexOf = [].indexOf;\n\t\n\tmodule.exports = function(arr, obj){\n\t  if (indexOf) return arr.indexOf(obj);\n\t  for (var i = 0; i < arr.length; ++i) {\n\t    if (arr[i] === obj) return i;\n\t  }\n\t  return -1;\n\t};\n\n/***/ },\n/* 19 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Parses an URI\n\t *\n\t * @author Steven Levithan <stevenlevithan.com> (MIT license)\n\t * @api private\n\t */\n\t\n\tvar re = /^(?:(?![^:@]+:[^:@\\/]*@)(http|https|ws|wss):\\/\\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\\/?#]*)(?::(\\d*))?)(((\\/(?:[^?#](?![^?#\\/]*\\.[^?#\\/.]+(?:[?#]|$)))*\\/?)?([^?#\\/]*))(?:\\?([^#]*))?(?:#(.*))?)/;\n\t\n\tvar parts = [\n\t    'source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'\n\t];\n\t\n\tmodule.exports = function parseuri(str) {\n\t    var src = str,\n\t        b = str.indexOf('['),\n\t        e = str.indexOf(']');\n\t\n\t    if (b != -1 && e != -1) {\n\t        str = str.substring(0, b) + str.substring(b, e).replace(/:/g, ';') + str.substring(e, str.length);\n\t    }\n\t\n\t    var m = re.exec(str || ''),\n\t        uri = {},\n\t        i = 14;\n\t\n\t    while (i--) {\n\t        uri[parts[i]] = m[i] || '';\n\t    }\n\t\n\t    if (b != -1 && e != -1) {\n\t        uri.source = src;\n\t        uri.host = uri.host.substring(1, uri.host.length - 1).replace(/;/g, ':');\n\t        uri.authority = uri.authority.replace('[', '').replace(']', '').replace(/;/g, ':');\n\t        uri.ipv6uri = true;\n\t    }\n\t\n\t    return uri;\n\t};\n\n\n/***/ },\n/* 20 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar eio = __webpack_require__(62);\n\tvar Socket = __webpack_require__(22);\n\tvar Emitter = __webpack_require__(23);\n\tvar parser = __webpack_require__(11);\n\tvar on = __webpack_require__(21);\n\tvar bind = __webpack_require__(15);\n\tvar debug = __webpack_require__(2)('socket.io-client:manager');\n\tvar indexOf = __webpack_require__(18);\n\tvar Backoff = __webpack_require__(58);\n\t\n\t/**\n\t * IE6+ hasOwnProperty\n\t */\n\t\n\tvar has = Object.prototype.hasOwnProperty;\n\t\n\t/**\n\t * Module exports\n\t */\n\t\n\tmodule.exports = Manager;\n\t\n\t/**\n\t * `Manager` constructor.\n\t *\n\t * @param {String} engine instance or engine uri/opts\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Manager(uri, opts){\n\t  if (!(this instanceof Manager)) return new Manager(uri, opts);\n\t  if (uri && ('object' == typeof uri)) {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t  opts = opts || {};\n\t\n\t  opts.path = opts.path || '/socket.io';\n\t  this.nsps = {};\n\t  this.subs = [];\n\t  this.opts = opts;\n\t  this.reconnection(opts.reconnection !== false);\n\t  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);\n\t  this.reconnectionDelay(opts.reconnectionDelay || 1000);\n\t  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5000);\n\t  this.randomizationFactor(opts.randomizationFactor || 0.5);\n\t  this.backoff = new Backoff({\n\t    min: this.reconnectionDelay(),\n\t    max: this.reconnectionDelayMax(),\n\t    jitter: this.randomizationFactor()\n\t  });\n\t  this.timeout(null == opts.timeout ? 20000 : opts.timeout);\n\t  this.readyState = 'closed';\n\t  this.uri = uri;\n\t  this.connecting = [];\n\t  this.lastPing = null;\n\t  this.encoding = false;\n\t  this.packetBuffer = [];\n\t  this.encoder = new parser.Encoder();\n\t  this.decoder = new parser.Decoder();\n\t  this.autoConnect = opts.autoConnect !== false;\n\t  if (this.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Propagate given event to sockets and emit on `this`\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.emitAll = function() {\n\t  this.emit.apply(this, arguments);\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].emit.apply(this.nsps[nsp], arguments);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Update `socket.id` of all sockets\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.updateSocketIds = function(){\n\t  for (var nsp in this.nsps) {\n\t    if (has.call(this.nsps, nsp)) {\n\t      this.nsps[nsp].id = this.engine.id;\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Manager.prototype);\n\t\n\t/**\n\t * Sets the `reconnection` config.\n\t *\n\t * @param {Boolean} true/false if it should automatically reconnect\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnection = function(v){\n\t  if (!arguments.length) return this._reconnection;\n\t  this._reconnection = !!v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the reconnection attempts config.\n\t *\n\t * @param {Number} max reconnection attempts before giving up\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionAttempts = function(v){\n\t  if (!arguments.length) return this._reconnectionAttempts;\n\t  this._reconnectionAttempts = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelay = function(v){\n\t  if (!arguments.length) return this._reconnectionDelay;\n\t  this._reconnectionDelay = v;\n\t  this.backoff && this.backoff.setMin(v);\n\t  return this;\n\t};\n\t\n\tManager.prototype.randomizationFactor = function(v){\n\t  if (!arguments.length) return this._randomizationFactor;\n\t  this._randomizationFactor = v;\n\t  this.backoff && this.backoff.setJitter(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the maximum delay between reconnections.\n\t *\n\t * @param {Number} delay\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.reconnectionDelayMax = function(v){\n\t  if (!arguments.length) return this._reconnectionDelayMax;\n\t  this._reconnectionDelayMax = v;\n\t  this.backoff && this.backoff.setMax(v);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the connection timeout. `false` to disable\n\t *\n\t * @return {Manager} self or value\n\t * @api public\n\t */\n\t\n\tManager.prototype.timeout = function(v){\n\t  if (!arguments.length) return this._timeout;\n\t  this._timeout = v;\n\t  return this;\n\t};\n\t\n\t/**\n\t * Starts trying to reconnect if reconnection is enabled and we have not\n\t * started reconnecting yet\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.maybeReconnectOnOpen = function() {\n\t  // Only try to reconnect if it's the first time we're connecting\n\t  if (!this.reconnecting && this._reconnection && this.backoff.attempts === 0) {\n\t    // keeps reconnection from firing twice for the same reconnection loop\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t\n\t/**\n\t * Sets the current transport `socket`.\n\t *\n\t * @param {Function} optional, callback\n\t * @return {Manager} self\n\t * @api public\n\t */\n\t\n\tManager.prototype.open =\n\tManager.prototype.connect = function(fn){\n\t  debug('readyState %s', this.readyState);\n\t  if (~this.readyState.indexOf('open')) return this;\n\t\n\t  debug('opening %s', this.uri);\n\t  this.engine = eio(this.uri, this.opts);\n\t  var socket = this.engine;\n\t  var self = this;\n\t  this.readyState = 'opening';\n\t  this.skipReconnect = false;\n\t\n\t  // emit `open`\n\t  var openSub = on(socket, 'open', function() {\n\t    self.onopen();\n\t    fn && fn();\n\t  });\n\t\n\t  // emit `connect_error`\n\t  var errorSub = on(socket, 'error', function(data){\n\t    debug('connect_error');\n\t    self.cleanup();\n\t    self.readyState = 'closed';\n\t    self.emitAll('connect_error', data);\n\t    if (fn) {\n\t      var err = new Error('Connection error');\n\t      err.data = data;\n\t      fn(err);\n\t    } else {\n\t      // Only do this if there is no fn to handle the error\n\t      self.maybeReconnectOnOpen();\n\t    }\n\t  });\n\t\n\t  // emit `connect_timeout`\n\t  if (false !== this._timeout) {\n\t    var timeout = this._timeout;\n\t    debug('connect attempt will timeout after %d', timeout);\n\t\n\t    // set timer\n\t    var timer = setTimeout(function(){\n\t      debug('connect attempt timed out after %d', timeout);\n\t      openSub.destroy();\n\t      socket.close();\n\t      socket.emit('error', 'timeout');\n\t      self.emitAll('connect_timeout', timeout);\n\t    }, timeout);\n\t\n\t    this.subs.push({\n\t      destroy: function(){\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t\n\t  this.subs.push(openSub);\n\t  this.subs.push(errorSub);\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport open.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onopen = function(){\n\t  debug('open');\n\t\n\t  // clear old subs\n\t  this.cleanup();\n\t\n\t  // mark as open\n\t  this.readyState = 'open';\n\t  this.emit('open');\n\t\n\t  // add new subs\n\t  var socket = this.engine;\n\t  this.subs.push(on(socket, 'data', bind(this, 'ondata')));\n\t  this.subs.push(on(socket, 'ping', bind(this, 'onping')));\n\t  this.subs.push(on(socket, 'pong', bind(this, 'onpong')));\n\t  this.subs.push(on(socket, 'error', bind(this, 'onerror')));\n\t  this.subs.push(on(socket, 'close', bind(this, 'onclose')));\n\t  this.subs.push(on(this.decoder, 'decoded', bind(this, 'ondecoded')));\n\t};\n\t\n\t/**\n\t * Called upon a ping.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onping = function(){\n\t  this.lastPing = new Date;\n\t  this.emitAll('ping');\n\t};\n\t\n\t/**\n\t * Called upon a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onpong = function(){\n\t  this.emitAll('pong', new Date - this.lastPing);\n\t};\n\t\n\t/**\n\t * Called with data.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondata = function(data){\n\t  this.decoder.add(data);\n\t};\n\t\n\t/**\n\t * Called when parser fully decodes a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.ondecoded = function(packet) {\n\t  this.emit('packet', packet);\n\t};\n\t\n\t/**\n\t * Called upon socket error.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onerror = function(err){\n\t  debug('error', err);\n\t  this.emitAll('error', err);\n\t};\n\t\n\t/**\n\t * Creates a new socket for the given `nsp`.\n\t *\n\t * @return {Socket}\n\t * @api public\n\t */\n\t\n\tManager.prototype.socket = function(nsp){\n\t  var socket = this.nsps[nsp];\n\t  if (!socket) {\n\t    socket = new Socket(this, nsp);\n\t    this.nsps[nsp] = socket;\n\t    var self = this;\n\t    socket.on('connecting', onConnecting);\n\t    socket.on('connect', function(){\n\t      socket.id = self.engine.id;\n\t    });\n\t\n\t    if (this.autoConnect) {\n\t      // manually call here since connecting evnet is fired before listening\n\t      onConnecting();\n\t    }\n\t  }\n\t\n\t  function onConnecting() {\n\t    if (!~indexOf(self.connecting, socket)) {\n\t      self.connecting.push(socket);\n\t    }\n\t  }\n\t\n\t  return socket;\n\t};\n\t\n\t/**\n\t * Called upon a socket close.\n\t *\n\t * @param {Socket} socket\n\t */\n\t\n\tManager.prototype.destroy = function(socket){\n\t  var index = indexOf(this.connecting, socket);\n\t  if (~index) this.connecting.splice(index, 1);\n\t  if (this.connecting.length) return;\n\t\n\t  this.close();\n\t};\n\t\n\t/**\n\t * Writes a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tManager.prototype.packet = function(packet){\n\t  debug('writing packet %j', packet);\n\t  var self = this;\n\t\n\t  if (!self.encoding) {\n\t    // encode, then write to engine with result\n\t    self.encoding = true;\n\t    this.encoder.encode(packet, function(encodedPackets) {\n\t      for (var i = 0; i < encodedPackets.length; i++) {\n\t        self.engine.write(encodedPackets[i], packet.options);\n\t      }\n\t      self.encoding = false;\n\t      self.processPacketQueue();\n\t    });\n\t  } else { // add packet to the queue\n\t    self.packetBuffer.push(packet);\n\t  }\n\t};\n\t\n\t/**\n\t * If packet buffer is non-empty, begins encoding the\n\t * next packet in line.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.processPacketQueue = function() {\n\t  if (this.packetBuffer.length > 0 && !this.encoding) {\n\t    var pack = this.packetBuffer.shift();\n\t    this.packet(pack);\n\t  }\n\t};\n\t\n\t/**\n\t * Clean up transport subscriptions and packet buffer.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.cleanup = function(){\n\t  debug('cleanup');\n\t\n\t  var sub;\n\t  while (sub = this.subs.shift()) sub.destroy();\n\t\n\t  this.packetBuffer = [];\n\t  this.encoding = false;\n\t  this.lastPing = null;\n\t\n\t  this.decoder.destroy();\n\t};\n\t\n\t/**\n\t * Close the current socket.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.close =\n\tManager.prototype.disconnect = function(){\n\t  debug('disconnect');\n\t  this.skipReconnect = true;\n\t  this.reconnecting = false;\n\t  if ('opening' == this.readyState) {\n\t    // `onclose` will not fire because\n\t    // an open event never happened\n\t    this.cleanup();\n\t  }\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  if (this.engine) this.engine.close();\n\t};\n\t\n\t/**\n\t * Called upon engine close.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onclose = function(reason){\n\t  debug('onclose');\n\t\n\t  this.cleanup();\n\t  this.backoff.reset();\n\t  this.readyState = 'closed';\n\t  this.emit('close', reason);\n\t\n\t  if (this._reconnection && !this.skipReconnect) {\n\t    this.reconnect();\n\t  }\n\t};\n\t\n\t/**\n\t * Attempt a reconnection.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.reconnect = function(){\n\t  if (this.reconnecting || this.skipReconnect) return this;\n\t\n\t  var self = this;\n\t\n\t  if (this.backoff.attempts >= this._reconnectionAttempts) {\n\t    debug('reconnect failed');\n\t    this.backoff.reset();\n\t    this.emitAll('reconnect_failed');\n\t    this.reconnecting = false;\n\t  } else {\n\t    var delay = this.backoff.duration();\n\t    debug('will wait %dms before reconnect attempt', delay);\n\t\n\t    this.reconnecting = true;\n\t    var timer = setTimeout(function(){\n\t      if (self.skipReconnect) return;\n\t\n\t      debug('attempting reconnect');\n\t      self.emitAll('reconnect_attempt', self.backoff.attempts);\n\t      self.emitAll('reconnecting', self.backoff.attempts);\n\t\n\t      // check again for the case socket closed in above events\n\t      if (self.skipReconnect) return;\n\t\n\t      self.open(function(err){\n\t        if (err) {\n\t          debug('reconnect attempt error');\n\t          self.reconnecting = false;\n\t          self.reconnect();\n\t          self.emitAll('reconnect_error', err.data);\n\t        } else {\n\t          debug('reconnect success');\n\t          self.onreconnect();\n\t        }\n\t      });\n\t    }, delay);\n\t\n\t    this.subs.push({\n\t      destroy: function(){\n\t        clearTimeout(timer);\n\t      }\n\t    });\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful reconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tManager.prototype.onreconnect = function(){\n\t  var attempt = this.backoff.attempts;\n\t  this.reconnecting = false;\n\t  this.backoff.reset();\n\t  this.updateSocketIds();\n\t  this.emitAll('reconnect', attempt);\n\t};\n\n\n/***/ },\n/* 21 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = on;\n\t\n\t/**\n\t * Helper for subscriptions.\n\t *\n\t * @param {Object|EventEmitter} obj with `Emitter` mixin or `EventEmitter`\n\t * @param {String} event name\n\t * @param {Function} callback\n\t * @api public\n\t */\n\t\n\tfunction on(obj, ev, fn) {\n\t  obj.on(ev, fn);\n\t  return {\n\t    destroy: function(){\n\t      obj.removeListener(ev, fn);\n\t    }\n\t  };\n\t}\n\n\n/***/ },\n/* 22 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parser = __webpack_require__(11);\n\tvar Emitter = __webpack_require__(23);\n\tvar toArray = __webpack_require__(79);\n\tvar on = __webpack_require__(21);\n\tvar bind = __webpack_require__(15);\n\tvar debug = __webpack_require__(2)('socket.io-client:socket');\n\tvar hasBin = __webpack_require__(70);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = Socket;\n\t\n\t/**\n\t * Internal events (blacklisted).\n\t * These events can't be emitted by the user.\n\t *\n\t * @api private\n\t */\n\t\n\tvar events = {\n\t  connect: 1,\n\t  connect_error: 1,\n\t  connect_timeout: 1,\n\t  connecting: 1,\n\t  disconnect: 1,\n\t  error: 1,\n\t  reconnect: 1,\n\t  reconnect_attempt: 1,\n\t  reconnect_failed: 1,\n\t  reconnect_error: 1,\n\t  reconnecting: 1,\n\t  ping: 1,\n\t  pong: 1\n\t};\n\t\n\t/**\n\t * Shortcut to `Emitter#emit`.\n\t */\n\t\n\tvar emit = Emitter.prototype.emit;\n\t\n\t/**\n\t * `Socket` constructor.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Socket(io, nsp){\n\t  this.io = io;\n\t  this.nsp = nsp;\n\t  this.json = this; // compat\n\t  this.ids = 0;\n\t  this.acks = {};\n\t  this.receiveBuffer = [];\n\t  this.sendBuffer = [];\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  if (this.io.autoConnect) this.open();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Subscribe to open, close and packet events\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.subEvents = function() {\n\t  if (this.subs) return;\n\t\n\t  var io = this.io;\n\t  this.subs = [\n\t    on(io, 'open', bind(this, 'onopen')),\n\t    on(io, 'packet', bind(this, 'onpacket')),\n\t    on(io, 'close', bind(this, 'onclose'))\n\t  ];\n\t};\n\t\n\t/**\n\t * \"Opens\" the socket.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.open =\n\tSocket.prototype.connect = function(){\n\t  if (this.connected) return this;\n\t\n\t  this.subEvents();\n\t  this.io.open(); // ensure open\n\t  if ('open' == this.io.readyState) this.onopen();\n\t  this.emit('connecting');\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a `message` event.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.send = function(){\n\t  var args = toArray(arguments);\n\t  args.unshift('message');\n\t  this.emit.apply(this, args);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Override `emit`.\n\t * If the event is in `events`, it's emitted normally.\n\t *\n\t * @param {String} event name\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.emit = function(ev){\n\t  if (events.hasOwnProperty(ev)) {\n\t    emit.apply(this, arguments);\n\t    return this;\n\t  }\n\t\n\t  var args = toArray(arguments);\n\t  var parserType = parser.EVENT; // default\n\t  if (hasBin(args)) { parserType = parser.BINARY_EVENT; } // binary\n\t  var packet = { type: parserType, data: args };\n\t\n\t  packet.options = {};\n\t  packet.options.compress = !this.flags || false !== this.flags.compress;\n\t\n\t  // event ack callback\n\t  if ('function' == typeof args[args.length - 1]) {\n\t    debug('emitting packet with ack id %d', this.ids);\n\t    this.acks[this.ids] = args.pop();\n\t    packet.id = this.ids++;\n\t  }\n\t\n\t  if (this.connected) {\n\t    this.packet(packet);\n\t  } else {\n\t    this.sendBuffer.push(packet);\n\t  }\n\t\n\t  delete this.flags;\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.packet = function(packet){\n\t  packet.nsp = this.nsp;\n\t  this.io.packet(packet);\n\t};\n\t\n\t/**\n\t * Called upon engine `open`.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onopen = function(){\n\t  debug('transport is open - connecting');\n\t\n\t  // write connect packet if necessary\n\t  if ('/' != this.nsp) {\n\t    this.packet({ type: parser.CONNECT });\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon engine `close`.\n\t *\n\t * @param {String} reason\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onclose = function(reason){\n\t  debug('close (%s)', reason);\n\t  this.connected = false;\n\t  this.disconnected = true;\n\t  delete this.id;\n\t  this.emit('disconnect', reason);\n\t};\n\t\n\t/**\n\t * Called with socket packet.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onpacket = function(packet){\n\t  if (packet.nsp != this.nsp) return;\n\t\n\t  switch (packet.type) {\n\t    case parser.CONNECT:\n\t      this.onconnect();\n\t      break;\n\t\n\t    case parser.EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.BINARY_EVENT:\n\t      this.onevent(packet);\n\t      break;\n\t\n\t    case parser.ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.BINARY_ACK:\n\t      this.onack(packet);\n\t      break;\n\t\n\t    case parser.DISCONNECT:\n\t      this.ondisconnect();\n\t      break;\n\t\n\t    case parser.ERROR:\n\t      this.emit('error', packet.data);\n\t      break;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon a server event.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onevent = function(packet){\n\t  var args = packet.data || [];\n\t  debug('emitting event %j', args);\n\t\n\t  if (null != packet.id) {\n\t    debug('attaching ack callback to event');\n\t    args.push(this.ack(packet.id));\n\t  }\n\t\n\t  if (this.connected) {\n\t    emit.apply(this, args);\n\t  } else {\n\t    this.receiveBuffer.push(args);\n\t  }\n\t};\n\t\n\t/**\n\t * Produces an ack callback to emit with an event.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ack = function(id){\n\t  var self = this;\n\t  var sent = false;\n\t  return function(){\n\t    // prevent double callbacks\n\t    if (sent) return;\n\t    sent = true;\n\t    var args = toArray(arguments);\n\t    debug('sending ack %j', args);\n\t\n\t    var type = hasBin(args) ? parser.BINARY_ACK : parser.ACK;\n\t    self.packet({\n\t      type: type,\n\t      id: id,\n\t      data: args\n\t    });\n\t  };\n\t};\n\t\n\t/**\n\t * Called upon a server acknowlegement.\n\t *\n\t * @param {Object} packet\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onack = function(packet){\n\t  var ack = this.acks[packet.id];\n\t  if ('function' == typeof ack) {\n\t    debug('calling ack %s with %j', packet.id, packet.data);\n\t    ack.apply(this, packet.data);\n\t    delete this.acks[packet.id];\n\t  } else {\n\t    debug('bad ack %s', packet.id);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon server connect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onconnect = function(){\n\t  this.connected = true;\n\t  this.disconnected = false;\n\t  this.emit('connect');\n\t  this.emitBuffered();\n\t};\n\t\n\t/**\n\t * Emit buffered events (received and emitted).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.emitBuffered = function(){\n\t  var i;\n\t  for (i = 0; i < this.receiveBuffer.length; i++) {\n\t    emit.apply(this, this.receiveBuffer[i]);\n\t  }\n\t  this.receiveBuffer = [];\n\t\n\t  for (i = 0; i < this.sendBuffer.length; i++) {\n\t    this.packet(this.sendBuffer[i]);\n\t  }\n\t  this.sendBuffer = [];\n\t};\n\t\n\t/**\n\t * Called upon server disconnect.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.ondisconnect = function(){\n\t  debug('server disconnect (%s)', this.nsp);\n\t  this.destroy();\n\t  this.onclose('io server disconnect');\n\t};\n\t\n\t/**\n\t * Called upon forced client/server side disconnections,\n\t * this method ensures the manager stops tracking us and\n\t * that reconnections don't get triggered for this.\n\t *\n\t * @api private.\n\t */\n\t\n\tSocket.prototype.destroy = function(){\n\t  if (this.subs) {\n\t    // clean subscriptions to avoid reconnections\n\t    for (var i = 0; i < this.subs.length; i++) {\n\t      this.subs[i].destroy();\n\t    }\n\t    this.subs = null;\n\t  }\n\t\n\t  this.io.destroy(this);\n\t};\n\t\n\t/**\n\t * Disconnects the socket manually.\n\t *\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.close =\n\tSocket.prototype.disconnect = function(){\n\t  if (this.connected) {\n\t    debug('performing disconnect (%s)', this.nsp);\n\t    this.packet({ type: parser.DISCONNECT });\n\t  }\n\t\n\t  // remove socket from pool\n\t  this.destroy();\n\t\n\t  if (this.connected) {\n\t    // fire events\n\t    this.onclose('io client disconnect');\n\t  }\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sets the compress flag.\n\t *\n\t * @param {Boolean} if `true`, compresses the sending data\n\t * @return {Socket} self\n\t * @api public\n\t */\n\t\n\tSocket.prototype.compress = function(compress){\n\t  this.flags = this.flags || {};\n\t  this.flags.compress = compress;\n\t  return this;\n\t};\n\n\n/***/ },\n/* 23 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Expose `Emitter`.\n\t */\n\t\n\tmodule.exports = Emitter;\n\t\n\t/**\n\t * Initialize a new `Emitter`.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction Emitter(obj) {\n\t  if (obj) return mixin(obj);\n\t};\n\t\n\t/**\n\t * Mixin the emitter properties.\n\t *\n\t * @param {Object} obj\n\t * @return {Object}\n\t * @api private\n\t */\n\t\n\tfunction mixin(obj) {\n\t  for (var key in Emitter.prototype) {\n\t    obj[key] = Emitter.prototype[key];\n\t  }\n\t  return obj;\n\t}\n\t\n\t/**\n\t * Listen on the given `event` with `fn`.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.on =\n\tEmitter.prototype.addEventListener = function(event, fn){\n\t  this._callbacks = this._callbacks || {};\n\t  (this._callbacks['$' + event] = this._callbacks['$' + event] || [])\n\t    .push(fn);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Adds an `event` listener that will be invoked a single\n\t * time then automatically removed.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.once = function(event, fn){\n\t  function on() {\n\t    this.off(event, on);\n\t    fn.apply(this, arguments);\n\t  }\n\t\n\t  on.fn = fn;\n\t  this.on(event, on);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Remove the given callback for `event` or all\n\t * registered callbacks.\n\t *\n\t * @param {String} event\n\t * @param {Function} fn\n\t * @return {Emitter}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.off =\n\tEmitter.prototype.removeListener =\n\tEmitter.prototype.removeAllListeners =\n\tEmitter.prototype.removeEventListener = function(event, fn){\n\t  this._callbacks = this._callbacks || {};\n\t\n\t  // all\n\t  if (0 == arguments.length) {\n\t    this._callbacks = {};\n\t    return this;\n\t  }\n\t\n\t  // specific event\n\t  var callbacks = this._callbacks['$' + event];\n\t  if (!callbacks) return this;\n\t\n\t  // remove all handlers\n\t  if (1 == arguments.length) {\n\t    delete this._callbacks['$' + event];\n\t    return this;\n\t  }\n\t\n\t  // remove specific handler\n\t  var cb;\n\t  for (var i = 0; i < callbacks.length; i++) {\n\t    cb = callbacks[i];\n\t    if (cb === fn || cb.fn === fn) {\n\t      callbacks.splice(i, 1);\n\t      break;\n\t    }\n\t  }\n\t  return this;\n\t};\n\t\n\t/**\n\t * Emit `event` with the given args.\n\t *\n\t * @param {String} event\n\t * @param {Mixed} ...\n\t * @return {Emitter}\n\t */\n\t\n\tEmitter.prototype.emit = function(event){\n\t  this._callbacks = this._callbacks || {};\n\t  var args = [].slice.call(arguments, 1)\n\t    , callbacks = this._callbacks['$' + event];\n\t\n\t  if (callbacks) {\n\t    callbacks = callbacks.slice(0);\n\t    for (var i = 0, len = callbacks.length; i < len; ++i) {\n\t      callbacks[i].apply(this, args);\n\t    }\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Return array of callbacks for `event`.\n\t *\n\t * @param {String} event\n\t * @return {Array}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.listeners = function(event){\n\t  this._callbacks = this._callbacks || {};\n\t  return this._callbacks['$' + event] || [];\n\t};\n\t\n\t/**\n\t * Check if this emitter has `event` handlers.\n\t *\n\t * @param {String} event\n\t * @return {Boolean}\n\t * @api public\n\t */\n\t\n\tEmitter.prototype.hasListeners = function(event){\n\t  return !! this.listeners(event).length;\n\t};\n\n\n/***/ },\n/* 24 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\tmodule.exports = isBuf;\n\t\n\t/**\n\t * Returns true if obj is a buffer or an arraybuffer.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction isBuf(obj) {\n\t  return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t         (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 25 */\n/***/ function(module, exports) {\n\n\tmodule.exports = function(module) {\r\n\t\tif(!module.webpackPolyfill) {\r\n\t\t\tmodule.deprecate = function() {};\r\n\t\t\tmodule.paths = [];\r\n\t\t\t// module.parent = undefined by default\r\n\t\t\tmodule.children = [];\r\n\t\t\tmodule.webpackPolyfill = 1;\r\n\t\t}\r\n\t\treturn module;\r\n\t}\r\n\n\n/***/ },\n/* 26 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar alphabet = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_'.split('')\n\t  , length = 64\n\t  , map = {}\n\t  , seed = 0\n\t  , i = 0\n\t  , prev;\n\t\n\t/**\n\t * Return a string representing the specified number.\n\t *\n\t * @param {Number} num The number to convert.\n\t * @returns {String} The string representation of the number.\n\t * @api public\n\t */\n\tfunction encode(num) {\n\t  var encoded = '';\n\t\n\t  do {\n\t    encoded = alphabet[num % length] + encoded;\n\t    num = Math.floor(num / length);\n\t  } while (num > 0);\n\t\n\t  return encoded;\n\t}\n\t\n\t/**\n\t * Return the integer value specified by the given string.\n\t *\n\t * @param {String} str The string to convert.\n\t * @returns {Number} The integer value represented by the string.\n\t * @api public\n\t */\n\tfunction decode(str) {\n\t  var decoded = 0;\n\t\n\t  for (i = 0; i < str.length; i++) {\n\t    decoded = decoded * length + map[str.charAt(i)];\n\t  }\n\t\n\t  return decoded;\n\t}\n\t\n\t/**\n\t * Yeast: A tiny growing id generator.\n\t *\n\t * @returns {String} A unique id.\n\t * @api public\n\t */\n\tfunction yeast() {\n\t  var now = encode(+new Date());\n\t\n\t  if (now !== prev) return seed = 0, prev = now;\n\t  return now +'.'+ encode(seed++);\n\t}\n\t\n\t//\n\t// Map each character to its index.\n\t//\n\tfor (; i < length; i++) map[alphabet[i]] = i;\n\t\n\t//\n\t// Expose the `yeast`, `encode` and `decode` functions.\n\t//\n\tyeast.encode = encode;\n\tyeast.decode = decode;\n\tmodule.exports = yeast;\n\n\n/***/ },\n/* 27 */\n/***/ function(module, exports) {\n\n\tmodule.exports = after\n\t\n\tfunction after(count, callback, err_cb) {\n\t    var bail = false\n\t    err_cb = err_cb || noop\n\t    proxy.count = count\n\t\n\t    return (count === 0) ? callback() : proxy\n\t\n\t    function proxy(err, result) {\n\t        if (proxy.count <= 0) {\n\t            throw new Error('after called too many times')\n\t        }\n\t        --proxy.count\n\t\n\t        // after first error, rest are passed to err_cb\n\t        if (err) {\n\t            bail = true\n\t            callback(err)\n\t            // future error callbacks will go to error handler\n\t            callback = err_cb\n\t        } else if (proxy.count === 0 && !bail) {\n\t            callback(null, result)\n\t        }\n\t    }\n\t}\n\t\n\tfunction noop() {}\n\n\n/***/ },\n/* 28 */\n/***/ function(module, exports) {\n\n\t/**\n\t * An abstraction for slicing an arraybuffer even when\n\t * ArrayBuffer.prototype.slice is not supported\n\t *\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(arraybuffer, start, end) {\n\t  var bytes = arraybuffer.byteLength;\n\t  start = start || 0;\n\t  end = end || bytes;\n\t\n\t  if (arraybuffer.slice) { return arraybuffer.slice(start, end); }\n\t\n\t  if (start < 0) { start += bytes; }\n\t  if (end < 0) { end += bytes; }\n\t  if (end > bytes) { end = bytes; }\n\t\n\t  if (start >= bytes || start >= end || bytes === 0) {\n\t    return new ArrayBuffer(0);\n\t  }\n\t\n\t  var abv = new Uint8Array(arraybuffer);\n\t  var result = new Uint8Array(end - start);\n\t  for (var i = start, ii = 0; i < end; i++, ii++) {\n\t    result[ii] = abv[i];\n\t  }\n\t  return result.buffer;\n\t};\n\n\n/***/ },\n/* 29 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Adds a listener to the window on the mobile device in order to read the accelerometer data.\n\t// Will send accelerometer data to the socket in the form of {x: x, y:y, z:z}.\n\t// Accepts 3 arguments:\n\t// 1. The socket you would like to connect to as the first parameter.\n\t// 2. A room name that will inform the server which room to emit the acceleration event and data to.\n\t// 4. A callback function that will be run every time the tap event is triggered, by default\n\t// we will provide this function with the accelerometer data.\n\tvar emitAcceleration = {};\n\t\n\tvar handleDeviceMotionGravity = function handleDeviceMotionGravity(event) {\n\t  var localCallback = imperio.callbacks.gravityLocal;\n\t  var modifyDataCallback = imperio.callbacks.gravityModify;\n\t  var x = event.accelerationIncludingGravity.x;\n\t  var y = event.accelerationIncludingGravity.y;\n\t  var z = event.accelerationIncludingGravity.z;\n\t  var accObject = {\n\t    x: x,\n\t    y: y,\n\t    z: z\n\t  };\n\t  if (modifyDataCallback) accObject = modifyDataCallback(accObject);\n\t  var webRTCData = {\n\t    data: accObject,\n\t    type: 'acceleration'\n\t  };\n\t  if (imperio.connectionType === 'webRTC') {\n\t    imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t  } else imperio.socket.emit('acceleration', imperio.room, accObject);\n\t  if (localCallback) localCallback(accObject);\n\t};\n\t\n\temitAcceleration.gravity = function (localCallback, modifyDataCallback) {\n\t  imperio.callbacks.gravityLocal = localCallback;\n\t  imperio.callbacks.gravityModify = modifyDataCallback;\n\t  window.addEventListener('devicemotion', handleDeviceMotionGravity);\n\t};\n\temitAcceleration.removeGravity = function () {\n\t  delete imperio.callbacks.gravityLocal;\n\t  delete imperio.callbacks.gravityModify;\n\t  window.removeEventListener('devicemotion', handleDeviceMotionGravity);\n\t};\n\t\n\tvar handleDeviceMotionNoGravity = function handleDeviceMotionNoGravity(event) {\n\t  var localCallback = imperio.callbacks.noGravityLocal;\n\t  var modifyDataCallback = imperio.callbacks.noGravityModify;\n\t  var x = event.acceleration.x;\n\t  var y = event.acceleration.y;\n\t  var z = event.acceleration.z;\n\t  var accObject = {\n\t    x: x,\n\t    y: y,\n\t    z: z\n\t  };\n\t  if (modifyDataCallback) accObject = modifyDataCallback(accObject);\n\t  var webRTCData = {\n\t    data: accObject,\n\t    type: 'acceleration'\n\t  };\n\t  if (imperio.connectionType === 'webRTC') {\n\t    imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t  } else imperio.socket.emit('acceleration', imperio.room, accObject);\n\t  if (localCallback) localCallback(accObject);\n\t};\n\t\n\temitAcceleration.noGravity = function (localCallback, modifyDataCallback) {\n\t  imperio.callbacks.noGravityLocal = localCallback;\n\t  imperio.callbacks.noGravityModify = modifyDataCallback;\n\t  window.addEventListener('devicemotion', handleDeviceMotionNoGravity);\n\t};\n\temitAcceleration.removeNoGravity = function () {\n\t  delete imperio.callbacks.noGravityLocal;\n\t  delete imperio.callbacks.noGravityModify;\n\t  window.removeEventListener('devicemotion', handleDeviceMotionNoGravity);\n\t};\n\t\n\tmodule.exports = emitAcceleration;\n\n/***/ },\n/* 30 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitData = function emitData(callback, data) {\n\t  if (imperio.connectionType === 'webRTC') {\n\t    var webRTCData = {\n\t      data: data,\n\t      type: 'data'\n\t    };\n\t    imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t  } else imperio.socket.emit('data', imperio.room, data);\n\t  if (callback) callback(data);\n\t};\n\t\n\tmodule.exports = emitData;\n\n/***/ },\n/* 31 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t* This emits to the specified room, the location of\n\t* @param The getCurrentPosition.coords property has several properties eg:\n\t*        accuracy,altitude, altitudeAccuracy, heading, latitude, longitude\n\t*        & speed\n\t*/\n\t\n\tvar emitGeoLocation = function emitGeoLocation(localCallback, modifyDataCallback) {\n\t  if (!navigator.geolocation) {\n\t    console.log('This browser does not support Geolocation');\n\t    return;\n\t  }\n\t  navigator.geolocation.getCurrentPosition(function (position) {\n\t    var geoLocation = position;\n\t    if (modifyDataCallback) geoLocation = modifyDataCallback(geoLocation);\n\t    var webRTCData = {\n\t      data: geoLocation,\n\t      type: 'geoLocation'\n\t    };\n\t    if (imperio.connectionType === 'webRTC') {\n\t      imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t    } else imperio.socket.emit('geoLocation', imperio.room, geoLocation);\n\t    if (localCallback) localCallback(geoLocation);\n\t  });\n\t};\n\t\n\tmodule.exports = emitGeoLocation;\n\n/***/ },\n/* 32 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Adds a listener to the window on the mobile device in order to read the gyroscope data.\n\t// Will send gyroscope data to the socket in the form of {alpha: alpha, beta:beta, gamma:gamma}.\n\t// Accepts 1 argument:\n\t// 1. A callback function that will be run every time the tap event is triggered, by default\n\t// we will provide this function with the gyroscope data.\n\tvar emitGyroscope = {};\n\tvar handleDeviceOrientation = function handleDeviceOrientation(event) {\n\t  var localCallback = imperio.callbacks.gyroLocal;\n\t  var modifyDataCallback = imperio.callbacks.gyroModify;\n\t  var alpha = event.alpha;\n\t  var beta = event.beta;\n\t  var gamma = event.gamma;\n\t  var gyroObject = {\n\t    alpha: alpha,\n\t    beta: beta,\n\t    gamma: gamma\n\t  };\n\t  if (modifyDataCallback) gyroObject = modifyDataCallback(gyroObject);\n\t  var webRTCData = {\n\t    data: gyroObject,\n\t    type: 'gyroscope'\n\t  };\n\t  if (imperio.connectionType === 'webRTC') {\n\t    imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t  } else imperio.socket.emit('gyroscope', imperio.room, gyroObject);\n\t  if (localCallback) localCallback(gyroObject);\n\t};\n\t\n\temitGyroscope.start = function (localCallback, modifyDataCallback) {\n\t  imperio.callbacks.gyroLocal = localCallback;\n\t  imperio.callbacks.gyroModify = modifyDataCallback;\n\t  window.addEventListener('deviceorientation', handleDeviceOrientation);\n\t};\n\temitGyroscope.remove = function (localCallback, modifyDataCallback) {\n\t  imperio.callbacks.gyroLocal = localCallback;\n\t  imperio.callbacks.gyroModify = modifyDataCallback;\n\t  window.removeEventListener('deviceorientation', handleDeviceOrientation);\n\t};\n\t\n\tmodule.exports = emitGyroscope;\n\n/***/ },\n/* 33 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Establishes a connection to the socket and shares the room it should connnect to.\n\t// Accepts 1 arguments:\n\t// 1. A callback that is invoked when the connect event is received\n\t// (happens once on first connect to socket).\n\t\n\tvar emitRoomSetup = function emitRoomSetup(callback) {\n\t  imperio.socket.on('connect', function () {\n\t    // only attempt to join room if room is defined in cookie and passed here\n\t    imperio.connectionType = 'sockets';\n\t    if (imperio.room) {\n\t      var clientData = {\n\t        room: imperio.room,\n\t        id: imperio.socket.id,\n\t        role: 'emitter'\n\t      };\n\t      imperio.socket.emit('createRoom', clientData);\n\t    }\n\t    if (callback) callback(imperio.socket);\n\t  });\n\t};\n\t\n\tmodule.exports = emitRoomSetup;\n\n/***/ },\n/* 34 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar emitPan = __webpack_require__(35);\n\tvar emitPinch = __webpack_require__(36);\n\tvar emitPress = __webpack_require__(37);\n\tvar emitPressUp = __webpack_require__(38);\n\tvar emitRotate = __webpack_require__(39);\n\tvar emitSwipe = __webpack_require__(40);\n\tvar emitTap = __webpack_require__(41);\n\t\n\tvar curse = function curse(action, element, localCallback, modifyDataCallback) {\n\t  if (action === 'pan') emitPan(element, localCallback, modifyDataCallback);\n\t  if (action === 'pinch') emitPinch(element, localCallback, modifyDataCallback);\n\t  if (action === 'press') emitPress(element, localCallback, modifyDataCallback);\n\t  if (action === 'pressUp') emitPressUp(element, localCallback, modifyDataCallback);\n\t  if (action === 'rotate') emitRotate(element, localCallback, modifyDataCallback);\n\t  if (action === 'swipe') emitSwipe(element, localCallback, modifyDataCallback);\n\t  if (action === 'tap') emitTap(element, localCallback, modifyDataCallback);\n\t};\n\t\n\tmodule.exports = curse;\n\n/***/ },\n/* 35 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitPan = function emitPan(element, localCallback, modifyDataCallback) {\n\t  var imperioControl = new Hammer(element);\n\t  var panEvents = ['pan', 'panstart', 'panend'];\n\t  panEvents.forEach(function (panEvent) {\n\t    imperioControl.on(panEvent, function (event) {\n\t      event.start = panEvent.indexOf('start') > -1;\n\t      event.end = panEvent.indexOf('end') > -1;\n\t      if (modifyDataCallback) event = modifyDataCallback(event);\n\t      if (imperio.connectionType === 'webRTC') {\n\t        var webRTCData = {};\n\t        webRTCData.data = event;\n\t        webRTCData.type = 'pan';\n\t        imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t      } else imperio.socket.emit('pan', imperio.room, event);\n\t      if (localCallback) localCallback(event);\n\t    });\n\t  });\n\t};\n\t\n\tmodule.exports = emitPan;\n\n/***/ },\n/* 36 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitPinch = function emitPinch(element, localCallback, modifyDataCallback) {\n\t  var imperioControl = new Hammer(element);\n\t  var pinchEvents = ['pinch', 'pinchstart', 'pinchend'];\n\t  imperioControl.get('pinch').set({ enable: true });\n\t  pinchEvents.forEach(function (pinchEvent) {\n\t    imperioControl.on(pinchEvent, function (event) {\n\t      event.start = pinchEvent.indexOf('start') > -1;\n\t      event.end = pinchEvent.indexOf('end') > -1;\n\t      if (modifyDataCallback) event = modifyDataCallback(event);\n\t      if (imperio.connectionType === 'webRTC') {\n\t        var webRTCData = {};\n\t        webRTCData.data = event;\n\t        webRTCData.type = 'pinch';\n\t        imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t      } else imperio.socket.emit('pinch', imperio.room, event);\n\t      if (localCallback) localCallback(event);\n\t    });\n\t  });\n\t};\n\t\n\tmodule.exports = emitPinch;\n\n/***/ },\n/* 37 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitPress = function emitPress(element, localCallback, modifyDataCallback) {\n\t  var imperioControl = new Hammer(element);\n\t  imperioControl.on('press', function (event) {\n\t    event.start = true;\n\t    event.end = false;\n\t    if (modifyDataCallback) event = modifyDataCallback(event);\n\t    if (imperio.connectionType === 'webRTC') {\n\t      var webRTCData = {};\n\t      webRTCData.data = event;\n\t      webRTCData.type = 'press';\n\t      imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t    } else imperio.socket.emit('press', imperio.room, event);\n\t    if (localCallback) localCallback(event);\n\t  });\n\t};\n\t\n\tmodule.exports = emitPress;\n\n/***/ },\n/* 38 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitPressUp = function emitPressUp(element, localCallback, modifyDataCallback) {\n\t  var hammertime = new Hammer(element);\n\t  hammertime.on('pressup', function (event) {\n\t    event.start = false;\n\t    event.end = true;\n\t    if (modifyDataCallback) event = modifyDataCallback(event);\n\t    if (imperio.connectionType === 'webRTC') {\n\t      var webRTCData = {};\n\t      webRTCData.data = event;\n\t      webRTCData.type = 'pressUp';\n\t      imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t    } else imperio.socket.emit('pressUp', imperio.room, event);\n\t    if (localCallback) localCallback(event);\n\t  });\n\t};\n\t\n\tmodule.exports = emitPressUp;\n\n/***/ },\n/* 39 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitRotate = function emitRotate(element, localCallback, modifyDataCallback) {\n\t  var imperioControl = new Hammer(element);\n\t  var rotateEvents = ['rotate', 'rotatestart', 'rotateend'];\n\t  imperioControl.get('rotate').set({ enable: true });\n\t  rotateEvents.forEach(function (rotateEvent) {\n\t    imperioControl.on(rotateEvent, function (event) {\n\t      event.start = rotateEvent.indexOf('start') > -1;\n\t      event.end = rotateEvent.indexOf('end') > -1;\n\t      if (modifyDataCallback) event = modifyDataCallback(event);\n\t      if (imperio.connectionType === 'webRTC') {\n\t        var webRTCData = {};\n\t        webRTCData.data = event;\n\t        webRTCData.type = 'rotate';\n\t        imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t      } else imperio.socket.emit('rotate', imperio.room, event);\n\t      if (localCallback) localCallback(event);\n\t    });\n\t  });\n\t};\n\t\n\tmodule.exports = emitRotate;\n\n/***/ },\n/* 40 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar emitSwipe = function emitSwipe(element, localCallback, modifyDataCallback) {\n\t  var imperioControl = new Hammer(element);\n\t  imperioControl.on('swipe', function (event) {\n\t    event.start = true;\n\t    event.end = true;\n\t    if (modifyDataCallback) event = modifyDataCallback(event);\n\t    if (imperio.connectionType === 'webRTC') {\n\t      var webRTCData = {};\n\t      webRTCData.data = event;\n\t      webRTCData.type = 'swipe';\n\t      imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t    } else imperio.socket.emit('swipe', imperio.room, event);\n\t    if (localCallback) localCallback(event);\n\t  });\n\t};\n\t\n\tmodule.exports = emitSwipe;\n\n/***/ },\n/* 41 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Attach to a tappable element and it will emit the tap event.\n\t// Accepts 1 argument:\n\t// 1. A callback function that will be run every time the tap event is triggered.\n\tvar emitTap = function emitTap(element, localCallback, modifyDataCallback) {\n\t  element.addEventListener('click', function (event) {\n\t    if (modifyDataCallback) event = modifyDataCallback(event);\n\t    if (imperio.connectionType === 'webRTC') {\n\t      var webRTCData = {\n\t        data: event,\n\t        type: 'tap'\n\t      };\n\t      imperio.dataChannel.send(JSON.stringify(webRTCData));\n\t    } else imperio.socket.emit('tap', imperio.room, event);\n\t    if (localCallback) localCallback(event);\n\t  });\n\t};\n\t\n\tmodule.exports = emitTap;\n\n/***/ },\n/* 42 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar requestNonceTimeout = function requestNonceTimeout(callback) {\n\t  imperio.socket.emit('updateNonceTimeouts', imperio.room);\n\t  if (callback) callback();\n\t};\n\t\n\tmodule.exports = requestNonceTimeout;\n\n/***/ },\n/* 43 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Sets up a listener for the acceleration event and expects to receive an object\n\t// with the acceleration data in the form of {x: x, y:y, z:z}.\n\t// Accepts 1 argument:\n\t// 1. A callback function that will be run every time the acceleration event is triggered.\n\tvar accelerationListener = function accelerationListener(callback) {\n\t  imperio.callbacks.acceleration = callback;\n\t  imperio.socket.on('acceleration', function (accObject) {\n\t    if (callback) callback(accObject);\n\t  });\n\t};\n\t\n\tmodule.exports = accelerationListener;\n\n/***/ },\n/* 44 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Sets up a listener for a data event.\n\t * @param {Object} socket - The socket you would like to connect to\n\t * @param {function} callback - A callback function\n\t *        that will be run every time the tap event is triggered\n\t */\n\tvar dataListener = function dataListener(callback) {\n\t  imperio.callbacks.data = callback;\n\t  imperio.socket.on('data', function (data) {\n\t    if (callback) callback(data);\n\t  });\n\t};\n\t\n\tmodule.exports = dataListener;\n\n/***/ },\n/* 45 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Sets up a listener for the location data and expects to receive an object\n\t// with the location data in the form of {cords: {accuracy:21, altitude:null,\n\t// altitudeAccuracy:null, heading:null, latitude:33.9794281, longitude:-118.42238250000001,\n\t// speed:null}, }.\n\t// Accepts 1 argument:\n\t// 1. A callback function that will be run every time the location event is triggered.\n\tvar geoLocationListener = function geoLocationListener(callback) {\n\t  imperio.callbacks.geoLocation = callback;\n\t  imperio.socket.on('geoLocation', function (locationObj) {\n\t    if (callback) callback(locationObj);\n\t  });\n\t};\n\t\n\tmodule.exports = geoLocationListener;\n\n/***/ },\n/* 46 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Sets up a listener for the orientation data and expects to receive an object\n\t// with the gyroscope data in the form of {alpha: alpha, beta:beta, gamma:gamma}.\n\t// Accepts 1 argument:\n\t// 1. A callback function that will be run every time the gyroscope event is triggered.\n\tvar gyroscopeListener = function gyroscopeListener(callback) {\n\t  imperio.callbacks.gyroscope = callback;\n\t  imperio.socket.on('gyroscope', function (gyroObject) {\n\t    if (callback) callback(gyroObject);\n\t  });\n\t};\n\t\n\tmodule.exports = gyroscopeListener;\n\n/***/ },\n/* 47 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Establishes a connection to the socket and shares the room it should connnect to.\n\t// Accepts 1 argument:\n\t// 1. A callback that is invoked when the connect event is received\n\t// (happens once on first connect to socket).\n\tvar listenerRoomSetup = function listenerRoomSetup(callback) {\n\t  imperio.socket.on('connect', function () {\n\t    // only attempt to join room if room is defined in cookie and passed here\n\t    imperio.connectionType = 'sockets';\n\t    if (imperio.room) {\n\t      var clientData = {\n\t        room: imperio.room,\n\t        id: imperio.socket.id,\n\t        role: 'listener'\n\t      };\n\t      imperio.socket.emit('createRoom', clientData);\n\t    }\n\t    if (callback) callback();\n\t  });\n\t};\n\t\n\tmodule.exports = listenerRoomSetup;\n\n/***/ },\n/* 48 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Establishes a connection to the socket and shares the room it should connnect to.\n\t// Accepts 3 arguments:\n\t// 1. The socket you would like to connect to.\n\t// 2. A room name that will inform the server which room to create/join.\n\t// 3. A callback that is invoked when the connect event is received\n\tvar nonceTimeoutUpdate = function nonceTimeoutUpdate(callback) {\n\t  imperio.socket.on('updateNonceTimeouts', function (nonceTimeouts) {\n\t    if (callback) callback(nonceTimeouts);\n\t  });\n\t};\n\t\n\tmodule.exports = nonceTimeoutUpdate;\n\n/***/ },\n/* 49 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t/**\n\t * Sets up a listener for a tap event on the desktop.\n\t * @param {Object} socket - The socket you would like to connect to\n\t * @param {function} callback - A callback function\n\t *        that will be run every time the tap event is triggered\n\t */\n\tvar tapListener = function tapListener(callback) {\n\t  imperio.callbacks.tap = callback;\n\t  imperio.socket.on('tap', function (data) {\n\t    if (callback) callback(data);\n\t  });\n\t};\n\t\n\tmodule.exports = tapListener;\n\n/***/ },\n/* 50 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;\"use strict\";\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\t(function (g, f) {\n\t  'use strict';\n\t  var h = function h(e) {\n\t    if (\"object\" !== _typeof(e.document)) throw Error(\"Cookies.js requires a `window` with a `document` object\");var b = function b(a, d, c) {\n\t      return 1 === arguments.length ? b.get(a) : b.set(a, d, c);\n\t    };b._document = e.document;b._cacheKeyPrefix = \"cookey.\";b._maxExpireDate = new Date(\"Fri, 31 Dec 9999 23:59:59 UTC\");b.defaults = { path: \"/\", secure: !1 };b.get = function (a) {\n\t      b._cachedDocumentCookie !== b._document.cookie && b._renewCache();a = b._cache[b._cacheKeyPrefix + a];return a === f ? f : decodeURIComponent(a);\n\t    };\n\t    b.set = function (a, d, c) {\n\t      c = b._getExtendedOptions(c);c.expires = b._getExpiresDate(d === f ? -1 : c.expires);b._document.cookie = b._generateCookieString(a, d, c);return b;\n\t    };b.expire = function (a, d) {\n\t      return b.set(a, f, d);\n\t    };b._getExtendedOptions = function (a) {\n\t      return { path: a && a.path || b.defaults.path, domain: a && a.domain || b.defaults.domain, expires: a && a.expires || b.defaults.expires, secure: a && a.secure !== f ? a.secure : b.defaults.secure };\n\t    };b._isValidDate = function (a) {\n\t      return \"[object Date]\" === Object.prototype.toString.call(a) && !isNaN(a.getTime());\n\t    };\n\t    b._getExpiresDate = function (a, d) {\n\t      d = d || new Date();\"number\" === typeof a ? a = Infinity === a ? b._maxExpireDate : new Date(d.getTime() + 1E3 * a) : \"string\" === typeof a && (a = new Date(a));if (a && !b._isValidDate(a)) throw Error(\"`expires` parameter cannot be converted to a valid Date instance\");return a;\n\t    };b._generateCookieString = function (a, b, c) {\n\t      a = a.replace(/[^#$&+\\^`|]/g, encodeURIComponent);a = a.replace(/\\(/g, \"%28\").replace(/\\)/g, \"%29\");b = (b + \"\").replace(/[^!#$&-+\\--:<-\\[\\]-~]/g, encodeURIComponent);c = c || {};a = a + \"=\" + b + (c.path ? \";path=\" + c.path : \"\");a += c.domain ? \";domain=\" + c.domain : \"\";a += c.expires ? \";expires=\" + c.expires.toUTCString() : \"\";return a += c.secure ? \";secure\" : \"\";\n\t    };b._getCacheFromString = function (a) {\n\t      var d = {};a = a ? a.split(\"; \") : [];for (var c = 0; c < a.length; c++) {\n\t        var e = b._getKeyValuePairFromCookieString(a[c]);d[b._cacheKeyPrefix + e.key] === f && (d[b._cacheKeyPrefix + e.key] = e.value);\n\t      }return d;\n\t    };b._getKeyValuePairFromCookieString = function (a) {\n\t      var b = a.indexOf(\"=\"),\n\t          b = 0 > b ? a.length : b,\n\t          c = a.substr(0, b),\n\t          e;try {\n\t        e = decodeURIComponent(c);\n\t      } catch (f) {\n\t        console && \"function\" === typeof console.error && console.error('Could not decode cookie with key \"' + c + '\"', f);\n\t      }return { key: e, value: a.substr(b + 1) };\n\t    };b._renewCache = function () {\n\t      b._cache = b._getCacheFromString(b._document.cookie);b._cachedDocumentCookie = b._document.cookie;\n\t    };b._areEnabled = function () {\n\t      var a = \"1\" === b.set(\"cookies.js\", 1).get(\"cookies.js\");b.expire(\"cookies.js\");return a;\n\t    };b.enabled = b._areEnabled();return b;\n\t  },\n\t      e = \"object\" === _typeof(g.document) ? h(g) : h; true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t    return e;\n\t  }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \"object\" === (typeof exports === \"undefined\" ? \"undefined\" : _typeof(exports)) ? (\"object\" === (typeof module === \"undefined\" ? \"undefined\" : _typeof(module)) && \"object\" === _typeof(module.exports) && (exports = module.exports = e), exports.Cookies = e) : g.Cookies = e;\n\t})(\"undefined\" === typeof window ? undefined : window);\n\n/***/ },\n/* 51 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar _cookiesMin = __webpack_require__(50);\n\t\n\tvar _cookiesMin2 = _interopRequireDefault(_cookiesMin);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\t// Uses cookies-js to retrieve the cookie with the associated name.\n\t// Required to display the nonce for mobile connections and to pull the roomID\n\t// that sockets uses to establish the correct room.\n\tfunction getCookie(name) {\n\t  return _cookiesMin2.default.get(name);\n\t}\n\t\n\tmodule.exports = getCookie;\n\n/***/ },\n/* 52 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;\"use strict\";\n\t\n\tvar _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol ? \"symbol\" : typeof obj; };\n\t\n\t/*! Hammer.JS - v2.0.8 - 2016-04-23\n\t * http://hammerjs.github.io/\n\t *\n\t * Copyright (c) 2016 Jorik Tangelder;\n\t * Licensed under the MIT license */\n\t!function (a, b, c, d) {\n\t  \"use strict\";\n\t  function e(a, b, c) {\n\t    return setTimeout(j(a, c), b);\n\t  }function f(a, b, c) {\n\t    return Array.isArray(a) ? (g(a, c[b], c), !0) : !1;\n\t  }function g(a, b, c) {\n\t    var e;if (a) if (a.forEach) a.forEach(b, c);else if (a.length !== d) for (e = 0; e < a.length;) {\n\t      b.call(c, a[e], e, a), e++;\n\t    } else for (e in a) {\n\t      a.hasOwnProperty(e) && b.call(c, a[e], e, a);\n\t    }\n\t  }function h(b, c, d) {\n\t    var e = \"DEPRECATED METHOD: \" + c + \"\\n\" + d + \" AT \\n\";return function () {\n\t      var c = new Error(\"get-stack-trace\"),\n\t          d = c && c.stack ? c.stack.replace(/^[^\\(]+?[\\n$]/gm, \"\").replace(/^\\s+at\\s+/gm, \"\").replace(/^Object.<anonymous>\\s*\\(/gm, \"{anonymous}()@\") : \"Unknown Stack Trace\",\n\t          f = a.console && (a.console.warn || a.console.log);return f && f.call(a.console, e, d), b.apply(this, arguments);\n\t    };\n\t  }function i(a, b, c) {\n\t    var d,\n\t        e = b.prototype;d = a.prototype = Object.create(e), d.constructor = a, d._super = e, c && la(d, c);\n\t  }function j(a, b) {\n\t    return function () {\n\t      return a.apply(b, arguments);\n\t    };\n\t  }function k(a, b) {\n\t    return (typeof a === \"undefined\" ? \"undefined\" : _typeof(a)) == oa ? a.apply(b ? b[0] || d : d, b) : a;\n\t  }function l(a, b) {\n\t    return a === d ? b : a;\n\t  }function m(a, b, c) {\n\t    g(q(b), function (b) {\n\t      a.addEventListener(b, c, !1);\n\t    });\n\t  }function n(a, b, c) {\n\t    g(q(b), function (b) {\n\t      a.removeEventListener(b, c, !1);\n\t    });\n\t  }function o(a, b) {\n\t    for (; a;) {\n\t      if (a == b) return !0;a = a.parentNode;\n\t    }return !1;\n\t  }function p(a, b) {\n\t    return a.indexOf(b) > -1;\n\t  }function q(a) {\n\t    return a.trim().split(/\\s+/g);\n\t  }function r(a, b, c) {\n\t    if (a.indexOf && !c) return a.indexOf(b);for (var d = 0; d < a.length;) {\n\t      if (c && a[d][c] == b || !c && a[d] === b) return d;d++;\n\t    }return -1;\n\t  }function s(a) {\n\t    return Array.prototype.slice.call(a, 0);\n\t  }function t(a, b, c) {\n\t    for (var d = [], e = [], f = 0; f < a.length;) {\n\t      var g = b ? a[f][b] : a[f];r(e, g) < 0 && d.push(a[f]), e[f] = g, f++;\n\t    }return c && (d = b ? d.sort(function (a, c) {\n\t      return a[b] > c[b];\n\t    }) : d.sort()), d;\n\t  }function u(a, b) {\n\t    for (var c, e, f = b[0].toUpperCase() + b.slice(1), g = 0; g < ma.length;) {\n\t      if (c = ma[g], e = c ? c + f : b, e in a) return e;g++;\n\t    }return d;\n\t  }function v() {\n\t    return ua++;\n\t  }function w(b) {\n\t    var c = b.ownerDocument || b;return c.defaultView || c.parentWindow || a;\n\t  }function x(a, b) {\n\t    var c = this;this.manager = a, this.callback = b, this.element = a.element, this.target = a.options.inputTarget, this.domHandler = function (b) {\n\t      k(a.options.enable, [a]) && c.handler(b);\n\t    }, this.init();\n\t  }function y(a) {\n\t    var b,\n\t        c = a.options.inputClass;return new (b = c ? c : xa ? M : ya ? P : wa ? R : L)(a, z);\n\t  }function z(a, b, c) {\n\t    var d = c.pointers.length,\n\t        e = c.changedPointers.length,\n\t        f = b & Ea && d - e === 0,\n\t        g = b & (Ga | Ha) && d - e === 0;c.isFirst = !!f, c.isFinal = !!g, f && (a.session = {}), c.eventType = b, A(a, c), a.emit(\"hammer.input\", c), a.recognize(c), a.session.prevInput = c;\n\t  }function A(a, b) {\n\t    var c = a.session,\n\t        d = b.pointers,\n\t        e = d.length;c.firstInput || (c.firstInput = D(b)), e > 1 && !c.firstMultiple ? c.firstMultiple = D(b) : 1 === e && (c.firstMultiple = !1);var f = c.firstInput,\n\t        g = c.firstMultiple,\n\t        h = g ? g.center : f.center,\n\t        i = b.center = E(d);b.timeStamp = ra(), b.deltaTime = b.timeStamp - f.timeStamp, b.angle = I(h, i), b.distance = H(h, i), B(c, b), b.offsetDirection = G(b.deltaX, b.deltaY);var j = F(b.deltaTime, b.deltaX, b.deltaY);b.overallVelocityX = j.x, b.overallVelocityY = j.y, b.overallVelocity = qa(j.x) > qa(j.y) ? j.x : j.y, b.scale = g ? K(g.pointers, d) : 1, b.rotation = g ? J(g.pointers, d) : 0, b.maxPointers = c.prevInput ? b.pointers.length > c.prevInput.maxPointers ? b.pointers.length : c.prevInput.maxPointers : b.pointers.length, C(c, b);var k = a.element;o(b.srcEvent.target, k) && (k = b.srcEvent.target), b.target = k;\n\t  }function B(a, b) {\n\t    var c = b.center,\n\t        d = a.offsetDelta || {},\n\t        e = a.prevDelta || {},\n\t        f = a.prevInput || {};b.eventType !== Ea && f.eventType !== Ga || (e = a.prevDelta = { x: f.deltaX || 0, y: f.deltaY || 0 }, d = a.offsetDelta = { x: c.x, y: c.y }), b.deltaX = e.x + (c.x - d.x), b.deltaY = e.y + (c.y - d.y);\n\t  }function C(a, b) {\n\t    var c,\n\t        e,\n\t        f,\n\t        g,\n\t        h = a.lastInterval || b,\n\t        i = b.timeStamp - h.timeStamp;if (b.eventType != Ha && (i > Da || h.velocity === d)) {\n\t      var j = b.deltaX - h.deltaX,\n\t          k = b.deltaY - h.deltaY,\n\t          l = F(i, j, k);e = l.x, f = l.y, c = qa(l.x) > qa(l.y) ? l.x : l.y, g = G(j, k), a.lastInterval = b;\n\t    } else c = h.velocity, e = h.velocityX, f = h.velocityY, g = h.direction;b.velocity = c, b.velocityX = e, b.velocityY = f, b.direction = g;\n\t  }function D(a) {\n\t    for (var b = [], c = 0; c < a.pointers.length;) {\n\t      b[c] = { clientX: pa(a.pointers[c].clientX), clientY: pa(a.pointers[c].clientY) }, c++;\n\t    }return { timeStamp: ra(), pointers: b, center: E(b), deltaX: a.deltaX, deltaY: a.deltaY };\n\t  }function E(a) {\n\t    var b = a.length;if (1 === b) return { x: pa(a[0].clientX), y: pa(a[0].clientY) };for (var c = 0, d = 0, e = 0; b > e;) {\n\t      c += a[e].clientX, d += a[e].clientY, e++;\n\t    }return { x: pa(c / b), y: pa(d / b) };\n\t  }function F(a, b, c) {\n\t    return { x: b / a || 0, y: c / a || 0 };\n\t  }function G(a, b) {\n\t    return a === b ? Ia : qa(a) >= qa(b) ? 0 > a ? Ja : Ka : 0 > b ? La : Ma;\n\t  }function H(a, b, c) {\n\t    c || (c = Qa);var d = b[c[0]] - a[c[0]],\n\t        e = b[c[1]] - a[c[1]];return Math.sqrt(d * d + e * e);\n\t  }function I(a, b, c) {\n\t    c || (c = Qa);var d = b[c[0]] - a[c[0]],\n\t        e = b[c[1]] - a[c[1]];return 180 * Math.atan2(e, d) / Math.PI;\n\t  }function J(a, b) {\n\t    return I(b[1], b[0], Ra) + I(a[1], a[0], Ra);\n\t  }function K(a, b) {\n\t    return H(b[0], b[1], Ra) / H(a[0], a[1], Ra);\n\t  }function L() {\n\t    this.evEl = Ta, this.evWin = Ua, this.pressed = !1, x.apply(this, arguments);\n\t  }function M() {\n\t    this.evEl = Xa, this.evWin = Ya, x.apply(this, arguments), this.store = this.manager.session.pointerEvents = [];\n\t  }function N() {\n\t    this.evTarget = $a, this.evWin = _a, this.started = !1, x.apply(this, arguments);\n\t  }function O(a, b) {\n\t    var c = s(a.touches),\n\t        d = s(a.changedTouches);return b & (Ga | Ha) && (c = t(c.concat(d), \"identifier\", !0)), [c, d];\n\t  }function P() {\n\t    this.evTarget = bb, this.targetIds = {}, x.apply(this, arguments);\n\t  }function Q(a, b) {\n\t    var c = s(a.touches),\n\t        d = this.targetIds;if (b & (Ea | Fa) && 1 === c.length) return d[c[0].identifier] = !0, [c, c];var e,\n\t        f,\n\t        g = s(a.changedTouches),\n\t        h = [],\n\t        i = this.target;if (f = c.filter(function (a) {\n\t      return o(a.target, i);\n\t    }), b === Ea) for (e = 0; e < f.length;) {\n\t      d[f[e].identifier] = !0, e++;\n\t    }for (e = 0; e < g.length;) {\n\t      d[g[e].identifier] && h.push(g[e]), b & (Ga | Ha) && delete d[g[e].identifier], e++;\n\t    }return h.length ? [t(f.concat(h), \"identifier\", !0), h] : void 0;\n\t  }function R() {\n\t    x.apply(this, arguments);var a = j(this.handler, this);this.touch = new P(this.manager, a), this.mouse = new L(this.manager, a), this.primaryTouch = null, this.lastTouches = [];\n\t  }function S(a, b) {\n\t    a & Ea ? (this.primaryTouch = b.changedPointers[0].identifier, T.call(this, b)) : a & (Ga | Ha) && T.call(this, b);\n\t  }function T(a) {\n\t    var b = a.changedPointers[0];if (b.identifier === this.primaryTouch) {\n\t      var c = { x: b.clientX, y: b.clientY };this.lastTouches.push(c);var d = this.lastTouches,\n\t          e = function e() {\n\t        var a = d.indexOf(c);a > -1 && d.splice(a, 1);\n\t      };setTimeout(e, cb);\n\t    }\n\t  }function U(a) {\n\t    for (var b = a.srcEvent.clientX, c = a.srcEvent.clientY, d = 0; d < this.lastTouches.length; d++) {\n\t      var e = this.lastTouches[d],\n\t          f = Math.abs(b - e.x),\n\t          g = Math.abs(c - e.y);if (db >= f && db >= g) return !0;\n\t    }return !1;\n\t  }function V(a, b) {\n\t    this.manager = a, this.set(b);\n\t  }function W(a) {\n\t    if (p(a, jb)) return jb;var b = p(a, kb),\n\t        c = p(a, lb);return b && c ? jb : b || c ? b ? kb : lb : p(a, ib) ? ib : hb;\n\t  }function X() {\n\t    if (!fb) return !1;var b = {},\n\t        c = a.CSS && a.CSS.supports;return [\"auto\", \"manipulation\", \"pan-y\", \"pan-x\", \"pan-x pan-y\", \"none\"].forEach(function (d) {\n\t      b[d] = c ? a.CSS.supports(\"touch-action\", d) : !0;\n\t    }), b;\n\t  }function Y(a) {\n\t    this.options = la({}, this.defaults, a || {}), this.id = v(), this.manager = null, this.options.enable = l(this.options.enable, !0), this.state = nb, this.simultaneous = {}, this.requireFail = [];\n\t  }function Z(a) {\n\t    return a & sb ? \"cancel\" : a & qb ? \"end\" : a & pb ? \"move\" : a & ob ? \"start\" : \"\";\n\t  }function $(a) {\n\t    return a == Ma ? \"down\" : a == La ? \"up\" : a == Ja ? \"left\" : a == Ka ? \"right\" : \"\";\n\t  }function _(a, b) {\n\t    var c = b.manager;return c ? c.get(a) : a;\n\t  }function aa() {\n\t    Y.apply(this, arguments);\n\t  }function ba() {\n\t    aa.apply(this, arguments), this.pX = null, this.pY = null;\n\t  }function ca() {\n\t    aa.apply(this, arguments);\n\t  }function da() {\n\t    Y.apply(this, arguments), this._timer = null, this._input = null;\n\t  }function ea() {\n\t    aa.apply(this, arguments);\n\t  }function fa() {\n\t    aa.apply(this, arguments);\n\t  }function ga() {\n\t    Y.apply(this, arguments), this.pTime = !1, this.pCenter = !1, this._timer = null, this._input = null, this.count = 0;\n\t  }function ha(a, b) {\n\t    return b = b || {}, b.recognizers = l(b.recognizers, ha.defaults.preset), new ia(a, b);\n\t  }function ia(a, b) {\n\t    this.options = la({}, ha.defaults, b || {}), this.options.inputTarget = this.options.inputTarget || a, this.handlers = {}, this.session = {}, this.recognizers = [], this.oldCssProps = {}, this.element = a, this.input = y(this), this.touchAction = new V(this, this.options.touchAction), ja(this, !0), g(this.options.recognizers, function (a) {\n\t      var b = this.add(new a[0](a[1]));a[2] && b.recognizeWith(a[2]), a[3] && b.requireFailure(a[3]);\n\t    }, this);\n\t  }function ja(a, b) {\n\t    var c = a.element;if (c.style) {\n\t      var d;g(a.options.cssProps, function (e, f) {\n\t        d = u(c.style, f), b ? (a.oldCssProps[d] = c.style[d], c.style[d] = e) : c.style[d] = a.oldCssProps[d] || \"\";\n\t      }), b || (a.oldCssProps = {});\n\t    }\n\t  }function ka(a, c) {\n\t    var d = b.createEvent(\"Event\");d.initEvent(a, !0, !0), d.gesture = c, c.target.dispatchEvent(d);\n\t  }var la,\n\t      ma = [\"\", \"webkit\", \"Moz\", \"MS\", \"ms\", \"o\"],\n\t      na = b.createElement(\"div\"),\n\t      oa = \"function\",\n\t      pa = Math.round,\n\t      qa = Math.abs,\n\t      ra = Date.now;la = \"function\" != typeof Object.assign ? function (a) {\n\t    if (a === d || null === a) throw new TypeError(\"Cannot convert undefined or null to object\");for (var b = Object(a), c = 1; c < arguments.length; c++) {\n\t      var e = arguments[c];if (e !== d && null !== e) for (var f in e) {\n\t        e.hasOwnProperty(f) && (b[f] = e[f]);\n\t      }\n\t    }return b;\n\t  } : Object.assign;var sa = h(function (a, b, c) {\n\t    for (var e = Object.keys(b), f = 0; f < e.length;) {\n\t      (!c || c && a[e[f]] === d) && (a[e[f]] = b[e[f]]), f++;\n\t    }return a;\n\t  }, \"extend\", \"Use `assign`.\"),\n\t      ta = h(function (a, b) {\n\t    return sa(a, b, !0);\n\t  }, \"merge\", \"Use `assign`.\"),\n\t      ua = 1,\n\t      va = /mobile|tablet|ip(ad|hone|od)|android/i,\n\t      wa = \"ontouchstart\" in a,\n\t      xa = u(a, \"PointerEvent\") !== d,\n\t      ya = wa && va.test(navigator.userAgent),\n\t      za = \"touch\",\n\t      Aa = \"pen\",\n\t      Ba = \"mouse\",\n\t      Ca = \"kinect\",\n\t      Da = 25,\n\t      Ea = 1,\n\t      Fa = 2,\n\t      Ga = 4,\n\t      Ha = 8,\n\t      Ia = 1,\n\t      Ja = 2,\n\t      Ka = 4,\n\t      La = 8,\n\t      Ma = 16,\n\t      Na = Ja | Ka,\n\t      Oa = La | Ma,\n\t      Pa = Na | Oa,\n\t      Qa = [\"x\", \"y\"],\n\t      Ra = [\"clientX\", \"clientY\"];x.prototype = { handler: function handler() {}, init: function init() {\n\t      this.evEl && m(this.element, this.evEl, this.domHandler), this.evTarget && m(this.target, this.evTarget, this.domHandler), this.evWin && m(w(this.element), this.evWin, this.domHandler);\n\t    }, destroy: function destroy() {\n\t      this.evEl && n(this.element, this.evEl, this.domHandler), this.evTarget && n(this.target, this.evTarget, this.domHandler), this.evWin && n(w(this.element), this.evWin, this.domHandler);\n\t    } };var Sa = { mousedown: Ea, mousemove: Fa, mouseup: Ga },\n\t      Ta = \"mousedown\",\n\t      Ua = \"mousemove mouseup\";i(L, x, { handler: function handler(a) {\n\t      var b = Sa[a.type];b & Ea && 0 === a.button && (this.pressed = !0), b & Fa && 1 !== a.which && (b = Ga), this.pressed && (b & Ga && (this.pressed = !1), this.callback(this.manager, b, { pointers: [a], changedPointers: [a], pointerType: Ba, srcEvent: a }));\n\t    } });var Va = { pointerdown: Ea, pointermove: Fa, pointerup: Ga, pointercancel: Ha, pointerout: Ha },\n\t      Wa = { 2: za, 3: Aa, 4: Ba, 5: Ca },\n\t      Xa = \"pointerdown\",\n\t      Ya = \"pointermove pointerup pointercancel\";a.MSPointerEvent && !a.PointerEvent && (Xa = \"MSPointerDown\", Ya = \"MSPointerMove MSPointerUp MSPointerCancel\"), i(M, x, { handler: function handler(a) {\n\t      var b = this.store,\n\t          c = !1,\n\t          d = a.type.toLowerCase().replace(\"ms\", \"\"),\n\t          e = Va[d],\n\t          f = Wa[a.pointerType] || a.pointerType,\n\t          g = f == za,\n\t          h = r(b, a.pointerId, \"pointerId\");e & Ea && (0 === a.button || g) ? 0 > h && (b.push(a), h = b.length - 1) : e & (Ga | Ha) && (c = !0), 0 > h || (b[h] = a, this.callback(this.manager, e, { pointers: b, changedPointers: [a], pointerType: f, srcEvent: a }), c && b.splice(h, 1));\n\t    } });var Za = { touchstart: Ea, touchmove: Fa, touchend: Ga, touchcancel: Ha },\n\t      $a = \"touchstart\",\n\t      _a = \"touchstart touchmove touchend touchcancel\";i(N, x, { handler: function handler(a) {\n\t      var b = Za[a.type];if (b === Ea && (this.started = !0), this.started) {\n\t        var c = O.call(this, a, b);b & (Ga | Ha) && c[0].length - c[1].length === 0 && (this.started = !1), this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: za, srcEvent: a });\n\t      }\n\t    } });var ab = { touchstart: Ea, touchmove: Fa, touchend: Ga, touchcancel: Ha },\n\t      bb = \"touchstart touchmove touchend touchcancel\";i(P, x, { handler: function handler(a) {\n\t      var b = ab[a.type],\n\t          c = Q.call(this, a, b);c && this.callback(this.manager, b, { pointers: c[0], changedPointers: c[1], pointerType: za, srcEvent: a });\n\t    } });var cb = 2500,\n\t      db = 25;i(R, x, { handler: function handler(a, b, c) {\n\t      var d = c.pointerType == za,\n\t          e = c.pointerType == Ba;if (!(e && c.sourceCapabilities && c.sourceCapabilities.firesTouchEvents)) {\n\t        if (d) S.call(this, b, c);else if (e && U.call(this, c)) return;this.callback(a, b, c);\n\t      }\n\t    }, destroy: function destroy() {\n\t      this.touch.destroy(), this.mouse.destroy();\n\t    } });var eb = u(na.style, \"touchAction\"),\n\t      fb = eb !== d,\n\t      gb = \"compute\",\n\t      hb = \"auto\",\n\t      ib = \"manipulation\",\n\t      jb = \"none\",\n\t      kb = \"pan-x\",\n\t      lb = \"pan-y\",\n\t      mb = X();V.prototype = { set: function set(a) {\n\t      a == gb && (a = this.compute()), fb && this.manager.element.style && mb[a] && (this.manager.element.style[eb] = a), this.actions = a.toLowerCase().trim();\n\t    }, update: function update() {\n\t      this.set(this.manager.options.touchAction);\n\t    }, compute: function compute() {\n\t      var a = [];return g(this.manager.recognizers, function (b) {\n\t        k(b.options.enable, [b]) && (a = a.concat(b.getTouchAction()));\n\t      }), W(a.join(\" \"));\n\t    }, preventDefaults: function preventDefaults(a) {\n\t      var b = a.srcEvent,\n\t          c = a.offsetDirection;if (this.manager.session.prevented) return void b.preventDefault();var d = this.actions,\n\t          e = p(d, jb) && !mb[jb],\n\t          f = p(d, lb) && !mb[lb],\n\t          g = p(d, kb) && !mb[kb];if (e) {\n\t        var h = 1 === a.pointers.length,\n\t            i = a.distance < 2,\n\t            j = a.deltaTime < 250;if (h && i && j) return;\n\t      }return g && f ? void 0 : e || f && c & Na || g && c & Oa ? this.preventSrc(b) : void 0;\n\t    }, preventSrc: function preventSrc(a) {\n\t      this.manager.session.prevented = !0, a.preventDefault();\n\t    } };var nb = 1,\n\t      ob = 2,\n\t      pb = 4,\n\t      qb = 8,\n\t      rb = qb,\n\t      sb = 16,\n\t      tb = 32;Y.prototype = { defaults: {}, set: function set(a) {\n\t      return la(this.options, a), this.manager && this.manager.touchAction.update(), this;\n\t    }, recognizeWith: function recognizeWith(a) {\n\t      if (f(a, \"recognizeWith\", this)) return this;var b = this.simultaneous;return a = _(a, this), b[a.id] || (b[a.id] = a, a.recognizeWith(this)), this;\n\t    }, dropRecognizeWith: function dropRecognizeWith(a) {\n\t      return f(a, \"dropRecognizeWith\", this) ? this : (a = _(a, this), delete this.simultaneous[a.id], this);\n\t    }, requireFailure: function requireFailure(a) {\n\t      if (f(a, \"requireFailure\", this)) return this;var b = this.requireFail;return a = _(a, this), -1 === r(b, a) && (b.push(a), a.requireFailure(this)), this;\n\t    }, dropRequireFailure: function dropRequireFailure(a) {\n\t      if (f(a, \"dropRequireFailure\", this)) return this;a = _(a, this);var b = r(this.requireFail, a);return b > -1 && this.requireFail.splice(b, 1), this;\n\t    }, hasRequireFailures: function hasRequireFailures() {\n\t      return this.requireFail.length > 0;\n\t    }, canRecognizeWith: function canRecognizeWith(a) {\n\t      return !!this.simultaneous[a.id];\n\t    }, emit: function emit(a) {\n\t      function b(b) {\n\t        c.manager.emit(b, a);\n\t      }var c = this,\n\t          d = this.state;qb > d && b(c.options.event + Z(d)), b(c.options.event), a.additionalEvent && b(a.additionalEvent), d >= qb && b(c.options.event + Z(d));\n\t    }, tryEmit: function tryEmit(a) {\n\t      return this.canEmit() ? this.emit(a) : void (this.state = tb);\n\t    }, canEmit: function canEmit() {\n\t      for (var a = 0; a < this.requireFail.length;) {\n\t        if (!(this.requireFail[a].state & (tb | nb))) return !1;a++;\n\t      }return !0;\n\t    }, recognize: function recognize(a) {\n\t      var b = la({}, a);return k(this.options.enable, [this, b]) ? (this.state & (rb | sb | tb) && (this.state = nb), this.state = this.process(b), void (this.state & (ob | pb | qb | sb) && this.tryEmit(b))) : (this.reset(), void (this.state = tb));\n\t    }, process: function process(a) {}, getTouchAction: function getTouchAction() {}, reset: function reset() {} }, i(aa, Y, { defaults: { pointers: 1 }, attrTest: function attrTest(a) {\n\t      var b = this.options.pointers;return 0 === b || a.pointers.length === b;\n\t    }, process: function process(a) {\n\t      var b = this.state,\n\t          c = a.eventType,\n\t          d = b & (ob | pb),\n\t          e = this.attrTest(a);return d && (c & Ha || !e) ? b | sb : d || e ? c & Ga ? b | qb : b & ob ? b | pb : ob : tb;\n\t    } }), i(ba, aa, { defaults: { event: \"pan\", threshold: 10, pointers: 1, direction: Pa }, getTouchAction: function getTouchAction() {\n\t      var a = this.options.direction,\n\t          b = [];return a & Na && b.push(lb), a & Oa && b.push(kb), b;\n\t    }, directionTest: function directionTest(a) {\n\t      var b = this.options,\n\t          c = !0,\n\t          d = a.distance,\n\t          e = a.direction,\n\t          f = a.deltaX,\n\t          g = a.deltaY;return e & b.direction || (b.direction & Na ? (e = 0 === f ? Ia : 0 > f ? Ja : Ka, c = f != this.pX, d = Math.abs(a.deltaX)) : (e = 0 === g ? Ia : 0 > g ? La : Ma, c = g != this.pY, d = Math.abs(a.deltaY))), a.direction = e, c && d > b.threshold && e & b.direction;\n\t    }, attrTest: function attrTest(a) {\n\t      return aa.prototype.attrTest.call(this, a) && (this.state & ob || !(this.state & ob) && this.directionTest(a));\n\t    }, emit: function emit(a) {\n\t      this.pX = a.deltaX, this.pY = a.deltaY;var b = $(a.direction);b && (a.additionalEvent = this.options.event + b), this._super.emit.call(this, a);\n\t    } }), i(ca, aa, { defaults: { event: \"pinch\", threshold: 0, pointers: 2 }, getTouchAction: function getTouchAction() {\n\t      return [jb];\n\t    }, attrTest: function attrTest(a) {\n\t      return this._super.attrTest.call(this, a) && (Math.abs(a.scale - 1) > this.options.threshold || this.state & ob);\n\t    }, emit: function emit(a) {\n\t      if (1 !== a.scale) {\n\t        var b = a.scale < 1 ? \"in\" : \"out\";a.additionalEvent = this.options.event + b;\n\t      }this._super.emit.call(this, a);\n\t    } }), i(da, Y, { defaults: { event: \"press\", pointers: 1, time: 251, threshold: 9 }, getTouchAction: function getTouchAction() {\n\t      return [hb];\n\t    }, process: function process(a) {\n\t      var b = this.options,\n\t          c = a.pointers.length === b.pointers,\n\t          d = a.distance < b.threshold,\n\t          f = a.deltaTime > b.time;if (this._input = a, !d || !c || a.eventType & (Ga | Ha) && !f) this.reset();else if (a.eventType & Ea) this.reset(), this._timer = e(function () {\n\t        this.state = rb, this.tryEmit();\n\t      }, b.time, this);else if (a.eventType & Ga) return rb;return tb;\n\t    }, reset: function reset() {\n\t      clearTimeout(this._timer);\n\t    }, emit: function emit(a) {\n\t      this.state === rb && (a && a.eventType & Ga ? this.manager.emit(this.options.event + \"up\", a) : (this._input.timeStamp = ra(), this.manager.emit(this.options.event, this._input)));\n\t    } }), i(ea, aa, { defaults: { event: \"rotate\", threshold: 0, pointers: 2 }, getTouchAction: function getTouchAction() {\n\t      return [jb];\n\t    }, attrTest: function attrTest(a) {\n\t      return this._super.attrTest.call(this, a) && (Math.abs(a.rotation) > this.options.threshold || this.state & ob);\n\t    } }), i(fa, aa, { defaults: { event: \"swipe\", threshold: 10, velocity: .3, direction: Na | Oa, pointers: 1 }, getTouchAction: function getTouchAction() {\n\t      return ba.prototype.getTouchAction.call(this);\n\t    }, attrTest: function attrTest(a) {\n\t      var b,\n\t          c = this.options.direction;return c & (Na | Oa) ? b = a.overallVelocity : c & Na ? b = a.overallVelocityX : c & Oa && (b = a.overallVelocityY), this._super.attrTest.call(this, a) && c & a.offsetDirection && a.distance > this.options.threshold && a.maxPointers == this.options.pointers && qa(b) > this.options.velocity && a.eventType & Ga;\n\t    }, emit: function emit(a) {\n\t      var b = $(a.offsetDirection);b && this.manager.emit(this.options.event + b, a), this.manager.emit(this.options.event, a);\n\t    } }), i(ga, Y, { defaults: { event: \"tap\", pointers: 1, taps: 1, interval: 300, time: 250, threshold: 9, posThreshold: 10 }, getTouchAction: function getTouchAction() {\n\t      return [ib];\n\t    }, process: function process(a) {\n\t      var b = this.options,\n\t          c = a.pointers.length === b.pointers,\n\t          d = a.distance < b.threshold,\n\t          f = a.deltaTime < b.time;if (this.reset(), a.eventType & Ea && 0 === this.count) return this.failTimeout();if (d && f && c) {\n\t        if (a.eventType != Ga) return this.failTimeout();var g = this.pTime ? a.timeStamp - this.pTime < b.interval : !0,\n\t            h = !this.pCenter || H(this.pCenter, a.center) < b.posThreshold;this.pTime = a.timeStamp, this.pCenter = a.center, h && g ? this.count += 1 : this.count = 1, this._input = a;var i = this.count % b.taps;if (0 === i) return this.hasRequireFailures() ? (this._timer = e(function () {\n\t          this.state = rb, this.tryEmit();\n\t        }, b.interval, this), ob) : rb;\n\t      }return tb;\n\t    }, failTimeout: function failTimeout() {\n\t      return this._timer = e(function () {\n\t        this.state = tb;\n\t      }, this.options.interval, this), tb;\n\t    }, reset: function reset() {\n\t      clearTimeout(this._timer);\n\t    }, emit: function emit() {\n\t      this.state == rb && (this._input.tapCount = this.count, this.manager.emit(this.options.event, this._input));\n\t    } }), ha.VERSION = \"2.0.8\", ha.defaults = { domEvents: !1, touchAction: gb, enable: !0, inputTarget: null, inputClass: null, preset: [[ea, { enable: !1 }], [ca, { enable: !1 }, [\"rotate\"]], [fa, { direction: Na }], [ba, { direction: Na }, [\"swipe\"]], [ga], [ga, { event: \"doubletap\", taps: 2 }, [\"tap\"]], [da]], cssProps: { userSelect: \"none\", touchSelect: \"none\", touchCallout: \"none\", contentZooming: \"none\", userDrag: \"none\", tapHighlightColor: \"rgba(0,0,0,0)\" } };var ub = 1,\n\t      vb = 2;ia.prototype = { set: function set(a) {\n\t      return la(this.options, a), a.touchAction && this.touchAction.update(), a.inputTarget && (this.input.destroy(), this.input.target = a.inputTarget, this.input.init()), this;\n\t    }, stop: function stop(a) {\n\t      this.session.stopped = a ? vb : ub;\n\t    }, recognize: function recognize(a) {\n\t      var b = this.session;if (!b.stopped) {\n\t        this.touchAction.preventDefaults(a);var c,\n\t            d = this.recognizers,\n\t            e = b.curRecognizer;(!e || e && e.state & rb) && (e = b.curRecognizer = null);for (var f = 0; f < d.length;) {\n\t          c = d[f], b.stopped === vb || e && c != e && !c.canRecognizeWith(e) ? c.reset() : c.recognize(a), !e && c.state & (ob | pb | qb) && (e = b.curRecognizer = c), f++;\n\t        }\n\t      }\n\t    }, get: function get(a) {\n\t      if (a instanceof Y) return a;for (var b = this.recognizers, c = 0; c < b.length; c++) {\n\t        if (b[c].options.event == a) return b[c];\n\t      }return null;\n\t    }, add: function add(a) {\n\t      if (f(a, \"add\", this)) return this;var b = this.get(a.options.event);return b && this.remove(b), this.recognizers.push(a), a.manager = this, this.touchAction.update(), a;\n\t    }, remove: function remove(a) {\n\t      if (f(a, \"remove\", this)) return this;if (a = this.get(a)) {\n\t        var b = this.recognizers,\n\t            c = r(b, a);-1 !== c && (b.splice(c, 1), this.touchAction.update());\n\t      }return this;\n\t    }, on: function on(a, b) {\n\t      if (a !== d && b !== d) {\n\t        var c = this.handlers;return g(q(a), function (a) {\n\t          c[a] = c[a] || [], c[a].push(b);\n\t        }), this;\n\t      }\n\t    }, off: function off(a, b) {\n\t      if (a !== d) {\n\t        var c = this.handlers;return g(q(a), function (a) {\n\t          b ? c[a] && c[a].splice(r(c[a], b), 1) : delete c[a];\n\t        }), this;\n\t      }\n\t    }, emit: function emit(a, b) {\n\t      this.options.domEvents && ka(a, b);var c = this.handlers[a] && this.handlers[a].slice();if (c && c.length) {\n\t        b.type = a, b.preventDefault = function () {\n\t          b.srcEvent.preventDefault();\n\t        };for (var d = 0; d < c.length;) {\n\t          c[d](b), d++;\n\t        }\n\t      }\n\t    }, destroy: function destroy() {\n\t      this.element && ja(this, !1), this.handlers = {}, this.session = {}, this.input.destroy(), this.element = null;\n\t    } }, la(ha, { INPUT_START: Ea, INPUT_MOVE: Fa, INPUT_END: Ga, INPUT_CANCEL: Ha, STATE_POSSIBLE: nb, STATE_BEGAN: ob, STATE_CHANGED: pb, STATE_ENDED: qb, STATE_RECOGNIZED: rb, STATE_CANCELLED: sb, STATE_FAILED: tb, DIRECTION_NONE: Ia, DIRECTION_LEFT: Ja, DIRECTION_RIGHT: Ka, DIRECTION_UP: La, DIRECTION_DOWN: Ma, DIRECTION_HORIZONTAL: Na, DIRECTION_VERTICAL: Oa, DIRECTION_ALL: Pa, Manager: ia, Input: x, TouchAction: V, TouchInput: P, MouseInput: L, PointerEventInput: M, TouchMouseInput: R, SingleTouchInput: N, Recognizer: Y, AttrRecognizer: aa, Tap: ga, Pan: ba, Swipe: fa, Pinch: ca, Rotate: ea, Press: da, on: m, off: n, each: g, merge: ta, extend: sa, assign: la, inherit: i, bindFn: j, prefixed: u });var wb = \"undefined\" != typeof a ? a : \"undefined\" != typeof self ? self : {};wb.Hammer = ha,  true ? !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t    return ha;\n\t  }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)) : \"undefined\" != typeof module && module.exports ? module.exports = ha : a[c] = ha;\n\t}(window, document, \"Hammer\");\n\n/***/ },\n/* 53 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\t// Sets up a listener for updates to client connections to the room.\n\t// Accepts 1 argument:\n\t// 1. A callback function to handle the roomData object passed with the event\n\tvar roomUpdate = function roomUpdate(callback) {\n\t  imperio.socket.on('updateRoomData', function (roomData) {\n\t    imperio.myID = imperio.socket.id;\n\t    imperio.otherIDs = Object.keys(roomData.sockets).map(function (socketID) {\n\t      return socketID.substring(2);\n\t    }).filter(function (socketID) {\n\t      return socketID !== imperio.myID;\n\t    });\n\t    if (callback) callback(roomData);\n\t  });\n\t};\n\t\n\tmodule.exports = roomUpdate;\n\n/***/ },\n/* 54 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar sendMessage = __webpack_require__(13);\n\tvar logError = __webpack_require__(7);\n\tvar onDataChannelCreated = __webpack_require__(55);\n\tvar onLocalSessionCreated = __webpack_require__(12);\n\t\n\t// const createPeerConnection\n\tmodule.exports = function (isInitiator, config) {\n\t  console.log('Creating Peer connection as initiator?', isInitiator, 'config:', config);\n\t  imperio.peerConnection = new RTCPeerConnection(config);\n\t  // send any ice candidates to the other peer\n\t  imperio.peerConnection.onicecandidate = function (event) {\n\t    console.log('icecandidate event:', event);\n\t    if (event.candidate) {\n\t      sendMessage({\n\t        type: 'candidate',\n\t        label: event.candidate.sdpMLineIndex,\n\t        id: event.candidate.sdpMid,\n\t        candidate: event.candidate.candidate\n\t      });\n\t    } else {\n\t      console.log('End of candidates.');\n\t    }\n\t  };\n\t  if (isInitiator) {\n\t    console.log('Creating Data Channel');\n\t    imperio.dataChannel = imperio.peerConnection.createDataChannel('phone data', { ordered: false, maxRetransmits: 0 });\n\t    onDataChannelCreated();\n\t    console.log('Creating an offer');\n\t    imperio.peerConnection.createOffer(onLocalSessionCreated, logError);\n\t  } else {\n\t    imperio.peerConnection.ondatachannel = function (event) {\n\t      console.log('ondatachannel:', event.channel);\n\t      imperio.dataChannel = event.channel;\n\t      onDataChannelCreated();\n\t    };\n\t  }\n\t};\n\t\n\t// module.export = createPeerConnection;\n\n/***/ },\n/* 55 */\n/***/ function(module, exports) {\n\n\t'use strict';\n\t\n\tvar onDataChannelCreated = function onDataChannelCreated() {\n\t  if (imperio.dataChannel) {\n\t    imperio.dataChannel.onopen = function () {\n\t      console.log('CHANNEL opened!!!');\n\t      imperio.connectionType = 'webRTC';\n\t      imperio.dataChannel.onmessage = function (event) {\n\t        var eventObject = JSON.parse(event.data);\n\t        var handlerOptions = ['acceleration', 'gyroscope', 'geoLocation', 'tap', 'pan', 'pinch', 'press', 'presUp', 'rotate', 'swipe', 'data'];\n\t        handlerOptions.forEach(function (handler) {\n\t          if (eventObject.type === handler) {\n\t            if (imperio.callbacks[handler]) imperio.callbacks[handler](eventObject.data);\n\t          }\n\t        });\n\t      };\n\t    };\n\t  }\n\t};\n\t\n\tmodule.exports = onDataChannelCreated;\n\n/***/ },\n/* 56 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar logError = __webpack_require__(7);\n\tvar onLocalSessionCreated = __webpack_require__(12);\n\t\n\tvar signalingMessageCallback = function signalingMessageCallback(message) {\n\t  if (message.type === 'offer') {\n\t    console.log('Got offer. Sending answer to peer.');\n\t    imperio.peerConnection.setRemoteDescription(new RTCSessionDescription(message), function () {}, logError);\n\t    imperio.peerConnection.createAnswer(onLocalSessionCreated, logError);\n\t  } else if (message.type === 'answer') {\n\t    console.log('Got answer.');\n\t    imperio.peerConnection.setRemoteDescription(new RTCSessionDescription(message), function () {}, logError);\n\t  } else if (message.type === 'candidate') {\n\t    console.log('Setting candidate.');\n\t    imperio.peerConnection.addIceCandidate(new RTCIceCandidate({ candidate: message.candidate }));\n\t  } else if (message === 'bye') {\n\t    // TODO: do something when device disconnects?\n\t  }\n\t};\n\t\n\tmodule.exports = signalingMessageCallback;\n\n/***/ },\n/* 57 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tvar createPeerConnection = __webpack_require__(54);\n\tvar signalingMessageCallback = __webpack_require__(56);\n\tvar webRTCSupport = __webpack_require__(14);\n\t\n\tvar webRTCConnect = function webRTCConnect() {\n\t  if (webRTCSupport) {\n\t    imperio.socket.on('created', function (room, clientId) {\n\t      console.log('Created room, ' + room + ' - my client ID is, ' + clientId);\n\t    });\n\t    imperio.socket.on('log', function (array) {\n\t      console.log.apply(console, array);\n\t    });\n\t    imperio.socket.on('joined', function (room, clientId) {\n\t      console.log('This peer has joined room, ' + room + ', with client ID, ' + clientId);\n\t      createPeerConnection(false, imperio.webRTCConfiguration);\n\t    });\n\t    imperio.socket.on('ready', function () {\n\t      console.log('Socket is ready');\n\t      createPeerConnection(true, imperio.webRTCConfiguration);\n\t    });\n\t    imperio.socket.on('message', function (message) {\n\t      console.log('Client received message: ' + message);\n\t      signalingMessageCallback(message);\n\t    });\n\t  } else console.log('WebRTC is not supported, will continue using Sockets.');\n\t};\n\t\n\tmodule.exports = webRTCConnect;\n\n/***/ },\n/* 58 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Expose `Backoff`.\n\t */\n\t\n\tmodule.exports = Backoff;\n\t\n\t/**\n\t * Initialize backoff timer with `opts`.\n\t *\n\t * - `min` initial timeout in milliseconds [100]\n\t * - `max` max timeout [10000]\n\t * - `jitter` [0]\n\t * - `factor` [2]\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction Backoff(opts) {\n\t  opts = opts || {};\n\t  this.ms = opts.min || 100;\n\t  this.max = opts.max || 10000;\n\t  this.factor = opts.factor || 2;\n\t  this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;\n\t  this.attempts = 0;\n\t}\n\t\n\t/**\n\t * Return the backoff duration.\n\t *\n\t * @return {Number}\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.duration = function(){\n\t  var ms = this.ms * Math.pow(this.factor, this.attempts++);\n\t  if (this.jitter) {\n\t    var rand =  Math.random();\n\t    var deviation = Math.floor(rand * this.jitter * ms);\n\t    ms = (Math.floor(rand * 10) & 1) == 0  ? ms - deviation : ms + deviation;\n\t  }\n\t  return Math.min(ms, this.max) | 0;\n\t};\n\t\n\t/**\n\t * Reset the number of attempts.\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.reset = function(){\n\t  this.attempts = 0;\n\t};\n\t\n\t/**\n\t * Set the minimum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMin = function(min){\n\t  this.ms = min;\n\t};\n\t\n\t/**\n\t * Set the maximum duration\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setMax = function(max){\n\t  this.max = max;\n\t};\n\t\n\t/**\n\t * Set the jitter\n\t *\n\t * @api public\n\t */\n\t\n\tBackoff.prototype.setJitter = function(jitter){\n\t  this.jitter = jitter;\n\t};\n\t\n\n\n/***/ },\n/* 59 */\n/***/ function(module, exports) {\n\n\t/*\n\t * base64-arraybuffer\n\t * https://github.com/niklasvh/base64-arraybuffer\n\t *\n\t * Copyright (c) 2012 Niklas von Hertzen\n\t * Licensed under the MIT license.\n\t */\n\t(function(chars){\n\t  \"use strict\";\n\t\n\t  exports.encode = function(arraybuffer) {\n\t    var bytes = new Uint8Array(arraybuffer),\n\t    i, len = bytes.length, base64 = \"\";\n\t\n\t    for (i = 0; i < len; i+=3) {\n\t      base64 += chars[bytes[i] >> 2];\n\t      base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n\t      base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n\t      base64 += chars[bytes[i + 2] & 63];\n\t    }\n\t\n\t    if ((len % 3) === 2) {\n\t      base64 = base64.substring(0, base64.length - 1) + \"=\";\n\t    } else if (len % 3 === 1) {\n\t      base64 = base64.substring(0, base64.length - 2) + \"==\";\n\t    }\n\t\n\t    return base64;\n\t  };\n\t\n\t  exports.decode =  function(base64) {\n\t    var bufferLength = base64.length * 0.75,\n\t    len = base64.length, i, p = 0,\n\t    encoded1, encoded2, encoded3, encoded4;\n\t\n\t    if (base64[base64.length - 1] === \"=\") {\n\t      bufferLength--;\n\t      if (base64[base64.length - 2] === \"=\") {\n\t        bufferLength--;\n\t      }\n\t    }\n\t\n\t    var arraybuffer = new ArrayBuffer(bufferLength),\n\t    bytes = new Uint8Array(arraybuffer);\n\t\n\t    for (i = 0; i < len; i+=4) {\n\t      encoded1 = chars.indexOf(base64[i]);\n\t      encoded2 = chars.indexOf(base64[i+1]);\n\t      encoded3 = chars.indexOf(base64[i+2]);\n\t      encoded4 = chars.indexOf(base64[i+3]);\n\t\n\t      bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n\t      bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n\t      bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n\t    }\n\t\n\t    return arraybuffer;\n\t  };\n\t})(\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\");\n\n\n/***/ },\n/* 60 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Create a blob builder even when vendor prefixes exist\n\t */\n\t\n\tvar BlobBuilder = global.BlobBuilder\n\t  || global.WebKitBlobBuilder\n\t  || global.MSBlobBuilder\n\t  || global.MozBlobBuilder;\n\t\n\t/**\n\t * Check if Blob constructor is supported\n\t */\n\t\n\tvar blobSupported = (function() {\n\t  try {\n\t    var a = new Blob(['hi']);\n\t    return a.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if Blob constructor supports ArrayBufferViews\n\t * Fails in Safari 6, so we need to map to ArrayBuffers there.\n\t */\n\t\n\tvar blobSupportsArrayBufferView = blobSupported && (function() {\n\t  try {\n\t    var b = new Blob([new Uint8Array([1,2])]);\n\t    return b.size === 2;\n\t  } catch(e) {\n\t    return false;\n\t  }\n\t})();\n\t\n\t/**\n\t * Check if BlobBuilder is supported\n\t */\n\t\n\tvar blobBuilderSupported = BlobBuilder\n\t  && BlobBuilder.prototype.append\n\t  && BlobBuilder.prototype.getBlob;\n\t\n\t/**\n\t * Helper function that maps ArrayBufferViews to ArrayBuffers\n\t * Used by BlobBuilder constructor and old browsers that didn't\n\t * support it in the Blob constructor.\n\t */\n\t\n\tfunction mapArrayBufferViews(ary) {\n\t  for (var i = 0; i < ary.length; i++) {\n\t    var chunk = ary[i];\n\t    if (chunk.buffer instanceof ArrayBuffer) {\n\t      var buf = chunk.buffer;\n\t\n\t      // if this is a subarray, make a copy so we only\n\t      // include the subarray region from the underlying buffer\n\t      if (chunk.byteLength !== buf.byteLength) {\n\t        var copy = new Uint8Array(chunk.byteLength);\n\t        copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength));\n\t        buf = copy.buffer;\n\t      }\n\t\n\t      ary[i] = buf;\n\t    }\n\t  }\n\t}\n\t\n\tfunction BlobBuilderConstructor(ary, options) {\n\t  options = options || {};\n\t\n\t  var bb = new BlobBuilder();\n\t  mapArrayBufferViews(ary);\n\t\n\t  for (var i = 0; i < ary.length; i++) {\n\t    bb.append(ary[i]);\n\t  }\n\t\n\t  return (options.type) ? bb.getBlob(options.type) : bb.getBlob();\n\t};\n\t\n\tfunction BlobConstructor(ary, options) {\n\t  mapArrayBufferViews(ary);\n\t  return new Blob(ary, options || {});\n\t};\n\t\n\tmodule.exports = (function() {\n\t  if (blobSupported) {\n\t    return blobSupportsArrayBufferView ? global.Blob : BlobConstructor;\n\t  } else if (blobBuilderSupported) {\n\t    return BlobBuilderConstructor;\n\t  } else {\n\t    return undefined;\n\t  }\n\t})();\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 61 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * This is the common logic for both the Node.js and web browser\n\t * implementations of `debug()`.\n\t *\n\t * Expose `debug()` as the module.\n\t */\n\t\n\texports = module.exports = debug;\n\texports.coerce = coerce;\n\texports.disable = disable;\n\texports.enable = enable;\n\texports.enabled = enabled;\n\texports.humanize = __webpack_require__(72);\n\t\n\t/**\n\t * The currently active debug mode names, and names to skip.\n\t */\n\t\n\texports.names = [];\n\texports.skips = [];\n\t\n\t/**\n\t * Map of special \"%n\" handling functions, for the debug \"format\" argument.\n\t *\n\t * Valid key names are a single, lowercased letter, i.e. \"n\".\n\t */\n\t\n\texports.formatters = {};\n\t\n\t/**\n\t * Previously assigned color.\n\t */\n\t\n\tvar prevColor = 0;\n\t\n\t/**\n\t * Previous log timestamp.\n\t */\n\t\n\tvar prevTime;\n\t\n\t/**\n\t * Select a color.\n\t *\n\t * @return {Number}\n\t * @api private\n\t */\n\t\n\tfunction selectColor() {\n\t  return exports.colors[prevColor++ % exports.colors.length];\n\t}\n\t\n\t/**\n\t * Create a debugger with the given `namespace`.\n\t *\n\t * @param {String} namespace\n\t * @return {Function}\n\t * @api public\n\t */\n\t\n\tfunction debug(namespace) {\n\t\n\t  // define the `disabled` version\n\t  function disabled() {\n\t  }\n\t  disabled.enabled = false;\n\t\n\t  // define the `enabled` version\n\t  function enabled() {\n\t\n\t    var self = enabled;\n\t\n\t    // set `diff` timestamp\n\t    var curr = +new Date();\n\t    var ms = curr - (prevTime || curr);\n\t    self.diff = ms;\n\t    self.prev = prevTime;\n\t    self.curr = curr;\n\t    prevTime = curr;\n\t\n\t    // add the `color` if not set\n\t    if (null == self.useColors) self.useColors = exports.useColors();\n\t    if (null == self.color && self.useColors) self.color = selectColor();\n\t\n\t    var args = Array.prototype.slice.call(arguments);\n\t\n\t    args[0] = exports.coerce(args[0]);\n\t\n\t    if ('string' !== typeof args[0]) {\n\t      // anything else let's inspect with %o\n\t      args = ['%o'].concat(args);\n\t    }\n\t\n\t    // apply any `formatters` transformations\n\t    var index = 0;\n\t    args[0] = args[0].replace(/%([a-z%])/g, function(match, format) {\n\t      // if we encounter an escaped % then don't increase the array index\n\t      if (match === '%%') return match;\n\t      index++;\n\t      var formatter = exports.formatters[format];\n\t      if ('function' === typeof formatter) {\n\t        var val = args[index];\n\t        match = formatter.call(self, val);\n\t\n\t        // now we need to remove `args[index]` since it's inlined in the `format`\n\t        args.splice(index, 1);\n\t        index--;\n\t      }\n\t      return match;\n\t    });\n\t\n\t    if ('function' === typeof exports.formatArgs) {\n\t      args = exports.formatArgs.apply(self, args);\n\t    }\n\t    var logFn = enabled.log || exports.log || console.log.bind(console);\n\t    logFn.apply(self, args);\n\t  }\n\t  enabled.enabled = true;\n\t\n\t  var fn = exports.enabled(namespace) ? enabled : disabled;\n\t\n\t  fn.namespace = namespace;\n\t\n\t  return fn;\n\t}\n\t\n\t/**\n\t * Enables a debug mode by namespaces. This can include modes\n\t * separated by a colon and wildcards.\n\t *\n\t * @param {String} namespaces\n\t * @api public\n\t */\n\t\n\tfunction enable(namespaces) {\n\t  exports.save(namespaces);\n\t\n\t  var split = (namespaces || '').split(/[\\s,]+/);\n\t  var len = split.length;\n\t\n\t  for (var i = 0; i < len; i++) {\n\t    if (!split[i]) continue; // ignore empty strings\n\t    namespaces = split[i].replace(/\\*/g, '.*?');\n\t    if (namespaces[0] === '-') {\n\t      exports.skips.push(new RegExp('^' + namespaces.substr(1) + '$'));\n\t    } else {\n\t      exports.names.push(new RegExp('^' + namespaces + '$'));\n\t    }\n\t  }\n\t}\n\t\n\t/**\n\t * Disable debug output.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction disable() {\n\t  exports.enable('');\n\t}\n\t\n\t/**\n\t * Returns true if the given mode name is enabled, false otherwise.\n\t *\n\t * @param {String} name\n\t * @return {Boolean}\n\t * @api public\n\t */\n\t\n\tfunction enabled(name) {\n\t  var i, len;\n\t  for (i = 0, len = exports.skips.length; i < len; i++) {\n\t    if (exports.skips[i].test(name)) {\n\t      return false;\n\t    }\n\t  }\n\t  for (i = 0, len = exports.names.length; i < len; i++) {\n\t    if (exports.names[i].test(name)) {\n\t      return true;\n\t    }\n\t  }\n\t  return false;\n\t}\n\t\n\t/**\n\t * Coerce `val`.\n\t *\n\t * @param {Mixed} val\n\t * @return {Mixed}\n\t * @api private\n\t */\n\t\n\tfunction coerce(val) {\n\t  if (val instanceof Error) return val.stack || val.message;\n\t  return val;\n\t}\n\n\n/***/ },\n/* 62 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports =  __webpack_require__(63);\n\n\n/***/ },\n/* 63 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\tmodule.exports = __webpack_require__(64);\n\t\n\t/**\n\t * Exports parser\n\t *\n\t * @api public\n\t *\n\t */\n\tmodule.exports.parser = __webpack_require__(3);\n\n\n/***/ },\n/* 64 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar transports = __webpack_require__(16);\n\tvar Emitter = __webpack_require__(4);\n\tvar debug = __webpack_require__(2)('engine.io-client:socket');\n\tvar index = __webpack_require__(18);\n\tvar parser = __webpack_require__(3);\n\tvar parseuri = __webpack_require__(19);\n\tvar parsejson = __webpack_require__(73);\n\tvar parseqs = __webpack_require__(10);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = Socket;\n\t\n\t/**\n\t * Noop function.\n\t *\n\t * @api private\n\t */\n\t\n\tfunction noop(){}\n\t\n\t/**\n\t * Socket constructor.\n\t *\n\t * @param {String|Object} uri or options\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Socket(uri, opts){\n\t  if (!(this instanceof Socket)) return new Socket(uri, opts);\n\t\n\t  opts = opts || {};\n\t\n\t  if (uri && 'object' == typeof uri) {\n\t    opts = uri;\n\t    uri = null;\n\t  }\n\t\n\t  if (uri) {\n\t    uri = parseuri(uri);\n\t    opts.hostname = uri.host;\n\t    opts.secure = uri.protocol == 'https' || uri.protocol == 'wss';\n\t    opts.port = uri.port;\n\t    if (uri.query) opts.query = uri.query;\n\t  } else if (opts.host) {\n\t    opts.hostname = parseuri(opts.host).host;\n\t  }\n\t\n\t  this.secure = null != opts.secure ? opts.secure :\n\t    (global.location && 'https:' == location.protocol);\n\t\n\t  if (opts.hostname && !opts.port) {\n\t    // if no port is specified manually, use the protocol default\n\t    opts.port = this.secure ? '443' : '80';\n\t  }\n\t\n\t  this.agent = opts.agent || false;\n\t  this.hostname = opts.hostname ||\n\t    (global.location ? location.hostname : 'localhost');\n\t  this.port = opts.port || (global.location && location.port ?\n\t       location.port :\n\t       (this.secure ? 443 : 80));\n\t  this.query = opts.query || {};\n\t  if ('string' == typeof this.query) this.query = parseqs.decode(this.query);\n\t  this.upgrade = false !== opts.upgrade;\n\t  this.path = (opts.path || '/engine.io').replace(/\\/$/, '') + '/';\n\t  this.forceJSONP = !!opts.forceJSONP;\n\t  this.jsonp = false !== opts.jsonp;\n\t  this.forceBase64 = !!opts.forceBase64;\n\t  this.enablesXDR = !!opts.enablesXDR;\n\t  this.timestampParam = opts.timestampParam || 't';\n\t  this.timestampRequests = opts.timestampRequests;\n\t  this.transports = opts.transports || ['polling', 'websocket'];\n\t  this.readyState = '';\n\t  this.writeBuffer = [];\n\t  this.policyPort = opts.policyPort || 843;\n\t  this.rememberUpgrade = opts.rememberUpgrade || false;\n\t  this.binaryType = null;\n\t  this.onlyBinaryUpgrades = opts.onlyBinaryUpgrades;\n\t  this.perMessageDeflate = false !== opts.perMessageDeflate ? (opts.perMessageDeflate || {}) : false;\n\t\n\t  if (true === this.perMessageDeflate) this.perMessageDeflate = {};\n\t  if (this.perMessageDeflate && null == this.perMessageDeflate.threshold) {\n\t    this.perMessageDeflate.threshold = 1024;\n\t  }\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx || null;\n\t  this.key = opts.key || null;\n\t  this.passphrase = opts.passphrase || null;\n\t  this.cert = opts.cert || null;\n\t  this.ca = opts.ca || null;\n\t  this.ciphers = opts.ciphers || null;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized === undefined ? true : opts.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  var freeGlobal = typeof global == 'object' && global;\n\t  if (freeGlobal.global === freeGlobal) {\n\t    if (opts.extraHeaders && Object.keys(opts.extraHeaders).length > 0) {\n\t      this.extraHeaders = opts.extraHeaders;\n\t    }\n\t  }\n\t\n\t  this.open();\n\t}\n\t\n\tSocket.priorWebsocketSuccess = false;\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Socket.prototype);\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.protocol = parser.protocol; // this is an int\n\t\n\t/**\n\t * Expose deps for legacy compatibility\n\t * and standalone browser access.\n\t */\n\t\n\tSocket.Socket = Socket;\n\tSocket.Transport = __webpack_require__(8);\n\tSocket.transports = __webpack_require__(16);\n\tSocket.parser = __webpack_require__(3);\n\t\n\t/**\n\t * Creates transport of the given type.\n\t *\n\t * @param {String} transport name\n\t * @return {Transport}\n\t * @api private\n\t */\n\t\n\tSocket.prototype.createTransport = function (name) {\n\t  debug('creating transport \"%s\"', name);\n\t  var query = clone(this.query);\n\t\n\t  // append engine.io protocol identifier\n\t  query.EIO = parser.protocol;\n\t\n\t  // transport name\n\t  query.transport = name;\n\t\n\t  // session id if we already have one\n\t  if (this.id) query.sid = this.id;\n\t\n\t  var transport = new transports[name]({\n\t    agent: this.agent,\n\t    hostname: this.hostname,\n\t    port: this.port,\n\t    secure: this.secure,\n\t    path: this.path,\n\t    query: query,\n\t    forceJSONP: this.forceJSONP,\n\t    jsonp: this.jsonp,\n\t    forceBase64: this.forceBase64,\n\t    enablesXDR: this.enablesXDR,\n\t    timestampRequests: this.timestampRequests,\n\t    timestampParam: this.timestampParam,\n\t    policyPort: this.policyPort,\n\t    socket: this,\n\t    pfx: this.pfx,\n\t    key: this.key,\n\t    passphrase: this.passphrase,\n\t    cert: this.cert,\n\t    ca: this.ca,\n\t    ciphers: this.ciphers,\n\t    rejectUnauthorized: this.rejectUnauthorized,\n\t    perMessageDeflate: this.perMessageDeflate,\n\t    extraHeaders: this.extraHeaders\n\t  });\n\t\n\t  return transport;\n\t};\n\t\n\tfunction clone (obj) {\n\t  var o = {};\n\t  for (var i in obj) {\n\t    if (obj.hasOwnProperty(i)) {\n\t      o[i] = obj[i];\n\t    }\n\t  }\n\t  return o;\n\t}\n\t\n\t/**\n\t * Initializes transport to use and starts probe.\n\t *\n\t * @api private\n\t */\n\tSocket.prototype.open = function () {\n\t  var transport;\n\t  if (this.rememberUpgrade && Socket.priorWebsocketSuccess && this.transports.indexOf('websocket') != -1) {\n\t    transport = 'websocket';\n\t  } else if (0 === this.transports.length) {\n\t    // Emit error on next tick so it can be listened to\n\t    var self = this;\n\t    setTimeout(function() {\n\t      self.emit('error', 'No transports available');\n\t    }, 0);\n\t    return;\n\t  } else {\n\t    transport = this.transports[0];\n\t  }\n\t  this.readyState = 'opening';\n\t\n\t  // Retry with the next transport if the transport is disabled (jsonp: false)\n\t  try {\n\t    transport = this.createTransport(transport);\n\t  } catch (e) {\n\t    this.transports.shift();\n\t    this.open();\n\t    return;\n\t  }\n\t\n\t  transport.open();\n\t  this.setTransport(transport);\n\t};\n\t\n\t/**\n\t * Sets the current transport. Disables the existing one (if any).\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setTransport = function(transport){\n\t  debug('setting transport %s', transport.name);\n\t  var self = this;\n\t\n\t  if (this.transport) {\n\t    debug('clearing existing transport %s', this.transport.name);\n\t    this.transport.removeAllListeners();\n\t  }\n\t\n\t  // set up transport\n\t  this.transport = transport;\n\t\n\t  // set up transport listeners\n\t  transport\n\t  .on('drain', function(){\n\t    self.onDrain();\n\t  })\n\t  .on('packet', function(packet){\n\t    self.onPacket(packet);\n\t  })\n\t  .on('error', function(e){\n\t    self.onError(e);\n\t  })\n\t  .on('close', function(){\n\t    self.onClose('transport close');\n\t  });\n\t};\n\t\n\t/**\n\t * Probes a transport.\n\t *\n\t * @param {String} transport name\n\t * @api private\n\t */\n\t\n\tSocket.prototype.probe = function (name) {\n\t  debug('probing transport \"%s\"', name);\n\t  var transport = this.createTransport(name, { probe: 1 })\n\t    , failed = false\n\t    , self = this;\n\t\n\t  Socket.priorWebsocketSuccess = false;\n\t\n\t  function onTransportOpen(){\n\t    if (self.onlyBinaryUpgrades) {\n\t      var upgradeLosesBinary = !this.supportsBinary && self.transport.supportsBinary;\n\t      failed = failed || upgradeLosesBinary;\n\t    }\n\t    if (failed) return;\n\t\n\t    debug('probe transport \"%s\" opened', name);\n\t    transport.send([{ type: 'ping', data: 'probe' }]);\n\t    transport.once('packet', function (msg) {\n\t      if (failed) return;\n\t      if ('pong' == msg.type && 'probe' == msg.data) {\n\t        debug('probe transport \"%s\" pong', name);\n\t        self.upgrading = true;\n\t        self.emit('upgrading', transport);\n\t        if (!transport) return;\n\t        Socket.priorWebsocketSuccess = 'websocket' == transport.name;\n\t\n\t        debug('pausing current transport \"%s\"', self.transport.name);\n\t        self.transport.pause(function () {\n\t          if (failed) return;\n\t          if ('closed' == self.readyState) return;\n\t          debug('changing transport and sending upgrade packet');\n\t\n\t          cleanup();\n\t\n\t          self.setTransport(transport);\n\t          transport.send([{ type: 'upgrade' }]);\n\t          self.emit('upgrade', transport);\n\t          transport = null;\n\t          self.upgrading = false;\n\t          self.flush();\n\t        });\n\t      } else {\n\t        debug('probe transport \"%s\" failed', name);\n\t        var err = new Error('probe error');\n\t        err.transport = transport.name;\n\t        self.emit('upgradeError', err);\n\t      }\n\t    });\n\t  }\n\t\n\t  function freezeTransport() {\n\t    if (failed) return;\n\t\n\t    // Any callback called by transport should be ignored since now\n\t    failed = true;\n\t\n\t    cleanup();\n\t\n\t    transport.close();\n\t    transport = null;\n\t  }\n\t\n\t  //Handle any error that happens while probing\n\t  function onerror(err) {\n\t    var error = new Error('probe error: ' + err);\n\t    error.transport = transport.name;\n\t\n\t    freezeTransport();\n\t\n\t    debug('probe transport \"%s\" failed because of error: %s', name, err);\n\t\n\t    self.emit('upgradeError', error);\n\t  }\n\t\n\t  function onTransportClose(){\n\t    onerror(\"transport closed\");\n\t  }\n\t\n\t  //When the socket is closed while we're probing\n\t  function onclose(){\n\t    onerror(\"socket closed\");\n\t  }\n\t\n\t  //When the socket is upgraded while we're probing\n\t  function onupgrade(to){\n\t    if (transport && to.name != transport.name) {\n\t      debug('\"%s\" works - aborting \"%s\"', to.name, transport.name);\n\t      freezeTransport();\n\t    }\n\t  }\n\t\n\t  //Remove all listeners on the transport and on self\n\t  function cleanup(){\n\t    transport.removeListener('open', onTransportOpen);\n\t    transport.removeListener('error', onerror);\n\t    transport.removeListener('close', onTransportClose);\n\t    self.removeListener('close', onclose);\n\t    self.removeListener('upgrading', onupgrade);\n\t  }\n\t\n\t  transport.once('open', onTransportOpen);\n\t  transport.once('error', onerror);\n\t  transport.once('close', onTransportClose);\n\t\n\t  this.once('close', onclose);\n\t  this.once('upgrading', onupgrade);\n\t\n\t  transport.open();\n\t\n\t};\n\t\n\t/**\n\t * Called when connection is deemed open.\n\t *\n\t * @api public\n\t */\n\t\n\tSocket.prototype.onOpen = function () {\n\t  debug('socket open');\n\t  this.readyState = 'open';\n\t  Socket.priorWebsocketSuccess = 'websocket' == this.transport.name;\n\t  this.emit('open');\n\t  this.flush();\n\t\n\t  // we check for `readyState` in case an `open`\n\t  // listener already closed the socket\n\t  if ('open' == this.readyState && this.upgrade && this.transport.pause) {\n\t    debug('starting upgrade probes');\n\t    for (var i = 0, l = this.upgrades.length; i < l; i++) {\n\t      this.probe(this.upgrades[i]);\n\t    }\n\t  }\n\t};\n\t\n\t/**\n\t * Handles a packet.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onPacket = function (packet) {\n\t  if ('opening' == this.readyState || 'open' == this.readyState) {\n\t    debug('socket receive: type \"%s\", data \"%s\"', packet.type, packet.data);\n\t\n\t    this.emit('packet', packet);\n\t\n\t    // Socket is live - any packet counts\n\t    this.emit('heartbeat');\n\t\n\t    switch (packet.type) {\n\t      case 'open':\n\t        this.onHandshake(parsejson(packet.data));\n\t        break;\n\t\n\t      case 'pong':\n\t        this.setPing();\n\t        this.emit('pong');\n\t        break;\n\t\n\t      case 'error':\n\t        var err = new Error('server error');\n\t        err.code = packet.data;\n\t        this.onError(err);\n\t        break;\n\t\n\t      case 'message':\n\t        this.emit('data', packet.data);\n\t        this.emit('message', packet.data);\n\t        break;\n\t    }\n\t  } else {\n\t    debug('packet received with socket readyState \"%s\"', this.readyState);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon handshake completion.\n\t *\n\t * @param {Object} handshake obj\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHandshake = function (data) {\n\t  this.emit('handshake', data);\n\t  this.id = data.sid;\n\t  this.transport.query.sid = data.sid;\n\t  this.upgrades = this.filterUpgrades(data.upgrades);\n\t  this.pingInterval = data.pingInterval;\n\t  this.pingTimeout = data.pingTimeout;\n\t  this.onOpen();\n\t  // In case open handler closes socket\n\t  if  ('closed' == this.readyState) return;\n\t  this.setPing();\n\t\n\t  // Prolong liveness of socket on heartbeat\n\t  this.removeListener('heartbeat', this.onHeartbeat);\n\t  this.on('heartbeat', this.onHeartbeat);\n\t};\n\t\n\t/**\n\t * Resets ping timeout.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onHeartbeat = function (timeout) {\n\t  clearTimeout(this.pingTimeoutTimer);\n\t  var self = this;\n\t  self.pingTimeoutTimer = setTimeout(function () {\n\t    if ('closed' == self.readyState) return;\n\t    self.onClose('ping timeout');\n\t  }, timeout || (self.pingInterval + self.pingTimeout));\n\t};\n\t\n\t/**\n\t * Pings server every `this.pingInterval` and expects response\n\t * within `this.pingTimeout` or closes connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.setPing = function () {\n\t  var self = this;\n\t  clearTimeout(self.pingIntervalTimer);\n\t  self.pingIntervalTimer = setTimeout(function () {\n\t    debug('writing ping packet - expecting pong within %sms', self.pingTimeout);\n\t    self.ping();\n\t    self.onHeartbeat(self.pingTimeout);\n\t  }, self.pingInterval);\n\t};\n\t\n\t/**\n\t* Sends a ping packet.\n\t*\n\t* @api private\n\t*/\n\t\n\tSocket.prototype.ping = function () {\n\t  var self = this;\n\t  this.sendPacket('ping', function(){\n\t    self.emit('ping');\n\t  });\n\t};\n\t\n\t/**\n\t * Called on `drain` event\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onDrain = function() {\n\t  this.writeBuffer.splice(0, this.prevBufferLen);\n\t\n\t  // setting prevBufferLen = 0 is very important\n\t  // for example, when upgrading, upgrade packet is sent over,\n\t  // and a nonzero prevBufferLen could cause problems on `drain`\n\t  this.prevBufferLen = 0;\n\t\n\t  if (0 === this.writeBuffer.length) {\n\t    this.emit('drain');\n\t  } else {\n\t    this.flush();\n\t  }\n\t};\n\t\n\t/**\n\t * Flush write buffers.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.flush = function () {\n\t  if ('closed' != this.readyState && this.transport.writable &&\n\t    !this.upgrading && this.writeBuffer.length) {\n\t    debug('flushing %d packets in socket', this.writeBuffer.length);\n\t    this.transport.send(this.writeBuffer);\n\t    // keep track of current length of writeBuffer\n\t    // splice writeBuffer and callbackBuffer on `drain`\n\t    this.prevBufferLen = this.writeBuffer.length;\n\t    this.emit('flush');\n\t  }\n\t};\n\t\n\t/**\n\t * Sends a message.\n\t *\n\t * @param {String} message.\n\t * @param {Function} callback function.\n\t * @param {Object} options.\n\t * @return {Socket} for chaining.\n\t * @api public\n\t */\n\t\n\tSocket.prototype.write =\n\tSocket.prototype.send = function (msg, options, fn) {\n\t  this.sendPacket('message', msg, options, fn);\n\t  return this;\n\t};\n\t\n\t/**\n\t * Sends a packet.\n\t *\n\t * @param {String} packet type.\n\t * @param {String} data.\n\t * @param {Object} options.\n\t * @param {Function} callback function.\n\t * @api private\n\t */\n\t\n\tSocket.prototype.sendPacket = function (type, data, options, fn) {\n\t  if('function' == typeof data) {\n\t    fn = data;\n\t    data = undefined;\n\t  }\n\t\n\t  if ('function' == typeof options) {\n\t    fn = options;\n\t    options = null;\n\t  }\n\t\n\t  if ('closing' == this.readyState || 'closed' == this.readyState) {\n\t    return;\n\t  }\n\t\n\t  options = options || {};\n\t  options.compress = false !== options.compress;\n\t\n\t  var packet = {\n\t    type: type,\n\t    data: data,\n\t    options: options\n\t  };\n\t  this.emit('packetCreate', packet);\n\t  this.writeBuffer.push(packet);\n\t  if (fn) this.once('flush', fn);\n\t  this.flush();\n\t};\n\t\n\t/**\n\t * Closes the connection.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.close = function () {\n\t  if ('opening' == this.readyState || 'open' == this.readyState) {\n\t    this.readyState = 'closing';\n\t\n\t    var self = this;\n\t\n\t    if (this.writeBuffer.length) {\n\t      this.once('drain', function() {\n\t        if (this.upgrading) {\n\t          waitForUpgrade();\n\t        } else {\n\t          close();\n\t        }\n\t      });\n\t    } else if (this.upgrading) {\n\t      waitForUpgrade();\n\t    } else {\n\t      close();\n\t    }\n\t  }\n\t\n\t  function close() {\n\t    self.onClose('forced close');\n\t    debug('socket closing - telling transport to close');\n\t    self.transport.close();\n\t  }\n\t\n\t  function cleanupAndClose() {\n\t    self.removeListener('upgrade', cleanupAndClose);\n\t    self.removeListener('upgradeError', cleanupAndClose);\n\t    close();\n\t  }\n\t\n\t  function waitForUpgrade() {\n\t    // wait for upgrade to finish since we can't send packets while pausing a transport\n\t    self.once('upgrade', cleanupAndClose);\n\t    self.once('upgradeError', cleanupAndClose);\n\t  }\n\t\n\t  return this;\n\t};\n\t\n\t/**\n\t * Called upon transport error\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onError = function (err) {\n\t  debug('socket error %j', err);\n\t  Socket.priorWebsocketSuccess = false;\n\t  this.emit('error', err);\n\t  this.onClose('transport error', err);\n\t};\n\t\n\t/**\n\t * Called upon transport close.\n\t *\n\t * @api private\n\t */\n\t\n\tSocket.prototype.onClose = function (reason, desc) {\n\t  if ('opening' == this.readyState || 'open' == this.readyState || 'closing' == this.readyState) {\n\t    debug('socket close with reason: \"%s\"', reason);\n\t    var self = this;\n\t\n\t    // clear timers\n\t    clearTimeout(this.pingIntervalTimer);\n\t    clearTimeout(this.pingTimeoutTimer);\n\t\n\t    // stop event from firing again for transport\n\t    this.transport.removeAllListeners('close');\n\t\n\t    // ensure transport won't stay open\n\t    this.transport.close();\n\t\n\t    // ignore further transport communication\n\t    this.transport.removeAllListeners();\n\t\n\t    // set ready state\n\t    this.readyState = 'closed';\n\t\n\t    // clear session id\n\t    this.id = null;\n\t\n\t    // emit close event\n\t    this.emit('close', reason, desc);\n\t\n\t    // clean buffers after, so users can still\n\t    // grab the buffers on `close` event\n\t    self.writeBuffer = [];\n\t    self.prevBufferLen = 0;\n\t  }\n\t};\n\t\n\t/**\n\t * Filters upgrades, returning only those matching client transports.\n\t *\n\t * @param {Array} server upgrades\n\t * @api private\n\t *\n\t */\n\t\n\tSocket.prototype.filterUpgrades = function (upgrades) {\n\t  var filteredUpgrades = [];\n\t  for (var i = 0, j = upgrades.length; i<j; i++) {\n\t    if (~index(this.transports, upgrades[i])) filteredUpgrades.push(upgrades[i]);\n\t  }\n\t  return filteredUpgrades;\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 65 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/**\n\t * Module requirements.\n\t */\n\t\n\tvar Polling = __webpack_require__(17);\n\tvar inherit = __webpack_require__(5);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = JSONPPolling;\n\t\n\t/**\n\t * Cached regular expressions.\n\t */\n\t\n\tvar rNewline = /\\n/g;\n\tvar rEscapedNewline = /\\\\n/g;\n\t\n\t/**\n\t * Global JSONP callbacks.\n\t */\n\t\n\tvar callbacks;\n\t\n\t/**\n\t * Callbacks count.\n\t */\n\t\n\tvar index = 0;\n\t\n\t/**\n\t * Noop.\n\t */\n\t\n\tfunction empty () { }\n\t\n\t/**\n\t * JSONP Polling constructor.\n\t *\n\t * @param {Object} opts.\n\t * @api public\n\t */\n\t\n\tfunction JSONPPolling (opts) {\n\t  Polling.call(this, opts);\n\t\n\t  this.query = this.query || {};\n\t\n\t  // define global callbacks array if not present\n\t  // we do this here (lazily) to avoid unneeded global pollution\n\t  if (!callbacks) {\n\t    // we need to consider multiple engines in the same page\n\t    if (!global.___eio) global.___eio = [];\n\t    callbacks = global.___eio;\n\t  }\n\t\n\t  // callback identifier\n\t  this.index = callbacks.length;\n\t\n\t  // add callback to jsonp global\n\t  var self = this;\n\t  callbacks.push(function (msg) {\n\t    self.onData(msg);\n\t  });\n\t\n\t  // append to query string\n\t  this.query.j = this.index;\n\t\n\t  // prevent spurious errors from being emitted when the window is unloaded\n\t  if (global.document && global.addEventListener) {\n\t    global.addEventListener('beforeunload', function () {\n\t      if (self.script) self.script.onerror = empty;\n\t    }, false);\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(JSONPPolling, Polling);\n\t\n\t/*\n\t * JSONP only supports binary as base64 encoded strings\n\t */\n\t\n\tJSONPPolling.prototype.supportsBinary = false;\n\t\n\t/**\n\t * Closes the socket.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doClose = function () {\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  if (this.form) {\n\t    this.form.parentNode.removeChild(this.form);\n\t    this.form = null;\n\t    this.iframe = null;\n\t  }\n\t\n\t  Polling.prototype.doClose.call(this);\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doPoll = function () {\n\t  var self = this;\n\t  var script = document.createElement('script');\n\t\n\t  if (this.script) {\n\t    this.script.parentNode.removeChild(this.script);\n\t    this.script = null;\n\t  }\n\t\n\t  script.async = true;\n\t  script.src = this.uri();\n\t  script.onerror = function(e){\n\t    self.onError('jsonp poll error',e);\n\t  };\n\t\n\t  var insertAt = document.getElementsByTagName('script')[0];\n\t  if (insertAt) {\n\t    insertAt.parentNode.insertBefore(script, insertAt);\n\t  }\n\t  else {\n\t    (document.head || document.body).appendChild(script);\n\t  }\n\t  this.script = script;\n\t\n\t  var isUAgecko = 'undefined' != typeof navigator && /gecko/i.test(navigator.userAgent);\n\t  \n\t  if (isUAgecko) {\n\t    setTimeout(function () {\n\t      var iframe = document.createElement('iframe');\n\t      document.body.appendChild(iframe);\n\t      document.body.removeChild(iframe);\n\t    }, 100);\n\t  }\n\t};\n\t\n\t/**\n\t * Writes with a hidden iframe.\n\t *\n\t * @param {String} data to send\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tJSONPPolling.prototype.doWrite = function (data, fn) {\n\t  var self = this;\n\t\n\t  if (!this.form) {\n\t    var form = document.createElement('form');\n\t    var area = document.createElement('textarea');\n\t    var id = this.iframeId = 'eio_iframe_' + this.index;\n\t    var iframe;\n\t\n\t    form.className = 'socketio';\n\t    form.style.position = 'absolute';\n\t    form.style.top = '-1000px';\n\t    form.style.left = '-1000px';\n\t    form.target = id;\n\t    form.method = 'POST';\n\t    form.setAttribute('accept-charset', 'utf-8');\n\t    area.name = 'd';\n\t    form.appendChild(area);\n\t    document.body.appendChild(form);\n\t\n\t    this.form = form;\n\t    this.area = area;\n\t  }\n\t\n\t  this.form.action = this.uri();\n\t\n\t  function complete () {\n\t    initIframe();\n\t    fn();\n\t  }\n\t\n\t  function initIframe () {\n\t    if (self.iframe) {\n\t      try {\n\t        self.form.removeChild(self.iframe);\n\t      } catch (e) {\n\t        self.onError('jsonp polling iframe removal error', e);\n\t      }\n\t    }\n\t\n\t    try {\n\t      // ie6 dynamic iframes with target=\"\" support (thanks Chris Lambacher)\n\t      var html = '<iframe src=\"javascript:0\" name=\"'+ self.iframeId +'\">';\n\t      iframe = document.createElement(html);\n\t    } catch (e) {\n\t      iframe = document.createElement('iframe');\n\t      iframe.name = self.iframeId;\n\t      iframe.src = 'javascript:0';\n\t    }\n\t\n\t    iframe.id = self.iframeId;\n\t\n\t    self.form.appendChild(iframe);\n\t    self.iframe = iframe;\n\t  }\n\t\n\t  initIframe();\n\t\n\t  // escape \\n to prevent it from being converted into \\r\\n by some UAs\n\t  // double escaping is required for escaped new lines because unescaping of new lines can be done safely on server-side\n\t  data = data.replace(rEscapedNewline, '\\\\\\n');\n\t  this.area.value = data.replace(rNewline, '\\\\n');\n\t\n\t  try {\n\t    this.form.submit();\n\t  } catch(e) {}\n\t\n\t  if (this.iframe.attachEvent) {\n\t    this.iframe.onreadystatechange = function(){\n\t      if (self.iframe.readyState == 'complete') {\n\t        complete();\n\t      }\n\t    };\n\t  } else {\n\t    this.iframe.onload = complete;\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 66 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module requirements.\n\t */\n\t\n\tvar XMLHttpRequest = __webpack_require__(9);\n\tvar Polling = __webpack_require__(17);\n\tvar Emitter = __webpack_require__(4);\n\tvar inherit = __webpack_require__(5);\n\tvar debug = __webpack_require__(2)('engine.io-client:polling-xhr');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = XHR;\n\tmodule.exports.Request = Request;\n\t\n\t/**\n\t * Empty function\n\t */\n\t\n\tfunction empty(){}\n\t\n\t/**\n\t * XHR Polling constructor.\n\t *\n\t * @param {Object} opts\n\t * @api public\n\t */\n\t\n\tfunction XHR(opts){\n\t  Polling.call(this, opts);\n\t\n\t  if (global.location) {\n\t    var isSSL = 'https:' == location.protocol;\n\t    var port = location.port;\n\t\n\t    // some user agents have empty `location.port`\n\t    if (!port) {\n\t      port = isSSL ? 443 : 80;\n\t    }\n\t\n\t    this.xd = opts.hostname != global.location.hostname ||\n\t      port != opts.port;\n\t    this.xs = opts.secure != isSSL;\n\t  } else {\n\t    this.extraHeaders = opts.extraHeaders;\n\t  }\n\t}\n\t\n\t/**\n\t * Inherits from Polling.\n\t */\n\t\n\tinherit(XHR, Polling);\n\t\n\t/**\n\t * XHR supports binary\n\t */\n\t\n\tXHR.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Creates a request.\n\t *\n\t * @param {String} method\n\t * @api private\n\t */\n\t\n\tXHR.prototype.request = function(opts){\n\t  opts = opts || {};\n\t  opts.uri = this.uri();\n\t  opts.xd = this.xd;\n\t  opts.xs = this.xs;\n\t  opts.agent = this.agent || false;\n\t  opts.supportsBinary = this.supportsBinary;\n\t  opts.enablesXDR = this.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  opts.extraHeaders = this.extraHeaders;\n\t\n\t  return new Request(opts);\n\t};\n\t\n\t/**\n\t * Sends data.\n\t *\n\t * @param {String} data to send.\n\t * @param {Function} called upon flush.\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doWrite = function(data, fn){\n\t  var isBinary = typeof data !== 'string' && data !== undefined;\n\t  var req = this.request({ method: 'POST', data: data, isBinary: isBinary });\n\t  var self = this;\n\t  req.on('success', fn);\n\t  req.on('error', function(err){\n\t    self.onError('xhr post error', err);\n\t  });\n\t  this.sendXhr = req;\n\t};\n\t\n\t/**\n\t * Starts a poll cycle.\n\t *\n\t * @api private\n\t */\n\t\n\tXHR.prototype.doPoll = function(){\n\t  debug('xhr poll');\n\t  var req = this.request();\n\t  var self = this;\n\t  req.on('data', function(data){\n\t    self.onData(data);\n\t  });\n\t  req.on('error', function(err){\n\t    self.onError('xhr poll error', err);\n\t  });\n\t  this.pollXhr = req;\n\t};\n\t\n\t/**\n\t * Request constructor\n\t *\n\t * @param {Object} options\n\t * @api public\n\t */\n\t\n\tfunction Request(opts){\n\t  this.method = opts.method || 'GET';\n\t  this.uri = opts.uri;\n\t  this.xd = !!opts.xd;\n\t  this.xs = !!opts.xs;\n\t  this.async = false !== opts.async;\n\t  this.data = undefined != opts.data ? opts.data : null;\n\t  this.agent = opts.agent;\n\t  this.isBinary = opts.isBinary;\n\t  this.supportsBinary = opts.supportsBinary;\n\t  this.enablesXDR = opts.enablesXDR;\n\t\n\t  // SSL options for Node.js client\n\t  this.pfx = opts.pfx;\n\t  this.key = opts.key;\n\t  this.passphrase = opts.passphrase;\n\t  this.cert = opts.cert;\n\t  this.ca = opts.ca;\n\t  this.ciphers = opts.ciphers;\n\t  this.rejectUnauthorized = opts.rejectUnauthorized;\n\t\n\t  // other options for Node.js client\n\t  this.extraHeaders = opts.extraHeaders;\n\t\n\t  this.create();\n\t}\n\t\n\t/**\n\t * Mix in `Emitter`.\n\t */\n\t\n\tEmitter(Request.prototype);\n\t\n\t/**\n\t * Creates the XHR object and sends the request.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.create = function(){\n\t  var opts = { agent: this.agent, xdomain: this.xd, xscheme: this.xs, enablesXDR: this.enablesXDR };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t\n\t  var xhr = this.xhr = new XMLHttpRequest(opts);\n\t  var self = this;\n\t\n\t  try {\n\t    debug('xhr open %s: %s', this.method, this.uri);\n\t    xhr.open(this.method, this.uri, this.async);\n\t    try {\n\t      if (this.extraHeaders) {\n\t        xhr.setDisableHeaderCheck(true);\n\t        for (var i in this.extraHeaders) {\n\t          if (this.extraHeaders.hasOwnProperty(i)) {\n\t            xhr.setRequestHeader(i, this.extraHeaders[i]);\n\t          }\n\t        }\n\t      }\n\t    } catch (e) {}\n\t    if (this.supportsBinary) {\n\t      // This has to be done after open because Firefox is stupid\n\t      // http://stackoverflow.com/questions/13216903/get-binary-data-with-xmlhttprequest-in-a-firefox-extension\n\t      xhr.responseType = 'arraybuffer';\n\t    }\n\t\n\t    if ('POST' == this.method) {\n\t      try {\n\t        if (this.isBinary) {\n\t          xhr.setRequestHeader('Content-type', 'application/octet-stream');\n\t        } else {\n\t          xhr.setRequestHeader('Content-type', 'text/plain;charset=UTF-8');\n\t        }\n\t      } catch (e) {}\n\t    }\n\t\n\t    // ie6 check\n\t    if ('withCredentials' in xhr) {\n\t      xhr.withCredentials = true;\n\t    }\n\t\n\t    if (this.hasXDR()) {\n\t      xhr.onload = function(){\n\t        self.onLoad();\n\t      };\n\t      xhr.onerror = function(){\n\t        self.onError(xhr.responseText);\n\t      };\n\t    } else {\n\t      xhr.onreadystatechange = function(){\n\t        if (4 != xhr.readyState) return;\n\t        if (200 == xhr.status || 1223 == xhr.status) {\n\t          self.onLoad();\n\t        } else {\n\t          // make sure the `error` event handler that's user-set\n\t          // does not throw in the same tick and gets caught here\n\t          setTimeout(function(){\n\t            self.onError(xhr.status);\n\t          }, 0);\n\t        }\n\t      };\n\t    }\n\t\n\t    debug('xhr data %s', this.data);\n\t    xhr.send(this.data);\n\t  } catch (e) {\n\t    // Need to defer since .create() is called directly fhrom the constructor\n\t    // and thus the 'error' event can only be only bound *after* this exception\n\t    // occurs.  Therefore, also, we cannot throw here at all.\n\t    setTimeout(function() {\n\t      self.onError(e);\n\t    }, 0);\n\t    return;\n\t  }\n\t\n\t  if (global.document) {\n\t    this.index = Request.requestsCount++;\n\t    Request.requests[this.index] = this;\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon successful response.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onSuccess = function(){\n\t  this.emit('success');\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Called if we have data.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onData = function(data){\n\t  this.emit('data', data);\n\t  this.onSuccess();\n\t};\n\t\n\t/**\n\t * Called upon error.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onError = function(err){\n\t  this.emit('error', err);\n\t  this.cleanup(true);\n\t};\n\t\n\t/**\n\t * Cleans up house.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.cleanup = function(fromError){\n\t  if ('undefined' == typeof this.xhr || null === this.xhr) {\n\t    return;\n\t  }\n\t  // xmlhttprequest\n\t  if (this.hasXDR()) {\n\t    this.xhr.onload = this.xhr.onerror = empty;\n\t  } else {\n\t    this.xhr.onreadystatechange = empty;\n\t  }\n\t\n\t  if (fromError) {\n\t    try {\n\t      this.xhr.abort();\n\t    } catch(e) {}\n\t  }\n\t\n\t  if (global.document) {\n\t    delete Request.requests[this.index];\n\t  }\n\t\n\t  this.xhr = null;\n\t};\n\t\n\t/**\n\t * Called upon load.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.onLoad = function(){\n\t  var data;\n\t  try {\n\t    var contentType;\n\t    try {\n\t      contentType = this.xhr.getResponseHeader('Content-Type').split(';')[0];\n\t    } catch (e) {}\n\t    if (contentType === 'application/octet-stream') {\n\t      data = this.xhr.response;\n\t    } else {\n\t      if (!this.supportsBinary) {\n\t        data = this.xhr.responseText;\n\t      } else {\n\t        try {\n\t          data = String.fromCharCode.apply(null, new Uint8Array(this.xhr.response));\n\t        } catch (e) {\n\t          var ui8Arr = new Uint8Array(this.xhr.response);\n\t          var dataArray = [];\n\t          for (var idx = 0, length = ui8Arr.length; idx < length; idx++) {\n\t            dataArray.push(ui8Arr[idx]);\n\t          }\n\t\n\t          data = String.fromCharCode.apply(null, dataArray);\n\t        }\n\t      }\n\t    }\n\t  } catch (e) {\n\t    this.onError(e);\n\t  }\n\t  if (null != data) {\n\t    this.onData(data);\n\t  }\n\t};\n\t\n\t/**\n\t * Check if it has XDomainRequest.\n\t *\n\t * @api private\n\t */\n\t\n\tRequest.prototype.hasXDR = function(){\n\t  return 'undefined' !== typeof global.XDomainRequest && !this.xs && this.enablesXDR;\n\t};\n\t\n\t/**\n\t * Aborts the request.\n\t *\n\t * @api public\n\t */\n\t\n\tRequest.prototype.abort = function(){\n\t  this.cleanup();\n\t};\n\t\n\t/**\n\t * Aborts pending requests when unloading the window. This is needed to prevent\n\t * memory leaks (e.g. when using IE) and to ensure that no spurious error is\n\t * emitted.\n\t */\n\t\n\tif (global.document) {\n\t  Request.requestsCount = 0;\n\t  Request.requests = {};\n\t  if (global.attachEvent) {\n\t    global.attachEvent('onunload', unloadHandler);\n\t  } else if (global.addEventListener) {\n\t    global.addEventListener('beforeunload', unloadHandler, false);\n\t  }\n\t}\n\t\n\tfunction unloadHandler() {\n\t  for (var i in Request.requests) {\n\t    if (Request.requests.hasOwnProperty(i)) {\n\t      Request.requests[i].abort();\n\t    }\n\t  }\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 67 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * Module dependencies.\n\t */\n\t\n\tvar Transport = __webpack_require__(8);\n\tvar parser = __webpack_require__(3);\n\tvar parseqs = __webpack_require__(10);\n\tvar inherit = __webpack_require__(5);\n\tvar yeast = __webpack_require__(26);\n\tvar debug = __webpack_require__(2)('engine.io-client:websocket');\n\tvar BrowserWebSocket = global.WebSocket || global.MozWebSocket;\n\t\n\t/**\n\t * Get either the `WebSocket` or `MozWebSocket` globals\n\t * in the browser or try to resolve WebSocket-compatible\n\t * interface exposed by `ws` for Node-like environment.\n\t */\n\t\n\tvar WebSocket = BrowserWebSocket;\n\tif (!WebSocket && typeof window === 'undefined') {\n\t  try {\n\t    WebSocket = __webpack_require__(90);\n\t  } catch (e) { }\n\t}\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = WS;\n\t\n\t/**\n\t * WebSocket transport constructor.\n\t *\n\t * @api {Object} connection options\n\t * @api public\n\t */\n\t\n\tfunction WS(opts){\n\t  var forceBase64 = (opts && opts.forceBase64);\n\t  if (forceBase64) {\n\t    this.supportsBinary = false;\n\t  }\n\t  this.perMessageDeflate = opts.perMessageDeflate;\n\t  Transport.call(this, opts);\n\t}\n\t\n\t/**\n\t * Inherits from Transport.\n\t */\n\t\n\tinherit(WS, Transport);\n\t\n\t/**\n\t * Transport name.\n\t *\n\t * @api public\n\t */\n\t\n\tWS.prototype.name = 'websocket';\n\t\n\t/*\n\t * WebSockets support binary\n\t */\n\t\n\tWS.prototype.supportsBinary = true;\n\t\n\t/**\n\t * Opens socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doOpen = function(){\n\t  if (!this.check()) {\n\t    // let probe timeout\n\t    return;\n\t  }\n\t\n\t  var self = this;\n\t  var uri = this.uri();\n\t  var protocols = void(0);\n\t  var opts = {\n\t    agent: this.agent,\n\t    perMessageDeflate: this.perMessageDeflate\n\t  };\n\t\n\t  // SSL options for Node.js client\n\t  opts.pfx = this.pfx;\n\t  opts.key = this.key;\n\t  opts.passphrase = this.passphrase;\n\t  opts.cert = this.cert;\n\t  opts.ca = this.ca;\n\t  opts.ciphers = this.ciphers;\n\t  opts.rejectUnauthorized = this.rejectUnauthorized;\n\t  if (this.extraHeaders) {\n\t    opts.headers = this.extraHeaders;\n\t  }\n\t\n\t  this.ws = BrowserWebSocket ? new WebSocket(uri) : new WebSocket(uri, protocols, opts);\n\t\n\t  if (this.ws.binaryType === undefined) {\n\t    this.supportsBinary = false;\n\t  }\n\t\n\t  if (this.ws.supports && this.ws.supports.binary) {\n\t    this.supportsBinary = true;\n\t    this.ws.binaryType = 'buffer';\n\t  } else {\n\t    this.ws.binaryType = 'arraybuffer';\n\t  }\n\t\n\t  this.addEventListeners();\n\t};\n\t\n\t/**\n\t * Adds event listeners to the socket\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.addEventListeners = function(){\n\t  var self = this;\n\t\n\t  this.ws.onopen = function(){\n\t    self.onOpen();\n\t  };\n\t  this.ws.onclose = function(){\n\t    self.onClose();\n\t  };\n\t  this.ws.onmessage = function(ev){\n\t    self.onData(ev.data);\n\t  };\n\t  this.ws.onerror = function(e){\n\t    self.onError('websocket error', e);\n\t  };\n\t};\n\t\n\t/**\n\t * Override `onData` to use a timer on iOS.\n\t * See: https://gist.github.com/mloughran/2052006\n\t *\n\t * @api private\n\t */\n\t\n\tif ('undefined' != typeof navigator\n\t  && /iPad|iPhone|iPod/i.test(navigator.userAgent)) {\n\t  WS.prototype.onData = function(data){\n\t    var self = this;\n\t    setTimeout(function(){\n\t      Transport.prototype.onData.call(self, data);\n\t    }, 0);\n\t  };\n\t}\n\t\n\t/**\n\t * Writes data to socket.\n\t *\n\t * @param {Array} array of packets.\n\t * @api private\n\t */\n\t\n\tWS.prototype.write = function(packets){\n\t  var self = this;\n\t  this.writable = false;\n\t\n\t  // encodePacket efficient as it uses WS framing\n\t  // no need for encodePayload\n\t  var total = packets.length;\n\t  for (var i = 0, l = total; i < l; i++) {\n\t    (function(packet) {\n\t      parser.encodePacket(packet, self.supportsBinary, function(data) {\n\t        if (!BrowserWebSocket) {\n\t          // always create a new object (GH-437)\n\t          var opts = {};\n\t          if (packet.options) {\n\t            opts.compress = packet.options.compress;\n\t          }\n\t\n\t          if (self.perMessageDeflate) {\n\t            var len = 'string' == typeof data ? global.Buffer.byteLength(data) : data.length;\n\t            if (len < self.perMessageDeflate.threshold) {\n\t              opts.compress = false;\n\t            }\n\t          }\n\t        }\n\t\n\t        //Sometimes the websocket has already been closed but the browser didn't\n\t        //have a chance of informing us about it yet, in that case send will\n\t        //throw an error\n\t        try {\n\t          if (BrowserWebSocket) {\n\t            // TypeError is thrown when passing the second argument on Safari\n\t            self.ws.send(data);\n\t          } else {\n\t            self.ws.send(data, opts);\n\t          }\n\t        } catch (e){\n\t          debug('websocket closed before onclose event');\n\t        }\n\t\n\t        --total || done();\n\t      });\n\t    })(packets[i]);\n\t  }\n\t\n\t  function done(){\n\t    self.emit('flush');\n\t\n\t    // fake drain\n\t    // defer to next tick to allow Socket to clear writeBuffer\n\t    setTimeout(function(){\n\t      self.writable = true;\n\t      self.emit('drain');\n\t    }, 0);\n\t  }\n\t};\n\t\n\t/**\n\t * Called upon close\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.onClose = function(){\n\t  Transport.prototype.onClose.call(this);\n\t};\n\t\n\t/**\n\t * Closes socket.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.doClose = function(){\n\t  if (typeof this.ws !== 'undefined') {\n\t    this.ws.close();\n\t  }\n\t};\n\t\n\t/**\n\t * Generates uri for connection.\n\t *\n\t * @api private\n\t */\n\t\n\tWS.prototype.uri = function(){\n\t  var query = this.query || {};\n\t  var schema = this.secure ? 'wss' : 'ws';\n\t  var port = '';\n\t\n\t  // avoid port if default for schema\n\t  if (this.port && (('wss' == schema && this.port != 443)\n\t    || ('ws' == schema && this.port != 80))) {\n\t    port = ':' + this.port;\n\t  }\n\t\n\t  // append timestamp to URI\n\t  if (this.timestampRequests) {\n\t    query[this.timestampParam] = yeast();\n\t  }\n\t\n\t  // communicate binary support capabilities\n\t  if (!this.supportsBinary) {\n\t    query.b64 = 1;\n\t  }\n\t\n\t  query = parseqs.encode(query);\n\t\n\t  // prepend ? to query\n\t  if (query.length) {\n\t    query = '?' + query;\n\t  }\n\t\n\t  var ipv6 = this.hostname.indexOf(':') !== -1;\n\t  return schema + '://' + (ipv6 ? '[' + this.hostname + ']' : this.hostname) + port + this.path + query;\n\t};\n\t\n\t/**\n\t * Feature detection for WebSocket.\n\t *\n\t * @return {Boolean} whether this transport is available.\n\t * @api public\n\t */\n\t\n\tWS.prototype.check = function(){\n\t  return !!WebSocket && !('__initialize' in WebSocket && this.name === WS.prototype.name);\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 68 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Gets the keys for an object.\n\t *\n\t * @return {Array} keys\n\t * @api private\n\t */\n\t\n\tmodule.exports = Object.keys || function keys (obj){\n\t  var arr = [];\n\t  var has = Object.prototype.hasOwnProperty;\n\t\n\t  for (var i in obj) {\n\t    if (has.call(obj, i)) {\n\t      arr.push(i);\n\t    }\n\t  }\n\t  return arr;\n\t};\n\n\n/***/ },\n/* 69 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/*\n\t * Module requirements.\n\t */\n\t\n\tvar isArray = __webpack_require__(6);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = hasBinary;\n\t\n\t/**\n\t * Checks for binary data.\n\t *\n\t * Right now only Buffer and ArrayBuffer are supported..\n\t *\n\t * @param {Object} anything\n\t * @api public\n\t */\n\t\n\tfunction hasBinary(data) {\n\t\n\t  function _hasBinary(obj) {\n\t    if (!obj) return false;\n\t\n\t    if ( (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t         (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n\t         (global.Blob && obj instanceof Blob) ||\n\t         (global.File && obj instanceof File)\n\t        ) {\n\t      return true;\n\t    }\n\t\n\t    if (isArray(obj)) {\n\t      for (var i = 0; i < obj.length; i++) {\n\t          if (_hasBinary(obj[i])) {\n\t              return true;\n\t          }\n\t      }\n\t    } else if (obj && 'object' == typeof obj) {\n\t      if (obj.toJSON) {\n\t        obj = obj.toJSON();\n\t      }\n\t\n\t      for (var key in obj) {\n\t        if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n\t          return true;\n\t        }\n\t      }\n\t    }\n\t\n\t    return false;\n\t  }\n\t\n\t  return _hasBinary(data);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 70 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/*\n\t * Module requirements.\n\t */\n\t\n\tvar isArray = __webpack_require__(6);\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = hasBinary;\n\t\n\t/**\n\t * Checks for binary data.\n\t *\n\t * Right now only Buffer and ArrayBuffer are supported..\n\t *\n\t * @param {Object} anything\n\t * @api public\n\t */\n\t\n\tfunction hasBinary(data) {\n\t\n\t  function _hasBinary(obj) {\n\t    if (!obj) return false;\n\t\n\t    if ( (global.Buffer && global.Buffer.isBuffer && global.Buffer.isBuffer(obj)) ||\n\t         (global.ArrayBuffer && obj instanceof ArrayBuffer) ||\n\t         (global.Blob && obj instanceof Blob) ||\n\t         (global.File && obj instanceof File)\n\t        ) {\n\t      return true;\n\t    }\n\t\n\t    if (isArray(obj)) {\n\t      for (var i = 0; i < obj.length; i++) {\n\t          if (_hasBinary(obj[i])) {\n\t              return true;\n\t          }\n\t      }\n\t    } else if (obj && 'object' == typeof obj) {\n\t      // see: https://github.com/Automattic/has-binary/pull/4\n\t      if (obj.toJSON && 'function' == typeof obj.toJSON) {\n\t        obj = obj.toJSON();\n\t      }\n\t\n\t      for (var key in obj) {\n\t        if (Object.prototype.hasOwnProperty.call(obj, key) && _hasBinary(obj[key])) {\n\t          return true;\n\t        }\n\t      }\n\t    }\n\t\n\t    return false;\n\t  }\n\t\n\t  return _hasBinary(data);\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 71 */\n/***/ function(module, exports) {\n\n\t\n\t/**\n\t * Module exports.\n\t *\n\t * Logic borrowed from Modernizr:\n\t *\n\t *   - https://github.com/Modernizr/Modernizr/blob/master/feature-detects/cors.js\n\t */\n\t\n\ttry {\n\t  module.exports = typeof XMLHttpRequest !== 'undefined' &&\n\t    'withCredentials' in new XMLHttpRequest();\n\t} catch (err) {\n\t  // if XMLHttp support is disabled in IE then it will throw\n\t  // when trying to create\n\t  module.exports = false;\n\t}\n\n\n/***/ },\n/* 72 */\n/***/ function(module, exports) {\n\n\t/**\n\t * Helpers.\n\t */\n\t\n\tvar s = 1000;\n\tvar m = s * 60;\n\tvar h = m * 60;\n\tvar d = h * 24;\n\tvar y = d * 365.25;\n\t\n\t/**\n\t * Parse or format the given `val`.\n\t *\n\t * Options:\n\t *\n\t *  - `long` verbose formatting [false]\n\t *\n\t * @param {String|Number} val\n\t * @param {Object} options\n\t * @return {String|Number}\n\t * @api public\n\t */\n\t\n\tmodule.exports = function(val, options){\n\t  options = options || {};\n\t  if ('string' == typeof val) return parse(val);\n\t  return options.long\n\t    ? long(val)\n\t    : short(val);\n\t};\n\t\n\t/**\n\t * Parse the given `str` and return milliseconds.\n\t *\n\t * @param {String} str\n\t * @return {Number}\n\t * @api private\n\t */\n\t\n\tfunction parse(str) {\n\t  str = '' + str;\n\t  if (str.length > 10000) return;\n\t  var match = /^((?:\\d+)?\\.?\\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(str);\n\t  if (!match) return;\n\t  var n = parseFloat(match[1]);\n\t  var type = (match[2] || 'ms').toLowerCase();\n\t  switch (type) {\n\t    case 'years':\n\t    case 'year':\n\t    case 'yrs':\n\t    case 'yr':\n\t    case 'y':\n\t      return n * y;\n\t    case 'days':\n\t    case 'day':\n\t    case 'd':\n\t      return n * d;\n\t    case 'hours':\n\t    case 'hour':\n\t    case 'hrs':\n\t    case 'hr':\n\t    case 'h':\n\t      return n * h;\n\t    case 'minutes':\n\t    case 'minute':\n\t    case 'mins':\n\t    case 'min':\n\t    case 'm':\n\t      return n * m;\n\t    case 'seconds':\n\t    case 'second':\n\t    case 'secs':\n\t    case 'sec':\n\t    case 's':\n\t      return n * s;\n\t    case 'milliseconds':\n\t    case 'millisecond':\n\t    case 'msecs':\n\t    case 'msec':\n\t    case 'ms':\n\t      return n;\n\t  }\n\t}\n\t\n\t/**\n\t * Short format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tfunction short(ms) {\n\t  if (ms >= d) return Math.round(ms / d) + 'd';\n\t  if (ms >= h) return Math.round(ms / h) + 'h';\n\t  if (ms >= m) return Math.round(ms / m) + 'm';\n\t  if (ms >= s) return Math.round(ms / s) + 's';\n\t  return ms + 'ms';\n\t}\n\t\n\t/**\n\t * Long format for `ms`.\n\t *\n\t * @param {Number} ms\n\t * @return {String}\n\t * @api private\n\t */\n\t\n\tfunction long(ms) {\n\t  return plural(ms, d, 'day')\n\t    || plural(ms, h, 'hour')\n\t    || plural(ms, m, 'minute')\n\t    || plural(ms, s, 'second')\n\t    || ms + ' ms';\n\t}\n\t\n\t/**\n\t * Pluralization helper.\n\t */\n\t\n\tfunction plural(ms, n, name) {\n\t  if (ms < n) return;\n\t  if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;\n\t  return Math.ceil(ms / n) + ' ' + name + 's';\n\t}\n\n\n/***/ },\n/* 73 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/**\n\t * JSON parse.\n\t *\n\t * @see Based on jQuery#parseJSON (MIT) and JSON2\n\t * @api private\n\t */\n\t\n\tvar rvalidchars = /^[\\],:{}\\s]*$/;\n\tvar rvalidescape = /\\\\(?:[\"\\\\\\/bfnrt]|u[0-9a-fA-F]{4})/g;\n\tvar rvalidtokens = /\"[^\"\\\\\\n\\r]*\"|true|false|null|-?\\d+(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g;\n\tvar rvalidbraces = /(?:^|:|,)(?:\\s*\\[)+/g;\n\tvar rtrimLeft = /^\\s+/;\n\tvar rtrimRight = /\\s+$/;\n\t\n\tmodule.exports = function parsejson(data) {\n\t  if ('string' != typeof data || !data) {\n\t    return null;\n\t  }\n\t\n\t  data = data.replace(rtrimLeft, '').replace(rtrimRight, '');\n\t\n\t  // Attempt to parse using the native JSON parser first\n\t  if (global.JSON && JSON.parse) {\n\t    return JSON.parse(data);\n\t  }\n\t\n\t  if (rvalidchars.test(data.replace(rvalidescape, '@')\n\t      .replace(rvalidtokens, ']')\n\t      .replace(rvalidbraces, ''))) {\n\t    return (new Function('return ' + data))();\n\t  }\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 74 */\n/***/ function(module, exports) {\n\n\t /* eslint-env node */\n\t'use strict';\n\t\n\t// SDP helpers.\n\tvar SDPUtils = {};\n\t\n\t// Generate an alphanumeric identifier for cname or mids.\n\t// TODO: use UUIDs instead? https://gist.github.com/jed/982883\n\tSDPUtils.generateIdentifier = function() {\n\t  return Math.random().toString(36).substr(2, 10);\n\t};\n\t\n\t// The RTCP CNAME used by all peerconnections from the same JS.\n\tSDPUtils.localCName = SDPUtils.generateIdentifier();\n\t\n\t// Splits SDP into lines, dealing with both CRLF and LF.\n\tSDPUtils.splitLines = function(blob) {\n\t  return blob.trim().split('\\n').map(function(line) {\n\t    return line.trim();\n\t  });\n\t};\n\t// Splits SDP into sessionpart and mediasections. Ensures CRLF.\n\tSDPUtils.splitSections = function(blob) {\n\t  var parts = blob.split('\\nm=');\n\t  return parts.map(function(part, index) {\n\t    return (index > 0 ? 'm=' + part : part).trim() + '\\r\\n';\n\t  });\n\t};\n\t\n\t// Returns lines that start with a certain prefix.\n\tSDPUtils.matchPrefix = function(blob, prefix) {\n\t  return SDPUtils.splitLines(blob).filter(function(line) {\n\t    return line.indexOf(prefix) === 0;\n\t  });\n\t};\n\t\n\t// Parses an ICE candidate line. Sample input:\n\t// candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8\n\t// rport 55996\"\n\tSDPUtils.parseCandidate = function(line) {\n\t  var parts;\n\t  // Parse both variants.\n\t  if (line.indexOf('a=candidate:') === 0) {\n\t    parts = line.substring(12).split(' ');\n\t  } else {\n\t    parts = line.substring(10).split(' ');\n\t  }\n\t\n\t  var candidate = {\n\t    foundation: parts[0],\n\t    component: parts[1],\n\t    protocol: parts[2].toLowerCase(),\n\t    priority: parseInt(parts[3], 10),\n\t    ip: parts[4],\n\t    port: parseInt(parts[5], 10),\n\t    // skip parts[6] == 'typ'\n\t    type: parts[7]\n\t  };\n\t\n\t  for (var i = 8; i < parts.length; i += 2) {\n\t    switch (parts[i]) {\n\t      case 'raddr':\n\t        candidate.relatedAddress = parts[i + 1];\n\t        break;\n\t      case 'rport':\n\t        candidate.relatedPort = parseInt(parts[i + 1], 10);\n\t        break;\n\t      case 'tcptype':\n\t        candidate.tcpType = parts[i + 1];\n\t        break;\n\t      default: // Unknown extensions are silently ignored.\n\t        break;\n\t    }\n\t  }\n\t  return candidate;\n\t};\n\t\n\t// Translates a candidate object into SDP candidate attribute.\n\tSDPUtils.writeCandidate = function(candidate) {\n\t  var sdp = [];\n\t  sdp.push(candidate.foundation);\n\t  sdp.push(candidate.component);\n\t  sdp.push(candidate.protocol.toUpperCase());\n\t  sdp.push(candidate.priority);\n\t  sdp.push(candidate.ip);\n\t  sdp.push(candidate.port);\n\t\n\t  var type = candidate.type;\n\t  sdp.push('typ');\n\t  sdp.push(type);\n\t  if (type !== 'host' && candidate.relatedAddress &&\n\t      candidate.relatedPort) {\n\t    sdp.push('raddr');\n\t    sdp.push(candidate.relatedAddress); // was: relAddr\n\t    sdp.push('rport');\n\t    sdp.push(candidate.relatedPort); // was: relPort\n\t  }\n\t  if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') {\n\t    sdp.push('tcptype');\n\t    sdp.push(candidate.tcpType);\n\t  }\n\t  return 'candidate:' + sdp.join(' ');\n\t};\n\t\n\t// Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input:\n\t// a=rtpmap:111 opus/48000/2\n\tSDPUtils.parseRtpMap = function(line) {\n\t  var parts = line.substr(9).split(' ');\n\t  var parsed = {\n\t    payloadType: parseInt(parts.shift(), 10) // was: id\n\t  };\n\t\n\t  parts = parts[0].split('/');\n\t\n\t  parsed.name = parts[0];\n\t  parsed.clockRate = parseInt(parts[1], 10); // was: clockrate\n\t  // was: channels\n\t  parsed.numChannels = parts.length === 3 ? parseInt(parts[2], 10) : 1;\n\t  return parsed;\n\t};\n\t\n\t// Generate an a=rtpmap line from RTCRtpCodecCapability or\n\t// RTCRtpCodecParameters.\n\tSDPUtils.writeRtpMap = function(codec) {\n\t  var pt = codec.payloadType;\n\t  if (codec.preferredPayloadType !== undefined) {\n\t    pt = codec.preferredPayloadType;\n\t  }\n\t  return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate +\n\t      (codec.numChannels !== 1 ? '/' + codec.numChannels : '') + '\\r\\n';\n\t};\n\t\n\t// Parses an a=extmap line (headerextension from RFC 5285). Sample input:\n\t// a=extmap:2 urn:ietf:params:rtp-hdrext:toffset\n\tSDPUtils.parseExtmap = function(line) {\n\t  var parts = line.substr(9).split(' ');\n\t  return {\n\t    id: parseInt(parts[0], 10),\n\t    uri: parts[1]\n\t  };\n\t};\n\t\n\t// Generates a=extmap line from RTCRtpHeaderExtensionParameters or\n\t// RTCRtpHeaderExtension.\n\tSDPUtils.writeExtmap = function(headerExtension) {\n\t  return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) +\n\t       ' ' + headerExtension.uri + '\\r\\n';\n\t};\n\t\n\t// Parses an ftmp line, returns dictionary. Sample input:\n\t// a=fmtp:96 vbr=on;cng=on\n\t// Also deals with vbr=on; cng=on\n\tSDPUtils.parseFmtp = function(line) {\n\t  var parsed = {};\n\t  var kv;\n\t  var parts = line.substr(line.indexOf(' ') + 1).split(';');\n\t  for (var j = 0; j < parts.length; j++) {\n\t    kv = parts[j].trim().split('=');\n\t    parsed[kv[0].trim()] = kv[1];\n\t  }\n\t  return parsed;\n\t};\n\t\n\t// Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters.\n\tSDPUtils.writeFmtp = function(codec) {\n\t  var line = '';\n\t  var pt = codec.payloadType;\n\t  if (codec.preferredPayloadType !== undefined) {\n\t    pt = codec.preferredPayloadType;\n\t  }\n\t  if (codec.parameters && Object.keys(codec.parameters).length) {\n\t    var params = [];\n\t    Object.keys(codec.parameters).forEach(function(param) {\n\t      params.push(param + '=' + codec.parameters[param]);\n\t    });\n\t    line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\\r\\n';\n\t  }\n\t  return line;\n\t};\n\t\n\t// Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input:\n\t// a=rtcp-fb:98 nack rpsi\n\tSDPUtils.parseRtcpFb = function(line) {\n\t  var parts = line.substr(line.indexOf(' ') + 1).split(' ');\n\t  return {\n\t    type: parts.shift(),\n\t    parameter: parts.join(' ')\n\t  };\n\t};\n\t// Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters.\n\tSDPUtils.writeRtcpFb = function(codec) {\n\t  var lines = '';\n\t  var pt = codec.payloadType;\n\t  if (codec.preferredPayloadType !== undefined) {\n\t    pt = codec.preferredPayloadType;\n\t  }\n\t  if (codec.rtcpFeedback && codec.rtcpFeedback.length) {\n\t    // FIXME: special handling for trr-int?\n\t    codec.rtcpFeedback.forEach(function(fb) {\n\t      lines += 'a=rtcp-fb:' + pt + ' ' + fb.type +\n\t      (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') +\n\t          '\\r\\n';\n\t    });\n\t  }\n\t  return lines;\n\t};\n\t\n\t// Parses an RFC 5576 ssrc media attribute. Sample input:\n\t// a=ssrc:3735928559 cname:something\n\tSDPUtils.parseSsrcMedia = function(line) {\n\t  var sp = line.indexOf(' ');\n\t  var parts = {\n\t    ssrc: parseInt(line.substr(7, sp - 7), 10)\n\t  };\n\t  var colon = line.indexOf(':', sp);\n\t  if (colon > -1) {\n\t    parts.attribute = line.substr(sp + 1, colon - sp - 1);\n\t    parts.value = line.substr(colon + 1);\n\t  } else {\n\t    parts.attribute = line.substr(sp + 1);\n\t  }\n\t  return parts;\n\t};\n\t\n\t// Extracts DTLS parameters from SDP media section or sessionpart.\n\t// FIXME: for consistency with other functions this should only\n\t//   get the fingerprint line as input. See also getIceParameters.\n\tSDPUtils.getDtlsParameters = function(mediaSection, sessionpart) {\n\t  var lines = SDPUtils.splitLines(mediaSection);\n\t  // Search in session part, too.\n\t  lines = lines.concat(SDPUtils.splitLines(sessionpart));\n\t  var fpLine = lines.filter(function(line) {\n\t    return line.indexOf('a=fingerprint:') === 0;\n\t  })[0].substr(14);\n\t  // Note: a=setup line is ignored since we use the 'auto' role.\n\t  var dtlsParameters = {\n\t    role: 'auto',\n\t    fingerprints: [{\n\t      algorithm: fpLine.split(' ')[0],\n\t      value: fpLine.split(' ')[1]\n\t    }]\n\t  };\n\t  return dtlsParameters;\n\t};\n\t\n\t// Serializes DTLS parameters to SDP.\n\tSDPUtils.writeDtlsParameters = function(params, setupType) {\n\t  var sdp = 'a=setup:' + setupType + '\\r\\n';\n\t  params.fingerprints.forEach(function(fp) {\n\t    sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\\r\\n';\n\t  });\n\t  return sdp;\n\t};\n\t// Parses ICE information from SDP media section or sessionpart.\n\t// FIXME: for consistency with other functions this should only\n\t//   get the ice-ufrag and ice-pwd lines as input.\n\tSDPUtils.getIceParameters = function(mediaSection, sessionpart) {\n\t  var lines = SDPUtils.splitLines(mediaSection);\n\t  // Search in session part, too.\n\t  lines = lines.concat(SDPUtils.splitLines(sessionpart));\n\t  var iceParameters = {\n\t    usernameFragment: lines.filter(function(line) {\n\t      return line.indexOf('a=ice-ufrag:') === 0;\n\t    })[0].substr(12),\n\t    password: lines.filter(function(line) {\n\t      return line.indexOf('a=ice-pwd:') === 0;\n\t    })[0].substr(10)\n\t  };\n\t  return iceParameters;\n\t};\n\t\n\t// Serializes ICE parameters to SDP.\n\tSDPUtils.writeIceParameters = function(params) {\n\t  return 'a=ice-ufrag:' + params.usernameFragment + '\\r\\n' +\n\t      'a=ice-pwd:' + params.password + '\\r\\n';\n\t};\n\t\n\t// Parses the SDP media section and returns RTCRtpParameters.\n\tSDPUtils.parseRtpParameters = function(mediaSection) {\n\t  var description = {\n\t    codecs: [],\n\t    headerExtensions: [],\n\t    fecMechanisms: [],\n\t    rtcp: []\n\t  };\n\t  var lines = SDPUtils.splitLines(mediaSection);\n\t  var mline = lines[0].split(' ');\n\t  for (var i = 3; i < mline.length; i++) { // find all codecs from mline[3..]\n\t    var pt = mline[i];\n\t    var rtpmapline = SDPUtils.matchPrefix(\n\t        mediaSection, 'a=rtpmap:' + pt + ' ')[0];\n\t    if (rtpmapline) {\n\t      var codec = SDPUtils.parseRtpMap(rtpmapline);\n\t      var fmtps = SDPUtils.matchPrefix(\n\t          mediaSection, 'a=fmtp:' + pt + ' ');\n\t      // Only the first a=fmtp:<pt> is considered.\n\t      codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {};\n\t      codec.rtcpFeedback = SDPUtils.matchPrefix(\n\t          mediaSection, 'a=rtcp-fb:' + pt + ' ')\n\t        .map(SDPUtils.parseRtcpFb);\n\t      description.codecs.push(codec);\n\t      // parse FEC mechanisms from rtpmap lines.\n\t      switch (codec.name.toUpperCase()) {\n\t        case 'RED':\n\t        case 'ULPFEC':\n\t          description.fecMechanisms.push(codec.name.toUpperCase());\n\t          break;\n\t        default: // only RED and ULPFEC are recognized as FEC mechanisms.\n\t          break;\n\t      }\n\t    }\n\t  }\n\t  SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function(line) {\n\t    description.headerExtensions.push(SDPUtils.parseExtmap(line));\n\t  });\n\t  // FIXME: parse rtcp.\n\t  return description;\n\t};\n\t\n\t// Generates parts of the SDP media section describing the capabilities /\n\t// parameters.\n\tSDPUtils.writeRtpDescription = function(kind, caps) {\n\t  var sdp = '';\n\t\n\t  // Build the mline.\n\t  sdp += 'm=' + kind + ' ';\n\t  sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs.\n\t  sdp += ' UDP/TLS/RTP/SAVPF ';\n\t  sdp += caps.codecs.map(function(codec) {\n\t    if (codec.preferredPayloadType !== undefined) {\n\t      return codec.preferredPayloadType;\n\t    }\n\t    return codec.payloadType;\n\t  }).join(' ') + '\\r\\n';\n\t\n\t  sdp += 'c=IN IP4 0.0.0.0\\r\\n';\n\t  sdp += 'a=rtcp:9 IN IP4 0.0.0.0\\r\\n';\n\t\n\t  // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb.\n\t  caps.codecs.forEach(function(codec) {\n\t    sdp += SDPUtils.writeRtpMap(codec);\n\t    sdp += SDPUtils.writeFmtp(codec);\n\t    sdp += SDPUtils.writeRtcpFb(codec);\n\t  });\n\t  // FIXME: add headerExtensions, fecMechanismş and rtcp.\n\t  sdp += 'a=rtcp-mux\\r\\n';\n\t  return sdp;\n\t};\n\t\n\t// Parses the SDP media section and returns an array of\n\t// RTCRtpEncodingParameters.\n\tSDPUtils.parseRtpEncodingParameters = function(mediaSection) {\n\t  var encodingParameters = [];\n\t  var description = SDPUtils.parseRtpParameters(mediaSection);\n\t  var hasRed = description.fecMechanisms.indexOf('RED') !== -1;\n\t  var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1;\n\t\n\t  // filter a=ssrc:... cname:, ignore PlanB-msid\n\t  var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')\n\t  .map(function(line) {\n\t    return SDPUtils.parseSsrcMedia(line);\n\t  })\n\t  .filter(function(parts) {\n\t    return parts.attribute === 'cname';\n\t  });\n\t  var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc;\n\t  var secondarySsrc;\n\t\n\t  var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID')\n\t  .map(function(line) {\n\t    var parts = line.split(' ');\n\t    parts.shift();\n\t    return parts.map(function(part) {\n\t      return parseInt(part, 10);\n\t    });\n\t  });\n\t  if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) {\n\t    secondarySsrc = flows[0][1];\n\t  }\n\t\n\t  description.codecs.forEach(function(codec) {\n\t    if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) {\n\t      var encParam = {\n\t        ssrc: primarySsrc,\n\t        codecPayloadType: parseInt(codec.parameters.apt, 10),\n\t        rtx: {\n\t          payloadType: codec.payloadType,\n\t          ssrc: secondarySsrc\n\t        }\n\t      };\n\t      encodingParameters.push(encParam);\n\t      if (hasRed) {\n\t        encParam = JSON.parse(JSON.stringify(encParam));\n\t        encParam.fec = {\n\t          ssrc: secondarySsrc,\n\t          mechanism: hasUlpfec ? 'red+ulpfec' : 'red'\n\t        };\n\t        encodingParameters.push(encParam);\n\t      }\n\t    }\n\t  });\n\t  if (encodingParameters.length === 0 && primarySsrc) {\n\t    encodingParameters.push({\n\t      ssrc: primarySsrc\n\t    });\n\t  }\n\t\n\t  // we support both b=AS and b=TIAS but interpret AS as TIAS.\n\t  var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b=');\n\t  if (bandwidth.length) {\n\t    if (bandwidth[0].indexOf('b=TIAS:') === 0) {\n\t      bandwidth = parseInt(bandwidth[0].substr(7), 10);\n\t    } else if (bandwidth[0].indexOf('b=AS:') === 0) {\n\t      bandwidth = parseInt(bandwidth[0].substr(5), 10);\n\t    }\n\t    encodingParameters.forEach(function(params) {\n\t      params.maxBitrate = bandwidth;\n\t    });\n\t  }\n\t  return encodingParameters;\n\t};\n\t\n\tSDPUtils.writeSessionBoilerplate = function() {\n\t  // FIXME: sess-id should be an NTP timestamp.\n\t  return 'v=0\\r\\n' +\n\t      'o=thisisadapterortc 8169639915646943137 2 IN IP4 127.0.0.1\\r\\n' +\n\t      's=-\\r\\n' +\n\t      't=0 0\\r\\n';\n\t};\n\t\n\tSDPUtils.writeMediaSection = function(transceiver, caps, type, stream) {\n\t  var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps);\n\t\n\t  // Map ICE parameters (ufrag, pwd) to SDP.\n\t  sdp += SDPUtils.writeIceParameters(\n\t      transceiver.iceGatherer.getLocalParameters());\n\t\n\t  // Map DTLS parameters to SDP.\n\t  sdp += SDPUtils.writeDtlsParameters(\n\t      transceiver.dtlsTransport.getLocalParameters(),\n\t      type === 'offer' ? 'actpass' : 'active');\n\t\n\t  sdp += 'a=mid:' + transceiver.mid + '\\r\\n';\n\t\n\t  if (transceiver.rtpSender && transceiver.rtpReceiver) {\n\t    sdp += 'a=sendrecv\\r\\n';\n\t  } else if (transceiver.rtpSender) {\n\t    sdp += 'a=sendonly\\r\\n';\n\t  } else if (transceiver.rtpReceiver) {\n\t    sdp += 'a=recvonly\\r\\n';\n\t  } else {\n\t    sdp += 'a=inactive\\r\\n';\n\t  }\n\t\n\t  // FIXME: for RTX there might be multiple SSRCs. Not implemented in Edge yet.\n\t  if (transceiver.rtpSender) {\n\t    var msid = 'msid:' + stream.id + ' ' +\n\t        transceiver.rtpSender.track.id + '\\r\\n';\n\t    sdp += 'a=' + msid;\n\t    sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +\n\t        ' ' + msid;\n\t  }\n\t  // FIXME: this should be written by writeRtpDescription.\n\t  sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc +\n\t      ' cname:' + SDPUtils.localCName + '\\r\\n';\n\t  return sdp;\n\t};\n\t\n\t// Gets the direction from the mediaSection or the sessionpart.\n\tSDPUtils.getDirection = function(mediaSection, sessionpart) {\n\t  // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv.\n\t  var lines = SDPUtils.splitLines(mediaSection);\n\t  for (var i = 0; i < lines.length; i++) {\n\t    switch (lines[i]) {\n\t      case 'a=sendrecv':\n\t      case 'a=sendonly':\n\t      case 'a=recvonly':\n\t      case 'a=inactive':\n\t        return lines[i].substr(2);\n\t      default:\n\t        // FIXME: What should happen here?\n\t    }\n\t  }\n\t  if (sessionpart) {\n\t    return SDPUtils.getDirection(sessionpart);\n\t  }\n\t  return 'sendrecv';\n\t};\n\t\n\t// Expose public methods.\n\tmodule.exports = SDPUtils;\n\n\n/***/ },\n/* 75 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar url = __webpack_require__(76);\n\tvar parser = __webpack_require__(11);\n\tvar Manager = __webpack_require__(20);\n\tvar debug = __webpack_require__(2)('socket.io-client');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = exports = lookup;\n\t\n\t/**\n\t * Managers cache.\n\t */\n\t\n\tvar cache = exports.managers = {};\n\t\n\t/**\n\t * Looks up an existing `Manager` for multiplexing.\n\t * If the user summons:\n\t *\n\t *   `io('http://localhost/a');`\n\t *   `io('http://localhost/b');`\n\t *\n\t * We reuse the existing instance based on same scheme/port/host,\n\t * and we initialize sockets for each namespace.\n\t *\n\t * @api public\n\t */\n\t\n\tfunction lookup(uri, opts) {\n\t  if (typeof uri == 'object') {\n\t    opts = uri;\n\t    uri = undefined;\n\t  }\n\t\n\t  opts = opts || {};\n\t\n\t  var parsed = url(uri);\n\t  var source = parsed.source;\n\t  var id = parsed.id;\n\t  var path = parsed.path;\n\t  var sameNamespace = cache[id] && path in cache[id].nsps;\n\t  var newConnection = opts.forceNew || opts['force new connection'] ||\n\t                      false === opts.multiplex || sameNamespace;\n\t\n\t  var io;\n\t\n\t  if (newConnection) {\n\t    debug('ignoring socket cache for %s', source);\n\t    io = Manager(source, opts);\n\t  } else {\n\t    if (!cache[id]) {\n\t      debug('new io instance for %s', source);\n\t      cache[id] = Manager(source, opts);\n\t    }\n\t    io = cache[id];\n\t  }\n\t\n\t  return io.socket(parsed.path);\n\t}\n\t\n\t/**\n\t * Protocol version.\n\t *\n\t * @api public\n\t */\n\t\n\texports.protocol = parser.protocol;\n\t\n\t/**\n\t * `connect`.\n\t *\n\t * @param {String} uri\n\t * @api public\n\t */\n\t\n\texports.connect = lookup;\n\t\n\t/**\n\t * Expose constructors for standalone build.\n\t *\n\t * @api public\n\t */\n\t\n\texports.Manager = __webpack_require__(20);\n\texports.Socket = __webpack_require__(22);\n\n\n/***/ },\n/* 76 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {\n\t/**\n\t * Module dependencies.\n\t */\n\t\n\tvar parseuri = __webpack_require__(19);\n\tvar debug = __webpack_require__(2)('socket.io-client:url');\n\t\n\t/**\n\t * Module exports.\n\t */\n\t\n\tmodule.exports = url;\n\t\n\t/**\n\t * URL parser.\n\t *\n\t * @param {String} url\n\t * @param {Object} An object meant to mimic window.location.\n\t *                 Defaults to window.location.\n\t * @api public\n\t */\n\t\n\tfunction url(uri, loc){\n\t  var obj = uri;\n\t\n\t  // default to window.location\n\t  var loc = loc || global.location;\n\t  if (null == uri) uri = loc.protocol + '//' + loc.host;\n\t\n\t  // relative path support\n\t  if ('string' == typeof uri) {\n\t    if ('/' == uri.charAt(0)) {\n\t      if ('/' == uri.charAt(1)) {\n\t        uri = loc.protocol + uri;\n\t      } else {\n\t        uri = loc.host + uri;\n\t      }\n\t    }\n\t\n\t    if (!/^(https?|wss?):\\/\\//.test(uri)) {\n\t      debug('protocol-less url %s', uri);\n\t      if ('undefined' != typeof loc) {\n\t        uri = loc.protocol + '//' + uri;\n\t      } else {\n\t        uri = 'https://' + uri;\n\t      }\n\t    }\n\t\n\t    // parse\n\t    debug('parse %s', uri);\n\t    obj = parseuri(uri);\n\t  }\n\t\n\t  // make sure we treat `localhost:80` and `localhost` equally\n\t  if (!obj.port) {\n\t    if (/^(http|ws)$/.test(obj.protocol)) {\n\t      obj.port = '80';\n\t    }\n\t    else if (/^(http|ws)s$/.test(obj.protocol)) {\n\t      obj.port = '443';\n\t    }\n\t  }\n\t\n\t  obj.path = obj.path || '/';\n\t\n\t  var ipv6 = obj.host.indexOf(':') !== -1;\n\t  var host = ipv6 ? '[' + obj.host + ']' : obj.host;\n\t\n\t  // define unique id\n\t  obj.id = obj.protocol + '://' + host + ':' + obj.port;\n\t  // define href\n\t  obj.href = obj.protocol + '://' + host + (loc && loc.port == obj.port ? '' : (':' + obj.port));\n\t\n\t  return obj;\n\t}\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 77 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(global) {/*global Blob,File*/\n\t\n\t/**\n\t * Module requirements\n\t */\n\t\n\tvar isArray = __webpack_require__(6);\n\tvar isBuf = __webpack_require__(24);\n\t\n\t/**\n\t * Replaces every Buffer | ArrayBuffer in packet with a numbered placeholder.\n\t * Anything with blobs or files should be fed through removeBlobs before coming\n\t * here.\n\t *\n\t * @param {Object} packet - socket.io event packet\n\t * @return {Object} with deconstructed packet and list of buffers\n\t * @api public\n\t */\n\t\n\texports.deconstructPacket = function(packet){\n\t  var buffers = [];\n\t  var packetData = packet.data;\n\t\n\t  function _deconstructPacket(data) {\n\t    if (!data) return data;\n\t\n\t    if (isBuf(data)) {\n\t      var placeholder = { _placeholder: true, num: buffers.length };\n\t      buffers.push(data);\n\t      return placeholder;\n\t    } else if (isArray(data)) {\n\t      var newData = new Array(data.length);\n\t      for (var i = 0; i < data.length; i++) {\n\t        newData[i] = _deconstructPacket(data[i]);\n\t      }\n\t      return newData;\n\t    } else if ('object' == typeof data && !(data instanceof Date)) {\n\t      var newData = {};\n\t      for (var key in data) {\n\t        newData[key] = _deconstructPacket(data[key]);\n\t      }\n\t      return newData;\n\t    }\n\t    return data;\n\t  }\n\t\n\t  var pack = packet;\n\t  pack.data = _deconstructPacket(packetData);\n\t  pack.attachments = buffers.length; // number of binary 'attachments'\n\t  return {packet: pack, buffers: buffers};\n\t};\n\t\n\t/**\n\t * Reconstructs a binary packet from its placeholder packet and buffers\n\t *\n\t * @param {Object} packet - event packet with placeholders\n\t * @param {Array} buffers - binary buffers to put in placeholder positions\n\t * @return {Object} reconstructed packet\n\t * @api public\n\t */\n\t\n\texports.reconstructPacket = function(packet, buffers) {\n\t  var curPlaceHolder = 0;\n\t\n\t  function _reconstructPacket(data) {\n\t    if (data && data._placeholder) {\n\t      var buf = buffers[data.num]; // appropriate buffer (should be natural order anyway)\n\t      return buf;\n\t    } else if (isArray(data)) {\n\t      for (var i = 0; i < data.length; i++) {\n\t        data[i] = _reconstructPacket(data[i]);\n\t      }\n\t      return data;\n\t    } else if (data && 'object' == typeof data) {\n\t      for (var key in data) {\n\t        data[key] = _reconstructPacket(data[key]);\n\t      }\n\t      return data;\n\t    }\n\t    return data;\n\t  }\n\t\n\t  packet.data = _reconstructPacket(packet.data);\n\t  packet.attachments = undefined; // no longer useful\n\t  return packet;\n\t};\n\t\n\t/**\n\t * Asynchronously removes Blobs or Files from data via\n\t * FileReader's readAsArrayBuffer method. Used before encoding\n\t * data as msgpack. Calls callback with the blobless data.\n\t *\n\t * @param {Object} data\n\t * @param {Function} callback\n\t * @api private\n\t */\n\t\n\texports.removeBlobs = function(data, callback) {\n\t  function _removeBlobs(obj, curKey, containingObject) {\n\t    if (!obj) return obj;\n\t\n\t    // convert any blob\n\t    if ((global.Blob && obj instanceof Blob) ||\n\t        (global.File && obj instanceof File)) {\n\t      pendingBlobs++;\n\t\n\t      // async filereader\n\t      var fileReader = new FileReader();\n\t      fileReader.onload = function() { // this.result == arraybuffer\n\t        if (containingObject) {\n\t          containingObject[curKey] = this.result;\n\t        }\n\t        else {\n\t          bloblessData = this.result;\n\t        }\n\t\n\t        // if nothing pending its callback time\n\t        if(! --pendingBlobs) {\n\t          callback(bloblessData);\n\t        }\n\t      };\n\t\n\t      fileReader.readAsArrayBuffer(obj); // blob -> arraybuffer\n\t    } else if (isArray(obj)) { // handle array\n\t      for (var i = 0; i < obj.length; i++) {\n\t        _removeBlobs(obj[i], i, obj);\n\t      }\n\t    } else if (obj && 'object' == typeof obj && !isBuf(obj)) { // and object\n\t      for (var key in obj) {\n\t        _removeBlobs(obj[key], key, obj);\n\t      }\n\t    }\n\t  }\n\t\n\t  var pendingBlobs = 0;\n\t  var bloblessData = data;\n\t  _removeBlobs(bloblessData);\n\t  if (!pendingBlobs) {\n\t    callback(bloblessData);\n\t  }\n\t};\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, (function() { return this; }())))\n\n/***/ },\n/* 78 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! JSON v3.3.2 | http://bestiejs.github.io/json3 | Copyright 2012-2014, Kit Cambridge | http://kit.mit-license.org */\n\t;(function () {\n\t  // Detect the `define` function exposed by asynchronous module loaders. The\n\t  // strict `define` check is necessary for compatibility with `r.js`.\n\t  var isLoader = \"function\" === \"function\" && __webpack_require__(81);\n\t\n\t  // A set of types used to distinguish objects from primitives.\n\t  var objectTypes = {\n\t    \"function\": true,\n\t    \"object\": true\n\t  };\n\t\n\t  // Detect the `exports` object exposed by CommonJS implementations.\n\t  var freeExports = objectTypes[typeof exports] && exports && !exports.nodeType && exports;\n\t\n\t  // Use the `global` object exposed by Node (including Browserify via\n\t  // `insert-module-globals`), Narwhal, and Ringo as the default context,\n\t  // and the `window` object in browsers. Rhino exports a `global` function\n\t  // instead.\n\t  var root = objectTypes[typeof window] && window || this,\n\t      freeGlobal = freeExports && objectTypes[typeof module] && module && !module.nodeType && typeof global == \"object\" && global;\n\t\n\t  if (freeGlobal && (freeGlobal[\"global\"] === freeGlobal || freeGlobal[\"window\"] === freeGlobal || freeGlobal[\"self\"] === freeGlobal)) {\n\t    root = freeGlobal;\n\t  }\n\t\n\t  // Public: Initializes JSON 3 using the given `context` object, attaching the\n\t  // `stringify` and `parse` functions to the specified `exports` object.\n\t  function runInContext(context, exports) {\n\t    context || (context = root[\"Object\"]());\n\t    exports || (exports = root[\"Object\"]());\n\t\n\t    // Native constructor aliases.\n\t    var Number = context[\"Number\"] || root[\"Number\"],\n\t        String = context[\"String\"] || root[\"String\"],\n\t        Object = context[\"Object\"] || root[\"Object\"],\n\t        Date = context[\"Date\"] || root[\"Date\"],\n\t        SyntaxError = context[\"SyntaxError\"] || root[\"SyntaxError\"],\n\t        TypeError = context[\"TypeError\"] || root[\"TypeError\"],\n\t        Math = context[\"Math\"] || root[\"Math\"],\n\t        nativeJSON = context[\"JSON\"] || root[\"JSON\"];\n\t\n\t    // Delegate to the native `stringify` and `parse` implementations.\n\t    if (typeof nativeJSON == \"object\" && nativeJSON) {\n\t      exports.stringify = nativeJSON.stringify;\n\t      exports.parse = nativeJSON.parse;\n\t    }\n\t\n\t    // Convenience aliases.\n\t    var objectProto = Object.prototype,\n\t        getClass = objectProto.toString,\n\t        isProperty, forEach, undef;\n\t\n\t    // Test the `Date#getUTC*` methods. Based on work by @Yaffle.\n\t    var isExtended = new Date(-3509827334573292);\n\t    try {\n\t      // The `getUTCFullYear`, `Month`, and `Date` methods return nonsensical\n\t      // results for certain dates in Opera >= 10.53.\n\t      isExtended = isExtended.getUTCFullYear() == -109252 && isExtended.getUTCMonth() === 0 && isExtended.getUTCDate() === 1 &&\n\t        // Safari < 2.0.2 stores the internal millisecond time value correctly,\n\t        // but clips the values returned by the date methods to the range of\n\t        // signed 32-bit integers ([-2 ** 31, 2 ** 31 - 1]).\n\t        isExtended.getUTCHours() == 10 && isExtended.getUTCMinutes() == 37 && isExtended.getUTCSeconds() == 6 && isExtended.getUTCMilliseconds() == 708;\n\t    } catch (exception) {}\n\t\n\t    // Internal: Determines whether the native `JSON.stringify` and `parse`\n\t    // implementations are spec-compliant. Based on work by Ken Snyder.\n\t    function has(name) {\n\t      if (has[name] !== undef) {\n\t        // Return cached feature test result.\n\t        return has[name];\n\t      }\n\t      var isSupported;\n\t      if (name == \"bug-string-char-index\") {\n\t        // IE <= 7 doesn't support accessing string characters using square\n\t        // bracket notation. IE 8 only supports this for primitives.\n\t        isSupported = \"a\"[0] != \"a\";\n\t      } else if (name == \"json\") {\n\t        // Indicates whether both `JSON.stringify` and `JSON.parse` are\n\t        // supported.\n\t        isSupported = has(\"json-stringify\") && has(\"json-parse\");\n\t      } else {\n\t        var value, serialized = '{\"a\":[1,true,false,null,\"\\\\u0000\\\\b\\\\n\\\\f\\\\r\\\\t\"]}';\n\t        // Test `JSON.stringify`.\n\t        if (name == \"json-stringify\") {\n\t          var stringify = exports.stringify, stringifySupported = typeof stringify == \"function\" && isExtended;\n\t          if (stringifySupported) {\n\t            // A test function object with a custom `toJSON` method.\n\t            (value = function () {\n\t              return 1;\n\t            }).toJSON = value;\n\t            try {\n\t              stringifySupported =\n\t                // Firefox 3.1b1 and b2 serialize string, number, and boolean\n\t                // primitives as object literals.\n\t                stringify(0) === \"0\" &&\n\t                // FF 3.1b1, b2, and JSON 2 serialize wrapped primitives as object\n\t                // literals.\n\t                stringify(new Number()) === \"0\" &&\n\t                stringify(new String()) == '\"\"' &&\n\t                // FF 3.1b1, 2 throw an error if the value is `null`, `undefined`, or\n\t                // does not define a canonical JSON representation (this applies to\n\t                // objects with `toJSON` properties as well, *unless* they are nested\n\t                // within an object or array).\n\t                stringify(getClass) === undef &&\n\t                // IE 8 serializes `undefined` as `\"undefined\"`. Safari <= 5.1.7 and\n\t                // FF 3.1b3 pass this test.\n\t                stringify(undef) === undef &&\n\t                // Safari <= 5.1.7 and FF 3.1b3 throw `Error`s and `TypeError`s,\n\t                // respectively, if the value is omitted entirely.\n\t                stringify() === undef &&\n\t                // FF 3.1b1, 2 throw an error if the given value is not a number,\n\t                // string, array, object, Boolean, or `null` literal. This applies to\n\t                // objects with custom `toJSON` methods as well, unless they are nested\n\t                // inside object or array literals. YUI 3.0.0b1 ignores custom `toJSON`\n\t                // methods entirely.\n\t                stringify(value) === \"1\" &&\n\t                stringify([value]) == \"[1]\" &&\n\t                // Prototype <= 1.6.1 serializes `[undefined]` as `\"[]\"` instead of\n\t                // `\"[null]\"`.\n\t                stringify([undef]) == \"[null]\" &&\n\t                // YUI 3.0.0b1 fails to serialize `null` literals.\n\t                stringify(null) == \"null\" &&\n\t                // FF 3.1b1, 2 halts serialization if an array contains a function:\n\t                // `[1, true, getClass, 1]` serializes as \"[1,true,],\". FF 3.1b3\n\t                // elides non-JSON values from objects and arrays, unless they\n\t                // define custom `toJSON` methods.\n\t                stringify([undef, getClass, null]) == \"[null,null,null]\" &&\n\t                // Simple serialization test. FF 3.1b1 uses Unicode escape sequences\n\t                // where character escape codes are expected (e.g., `\\b` => `\\u0008`).\n\t                stringify({ \"a\": [value, true, false, null, \"\\x00\\b\\n\\f\\r\\t\"] }) == serialized &&\n\t                // FF 3.1b1 and b2 ignore the `filter` and `width` arguments.\n\t                stringify(null, value) === \"1\" &&\n\t                stringify([1, 2], null, 1) == \"[\\n 1,\\n 2\\n]\" &&\n\t                // JSON 2, Prototype <= 1.7, and older WebKit builds incorrectly\n\t                // serialize extended years.\n\t                stringify(new Date(-8.64e15)) == '\"-271821-04-20T00:00:00.000Z\"' &&\n\t                // The milliseconds are optional in ES 5, but required in 5.1.\n\t                stringify(new Date(8.64e15)) == '\"+275760-09-13T00:00:00.000Z\"' &&\n\t                // Firefox <= 11.0 incorrectly serializes years prior to 0 as negative\n\t                // four-digit years instead of six-digit years. Credits: @Yaffle.\n\t                stringify(new Date(-621987552e5)) == '\"-000001-01-01T00:00:00.000Z\"' &&\n\t                // Safari <= 5.1.5 and Opera >= 10.53 incorrectly serialize millisecond\n\t                // values less than 1000. Credits: @Yaffle.\n\t                stringify(new Date(-1)) == '\"1969-12-31T23:59:59.999Z\"';\n\t            } catch (exception) {\n\t              stringifySupported = false;\n\t            }\n\t          }\n\t          isSupported = stringifySupported;\n\t        }\n\t        // Test `JSON.parse`.\n\t        if (name == \"json-parse\") {\n\t          var parse = exports.parse;\n\t          if (typeof parse == \"function\") {\n\t            try {\n\t              // FF 3.1b1, b2 will throw an exception if a bare literal is provided.\n\t              // Conforming implementations should also coerce the initial argument to\n\t              // a string prior to parsing.\n\t              if (parse(\"0\") === 0 && !parse(false)) {\n\t                // Simple parsing test.\n\t                value = parse(serialized);\n\t                var parseSupported = value[\"a\"].length == 5 && value[\"a\"][0] === 1;\n\t                if (parseSupported) {\n\t                  try {\n\t                    // Safari <= 5.1.2 and FF 3.1b1 allow unescaped tabs in strings.\n\t                    parseSupported = !parse('\"\\t\"');\n\t                  } catch (exception) {}\n\t                  if (parseSupported) {\n\t                    try {\n\t                      // FF 4.0 and 4.0.1 allow leading `+` signs and leading\n\t                      // decimal points. FF 4.0, 4.0.1, and IE 9-10 also allow\n\t                      // certain octal literals.\n\t                      parseSupported = parse(\"01\") !== 1;\n\t                    } catch (exception) {}\n\t                  }\n\t                  if (parseSupported) {\n\t                    try {\n\t                      // FF 4.0, 4.0.1, and Rhino 1.7R3-R4 allow trailing decimal\n\t                      // points. These environments, along with FF 3.1b1 and 2,\n\t                      // also allow trailing commas in JSON objects and arrays.\n\t                      parseSupported = parse(\"1.\") !== 1;\n\t                    } catch (exception) {}\n\t                  }\n\t                }\n\t              }\n\t            } catch (exception) {\n\t              parseSupported = false;\n\t            }\n\t          }\n\t          isSupported = parseSupported;\n\t        }\n\t      }\n\t      return has[name] = !!isSupported;\n\t    }\n\t\n\t    if (!has(\"json\")) {\n\t      // Common `[[Class]]` name aliases.\n\t      var functionClass = \"[object Function]\",\n\t          dateClass = \"[object Date]\",\n\t          numberClass = \"[object Number]\",\n\t          stringClass = \"[object String]\",\n\t          arrayClass = \"[object Array]\",\n\t          booleanClass = \"[object Boolean]\";\n\t\n\t      // Detect incomplete support for accessing string characters by index.\n\t      var charIndexBuggy = has(\"bug-string-char-index\");\n\t\n\t      // Define additional utility methods if the `Date` methods are buggy.\n\t      if (!isExtended) {\n\t        var floor = Math.floor;\n\t        // A mapping between the months of the year and the number of days between\n\t        // January 1st and the first of the respective month.\n\t        var Months = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334];\n\t        // Internal: Calculates the number of days between the Unix epoch and the\n\t        // first day of the given month.\n\t        var getDay = function (year, month) {\n\t          return Months[month] + 365 * (year - 1970) + floor((year - 1969 + (month = +(month > 1))) / 4) - floor((year - 1901 + month) / 100) + floor((year - 1601 + month) / 400);\n\t        };\n\t      }\n\t\n\t      // Internal: Determines if a property is a direct property of the given\n\t      // object. Delegates to the native `Object#hasOwnProperty` method.\n\t      if (!(isProperty = objectProto.hasOwnProperty)) {\n\t        isProperty = function (property) {\n\t          var members = {}, constructor;\n\t          if ((members.__proto__ = null, members.__proto__ = {\n\t            // The *proto* property cannot be set multiple times in recent\n\t            // versions of Firefox and SeaMonkey.\n\t            \"toString\": 1\n\t          }, members).toString != getClass) {\n\t            // Safari <= 2.0.3 doesn't implement `Object#hasOwnProperty`, but\n\t            // supports the mutable *proto* property.\n\t            isProperty = function (property) {\n\t              // Capture and break the object's prototype chain (see section 8.6.2\n\t              // of the ES 5.1 spec). The parenthesized expression prevents an\n\t              // unsafe transformation by the Closure Compiler.\n\t              var original = this.__proto__, result = property in (this.__proto__ = null, this);\n\t              // Restore the original prototype chain.\n\t              this.__proto__ = original;\n\t              return result;\n\t            };\n\t          } else {\n\t            // Capture a reference to the top-level `Object` constructor.\n\t            constructor = members.constructor;\n\t            // Use the `constructor` property to simulate `Object#hasOwnProperty` in\n\t            // other environments.\n\t            isProperty = function (property) {\n\t              var parent = (this.constructor || constructor).prototype;\n\t              return property in this && !(property in parent && this[property] === parent[property]);\n\t            };\n\t          }\n\t          members = null;\n\t          return isProperty.call(this, property);\n\t        };\n\t      }\n\t\n\t      // Internal: Normalizes the `for...in` iteration algorithm across\n\t      // environments. Each enumerated key is yielded to a `callback` function.\n\t      forEach = function (object, callback) {\n\t        var size = 0, Properties, members, property;\n\t\n\t        // Tests for bugs in the current environment's `for...in` algorithm. The\n\t        // `valueOf` property inherits the non-enumerable flag from\n\t        // `Object.prototype` in older versions of IE, Netscape, and Mozilla.\n\t        (Properties = function () {\n\t          this.valueOf = 0;\n\t        }).prototype.valueOf = 0;\n\t\n\t        // Iterate over a new instance of the `Properties` class.\n\t        members = new Properties();\n\t        for (property in members) {\n\t          // Ignore all properties inherited from `Object.prototype`.\n\t          if (isProperty.call(members, property)) {\n\t            size++;\n\t          }\n\t        }\n\t        Properties = members = null;\n\t\n\t        // Normalize the iteration algorithm.\n\t        if (!size) {\n\t          // A list of non-enumerable properties inherited from `Object.prototype`.\n\t          members = [\"valueOf\", \"toString\", \"toLocaleString\", \"propertyIsEnumerable\", \"isPrototypeOf\", \"hasOwnProperty\", \"constructor\"];\n\t          // IE <= 8, Mozilla 1.0, and Netscape 6.2 ignore shadowed non-enumerable\n\t          // properties.\n\t          forEach = function (object, callback) {\n\t            var isFunction = getClass.call(object) == functionClass, property, length;\n\t            var hasProperty = !isFunction && typeof object.constructor != \"function\" && objectTypes[typeof object.hasOwnProperty] && object.hasOwnProperty || isProperty;\n\t            for (property in object) {\n\t              // Gecko <= 1.0 enumerates the `prototype` property of functions under\n\t              // certain conditions; IE does not.\n\t              if (!(isFunction && property == \"prototype\") && hasProperty.call(object, property)) {\n\t                callback(property);\n\t              }\n\t            }\n\t            // Manually invoke the callback for each non-enumerable property.\n\t            for (length = members.length; property = members[--length]; hasProperty.call(object, property) && callback(property));\n\t          };\n\t        } else if (size == 2) {\n\t          // Safari <= 2.0.4 enumerates shadowed properties twice.\n\t          forEach = function (object, callback) {\n\t            // Create a set of iterated properties.\n\t            var members = {}, isFunction = getClass.call(object) == functionClass, property;\n\t            for (property in object) {\n\t              // Store each property name to prevent double enumeration. The\n\t              // `prototype` property of functions is not enumerated due to cross-\n\t              // environment inconsistencies.\n\t              if (!(isFunction && property == \"prototype\") && !isProperty.call(members, property) && (members[property] = 1) && isProperty.call(object, property)) {\n\t                callback(property);\n\t              }\n\t            }\n\t          };\n\t        } else {\n\t          // No bugs detected; use the standard `for...in` algorithm.\n\t          forEach = function (object, callback) {\n\t            var isFunction = getClass.call(object) == functionClass, property, isConstructor;\n\t            for (property in object) {\n\t              if (!(isFunction && property == \"prototype\") && isProperty.call(object, property) && !(isConstructor = property === \"constructor\")) {\n\t                callback(property);\n\t              }\n\t            }\n\t            // Manually invoke the callback for the `constructor` property due to\n\t            // cross-environment inconsistencies.\n\t            if (isConstructor || isProperty.call(object, (property = \"constructor\"))) {\n\t              callback(property);\n\t            }\n\t          };\n\t        }\n\t        return forEach(object, callback);\n\t      };\n\t\n\t      // Public: Serializes a JavaScript `value` as a JSON string. The optional\n\t      // `filter` argument may specify either a function that alters how object and\n\t      // array members are serialized, or an array of strings and numbers that\n\t      // indicates which properties should be serialized. The optional `width`\n\t      // argument may be either a string or number that specifies the indentation\n\t      // level of the output.\n\t      if (!has(\"json-stringify\")) {\n\t        // Internal: A map of control characters and their escaped equivalents.\n\t        var Escapes = {\n\t          92: \"\\\\\\\\\",\n\t          34: '\\\\\"',\n\t          8: \"\\\\b\",\n\t          12: \"\\\\f\",\n\t          10: \"\\\\n\",\n\t          13: \"\\\\r\",\n\t          9: \"\\\\t\"\n\t        };\n\t\n\t        // Internal: Converts `value` into a zero-padded string such that its\n\t        // length is at least equal to `width`. The `width` must be <= 6.\n\t        var leadingZeroes = \"000000\";\n\t        var toPaddedString = function (width, value) {\n\t          // The `|| 0` expression is necessary to work around a bug in\n\t          // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== \"0\"`.\n\t          return (leadingZeroes + (value || 0)).slice(-width);\n\t        };\n\t\n\t        // Internal: Double-quotes a string `value`, replacing all ASCII control\n\t        // characters (characters with code unit values between 0 and 31) with\n\t        // their escaped equivalents. This is an implementation of the\n\t        // `Quote(value)` operation defined in ES 5.1 section 15.12.3.\n\t        var unicodePrefix = \"\\\\u00\";\n\t        var quote = function (value) {\n\t          var result = '\"', index = 0, length = value.length, useCharIndex = !charIndexBuggy || length > 10;\n\t          var symbols = useCharIndex && (charIndexBuggy ? value.split(\"\") : value);\n\t          for (; index < length; index++) {\n\t            var charCode = value.charCodeAt(index);\n\t            // If the character is a control character, append its Unicode or\n\t            // shorthand escape sequence; otherwise, append the character as-is.\n\t            switch (charCode) {\n\t              case 8: case 9: case 10: case 12: case 13: case 34: case 92:\n\t                result += Escapes[charCode];\n\t                break;\n\t              default:\n\t                if (charCode < 32) {\n\t                  result += unicodePrefix + toPaddedString(2, charCode.toString(16));\n\t                  break;\n\t                }\n\t                result += useCharIndex ? symbols[index] : value.charAt(index);\n\t            }\n\t          }\n\t          return result + '\"';\n\t        };\n\t\n\t        // Internal: Recursively serializes an object. Implements the\n\t        // `Str(key, holder)`, `JO(value)`, and `JA(value)` operations.\n\t        var serialize = function (property, object, callback, properties, whitespace, indentation, stack) {\n\t          var value, className, year, month, date, time, hours, minutes, seconds, milliseconds, results, element, index, length, prefix, result;\n\t          try {\n\t            // Necessary for host object support.\n\t            value = object[property];\n\t          } catch (exception) {}\n\t          if (typeof value == \"object\" && value) {\n\t            className = getClass.call(value);\n\t            if (className == dateClass && !isProperty.call(value, \"toJSON\")) {\n\t              if (value > -1 / 0 && value < 1 / 0) {\n\t                // Dates are serialized according to the `Date#toJSON` method\n\t                // specified in ES 5.1 section 15.9.5.44. See section 15.9.1.15\n\t                // for the ISO 8601 date time string format.\n\t                if (getDay) {\n\t                  // Manually compute the year, month, date, hours, minutes,\n\t                  // seconds, and milliseconds if the `getUTC*` methods are\n\t                  // buggy. Adapted from @Yaffle's `date-shim` project.\n\t                  date = floor(value / 864e5);\n\t                  for (year = floor(date / 365.2425) + 1970 - 1; getDay(year + 1, 0) <= date; year++);\n\t                  for (month = floor((date - getDay(year, 0)) / 30.42); getDay(year, month + 1) <= date; month++);\n\t                  date = 1 + date - getDay(year, month);\n\t                  // The `time` value specifies the time within the day (see ES\n\t                  // 5.1 section 15.9.1.2). The formula `(A % B + B) % B` is used\n\t                  // to compute `A modulo B`, as the `%` operator does not\n\t                  // correspond to the `modulo` operation for negative numbers.\n\t                  time = (value % 864e5 + 864e5) % 864e5;\n\t                  // The hours, minutes, seconds, and milliseconds are obtained by\n\t                  // decomposing the time within the day. See section 15.9.1.10.\n\t                  hours = floor(time / 36e5) % 24;\n\t                  minutes = floor(time / 6e4) % 60;\n\t                  seconds = floor(time / 1e3) % 60;\n\t                  milliseconds = time % 1e3;\n\t                } else {\n\t                  year = value.getUTCFullYear();\n\t                  month = value.getUTCMonth();\n\t                  date = value.getUTCDate();\n\t                  hours = value.getUTCHours();\n\t                  minutes = value.getUTCMinutes();\n\t                  seconds = value.getUTCSeconds();\n\t                  milliseconds = value.getUTCMilliseconds();\n\t                }\n\t                // Serialize extended years correctly.\n\t                value = (year <= 0 || year >= 1e4 ? (year < 0 ? \"-\" : \"+\") + toPaddedString(6, year < 0 ? -year : year) : toPaddedString(4, year)) +\n\t                  \"-\" + toPaddedString(2, month + 1) + \"-\" + toPaddedString(2, date) +\n\t                  // Months, dates, hours, minutes, and seconds should have two\n\t                  // digits; milliseconds should have three.\n\t                  \"T\" + toPaddedString(2, hours) + \":\" + toPaddedString(2, minutes) + \":\" + toPaddedString(2, seconds) +\n\t                  // Milliseconds are optional in ES 5.0, but required in 5.1.\n\t                  \".\" + toPaddedString(3, milliseconds) + \"Z\";\n\t              } else {\n\t                value = null;\n\t              }\n\t            } else if (typeof value.toJSON == \"function\" && ((className != numberClass && className != stringClass && className != arrayClass) || isProperty.call(value, \"toJSON\"))) {\n\t              // Prototype <= 1.6.1 adds non-standard `toJSON` methods to the\n\t              // `Number`, `String`, `Date`, and `Array` prototypes. JSON 3\n\t              // ignores all `toJSON` methods on these objects unless they are\n\t              // defined directly on an instance.\n\t              value = value.toJSON(property);\n\t            }\n\t          }\n\t          if (callback) {\n\t            // If a replacement function was provided, call it to obtain the value\n\t            // for serialization.\n\t            value = callback.call(object, property, value);\n\t          }\n\t          if (value === null) {\n\t            return \"null\";\n\t          }\n\t          className = getClass.call(value);\n\t          if (className == booleanClass) {\n\t            // Booleans are represented literally.\n\t            return \"\" + value;\n\t          } else if (className == numberClass) {\n\t            // JSON numbers must be finite. `Infinity` and `NaN` are serialized as\n\t            // `\"null\"`.\n\t            return value > -1 / 0 && value < 1 / 0 ? \"\" + value : \"null\";\n\t          } else if (className == stringClass) {\n\t            // Strings are double-quoted and escaped.\n\t            return quote(\"\" + value);\n\t          }\n\t          // Recursively serialize objects and arrays.\n\t          if (typeof value == \"object\") {\n\t            // Check for cyclic structures. This is a linear search; performance\n\t            // is inversely proportional to the number of unique nested objects.\n\t            for (length = stack.length; length--;) {\n\t              if (stack[length] === value) {\n\t                // Cyclic structures cannot be serialized by `JSON.stringify`.\n\t                throw TypeError();\n\t              }\n\t            }\n\t            // Add the object to the stack of traversed objects.\n\t            stack.push(value);\n\t            results = [];\n\t            // Save the current indentation level and indent one additional level.\n\t            prefix = indentation;\n\t            indentation += whitespace;\n\t            if (className == arrayClass) {\n\t              // Recursively serialize array elements.\n\t              for (index = 0, length = value.length; index < length; index++) {\n\t                element = serialize(index, value, callback, properties, whitespace, indentation, stack);\n\t                results.push(element === undef ? \"null\" : element);\n\t              }\n\t              result = results.length ? (whitespace ? \"[\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"]\" : (\"[\" + results.join(\",\") + \"]\")) : \"[]\";\n\t            } else {\n\t              // Recursively serialize object members. Members are selected from\n\t              // either a user-specified list of property names, or the object\n\t              // itself.\n\t              forEach(properties || value, function (property) {\n\t                var element = serialize(property, value, callback, properties, whitespace, indentation, stack);\n\t                if (element !== undef) {\n\t                  // According to ES 5.1 section 15.12.3: \"If `gap` {whitespace}\n\t                  // is not the empty string, let `member` {quote(property) + \":\"}\n\t                  // be the concatenation of `member` and the `space` character.\"\n\t                  // The \"`space` character\" refers to the literal space\n\t                  // character, not the `space` {width} argument provided to\n\t                  // `JSON.stringify`.\n\t                  results.push(quote(property) + \":\" + (whitespace ? \" \" : \"\") + element);\n\t                }\n\t              });\n\t              result = results.length ? (whitespace ? \"{\\n\" + indentation + results.join(\",\\n\" + indentation) + \"\\n\" + prefix + \"}\" : (\"{\" + results.join(\",\") + \"}\")) : \"{}\";\n\t            }\n\t            // Remove the object from the traversed object stack.\n\t            stack.pop();\n\t            return result;\n\t          }\n\t        };\n\t\n\t        // Public: `JSON.stringify`. See ES 5.1 section 15.12.3.\n\t        exports.stringify = function (source, filter, width) {\n\t          var whitespace, callback, properties, className;\n\t          if (objectTypes[typeof filter] && filter) {\n\t            if ((className = getClass.call(filter)) == functionClass) {\n\t              callback = filter;\n\t            } else if (className == arrayClass) {\n\t              // Convert the property names array into a makeshift set.\n\t              properties = {};\n\t              for (var index = 0, length = filter.length, value; index < length; value = filter[index++], ((className = getClass.call(value)), className == stringClass || className == numberClass) && (properties[value] = 1));\n\t            }\n\t          }\n\t          if (width) {\n\t            if ((className = getClass.call(width)) == numberClass) {\n\t              // Convert the `width` to an integer and create a string containing\n\t              // `width` number of space characters.\n\t              if ((width -= width % 1) > 0) {\n\t                for (whitespace = \"\", width > 10 && (width = 10); whitespace.length < width; whitespace += \" \");\n\t              }\n\t            } else if (className == stringClass) {\n\t              whitespace = width.length <= 10 ? width : width.slice(0, 10);\n\t            }\n\t          }\n\t          // Opera <= 7.54u2 discards the values associated with empty string keys\n\t          // (`\"\"`) only if they are used directly within an object member list\n\t          // (e.g., `!(\"\" in { \"\": 1})`).\n\t          return serialize(\"\", (value = {}, value[\"\"] = source, value), callback, properties, whitespace, \"\", []);\n\t        };\n\t      }\n\t\n\t      // Public: Parses a JSON source string.\n\t      if (!has(\"json-parse\")) {\n\t        var fromCharCode = String.fromCharCode;\n\t\n\t        // Internal: A map of escaped control characters and their unescaped\n\t        // equivalents.\n\t        var Unescapes = {\n\t          92: \"\\\\\",\n\t          34: '\"',\n\t          47: \"/\",\n\t          98: \"\\b\",\n\t          116: \"\\t\",\n\t          110: \"\\n\",\n\t          102: \"\\f\",\n\t          114: \"\\r\"\n\t        };\n\t\n\t        // Internal: Stores the parser state.\n\t        var Index, Source;\n\t\n\t        // Internal: Resets the parser state and throws a `SyntaxError`.\n\t        var abort = function () {\n\t          Index = Source = null;\n\t          throw SyntaxError();\n\t        };\n\t\n\t        // Internal: Returns the next token, or `\"$\"` if the parser has reached\n\t        // the end of the source string. A token may be a string, number, `null`\n\t        // literal, or Boolean literal.\n\t        var lex = function () {\n\t          var source = Source, length = source.length, value, begin, position, isSigned, charCode;\n\t          while (Index < length) {\n\t            charCode = source.charCodeAt(Index);\n\t            switch (charCode) {\n\t              case 9: case 10: case 13: case 32:\n\t                // Skip whitespace tokens, including tabs, carriage returns, line\n\t                // feeds, and space characters.\n\t                Index++;\n\t                break;\n\t              case 123: case 125: case 91: case 93: case 58: case 44:\n\t                // Parse a punctuator token (`{`, `}`, `[`, `]`, `:`, or `,`) at\n\t                // the current position.\n\t                value = charIndexBuggy ? source.charAt(Index) : source[Index];\n\t                Index++;\n\t                return value;\n\t              case 34:\n\t                // `\"` delimits a JSON string; advance to the next character and\n\t                // begin parsing the string. String tokens are prefixed with the\n\t                // sentinel `@` character to distinguish them from punctuators and\n\t                // end-of-string tokens.\n\t                for (value = \"@\", Index++; Index < length;) {\n\t                  charCode = source.charCodeAt(Index);\n\t                  if (charCode < 32) {\n\t                    // Unescaped ASCII control characters (those with a code unit\n\t                    // less than the space character) are not permitted.\n\t                    abort();\n\t                  } else if (charCode == 92) {\n\t                    // A reverse solidus (`\\`) marks the beginning of an escaped\n\t                    // control character (including `\"`, `\\`, and `/`) or Unicode\n\t                    // escape sequence.\n\t                    charCode = source.charCodeAt(++Index);\n\t                    switch (charCode) {\n\t                      case 92: case 34: case 47: case 98: case 116: case 110: case 102: case 114:\n\t                        // Revive escaped control characters.\n\t                        value += Unescapes[charCode];\n\t                        Index++;\n\t                        break;\n\t                      case 117:\n\t                        // `\\u` marks the beginning of a Unicode escape sequence.\n\t                        // Advance to the first character and validate the\n\t                        // four-digit code point.\n\t                        begin = ++Index;\n\t                        for (position = Index + 4; Index < position; Index++) {\n\t                          charCode = source.charCodeAt(Index);\n\t                          // A valid sequence comprises four hexdigits (case-\n\t                          // insensitive) that form a single hexadecimal value.\n\t                          if (!(charCode >= 48 && charCode <= 57 || charCode >= 97 && charCode <= 102 || charCode >= 65 && charCode <= 70)) {\n\t                            // Invalid Unicode escape sequence.\n\t                            abort();\n\t                          }\n\t                        }\n\t                        // Revive the escaped character.\n\t                        value += fromCharCode(\"0x\" + source.slice(begin, Index));\n\t                        break;\n\t                      default:\n\t                        // Invalid escape sequence.\n\t                        abort();\n\t                    }\n\t                  } else {\n\t                    if (charCode == 34) {\n\t                      // An unescaped double-quote character marks the end of the\n\t                      // string.\n\t                      break;\n\t                    }\n\t                    charCode = source.charCodeAt(Index);\n\t                    begin = Index;\n\t                    // Optimize for the common case where a string is valid.\n\t                    while (charCode >= 32 && charCode != 92 && charCode != 34) {\n\t                      charCode = source.charCodeAt(++Index);\n\t                    }\n\t                    // Append the string as-is.\n\t                    value += source.slice(begin, Index);\n\t                  }\n\t                }\n\t                if (source.charCodeAt(Index) == 34) {\n\t                  // Advance to the next character and return the revived string.\n\t                  Index++;\n\t                  return value;\n\t                }\n\t                // Unterminated string.\n\t                abort();\n\t              default:\n\t                // Parse numbers and literals.\n\t                begin = Index;\n\t                // Advance past the negative sign, if one is specified.\n\t                if (charCode == 45) {\n\t                  isSigned = true;\n\t                  charCode = source.charCodeAt(++Index);\n\t                }\n\t                // Parse an integer or floating-point value.\n\t                if (charCode >= 48 && charCode <= 57) {\n\t                  // Leading zeroes are interpreted as octal literals.\n\t                  if (charCode == 48 && ((charCode = source.charCodeAt(Index + 1)), charCode >= 48 && charCode <= 57)) {\n\t                    // Illegal octal literal.\n\t                    abort();\n\t                  }\n\t                  isSigned = false;\n\t                  // Parse the integer component.\n\t                  for (; Index < length && ((charCode = source.charCodeAt(Index)), charCode >= 48 && charCode <= 57); Index++);\n\t                  // Floats cannot contain a leading decimal point; however, this\n\t                  // case is already accounted for by the parser.\n\t                  if (source.charCodeAt(Index) == 46) {\n\t                    position = ++Index;\n\t                    // Parse the decimal component.\n\t                    for (; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n\t                    if (position == Index) {\n\t                      // Illegal trailing decimal.\n\t                      abort();\n\t                    }\n\t                    Index = position;\n\t                  }\n\t                  // Parse exponents. The `e` denoting the exponent is\n\t                  // case-insensitive.\n\t                  charCode = source.charCodeAt(Index);\n\t                  if (charCode == 101 || charCode == 69) {\n\t                    charCode = source.charCodeAt(++Index);\n\t                    // Skip past the sign following the exponent, if one is\n\t                    // specified.\n\t                    if (charCode == 43 || charCode == 45) {\n\t                      Index++;\n\t                    }\n\t                    // Parse the exponential component.\n\t                    for (position = Index; position < length && ((charCode = source.charCodeAt(position)), charCode >= 48 && charCode <= 57); position++);\n\t                    if (position == Index) {\n\t                      // Illegal empty exponent.\n\t                      abort();\n\t                    }\n\t                    Index = position;\n\t                  }\n\t                  // Coerce the parsed value to a JavaScript number.\n\t                  return +source.slice(begin, Index);\n\t                }\n\t                // A negative sign may only precede numbers.\n\t                if (isSigned) {\n\t                  abort();\n\t                }\n\t                // `true`, `false`, and `null` literals.\n\t                if (source.slice(Index, Index + 4) == \"true\") {\n\t                  Index += 4;\n\t                  return true;\n\t                } else if (source.slice(Index, Index + 5) == \"false\") {\n\t                  Index += 5;\n\t                  return false;\n\t                } else if (source.slice(Index, Index + 4) == \"null\") {\n\t                  Index += 4;\n\t                  return null;\n\t                }\n\t                // Unrecognized token.\n\t                abort();\n\t            }\n\t          }\n\t          // Return the sentinel `$` character if the parser has reached the end\n\t          // of the source string.\n\t          return \"$\";\n\t        };\n\t\n\t        // Internal: Parses a JSON `value` token.\n\t        var get = function (value) {\n\t          var results, hasMembers;\n\t          if (value == \"$\") {\n\t            // Unexpected end of input.\n\t            abort();\n\t          }\n\t          if (typeof value == \"string\") {\n\t            if ((charIndexBuggy ? value.charAt(0) : value[0]) == \"@\") {\n\t              // Remove the sentinel `@` character.\n\t              return value.slice(1);\n\t            }\n\t            // Parse object and array literals.\n\t            if (value == \"[\") {\n\t              // Parses a JSON array, returning a new JavaScript array.\n\t              results = [];\n\t              for (;; hasMembers || (hasMembers = true)) {\n\t                value = lex();\n\t                // A closing square bracket marks the end of the array literal.\n\t                if (value == \"]\") {\n\t                  break;\n\t                }\n\t                // If the array literal contains elements, the current token\n\t                // should be a comma separating the previous element from the\n\t                // next.\n\t                if (hasMembers) {\n\t                  if (value == \",\") {\n\t                    value = lex();\n\t                    if (value == \"]\") {\n\t                      // Unexpected trailing `,` in array literal.\n\t                      abort();\n\t                    }\n\t                  } else {\n\t                    // A `,` must separate each array element.\n\t                    abort();\n\t                  }\n\t                }\n\t                // Elisions and leading commas are not permitted.\n\t                if (value == \",\") {\n\t                  abort();\n\t                }\n\t                results.push(get(value));\n\t              }\n\t              return results;\n\t            } else if (value == \"{\") {\n\t              // Parses a JSON object, returning a new JavaScript object.\n\t              results = {};\n\t              for (;; hasMembers || (hasMembers = true)) {\n\t                value = lex();\n\t                // A closing curly brace marks the end of the object literal.\n\t                if (value == \"}\") {\n\t                  break;\n\t                }\n\t                // If the object literal contains members, the current token\n\t                // should be a comma separator.\n\t                if (hasMembers) {\n\t                  if (value == \",\") {\n\t                    value = lex();\n\t                    if (value == \"}\") {\n\t                      // Unexpected trailing `,` in object literal.\n\t                      abort();\n\t                    }\n\t                  } else {\n\t                    // A `,` must separate each object member.\n\t                    abort();\n\t                  }\n\t                }\n\t                // Leading commas are not permitted, object property names must be\n\t                // double-quoted strings, and a `:` must separate each property\n\t                // name and value.\n\t                if (value == \",\" || typeof value != \"string\" || (charIndexBuggy ? value.charAt(0) : value[0]) != \"@\" || lex() != \":\") {\n\t                  abort();\n\t                }\n\t                results[value.slice(1)] = get(lex());\n\t              }\n\t              return results;\n\t            }\n\t            // Unexpected token encountered.\n\t            abort();\n\t          }\n\t          return value;\n\t        };\n\t\n\t        // Internal: Updates a traversed object member.\n\t        var update = function (source, property, callback) {\n\t          var element = walk(source, property, callback);\n\t          if (element === undef) {\n\t            delete source[property];\n\t          } else {\n\t            source[property] = element;\n\t          }\n\t        };\n\t\n\t        // Internal: Recursively traverses a parsed JSON object, invoking the\n\t        // `callback` function for each value. This is an implementation of the\n\t        // `Walk(holder, name)` operation defined in ES 5.1 section 15.12.2.\n\t        var walk = function (source, property, callback) {\n\t          var value = source[property], length;\n\t          if (typeof value == \"object\" && value) {\n\t            // `forEach` can't be used to traverse an array in Opera <= 8.54\n\t            // because its `Object#hasOwnProperty` implementation returns `false`\n\t            // for array indices (e.g., `![1, 2, 3].hasOwnProperty(\"0\")`).\n\t            if (getClass.call(value) == arrayClass) {\n\t              for (length = value.length; length--;) {\n\t                update(value, length, callback);\n\t              }\n\t            } else {\n\t              forEach(value, function (property) {\n\t                update(value, property, callback);\n\t              });\n\t            }\n\t          }\n\t          return callback.call(source, property, value);\n\t        };\n\t\n\t        // Public: `JSON.parse`. See ES 5.1 section 15.12.2.\n\t        exports.parse = function (source, callback) {\n\t          var result, value;\n\t          Index = 0;\n\t          Source = \"\" + source;\n\t          result = get(lex());\n\t          // If a JSON string contains multiple tokens, it is invalid.\n\t          if (lex() != \"$\") {\n\t            abort();\n\t          }\n\t          // Reset the parser state.\n\t          Index = Source = null;\n\t          return callback && getClass.call(callback) == functionClass ? walk((value = {}, value[\"\"] = result, value), \"\", callback) : result;\n\t        };\n\t      }\n\t    }\n\t\n\t    exports[\"runInContext\"] = runInContext;\n\t    return exports;\n\t  }\n\t\n\t  if (freeExports && !isLoader) {\n\t    // Export for CommonJS environments.\n\t    runInContext(root, freeExports);\n\t  } else {\n\t    // Export for web browsers and JavaScript engines.\n\t    var nativeJSON = root.JSON,\n\t        previousJSON = root[\"JSON3\"],\n\t        isRestored = false;\n\t\n\t    var JSON3 = runInContext(root, (root[\"JSON3\"] = {\n\t      // Public: Restores the original value of the global `JSON` object and\n\t      // returns a reference to the `JSON3` object.\n\t      \"noConflict\": function () {\n\t        if (!isRestored) {\n\t          isRestored = true;\n\t          root.JSON = nativeJSON;\n\t          root[\"JSON3\"] = previousJSON;\n\t          nativeJSON = previousJSON = null;\n\t        }\n\t        return JSON3;\n\t      }\n\t    }));\n\t\n\t    root.JSON = {\n\t      \"parse\": JSON3.parse,\n\t      \"stringify\": JSON3.stringify\n\t    };\n\t  }\n\t\n\t  // Export for asynchronous module loaders.\n\t  if (isLoader) {\n\t    !(__WEBPACK_AMD_DEFINE_RESULT__ = function () {\n\t      return JSON3;\n\t    }.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t  }\n\t}).call(this);\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module), (function() { return this; }())))\n\n/***/ },\n/* 79 */\n/***/ function(module, exports) {\n\n\tmodule.exports = toArray\n\t\n\tfunction toArray(list, index) {\n\t    var array = []\n\t\n\t    index = index || 0\n\t\n\t    for (var i = index || 0; i < list.length; i++) {\n\t        array[i - index] = list[i]\n\t    }\n\t\n\t    return array\n\t}\n\n\n/***/ },\n/* 80 */\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar __WEBPACK_AMD_DEFINE_RESULT__;/* WEBPACK VAR INJECTION */(function(module, global) {/*! https://mths.be/utf8js v2.0.0 by @mathias */\n\t;(function(root) {\n\t\n\t\t// Detect free variables `exports`\n\t\tvar freeExports = typeof exports == 'object' && exports;\n\t\n\t\t// Detect free variable `module`\n\t\tvar freeModule = typeof module == 'object' && module &&\n\t\t\tmodule.exports == freeExports && module;\n\t\n\t\t// Detect free variable `global`, from Node.js or Browserified code,\n\t\t// and use it as `root`\n\t\tvar freeGlobal = typeof global == 'object' && global;\n\t\tif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {\n\t\t\troot = freeGlobal;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar stringFromCharCode = String.fromCharCode;\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2decode(string) {\n\t\t\tvar output = [];\n\t\t\tvar counter = 0;\n\t\t\tvar length = string.length;\n\t\t\tvar value;\n\t\t\tvar extra;\n\t\t\twhile (counter < length) {\n\t\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\t\toutput.push(value);\n\t\t\t\t\t\tcounter--;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\toutput.push(value);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\t// Taken from https://mths.be/punycode\n\t\tfunction ucs2encode(array) {\n\t\t\tvar length = array.length;\n\t\t\tvar index = -1;\n\t\t\tvar value;\n\t\t\tvar output = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tvalue = array[index];\n\t\t\t\tif (value > 0xFFFF) {\n\t\t\t\t\tvalue -= 0x10000;\n\t\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t\t}\n\t\t\t\toutput += stringFromCharCode(value);\n\t\t\t}\n\t\t\treturn output;\n\t\t}\n\t\n\t\tfunction checkScalarValue(codePoint) {\n\t\t\tif (codePoint >= 0xD800 && codePoint <= 0xDFFF) {\n\t\t\t\tthrow Error(\n\t\t\t\t\t'Lone surrogate U+' + codePoint.toString(16).toUpperCase() +\n\t\t\t\t\t' is not a scalar value'\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction createByte(codePoint, shift) {\n\t\t\treturn stringFromCharCode(((codePoint >> shift) & 0x3F) | 0x80);\n\t\t}\n\t\n\t\tfunction encodeCodePoint(codePoint) {\n\t\t\tif ((codePoint & 0xFFFFFF80) == 0) { // 1-byte sequence\n\t\t\t\treturn stringFromCharCode(codePoint);\n\t\t\t}\n\t\t\tvar symbol = '';\n\t\t\tif ((codePoint & 0xFFFFF800) == 0) { // 2-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 6) & 0x1F) | 0xC0);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFFF0000) == 0) { // 3-byte sequence\n\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 12) & 0x0F) | 0xE0);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\telse if ((codePoint & 0xFFE00000) == 0) { // 4-byte sequence\n\t\t\t\tsymbol = stringFromCharCode(((codePoint >> 18) & 0x07) | 0xF0);\n\t\t\t\tsymbol += createByte(codePoint, 12);\n\t\t\t\tsymbol += createByte(codePoint, 6);\n\t\t\t}\n\t\t\tsymbol += stringFromCharCode((codePoint & 0x3F) | 0x80);\n\t\t\treturn symbol;\n\t\t}\n\t\n\t\tfunction utf8encode(string) {\n\t\t\tvar codePoints = ucs2decode(string);\n\t\t\tvar length = codePoints.length;\n\t\t\tvar index = -1;\n\t\t\tvar codePoint;\n\t\t\tvar byteString = '';\n\t\t\twhile (++index < length) {\n\t\t\t\tcodePoint = codePoints[index];\n\t\t\t\tbyteString += encodeCodePoint(codePoint);\n\t\t\t}\n\t\t\treturn byteString;\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tfunction readContinuationByte() {\n\t\t\tif (byteIndex >= byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tvar continuationByte = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\tif ((continuationByte & 0xC0) == 0x80) {\n\t\t\t\treturn continuationByte & 0x3F;\n\t\t\t}\n\t\n\t\t\t// If we end up here, it’s not a continuation byte\n\t\t\tthrow Error('Invalid continuation byte');\n\t\t}\n\t\n\t\tfunction decodeSymbol() {\n\t\t\tvar byte1;\n\t\t\tvar byte2;\n\t\t\tvar byte3;\n\t\t\tvar byte4;\n\t\t\tvar codePoint;\n\t\n\t\t\tif (byteIndex > byteCount) {\n\t\t\t\tthrow Error('Invalid byte index');\n\t\t\t}\n\t\n\t\t\tif (byteIndex == byteCount) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\n\t\t\t// Read first byte\n\t\t\tbyte1 = byteArray[byteIndex] & 0xFF;\n\t\t\tbyteIndex++;\n\t\n\t\t\t// 1-byte sequence (no continuation bytes)\n\t\t\tif ((byte1 & 0x80) == 0) {\n\t\t\t\treturn byte1;\n\t\t\t}\n\t\n\t\t\t// 2-byte sequence\n\t\t\tif ((byte1 & 0xE0) == 0xC0) {\n\t\t\t\tvar byte2 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x1F) << 6) | byte2;\n\t\t\t\tif (codePoint >= 0x80) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 3-byte sequence (may include unpaired surrogates)\n\t\t\tif ((byte1 & 0xF0) == 0xE0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x0F) << 12) | (byte2 << 6) | byte3;\n\t\t\t\tif (codePoint >= 0x0800) {\n\t\t\t\t\tcheckScalarValue(codePoint);\n\t\t\t\t\treturn codePoint;\n\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Invalid continuation byte');\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\t// 4-byte sequence\n\t\t\tif ((byte1 & 0xF8) == 0xF0) {\n\t\t\t\tbyte2 = readContinuationByte();\n\t\t\t\tbyte3 = readContinuationByte();\n\t\t\t\tbyte4 = readContinuationByte();\n\t\t\t\tcodePoint = ((byte1 & 0x0F) << 0x12) | (byte2 << 0x0C) |\n\t\t\t\t\t(byte3 << 0x06) | byte4;\n\t\t\t\tif (codePoint >= 0x010000 && codePoint <= 0x10FFFF) {\n\t\t\t\t\treturn codePoint;\n\t\t\t\t}\n\t\t\t}\n\t\n\t\t\tthrow Error('Invalid UTF-8 detected');\n\t\t}\n\t\n\t\tvar byteArray;\n\t\tvar byteCount;\n\t\tvar byteIndex;\n\t\tfunction utf8decode(byteString) {\n\t\t\tbyteArray = ucs2decode(byteString);\n\t\t\tbyteCount = byteArray.length;\n\t\t\tbyteIndex = 0;\n\t\t\tvar codePoints = [];\n\t\t\tvar tmp;\n\t\t\twhile ((tmp = decodeSymbol()) !== false) {\n\t\t\t\tcodePoints.push(tmp);\n\t\t\t}\n\t\t\treturn ucs2encode(codePoints);\n\t\t}\n\t\n\t\t/*--------------------------------------------------------------------------*/\n\t\n\t\tvar utf8 = {\n\t\t\t'version': '2.0.0',\n\t\t\t'encode': utf8encode,\n\t\t\t'decode': utf8decode\n\t\t};\n\t\n\t\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t\t// like the following:\n\t\tif (\n\t\t\ttrue\n\t\t) {\n\t\t\t!(__WEBPACK_AMD_DEFINE_RESULT__ = function() {\n\t\t\t\treturn utf8;\n\t\t\t}.call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n\t\t}\telse if (freeExports && !freeExports.nodeType) {\n\t\t\tif (freeModule) { // in Node.js or RingoJS v0.8.0+\n\t\t\t\tfreeModule.exports = utf8;\n\t\t\t} else { // in Narwhal or RingoJS v0.7.0-\n\t\t\t\tvar object = {};\n\t\t\t\tvar hasOwnProperty = object.hasOwnProperty;\n\t\t\t\tfor (var key in utf8) {\n\t\t\t\t\thasOwnProperty.call(utf8, key) && (freeExports[key] = utf8[key]);\n\t\t\t\t}\n\t\t\t}\n\t\t} else { // in Rhino or a web browser\n\t\t\troot.utf8 = utf8;\n\t\t}\n\t\n\t}(this));\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(25)(module), (function() { return this; }())))\n\n/***/ },\n/* 81 */\n/***/ function(module, exports) {\n\n\t/* WEBPACK VAR INJECTION */(function(__webpack_amd_options__) {module.exports = __webpack_amd_options__;\r\n\t\n\t/* WEBPACK VAR INJECTION */}.call(exports, {}))\n\n/***/ },\n/* 82 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t\n\t'use strict';\n\t\n\t// Shimming starts here.\n\t(function() {\n\t  // Utils.\n\t  var logging = __webpack_require__(1).log;\n\t  var browserDetails = __webpack_require__(1).browserDetails;\n\t  // Export to the adapter global object visible in the browser.\n\t  module.exports.browserDetails = browserDetails;\n\t  module.exports.extractVersion = __webpack_require__(1).extractVersion;\n\t  module.exports.disableLog = __webpack_require__(1).disableLog;\n\t\n\t  // Uncomment the line below if you want logging to occur, including logging\n\t  // for the switch statement below. Can also be turned on in the browser via\n\t  // adapter.disableLog(false), but then logging from the switch statement below\n\t  // will not appear.\n\t  // require('./utils').disableLog(false);\n\t\n\t  // Browser shims.\n\t  var chromeShim = __webpack_require__(83) || null;\n\t  var edgeShim = __webpack_require__(85) || null;\n\t  var firefoxShim = __webpack_require__(87) || null;\n\t  var safariShim = __webpack_require__(89) || null;\n\t\n\t  // Shim browser if found.\n\t  switch (browserDetails.browser) {\n\t    case 'opera': // fallthrough as it uses chrome shims\n\t    case 'chrome':\n\t      if (!chromeShim || !chromeShim.shimPeerConnection) {\n\t        logging('Chrome shim is not included in this adapter release.');\n\t        return;\n\t      }\n\t      logging('adapter.js shimming chrome.');\n\t      // Export to the adapter global object visible in the browser.\n\t      module.exports.browserShim = chromeShim;\n\t\n\t      chromeShim.shimGetUserMedia();\n\t      chromeShim.shimMediaStream();\n\t      chromeShim.shimSourceObject();\n\t      chromeShim.shimPeerConnection();\n\t      chromeShim.shimOnTrack();\n\t      break;\n\t    case 'firefox':\n\t      if (!firefoxShim || !firefoxShim.shimPeerConnection) {\n\t        logging('Firefox shim is not included in this adapter release.');\n\t        return;\n\t      }\n\t      logging('adapter.js shimming firefox.');\n\t      // Export to the adapter global object visible in the browser.\n\t      module.exports.browserShim = firefoxShim;\n\t\n\t      firefoxShim.shimGetUserMedia();\n\t      firefoxShim.shimSourceObject();\n\t      firefoxShim.shimPeerConnection();\n\t      firefoxShim.shimOnTrack();\n\t      break;\n\t    case 'edge':\n\t      if (!edgeShim || !edgeShim.shimPeerConnection) {\n\t        logging('MS edge shim is not included in this adapter release.');\n\t        return;\n\t      }\n\t      logging('adapter.js shimming edge.');\n\t      // Export to the adapter global object visible in the browser.\n\t      module.exports.browserShim = edgeShim;\n\t\n\t      edgeShim.shimGetUserMedia();\n\t      edgeShim.shimPeerConnection();\n\t      break;\n\t    case 'safari':\n\t      if (!safariShim) {\n\t        logging('Safari shim is not included in this adapter release.');\n\t        return;\n\t      }\n\t      logging('adapter.js shimming safari.');\n\t      // Export to the adapter global object visible in the browser.\n\t      module.exports.browserShim = safariShim;\n\t\n\t      safariShim.shimGetUserMedia();\n\t      break;\n\t    default:\n\t      logging('Unsupported browser!');\n\t  }\n\t})();\n\n\n/***/ },\n/* 83 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\tvar logging = __webpack_require__(1).log;\n\tvar browserDetails = __webpack_require__(1).browserDetails;\n\t\n\tvar chromeShim = {\n\t  shimMediaStream: function() {\n\t    window.MediaStream = window.MediaStream || window.webkitMediaStream;\n\t  },\n\t\n\t  shimOnTrack: function() {\n\t    if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n\t        window.RTCPeerConnection.prototype)) {\n\t      Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n\t        get: function() {\n\t          return this._ontrack;\n\t        },\n\t        set: function(f) {\n\t          var self = this;\n\t          if (this._ontrack) {\n\t            this.removeEventListener('track', this._ontrack);\n\t            this.removeEventListener('addstream', this._ontrackpoly);\n\t          }\n\t          this.addEventListener('track', this._ontrack = f);\n\t          this.addEventListener('addstream', this._ontrackpoly = function(e) {\n\t            // onaddstream does not fire when a track is added to an existing\n\t            // stream. But stream.onaddtrack is implemented so we use that.\n\t            e.stream.addEventListener('addtrack', function(te) {\n\t              var event = new Event('track');\n\t              event.track = te.track;\n\t              event.receiver = {track: te.track};\n\t              event.streams = [e.stream];\n\t              self.dispatchEvent(event);\n\t            });\n\t            e.stream.getTracks().forEach(function(track) {\n\t              var event = new Event('track');\n\t              event.track = track;\n\t              event.receiver = {track: track};\n\t              event.streams = [e.stream];\n\t              this.dispatchEvent(event);\n\t            }.bind(this));\n\t          }.bind(this));\n\t        }\n\t      });\n\t    }\n\t  },\n\t\n\t  shimSourceObject: function() {\n\t    if (typeof window === 'object') {\n\t      if (window.HTMLMediaElement &&\n\t        !('srcObject' in window.HTMLMediaElement.prototype)) {\n\t        // Shim the srcObject property, once, when HTMLMediaElement is found.\n\t        Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {\n\t          get: function() {\n\t            return this._srcObject;\n\t          },\n\t          set: function(stream) {\n\t            var self = this;\n\t            // Use _srcObject as a private property for this shim\n\t            this._srcObject = stream;\n\t            if (this.src) {\n\t              URL.revokeObjectURL(this.src);\n\t            }\n\t\n\t            if (!stream) {\n\t              this.src = '';\n\t              return;\n\t            }\n\t            this.src = URL.createObjectURL(stream);\n\t            // We need to recreate the blob url when a track is added or\n\t            // removed. Doing it manually since we want to avoid a recursion.\n\t            stream.addEventListener('addtrack', function() {\n\t              if (self.src) {\n\t                URL.revokeObjectURL(self.src);\n\t              }\n\t              self.src = URL.createObjectURL(stream);\n\t            });\n\t            stream.addEventListener('removetrack', function() {\n\t              if (self.src) {\n\t                URL.revokeObjectURL(self.src);\n\t              }\n\t              self.src = URL.createObjectURL(stream);\n\t            });\n\t          }\n\t        });\n\t      }\n\t    }\n\t  },\n\t\n\t  shimPeerConnection: function() {\n\t    // The RTCPeerConnection object.\n\t    window.RTCPeerConnection = function(pcConfig, pcConstraints) {\n\t      // Translate iceTransportPolicy to iceTransports,\n\t      // see https://code.google.com/p/webrtc/issues/detail?id=4869\n\t      logging('PeerConnection');\n\t      if (pcConfig && pcConfig.iceTransportPolicy) {\n\t        pcConfig.iceTransports = pcConfig.iceTransportPolicy;\n\t      }\n\t\n\t      var pc = new webkitRTCPeerConnection(pcConfig, pcConstraints);\n\t      var origGetStats = pc.getStats.bind(pc);\n\t      pc.getStats = function(selector, successCallback, errorCallback) {\n\t        var self = this;\n\t        var args = arguments;\n\t\n\t        // If selector is a function then we are in the old style stats so just\n\t        // pass back the original getStats format to avoid breaking old users.\n\t        if (arguments.length > 0 && typeof selector === 'function') {\n\t          return origGetStats(selector, successCallback);\n\t        }\n\t\n\t        var fixChromeStats_ = function(response) {\n\t          var standardReport = {};\n\t          var reports = response.result();\n\t          reports.forEach(function(report) {\n\t            var standardStats = {\n\t              id: report.id,\n\t              timestamp: report.timestamp,\n\t              type: report.type\n\t            };\n\t            report.names().forEach(function(name) {\n\t              standardStats[name] = report.stat(name);\n\t            });\n\t            standardReport[standardStats.id] = standardStats;\n\t          });\n\t\n\t          return standardReport;\n\t        };\n\t\n\t        // shim getStats with maplike support\n\t        var makeMapStats = function(stats, legacyStats) {\n\t          var map = new Map(Object.keys(stats).map(function(key) {\n\t            return[key, stats[key]];\n\t          }));\n\t          legacyStats = legacyStats || stats;\n\t          Object.keys(legacyStats).forEach(function(key) {\n\t            map[key] = legacyStats[key];\n\t          });\n\t          return map;\n\t        };\n\t\n\t        if (arguments.length >= 2) {\n\t          var successCallbackWrapper_ = function(response) {\n\t            args[1](makeMapStats(fixChromeStats_(response)));\n\t          };\n\t\n\t          return origGetStats.apply(this, [successCallbackWrapper_,\n\t              arguments[0]]);\n\t        }\n\t\n\t        // promise-support\n\t        return new Promise(function(resolve, reject) {\n\t          if (args.length === 1 && typeof selector === 'object') {\n\t            origGetStats.apply(self, [\n\t              function(response) {\n\t                resolve(makeMapStats(fixChromeStats_(response)));\n\t              }, reject]);\n\t          } else {\n\t            // Preserve legacy chrome stats only on legacy access of stats obj\n\t            origGetStats.apply(self, [\n\t              function(response) {\n\t                resolve(makeMapStats(fixChromeStats_(response),\n\t                    response.result()));\n\t              }, reject]);\n\t          }\n\t        }).then(successCallback, errorCallback);\n\t      };\n\t\n\t      return pc;\n\t    };\n\t    window.RTCPeerConnection.prototype = webkitRTCPeerConnection.prototype;\n\t\n\t    // wrap static methods. Currently just generateCertificate.\n\t    if (webkitRTCPeerConnection.generateCertificate) {\n\t      Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {\n\t        get: function() {\n\t          return webkitRTCPeerConnection.generateCertificate;\n\t        }\n\t      });\n\t    }\n\t\n\t    ['createOffer', 'createAnswer'].forEach(function(method) {\n\t      var nativeMethod = webkitRTCPeerConnection.prototype[method];\n\t      webkitRTCPeerConnection.prototype[method] = function() {\n\t        var self = this;\n\t        if (arguments.length < 1 || (arguments.length === 1 &&\n\t            typeof arguments[0] === 'object')) {\n\t          var opts = arguments.length === 1 ? arguments[0] : undefined;\n\t          return new Promise(function(resolve, reject) {\n\t            nativeMethod.apply(self, [resolve, reject, opts]);\n\t          });\n\t        }\n\t        return nativeMethod.apply(this, arguments);\n\t      };\n\t    });\n\t\n\t    // add promise support -- natively available in Chrome 51\n\t    if (browserDetails.version < 51) {\n\t      ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n\t          .forEach(function(method) {\n\t            var nativeMethod = webkitRTCPeerConnection.prototype[method];\n\t            webkitRTCPeerConnection.prototype[method] = function() {\n\t              var args = arguments;\n\t              var self = this;\n\t              var promise = new Promise(function(resolve, reject) {\n\t                nativeMethod.apply(self, [args[0], resolve, reject]);\n\t              });\n\t              if (args.length < 2) {\n\t                return promise;\n\t              }\n\t              return promise.then(function() {\n\t                args[1].apply(null, []);\n\t              },\n\t              function(err) {\n\t                if (args.length >= 3) {\n\t                  args[2].apply(null, [err]);\n\t                }\n\t              });\n\t            };\n\t          });\n\t    }\n\t\n\t    // support for addIceCandidate(null)\n\t    var nativeAddIceCandidate =\n\t        RTCPeerConnection.prototype.addIceCandidate;\n\t    RTCPeerConnection.prototype.addIceCandidate = function() {\n\t      return arguments[0] === null ? Promise.resolve()\n\t          : nativeAddIceCandidate.apply(this, arguments);\n\t    };\n\t\n\t    // shim implicit creation of RTCSessionDescription/RTCIceCandidate\n\t    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n\t        .forEach(function(method) {\n\t          var nativeMethod = webkitRTCPeerConnection.prototype[method];\n\t          webkitRTCPeerConnection.prototype[method] = function() {\n\t            arguments[0] = new ((method === 'addIceCandidate') ?\n\t                RTCIceCandidate : RTCSessionDescription)(arguments[0]);\n\t            return nativeMethod.apply(this, arguments);\n\t          };\n\t        });\n\t  },\n\t\n\t  // Attach a media stream to an element.\n\t  attachMediaStream: function(element, stream) {\n\t    logging('DEPRECATED, attachMediaStream will soon be removed.');\n\t    if (browserDetails.version >= 43) {\n\t      element.srcObject = stream;\n\t    } else if (typeof element.src !== 'undefined') {\n\t      element.src = URL.createObjectURL(stream);\n\t    } else {\n\t      logging('Error attaching stream to element.');\n\t    }\n\t  },\n\t\n\t  reattachMediaStream: function(to, from) {\n\t    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n\t    if (browserDetails.version >= 43) {\n\t      to.srcObject = from.srcObject;\n\t    } else {\n\t      to.src = from.src;\n\t    }\n\t  }\n\t};\n\t\n\t\n\t// Expose public methods.\n\tmodule.exports = {\n\t  shimMediaStream: chromeShim.shimMediaStream,\n\t  shimOnTrack: chromeShim.shimOnTrack,\n\t  shimSourceObject: chromeShim.shimSourceObject,\n\t  shimPeerConnection: chromeShim.shimPeerConnection,\n\t  shimGetUserMedia: __webpack_require__(84),\n\t  attachMediaStream: chromeShim.attachMediaStream,\n\t  reattachMediaStream: chromeShim.reattachMediaStream\n\t};\n\n\n/***/ },\n/* 84 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\tvar logging = __webpack_require__(1).log;\n\t\n\t// Expose public methods.\n\tmodule.exports = function() {\n\t  var constraintsToChrome_ = function(c) {\n\t    if (typeof c !== 'object' || c.mandatory || c.optional) {\n\t      return c;\n\t    }\n\t    var cc = {};\n\t    Object.keys(c).forEach(function(key) {\n\t      if (key === 'require' || key === 'advanced' || key === 'mediaSource') {\n\t        return;\n\t      }\n\t      var r = (typeof c[key] === 'object') ? c[key] : {ideal: c[key]};\n\t      if (r.exact !== undefined && typeof r.exact === 'number') {\n\t        r.min = r.max = r.exact;\n\t      }\n\t      var oldname_ = function(prefix, name) {\n\t        if (prefix) {\n\t          return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n\t        }\n\t        return (name === 'deviceId') ? 'sourceId' : name;\n\t      };\n\t      if (r.ideal !== undefined) {\n\t        cc.optional = cc.optional || [];\n\t        var oc = {};\n\t        if (typeof r.ideal === 'number') {\n\t          oc[oldname_('min', key)] = r.ideal;\n\t          cc.optional.push(oc);\n\t          oc = {};\n\t          oc[oldname_('max', key)] = r.ideal;\n\t          cc.optional.push(oc);\n\t        } else {\n\t          oc[oldname_('', key)] = r.ideal;\n\t          cc.optional.push(oc);\n\t        }\n\t      }\n\t      if (r.exact !== undefined && typeof r.exact !== 'number') {\n\t        cc.mandatory = cc.mandatory || {};\n\t        cc.mandatory[oldname_('', key)] = r.exact;\n\t      } else {\n\t        ['min', 'max'].forEach(function(mix) {\n\t          if (r[mix] !== undefined) {\n\t            cc.mandatory = cc.mandatory || {};\n\t            cc.mandatory[oldname_(mix, key)] = r[mix];\n\t          }\n\t        });\n\t      }\n\t    });\n\t    if (c.advanced) {\n\t      cc.optional = (cc.optional || []).concat(c.advanced);\n\t    }\n\t    return cc;\n\t  };\n\t\n\t  var shimConstraints_ = function(constraints, func) {\n\t    constraints = JSON.parse(JSON.stringify(constraints));\n\t    if (constraints && constraints.audio) {\n\t      constraints.audio = constraintsToChrome_(constraints.audio);\n\t    }\n\t    if (constraints && typeof constraints.video === 'object') {\n\t      // Shim facingMode for mobile, where it defaults to \"user\".\n\t      var face = constraints.video.facingMode;\n\t      face = face && ((typeof face === 'object') ? face : {ideal: face});\n\t\n\t      if ((face && (face.exact === 'user' || face.exact === 'environment' ||\n\t                    face.ideal === 'user' || face.ideal === 'environment')) &&\n\t          !(navigator.mediaDevices.getSupportedConstraints &&\n\t            navigator.mediaDevices.getSupportedConstraints().facingMode)) {\n\t        delete constraints.video.facingMode;\n\t        if (face.exact === 'environment' || face.ideal === 'environment') {\n\t          // Look for \"back\" in label, or use last cam (typically back cam).\n\t          return navigator.mediaDevices.enumerateDevices()\n\t          .then(function(devices) {\n\t            devices = devices.filter(function(d) {\n\t              return d.kind === 'videoinput';\n\t            });\n\t            var back = devices.find(function(d) {\n\t              return d.label.toLowerCase().indexOf('back') !== -1;\n\t            }) || (devices.length && devices[devices.length - 1]);\n\t            if (back) {\n\t              constraints.video.deviceId = face.exact ? {exact: back.deviceId} :\n\t                                                        {ideal: back.deviceId};\n\t            }\n\t            constraints.video = constraintsToChrome_(constraints.video);\n\t            logging('chrome: ' + JSON.stringify(constraints));\n\t            return func(constraints);\n\t          });\n\t        }\n\t      }\n\t      constraints.video = constraintsToChrome_(constraints.video);\n\t    }\n\t    logging('chrome: ' + JSON.stringify(constraints));\n\t    return func(constraints);\n\t  };\n\t\n\t  var shimError_ = function(e) {\n\t    return {\n\t      name: {\n\t        PermissionDeniedError: 'NotAllowedError',\n\t        ConstraintNotSatisfiedError: 'OverconstrainedError'\n\t      }[e.name] || e.name,\n\t      message: e.message,\n\t      constraint: e.constraintName,\n\t      toString: function() {\n\t        return this.name + (this.message && ': ') + this.message;\n\t      }\n\t    };\n\t  };\n\t\n\t  var getUserMedia_ = function(constraints, onSuccess, onError) {\n\t    shimConstraints_(constraints, function(c) {\n\t      navigator.webkitGetUserMedia(c, onSuccess, function(e) {\n\t        onError(shimError_(e));\n\t      });\n\t    });\n\t  };\n\t\n\t  navigator.getUserMedia = getUserMedia_;\n\t\n\t  // Returns the result of getUserMedia as a Promise.\n\t  var getUserMediaPromise_ = function(constraints) {\n\t    return new Promise(function(resolve, reject) {\n\t      navigator.getUserMedia(constraints, resolve, reject);\n\t    });\n\t  };\n\t\n\t  if (!navigator.mediaDevices) {\n\t    navigator.mediaDevices = {\n\t      getUserMedia: getUserMediaPromise_,\n\t      enumerateDevices: function() {\n\t        return new Promise(function(resolve) {\n\t          var kinds = {audio: 'audioinput', video: 'videoinput'};\n\t          return MediaStreamTrack.getSources(function(devices) {\n\t            resolve(devices.map(function(device) {\n\t              return {label: device.label,\n\t                      kind: kinds[device.kind],\n\t                      deviceId: device.id,\n\t                      groupId: ''};\n\t            }));\n\t          });\n\t        });\n\t      }\n\t    };\n\t  }\n\t\n\t  // A shim for getUserMedia method on the mediaDevices object.\n\t  // TODO(KaptenJansson) remove once implemented in Chrome stable.\n\t  if (!navigator.mediaDevices.getUserMedia) {\n\t    navigator.mediaDevices.getUserMedia = function(constraints) {\n\t      return getUserMediaPromise_(constraints);\n\t    };\n\t  } else {\n\t    // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia\n\t    // function which returns a Promise, it does not accept spec-style\n\t    // constraints.\n\t    var origGetUserMedia = navigator.mediaDevices.getUserMedia.\n\t        bind(navigator.mediaDevices);\n\t    navigator.mediaDevices.getUserMedia = function(cs) {\n\t      return shimConstraints_(cs, function(c) {\n\t        return origGetUserMedia(c).catch(function(e) {\n\t          return Promise.reject(shimError_(e));\n\t        });\n\t      });\n\t    };\n\t  }\n\t\n\t  // Dummy devicechange event methods.\n\t  // TODO(KaptenJansson) remove once implemented in Chrome stable.\n\t  if (typeof navigator.mediaDevices.addEventListener === 'undefined') {\n\t    navigator.mediaDevices.addEventListener = function() {\n\t      logging('Dummy mediaDevices.addEventListener called.');\n\t    };\n\t  }\n\t  if (typeof navigator.mediaDevices.removeEventListener === 'undefined') {\n\t    navigator.mediaDevices.removeEventListener = function() {\n\t      logging('Dummy mediaDevices.removeEventListener called.');\n\t    };\n\t  }\n\t};\n\n\n/***/ },\n/* 85 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\t\n\tvar SDPUtils = __webpack_require__(74);\n\tvar logging = __webpack_require__(1).log;\n\t\n\tvar edgeShim = {\n\t  shimPeerConnection: function() {\n\t    if (window.RTCIceGatherer) {\n\t      // ORTC defines an RTCIceCandidate object but no constructor.\n\t      // Not implemented in Edge.\n\t      if (!window.RTCIceCandidate) {\n\t        window.RTCIceCandidate = function(args) {\n\t          return args;\n\t        };\n\t      }\n\t      // ORTC does not have a session description object but\n\t      // other browsers (i.e. Chrome) that will support both PC and ORTC\n\t      // in the future might have this defined already.\n\t      if (!window.RTCSessionDescription) {\n\t        window.RTCSessionDescription = function(args) {\n\t          return args;\n\t        };\n\t      }\n\t    }\n\t\n\t    window.RTCPeerConnection = function(config) {\n\t      var self = this;\n\t\n\t      var _eventTarget = document.createDocumentFragment();\n\t      ['addEventListener', 'removeEventListener', 'dispatchEvent']\n\t          .forEach(function(method) {\n\t            self[method] = _eventTarget[method].bind(_eventTarget);\n\t          });\n\t\n\t      this.onicecandidate = null;\n\t      this.onaddstream = null;\n\t      this.ontrack = null;\n\t      this.onremovestream = null;\n\t      this.onsignalingstatechange = null;\n\t      this.oniceconnectionstatechange = null;\n\t      this.onnegotiationneeded = null;\n\t      this.ondatachannel = null;\n\t\n\t      this.localStreams = [];\n\t      this.remoteStreams = [];\n\t      this.getLocalStreams = function() {\n\t        return self.localStreams;\n\t      };\n\t      this.getRemoteStreams = function() {\n\t        return self.remoteStreams;\n\t      };\n\t\n\t      this.localDescription = new RTCSessionDescription({\n\t        type: '',\n\t        sdp: ''\n\t      });\n\t      this.remoteDescription = new RTCSessionDescription({\n\t        type: '',\n\t        sdp: ''\n\t      });\n\t      this.signalingState = 'stable';\n\t      this.iceConnectionState = 'new';\n\t      this.iceGatheringState = 'new';\n\t\n\t      this.iceOptions = {\n\t        gatherPolicy: 'all',\n\t        iceServers: []\n\t      };\n\t      if (config && config.iceTransportPolicy) {\n\t        switch (config.iceTransportPolicy) {\n\t          case 'all':\n\t          case 'relay':\n\t            this.iceOptions.gatherPolicy = config.iceTransportPolicy;\n\t            break;\n\t          case 'none':\n\t            // FIXME: remove once implementation and spec have added this.\n\t            throw new TypeError('iceTransportPolicy \"none\" not supported');\n\t          default:\n\t            // don't set iceTransportPolicy.\n\t            break;\n\t        }\n\t      }\n\t      this.usingBundle = config && config.bundlePolicy === 'max-bundle';\n\t\n\t      if (config && config.iceServers) {\n\t        // Edge does not like\n\t        // 1) stun:\n\t        // 2) turn: that does not have all of turn:host:port?transport=udp\n\t        var iceServers = JSON.parse(JSON.stringify(config.iceServers));\n\t        this.iceOptions.iceServers = iceServers.filter(function(server) {\n\t          if (server && server.urls) {\n\t            var urls = server.urls;\n\t            if (typeof urls === 'string') {\n\t              urls = [urls];\n\t            }\n\t            urls = urls.filter(function(url) {\n\t              return url.indexOf('turn:') === 0 &&\n\t                  url.indexOf('transport=udp') !== -1;\n\t            })[0];\n\t            return !!urls;\n\t          }\n\t          return false;\n\t        });\n\t      }\n\t\n\t      // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ...\n\t      // everything that is needed to describe a SDP m-line.\n\t      this.transceivers = [];\n\t\n\t      // since the iceGatherer is currently created in createOffer but we\n\t      // must not emit candidates until after setLocalDescription we buffer\n\t      // them in this array.\n\t      this._localIceCandidatesBuffer = [];\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype._emitBufferedCandidates = function() {\n\t      var self = this;\n\t      var sections = SDPUtils.splitSections(self.localDescription.sdp);\n\t      // FIXME: need to apply ice candidates in a way which is async but\n\t      // in-order\n\t      this._localIceCandidatesBuffer.forEach(function(event) {\n\t        var end = !event.candidate || Object.keys(event.candidate).length === 0;\n\t        if (end) {\n\t          for (var j = 1; j < sections.length; j++) {\n\t            if (sections[j].indexOf('\\r\\na=end-of-candidates\\r\\n') === -1) {\n\t              sections[j] += 'a=end-of-candidates\\r\\n';\n\t            }\n\t          }\n\t        } else if (event.candidate.candidate.indexOf('typ endOfCandidates')\n\t            === -1) {\n\t          sections[event.candidate.sdpMLineIndex + 1] +=\n\t              'a=' + event.candidate.candidate + '\\r\\n';\n\t        }\n\t        self.localDescription.sdp = sections.join('');\n\t        self.dispatchEvent(event);\n\t        if (self.onicecandidate !== null) {\n\t          self.onicecandidate(event);\n\t        }\n\t        if (!event.candidate && self.iceGatheringState !== 'complete') {\n\t          var complete = self.transceivers.every(function(transceiver) {\n\t            return transceiver.iceGatherer &&\n\t                transceiver.iceGatherer.state === 'completed';\n\t          });\n\t          if (complete) {\n\t            self.iceGatheringState = 'complete';\n\t          }\n\t        }\n\t      });\n\t      this._localIceCandidatesBuffer = [];\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.addStream = function(stream) {\n\t      // Clone is necessary for local demos mostly, attaching directly\n\t      // to two different senders does not work (build 10547).\n\t      this.localStreams.push(stream.clone());\n\t      this._maybeFireNegotiationNeeded();\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.removeStream = function(stream) {\n\t      var idx = this.localStreams.indexOf(stream);\n\t      if (idx > -1) {\n\t        this.localStreams.splice(idx, 1);\n\t        this._maybeFireNegotiationNeeded();\n\t      }\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.getSenders = function() {\n\t      return this.transceivers.filter(function(transceiver) {\n\t        return !!transceiver.rtpSender;\n\t      })\n\t      .map(function(transceiver) {\n\t        return transceiver.rtpSender;\n\t      });\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.getReceivers = function() {\n\t      return this.transceivers.filter(function(transceiver) {\n\t        return !!transceiver.rtpReceiver;\n\t      })\n\t      .map(function(transceiver) {\n\t        return transceiver.rtpReceiver;\n\t      });\n\t    };\n\t\n\t    // Determines the intersection of local and remote capabilities.\n\t    window.RTCPeerConnection.prototype._getCommonCapabilities =\n\t        function(localCapabilities, remoteCapabilities) {\n\t          var commonCapabilities = {\n\t            codecs: [],\n\t            headerExtensions: [],\n\t            fecMechanisms: []\n\t          };\n\t          localCapabilities.codecs.forEach(function(lCodec) {\n\t            for (var i = 0; i < remoteCapabilities.codecs.length; i++) {\n\t              var rCodec = remoteCapabilities.codecs[i];\n\t              if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() &&\n\t                  lCodec.clockRate === rCodec.clockRate &&\n\t                  lCodec.numChannels === rCodec.numChannels) {\n\t                // push rCodec so we reply with offerer payload type\n\t                commonCapabilities.codecs.push(rCodec);\n\t\n\t                // FIXME: also need to determine intersection between\n\t                // .rtcpFeedback and .parameters\n\t                break;\n\t              }\n\t            }\n\t          });\n\t\n\t          localCapabilities.headerExtensions\n\t              .forEach(function(lHeaderExtension) {\n\t                for (var i = 0; i < remoteCapabilities.headerExtensions.length;\n\t                     i++) {\n\t                  var rHeaderExtension = remoteCapabilities.headerExtensions[i];\n\t                  if (lHeaderExtension.uri === rHeaderExtension.uri) {\n\t                    commonCapabilities.headerExtensions.push(rHeaderExtension);\n\t                    break;\n\t                  }\n\t                }\n\t              });\n\t\n\t          // FIXME: fecMechanisms\n\t          return commonCapabilities;\n\t        };\n\t\n\t    // Create ICE gatherer, ICE transport and DTLS transport.\n\t    window.RTCPeerConnection.prototype._createIceAndDtlsTransports =\n\t        function(mid, sdpMLineIndex) {\n\t          var self = this;\n\t          var iceGatherer = new RTCIceGatherer(self.iceOptions);\n\t          var iceTransport = new RTCIceTransport(iceGatherer);\n\t          iceGatherer.onlocalcandidate = function(evt) {\n\t            var event = new Event('icecandidate');\n\t            event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex};\n\t\n\t            var cand = evt.candidate;\n\t            var end = !cand || Object.keys(cand).length === 0;\n\t            // Edge emits an empty object for RTCIceCandidateComplete‥\n\t            if (end) {\n\t              // polyfill since RTCIceGatherer.state is not implemented in\n\t              // Edge 10547 yet.\n\t              if (iceGatherer.state === undefined) {\n\t                iceGatherer.state = 'completed';\n\t              }\n\t\n\t              // Emit a candidate with type endOfCandidates to make the samples\n\t              // work. Edge requires addIceCandidate with this empty candidate\n\t              // to start checking. The real solution is to signal\n\t              // end-of-candidates to the other side when getting the null\n\t              // candidate but some apps (like the samples) don't do that.\n\t              event.candidate.candidate =\n\t                  'candidate:1 1 udp 1 0.0.0.0 9 typ endOfCandidates';\n\t            } else {\n\t              // RTCIceCandidate doesn't have a component, needs to be added\n\t              cand.component = iceTransport.component === 'RTCP' ? 2 : 1;\n\t              event.candidate.candidate = SDPUtils.writeCandidate(cand);\n\t            }\n\t\n\t            // update local description.\n\t            var sections = SDPUtils.splitSections(self.localDescription.sdp);\n\t            if (event.candidate.candidate.indexOf('typ endOfCandidates')\n\t                === -1) {\n\t              sections[event.candidate.sdpMLineIndex + 1] +=\n\t                  'a=' + event.candidate.candidate + '\\r\\n';\n\t            } else {\n\t              sections[event.candidate.sdpMLineIndex + 1] +=\n\t                  'a=end-of-candidates\\r\\n';\n\t            }\n\t            self.localDescription.sdp = sections.join('');\n\t\n\t            var complete = self.transceivers.every(function(transceiver) {\n\t              return transceiver.iceGatherer &&\n\t                  transceiver.iceGatherer.state === 'completed';\n\t            });\n\t\n\t            // Emit candidate if localDescription is set.\n\t            // Also emits null candidate when all gatherers are complete.\n\t            switch (self.iceGatheringState) {\n\t              case 'new':\n\t                self._localIceCandidatesBuffer.push(event);\n\t                if (end && complete) {\n\t                  self._localIceCandidatesBuffer.push(\n\t                      new Event('icecandidate'));\n\t                }\n\t                break;\n\t              case 'gathering':\n\t                self._emitBufferedCandidates();\n\t                self.dispatchEvent(event);\n\t                if (self.onicecandidate !== null) {\n\t                  self.onicecandidate(event);\n\t                }\n\t                if (complete) {\n\t                  self.dispatchEvent(new Event('icecandidate'));\n\t                  if (self.onicecandidate !== null) {\n\t                    self.onicecandidate(new Event('icecandidate'));\n\t                  }\n\t                  self.iceGatheringState = 'complete';\n\t                }\n\t                break;\n\t              case 'complete':\n\t                // should not happen... currently!\n\t                break;\n\t              default: // no-op.\n\t                break;\n\t            }\n\t          };\n\t          iceTransport.onicestatechange = function() {\n\t            self._updateConnectionState();\n\t          };\n\t\n\t          var dtlsTransport = new RTCDtlsTransport(iceTransport);\n\t          dtlsTransport.ondtlsstatechange = function() {\n\t            self._updateConnectionState();\n\t          };\n\t          dtlsTransport.onerror = function() {\n\t            // onerror does not set state to failed by itself.\n\t            dtlsTransport.state = 'failed';\n\t            self._updateConnectionState();\n\t          };\n\t\n\t          return {\n\t            iceGatherer: iceGatherer,\n\t            iceTransport: iceTransport,\n\t            dtlsTransport: dtlsTransport\n\t          };\n\t        };\n\t\n\t    // Start the RTP Sender and Receiver for a transceiver.\n\t    window.RTCPeerConnection.prototype._transceive = function(transceiver,\n\t        send, recv) {\n\t      var params = this._getCommonCapabilities(transceiver.localCapabilities,\n\t          transceiver.remoteCapabilities);\n\t      if (send && transceiver.rtpSender) {\n\t        params.encodings = transceiver.sendEncodingParameters;\n\t        params.rtcp = {\n\t          cname: SDPUtils.localCName\n\t        };\n\t        if (transceiver.recvEncodingParameters.length) {\n\t          params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc;\n\t        }\n\t        transceiver.rtpSender.send(params);\n\t      }\n\t      if (recv && transceiver.rtpReceiver) {\n\t        params.encodings = transceiver.recvEncodingParameters;\n\t        params.rtcp = {\n\t          cname: transceiver.cname\n\t        };\n\t        if (transceiver.sendEncodingParameters.length) {\n\t          params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc;\n\t        }\n\t        transceiver.rtpReceiver.receive(params);\n\t      }\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.setLocalDescription =\n\t        function(description) {\n\t          var self = this;\n\t          var sections;\n\t          var sessionpart;\n\t          if (description.type === 'offer') {\n\t            // FIXME: What was the purpose of this empty if statement?\n\t            // if (!this._pendingOffer) {\n\t            // } else {\n\t            if (this._pendingOffer) {\n\t              // VERY limited support for SDP munging. Limited to:\n\t              // * changing the order of codecs\n\t              sections = SDPUtils.splitSections(description.sdp);\n\t              sessionpart = sections.shift();\n\t              sections.forEach(function(mediaSection, sdpMLineIndex) {\n\t                var caps = SDPUtils.parseRtpParameters(mediaSection);\n\t                self._pendingOffer[sdpMLineIndex].localCapabilities = caps;\n\t              });\n\t              this.transceivers = this._pendingOffer;\n\t              delete this._pendingOffer;\n\t            }\n\t          } else if (description.type === 'answer') {\n\t            sections = SDPUtils.splitSections(self.remoteDescription.sdp);\n\t            sessionpart = sections.shift();\n\t            var isIceLite = SDPUtils.matchPrefix(sessionpart,\n\t                'a=ice-lite').length > 0;\n\t            sections.forEach(function(mediaSection, sdpMLineIndex) {\n\t              var transceiver = self.transceivers[sdpMLineIndex];\n\t              var iceGatherer = transceiver.iceGatherer;\n\t              var iceTransport = transceiver.iceTransport;\n\t              var dtlsTransport = transceiver.dtlsTransport;\n\t              var localCapabilities = transceiver.localCapabilities;\n\t              var remoteCapabilities = transceiver.remoteCapabilities;\n\t              var rejected = mediaSection.split('\\n', 1)[0]\n\t                  .split(' ', 2)[1] === '0';\n\t\n\t              if (!rejected) {\n\t                var remoteIceParameters = SDPUtils.getIceParameters(\n\t                    mediaSection, sessionpart);\n\t                if (isIceLite) {\n\t                  var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:')\n\t                  .map(function(cand) {\n\t                    return SDPUtils.parseCandidate(cand);\n\t                  })\n\t                  .filter(function(cand) {\n\t                    return cand.component === '1';\n\t                  });\n\t                  // ice-lite only includes host candidates in the SDP so we can\n\t                  // use setRemoteCandidates (which implies an\n\t                  // RTCIceCandidateComplete)\n\t                  if (cands.length) {\n\t                    iceTransport.setRemoteCandidates(cands);\n\t                  }\n\t                }\n\t                var remoteDtlsParameters = SDPUtils.getDtlsParameters(\n\t                    mediaSection, sessionpart);\n\t                if (isIceLite) {\n\t                  remoteDtlsParameters.role = 'server';\n\t                }\n\t\n\t                if (!self.usingBundle || sdpMLineIndex === 0) {\n\t                  iceTransport.start(iceGatherer, remoteIceParameters,\n\t                      isIceLite ? 'controlling' : 'controlled');\n\t                  dtlsTransport.start(remoteDtlsParameters);\n\t                }\n\t\n\t                // Calculate intersection of capabilities.\n\t                var params = self._getCommonCapabilities(localCapabilities,\n\t                    remoteCapabilities);\n\t\n\t                // Start the RTCRtpSender. The RTCRtpReceiver for this\n\t                // transceiver has already been started in setRemoteDescription.\n\t                self._transceive(transceiver,\n\t                    params.codecs.length > 0,\n\t                    false);\n\t              }\n\t            });\n\t          }\n\t\n\t          this.localDescription = {\n\t            type: description.type,\n\t            sdp: description.sdp\n\t          };\n\t          switch (description.type) {\n\t            case 'offer':\n\t              this._updateSignalingState('have-local-offer');\n\t              break;\n\t            case 'answer':\n\t              this._updateSignalingState('stable');\n\t              break;\n\t            default:\n\t              throw new TypeError('unsupported type \"' + description.type +\n\t                  '\"');\n\t          }\n\t\n\t          // If a success callback was provided, emit ICE candidates after it\n\t          // has been executed. Otherwise, emit callback after the Promise is\n\t          // resolved.\n\t          var hasCallback = arguments.length > 1 &&\n\t            typeof arguments[1] === 'function';\n\t          if (hasCallback) {\n\t            var cb = arguments[1];\n\t            window.setTimeout(function() {\n\t              cb();\n\t              if (self.iceGatheringState === 'new') {\n\t                self.iceGatheringState = 'gathering';\n\t              }\n\t              self._emitBufferedCandidates();\n\t            }, 0);\n\t          }\n\t          var p = Promise.resolve();\n\t          p.then(function() {\n\t            if (!hasCallback) {\n\t              if (self.iceGatheringState === 'new') {\n\t                self.iceGatheringState = 'gathering';\n\t              }\n\t              // Usually candidates will be emitted earlier.\n\t              window.setTimeout(self._emitBufferedCandidates.bind(self), 500);\n\t            }\n\t          });\n\t          return p;\n\t        };\n\t\n\t    window.RTCPeerConnection.prototype.setRemoteDescription =\n\t        function(description) {\n\t          var self = this;\n\t          var stream = new MediaStream();\n\t          var receiverList = [];\n\t          var sections = SDPUtils.splitSections(description.sdp);\n\t          var sessionpart = sections.shift();\n\t          var isIceLite = SDPUtils.matchPrefix(sessionpart,\n\t              'a=ice-lite').length > 0;\n\t          this.usingBundle = SDPUtils.matchPrefix(sessionpart,\n\t              'a=group:BUNDLE ').length > 0;\n\t          sections.forEach(function(mediaSection, sdpMLineIndex) {\n\t            var lines = SDPUtils.splitLines(mediaSection);\n\t            var mline = lines[0].substr(2).split(' ');\n\t            var kind = mline[0];\n\t            var rejected = mline[1] === '0';\n\t            var direction = SDPUtils.getDirection(mediaSection, sessionpart);\n\t\n\t            var transceiver;\n\t            var iceGatherer;\n\t            var iceTransport;\n\t            var dtlsTransport;\n\t            var rtpSender;\n\t            var rtpReceiver;\n\t            var sendEncodingParameters;\n\t            var recvEncodingParameters;\n\t            var localCapabilities;\n\t\n\t            var track;\n\t            // FIXME: ensure the mediaSection has rtcp-mux set.\n\t            var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection);\n\t            var remoteIceParameters;\n\t            var remoteDtlsParameters;\n\t            if (!rejected) {\n\t              remoteIceParameters = SDPUtils.getIceParameters(mediaSection,\n\t                  sessionpart);\n\t              remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection,\n\t                  sessionpart);\n\t              remoteDtlsParameters.role = 'client';\n\t            }\n\t            recvEncodingParameters =\n\t                SDPUtils.parseRtpEncodingParameters(mediaSection);\n\t\n\t            var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:');\n\t            if (mid.length) {\n\t              mid = mid[0].substr(6);\n\t            } else {\n\t              mid = SDPUtils.generateIdentifier();\n\t            }\n\t\n\t            var cname;\n\t            // Gets the first SSRC. Note that with RTX there might be multiple\n\t            // SSRCs.\n\t            var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:')\n\t                .map(function(line) {\n\t                  return SDPUtils.parseSsrcMedia(line);\n\t                })\n\t                .filter(function(obj) {\n\t                  return obj.attribute === 'cname';\n\t                })[0];\n\t            if (remoteSsrc) {\n\t              cname = remoteSsrc.value;\n\t            }\n\t\n\t            var isComplete = SDPUtils.matchPrefix(mediaSection,\n\t                'a=end-of-candidates').length > 0;\n\t            var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:')\n\t                .map(function(cand) {\n\t                  return SDPUtils.parseCandidate(cand);\n\t                })\n\t                .filter(function(cand) {\n\t                  return cand.component === '1';\n\t                });\n\t            if (description.type === 'offer' && !rejected) {\n\t              var transports = self.usingBundle && sdpMLineIndex > 0 ? {\n\t                iceGatherer: self.transceivers[0].iceGatherer,\n\t                iceTransport: self.transceivers[0].iceTransport,\n\t                dtlsTransport: self.transceivers[0].dtlsTransport\n\t              } : self._createIceAndDtlsTransports(mid, sdpMLineIndex);\n\t\n\t              if (isComplete) {\n\t                transports.iceTransport.setRemoteCandidates(cands);\n\t              }\n\t\n\t              localCapabilities = RTCRtpReceiver.getCapabilities(kind);\n\t              sendEncodingParameters = [{\n\t                ssrc: (2 * sdpMLineIndex + 2) * 1001\n\t              }];\n\t\n\t              rtpReceiver = new RTCRtpReceiver(transports.dtlsTransport, kind);\n\t\n\t              track = rtpReceiver.track;\n\t              receiverList.push([track, rtpReceiver]);\n\t              // FIXME: not correct when there are multiple streams but that is\n\t              // not currently supported in this shim.\n\t              stream.addTrack(track);\n\t\n\t              // FIXME: look at direction.\n\t              if (self.localStreams.length > 0 &&\n\t                  self.localStreams[0].getTracks().length >= sdpMLineIndex) {\n\t                // FIXME: actually more complicated, needs to match types etc\n\t                var localtrack = self.localStreams[0]\n\t                    .getTracks()[sdpMLineIndex];\n\t                rtpSender = new RTCRtpSender(localtrack,\n\t                    transports.dtlsTransport);\n\t              }\n\t\n\t              self.transceivers[sdpMLineIndex] = {\n\t                iceGatherer: transports.iceGatherer,\n\t                iceTransport: transports.iceTransport,\n\t                dtlsTransport: transports.dtlsTransport,\n\t                localCapabilities: localCapabilities,\n\t                remoteCapabilities: remoteCapabilities,\n\t                rtpSender: rtpSender,\n\t                rtpReceiver: rtpReceiver,\n\t                kind: kind,\n\t                mid: mid,\n\t                cname: cname,\n\t                sendEncodingParameters: sendEncodingParameters,\n\t                recvEncodingParameters: recvEncodingParameters\n\t              };\n\t              // Start the RTCRtpReceiver now. The RTPSender is started in\n\t              // setLocalDescription.\n\t              self._transceive(self.transceivers[sdpMLineIndex],\n\t                  false,\n\t                  direction === 'sendrecv' || direction === 'sendonly');\n\t            } else if (description.type === 'answer' && !rejected) {\n\t              transceiver = self.transceivers[sdpMLineIndex];\n\t              iceGatherer = transceiver.iceGatherer;\n\t              iceTransport = transceiver.iceTransport;\n\t              dtlsTransport = transceiver.dtlsTransport;\n\t              rtpSender = transceiver.rtpSender;\n\t              rtpReceiver = transceiver.rtpReceiver;\n\t              sendEncodingParameters = transceiver.sendEncodingParameters;\n\t              localCapabilities = transceiver.localCapabilities;\n\t\n\t              self.transceivers[sdpMLineIndex].recvEncodingParameters =\n\t                  recvEncodingParameters;\n\t              self.transceivers[sdpMLineIndex].remoteCapabilities =\n\t                  remoteCapabilities;\n\t              self.transceivers[sdpMLineIndex].cname = cname;\n\t\n\t              if ((isIceLite || isComplete) && cands.length) {\n\t                iceTransport.setRemoteCandidates(cands);\n\t              }\n\t              if (!self.usingBundle || sdpMLineIndex === 0) {\n\t                iceTransport.start(iceGatherer, remoteIceParameters,\n\t                    'controlling');\n\t                dtlsTransport.start(remoteDtlsParameters);\n\t              }\n\t\n\t              self._transceive(transceiver,\n\t                  direction === 'sendrecv' || direction === 'recvonly',\n\t                  direction === 'sendrecv' || direction === 'sendonly');\n\t\n\t              if (rtpReceiver &&\n\t                  (direction === 'sendrecv' || direction === 'sendonly')) {\n\t                track = rtpReceiver.track;\n\t                receiverList.push([track, rtpReceiver]);\n\t                stream.addTrack(track);\n\t              } else {\n\t                // FIXME: actually the receiver should be created later.\n\t                delete transceiver.rtpReceiver;\n\t              }\n\t            }\n\t          });\n\t\n\t          this.remoteDescription = {\n\t            type: description.type,\n\t            sdp: description.sdp\n\t          };\n\t          switch (description.type) {\n\t            case 'offer':\n\t              this._updateSignalingState('have-remote-offer');\n\t              break;\n\t            case 'answer':\n\t              this._updateSignalingState('stable');\n\t              break;\n\t            default:\n\t              throw new TypeError('unsupported type \"' + description.type +\n\t                  '\"');\n\t          }\n\t          if (stream.getTracks().length) {\n\t            self.remoteStreams.push(stream);\n\t            window.setTimeout(function() {\n\t              var event = new Event('addstream');\n\t              event.stream = stream;\n\t              self.dispatchEvent(event);\n\t              if (self.onaddstream !== null) {\n\t                window.setTimeout(function() {\n\t                  self.onaddstream(event);\n\t                }, 0);\n\t              }\n\t\n\t              receiverList.forEach(function(item) {\n\t                var track = item[0];\n\t                var receiver = item[1];\n\t                var trackEvent = new Event('track');\n\t                trackEvent.track = track;\n\t                trackEvent.receiver = receiver;\n\t                trackEvent.streams = [stream];\n\t                self.dispatchEvent(event);\n\t                if (self.ontrack !== null) {\n\t                  window.setTimeout(function() {\n\t                    self.ontrack(trackEvent);\n\t                  }, 0);\n\t                }\n\t              });\n\t            }, 0);\n\t          }\n\t          if (arguments.length > 1 && typeof arguments[1] === 'function') {\n\t            window.setTimeout(arguments[1], 0);\n\t          }\n\t          return Promise.resolve();\n\t        };\n\t\n\t    window.RTCPeerConnection.prototype.close = function() {\n\t      this.transceivers.forEach(function(transceiver) {\n\t        /* not yet\n\t        if (transceiver.iceGatherer) {\n\t          transceiver.iceGatherer.close();\n\t        }\n\t        */\n\t        if (transceiver.iceTransport) {\n\t          transceiver.iceTransport.stop();\n\t        }\n\t        if (transceiver.dtlsTransport) {\n\t          transceiver.dtlsTransport.stop();\n\t        }\n\t        if (transceiver.rtpSender) {\n\t          transceiver.rtpSender.stop();\n\t        }\n\t        if (transceiver.rtpReceiver) {\n\t          transceiver.rtpReceiver.stop();\n\t        }\n\t      });\n\t      // FIXME: clean up tracks, local streams, remote streams, etc\n\t      this._updateSignalingState('closed');\n\t    };\n\t\n\t    // Update the signaling state.\n\t    window.RTCPeerConnection.prototype._updateSignalingState =\n\t        function(newState) {\n\t          this.signalingState = newState;\n\t          var event = new Event('signalingstatechange');\n\t          this.dispatchEvent(event);\n\t          if (this.onsignalingstatechange !== null) {\n\t            this.onsignalingstatechange(event);\n\t          }\n\t        };\n\t\n\t    // Determine whether to fire the negotiationneeded event.\n\t    window.RTCPeerConnection.prototype._maybeFireNegotiationNeeded =\n\t        function() {\n\t          // Fire away (for now).\n\t          var event = new Event('negotiationneeded');\n\t          this.dispatchEvent(event);\n\t          if (this.onnegotiationneeded !== null) {\n\t            this.onnegotiationneeded(event);\n\t          }\n\t        };\n\t\n\t    // Update the connection state.\n\t    window.RTCPeerConnection.prototype._updateConnectionState = function() {\n\t      var self = this;\n\t      var newState;\n\t      var states = {\n\t        'new': 0,\n\t        closed: 0,\n\t        connecting: 0,\n\t        checking: 0,\n\t        connected: 0,\n\t        completed: 0,\n\t        failed: 0\n\t      };\n\t      this.transceivers.forEach(function(transceiver) {\n\t        states[transceiver.iceTransport.state]++;\n\t        states[transceiver.dtlsTransport.state]++;\n\t      });\n\t      // ICETransport.completed and connected are the same for this purpose.\n\t      states.connected += states.completed;\n\t\n\t      newState = 'new';\n\t      if (states.failed > 0) {\n\t        newState = 'failed';\n\t      } else if (states.connecting > 0 || states.checking > 0) {\n\t        newState = 'connecting';\n\t      } else if (states.disconnected > 0) {\n\t        newState = 'disconnected';\n\t      } else if (states.new > 0) {\n\t        newState = 'new';\n\t      } else if (states.connected > 0 || states.completed > 0) {\n\t        newState = 'connected';\n\t      }\n\t\n\t      if (newState !== self.iceConnectionState) {\n\t        self.iceConnectionState = newState;\n\t        var event = new Event('iceconnectionstatechange');\n\t        this.dispatchEvent(event);\n\t        if (this.oniceconnectionstatechange !== null) {\n\t          this.oniceconnectionstatechange(event);\n\t        }\n\t      }\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.createOffer = function() {\n\t      var self = this;\n\t      if (this._pendingOffer) {\n\t        throw new Error('createOffer called while there is a pending offer.');\n\t      }\n\t      var offerOptions;\n\t      if (arguments.length === 1 && typeof arguments[0] !== 'function') {\n\t        offerOptions = arguments[0];\n\t      } else if (arguments.length === 3) {\n\t        offerOptions = arguments[2];\n\t      }\n\t\n\t      var tracks = [];\n\t      var numAudioTracks = 0;\n\t      var numVideoTracks = 0;\n\t      // Default to sendrecv.\n\t      if (this.localStreams.length) {\n\t        numAudioTracks = this.localStreams[0].getAudioTracks().length;\n\t        numVideoTracks = this.localStreams[0].getVideoTracks().length;\n\t      }\n\t      // Determine number of audio and video tracks we need to send/recv.\n\t      if (offerOptions) {\n\t        // Reject Chrome legacy constraints.\n\t        if (offerOptions.mandatory || offerOptions.optional) {\n\t          throw new TypeError(\n\t              'Legacy mandatory/optional constraints not supported.');\n\t        }\n\t        if (offerOptions.offerToReceiveAudio !== undefined) {\n\t          numAudioTracks = offerOptions.offerToReceiveAudio;\n\t        }\n\t        if (offerOptions.offerToReceiveVideo !== undefined) {\n\t          numVideoTracks = offerOptions.offerToReceiveVideo;\n\t        }\n\t      }\n\t      if (this.localStreams.length) {\n\t        // Push local streams.\n\t        this.localStreams[0].getTracks().forEach(function(track) {\n\t          tracks.push({\n\t            kind: track.kind,\n\t            track: track,\n\t            wantReceive: track.kind === 'audio' ?\n\t                numAudioTracks > 0 : numVideoTracks > 0\n\t          });\n\t          if (track.kind === 'audio') {\n\t            numAudioTracks--;\n\t          } else if (track.kind === 'video') {\n\t            numVideoTracks--;\n\t          }\n\t        });\n\t      }\n\t      // Create M-lines for recvonly streams.\n\t      while (numAudioTracks > 0 || numVideoTracks > 0) {\n\t        if (numAudioTracks > 0) {\n\t          tracks.push({\n\t            kind: 'audio',\n\t            wantReceive: true\n\t          });\n\t          numAudioTracks--;\n\t        }\n\t        if (numVideoTracks > 0) {\n\t          tracks.push({\n\t            kind: 'video',\n\t            wantReceive: true\n\t          });\n\t          numVideoTracks--;\n\t        }\n\t      }\n\t\n\t      var sdp = SDPUtils.writeSessionBoilerplate();\n\t      var transceivers = [];\n\t      tracks.forEach(function(mline, sdpMLineIndex) {\n\t        // For each track, create an ice gatherer, ice transport,\n\t        // dtls transport, potentially rtpsender and rtpreceiver.\n\t        var track = mline.track;\n\t        var kind = mline.kind;\n\t        var mid = SDPUtils.generateIdentifier();\n\t\n\t        var transports = self.usingBundle && sdpMLineIndex > 0 ? {\n\t          iceGatherer: transceivers[0].iceGatherer,\n\t          iceTransport: transceivers[0].iceTransport,\n\t          dtlsTransport: transceivers[0].dtlsTransport\n\t        } : self._createIceAndDtlsTransports(mid, sdpMLineIndex);\n\t\n\t        var localCapabilities = RTCRtpSender.getCapabilities(kind);\n\t        var rtpSender;\n\t        var rtpReceiver;\n\t\n\t        // generate an ssrc now, to be used later in rtpSender.send\n\t        var sendEncodingParameters = [{\n\t          ssrc: (2 * sdpMLineIndex + 1) * 1001\n\t        }];\n\t        if (track) {\n\t          rtpSender = new RTCRtpSender(track, transports.dtlsTransport);\n\t        }\n\t\n\t        if (mline.wantReceive) {\n\t          rtpReceiver = new RTCRtpReceiver(transports.dtlsTransport, kind);\n\t        }\n\t\n\t        transceivers[sdpMLineIndex] = {\n\t          iceGatherer: transports.iceGatherer,\n\t          iceTransport: transports.iceTransport,\n\t          dtlsTransport: transports.dtlsTransport,\n\t          localCapabilities: localCapabilities,\n\t          remoteCapabilities: null,\n\t          rtpSender: rtpSender,\n\t          rtpReceiver: rtpReceiver,\n\t          kind: kind,\n\t          mid: mid,\n\t          sendEncodingParameters: sendEncodingParameters,\n\t          recvEncodingParameters: null\n\t        };\n\t      });\n\t      if (this.usingBundle) {\n\t        sdp += 'a=group:BUNDLE ' + transceivers.map(function(t) {\n\t          return t.mid;\n\t        }).join(' ') + '\\r\\n';\n\t      }\n\t      tracks.forEach(function(mline, sdpMLineIndex) {\n\t        var transceiver = transceivers[sdpMLineIndex];\n\t        sdp += SDPUtils.writeMediaSection(transceiver,\n\t            transceiver.localCapabilities, 'offer', self.localStreams[0]);\n\t      });\n\t\n\t      this._pendingOffer = transceivers;\n\t      var desc = new RTCSessionDescription({\n\t        type: 'offer',\n\t        sdp: sdp\n\t      });\n\t      if (arguments.length && typeof arguments[0] === 'function') {\n\t        window.setTimeout(arguments[0], 0, desc);\n\t      }\n\t      return Promise.resolve(desc);\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.createAnswer = function() {\n\t      var self = this;\n\t\n\t      var sdp = SDPUtils.writeSessionBoilerplate();\n\t      if (this.usingBundle) {\n\t        sdp += 'a=group:BUNDLE ' + this.transceivers.map(function(t) {\n\t          return t.mid;\n\t        }).join(' ') + '\\r\\n';\n\t      }\n\t      this.transceivers.forEach(function(transceiver) {\n\t        // Calculate intersection of capabilities.\n\t        var commonCapabilities = self._getCommonCapabilities(\n\t            transceiver.localCapabilities,\n\t            transceiver.remoteCapabilities);\n\t\n\t        sdp += SDPUtils.writeMediaSection(transceiver, commonCapabilities,\n\t            'answer', self.localStreams[0]);\n\t      });\n\t\n\t      var desc = new RTCSessionDescription({\n\t        type: 'answer',\n\t        sdp: sdp\n\t      });\n\t      if (arguments.length && typeof arguments[0] === 'function') {\n\t        window.setTimeout(arguments[0], 0, desc);\n\t      }\n\t      return Promise.resolve(desc);\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.addIceCandidate = function(candidate) {\n\t      if (candidate === null) {\n\t        this.transceivers.forEach(function(transceiver) {\n\t          transceiver.iceTransport.addRemoteCandidate({});\n\t        });\n\t      } else {\n\t        var mLineIndex = candidate.sdpMLineIndex;\n\t        if (candidate.sdpMid) {\n\t          for (var i = 0; i < this.transceivers.length; i++) {\n\t            if (this.transceivers[i].mid === candidate.sdpMid) {\n\t              mLineIndex = i;\n\t              break;\n\t            }\n\t          }\n\t        }\n\t        var transceiver = this.transceivers[mLineIndex];\n\t        if (transceiver) {\n\t          var cand = Object.keys(candidate.candidate).length > 0 ?\n\t              SDPUtils.parseCandidate(candidate.candidate) : {};\n\t          // Ignore Chrome's invalid candidates since Edge does not like them.\n\t          if (cand.protocol === 'tcp' && cand.port === 0) {\n\t            return;\n\t          }\n\t          // Ignore RTCP candidates, we assume RTCP-MUX.\n\t          if (cand.component !== '1') {\n\t            return;\n\t          }\n\t          // A dirty hack to make samples work.\n\t          if (cand.type === 'endOfCandidates') {\n\t            cand = {};\n\t          }\n\t          transceiver.iceTransport.addRemoteCandidate(cand);\n\t\n\t          // update the remoteDescription.\n\t          var sections = SDPUtils.splitSections(this.remoteDescription.sdp);\n\t          sections[mLineIndex + 1] += (cand.type ? candidate.candidate.trim()\n\t              : 'a=end-of-candidates') + '\\r\\n';\n\t          this.remoteDescription.sdp = sections.join('');\n\t        }\n\t      }\n\t      if (arguments.length > 1 && typeof arguments[1] === 'function') {\n\t        window.setTimeout(arguments[1], 0);\n\t      }\n\t      return Promise.resolve();\n\t    };\n\t\n\t    window.RTCPeerConnection.prototype.getStats = function() {\n\t      var promises = [];\n\t      this.transceivers.forEach(function(transceiver) {\n\t        ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport',\n\t            'dtlsTransport'].forEach(function(method) {\n\t              if (transceiver[method]) {\n\t                promises.push(transceiver[method].getStats());\n\t              }\n\t            });\n\t      });\n\t      var cb = arguments.length > 1 && typeof arguments[1] === 'function' &&\n\t          arguments[1];\n\t      return new Promise(function(resolve) {\n\t        // shim getStats with maplike support\n\t        var results = new Map();\n\t        Promise.all(promises).then(function(res) {\n\t          res.forEach(function(result) {\n\t            Object.keys(result).forEach(function(id) {\n\t              results.set(id, result[id]);\n\t              results[id] = result[id];\n\t            });\n\t          });\n\t          if (cb) {\n\t            window.setTimeout(cb, 0, results);\n\t          }\n\t          resolve(results);\n\t        });\n\t      });\n\t    };\n\t  },\n\t\n\t  // Attach a media stream to an element.\n\t  attachMediaStream: function(element, stream) {\n\t    logging('DEPRECATED, attachMediaStream will soon be removed.');\n\t    element.srcObject = stream;\n\t  },\n\t\n\t  reattachMediaStream: function(to, from) {\n\t    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n\t    to.srcObject = from.srcObject;\n\t  }\n\t};\n\t\n\t// Expose public methods.\n\tmodule.exports = {\n\t  shimPeerConnection: edgeShim.shimPeerConnection,\n\t  shimGetUserMedia: __webpack_require__(86),\n\t  attachMediaStream: edgeShim.attachMediaStream,\n\t  reattachMediaStream: edgeShim.reattachMediaStream\n\t};\n\n\n/***/ },\n/* 86 */\n/***/ function(module, exports) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\t\n\t// Expose public methods.\n\tmodule.exports = function() {\n\t  var shimError_ = function(e) {\n\t    return {\n\t      name: {PermissionDeniedError: 'NotAllowedError'}[e.name] || e.name,\n\t      message: e.message,\n\t      constraint: e.constraint,\n\t      toString: function() {\n\t        return this.name;\n\t      }\n\t    };\n\t  };\n\t\n\t  // getUserMedia error shim.\n\t  var origGetUserMedia = navigator.mediaDevices.getUserMedia.\n\t      bind(navigator.mediaDevices);\n\t  navigator.mediaDevices.getUserMedia = function(c) {\n\t    return origGetUserMedia(c).catch(function(e) {\n\t      return Promise.reject(shimError_(e));\n\t    });\n\t  };\n\t};\n\n\n/***/ },\n/* 87 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\t\n\tvar logging = __webpack_require__(1).log;\n\tvar browserDetails = __webpack_require__(1).browserDetails;\n\t\n\tvar firefoxShim = {\n\t  shimOnTrack: function() {\n\t    if (typeof window === 'object' && window.RTCPeerConnection && !('ontrack' in\n\t        window.RTCPeerConnection.prototype)) {\n\t      Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', {\n\t        get: function() {\n\t          return this._ontrack;\n\t        },\n\t        set: function(f) {\n\t          if (this._ontrack) {\n\t            this.removeEventListener('track', this._ontrack);\n\t            this.removeEventListener('addstream', this._ontrackpoly);\n\t          }\n\t          this.addEventListener('track', this._ontrack = f);\n\t          this.addEventListener('addstream', this._ontrackpoly = function(e) {\n\t            e.stream.getTracks().forEach(function(track) {\n\t              var event = new Event('track');\n\t              event.track = track;\n\t              event.receiver = {track: track};\n\t              event.streams = [e.stream];\n\t              this.dispatchEvent(event);\n\t            }.bind(this));\n\t          }.bind(this));\n\t        }\n\t      });\n\t    }\n\t  },\n\t\n\t  shimSourceObject: function() {\n\t    // Firefox has supported mozSrcObject since FF22, unprefixed in 42.\n\t    if (typeof window === 'object') {\n\t      if (window.HTMLMediaElement &&\n\t        !('srcObject' in window.HTMLMediaElement.prototype)) {\n\t        // Shim the srcObject property, once, when HTMLMediaElement is found.\n\t        Object.defineProperty(window.HTMLMediaElement.prototype, 'srcObject', {\n\t          get: function() {\n\t            return this.mozSrcObject;\n\t          },\n\t          set: function(stream) {\n\t            this.mozSrcObject = stream;\n\t          }\n\t        });\n\t      }\n\t    }\n\t  },\n\t\n\t  shimPeerConnection: function() {\n\t    if (typeof window !== 'object' || !(window.RTCPeerConnection ||\n\t        window.mozRTCPeerConnection)) {\n\t      return; // probably media.peerconnection.enabled=false in about:config\n\t    }\n\t    // The RTCPeerConnection object.\n\t    if (!window.RTCPeerConnection) {\n\t      window.RTCPeerConnection = function(pcConfig, pcConstraints) {\n\t        if (browserDetails.version < 38) {\n\t          // .urls is not supported in FF < 38.\n\t          // create RTCIceServers with a single url.\n\t          if (pcConfig && pcConfig.iceServers) {\n\t            var newIceServers = [];\n\t            for (var i = 0; i < pcConfig.iceServers.length; i++) {\n\t              var server = pcConfig.iceServers[i];\n\t              if (server.hasOwnProperty('urls')) {\n\t                for (var j = 0; j < server.urls.length; j++) {\n\t                  var newServer = {\n\t                    url: server.urls[j]\n\t                  };\n\t                  if (server.urls[j].indexOf('turn') === 0) {\n\t                    newServer.username = server.username;\n\t                    newServer.credential = server.credential;\n\t                  }\n\t                  newIceServers.push(newServer);\n\t                }\n\t              } else {\n\t                newIceServers.push(pcConfig.iceServers[i]);\n\t              }\n\t            }\n\t            pcConfig.iceServers = newIceServers;\n\t          }\n\t        }\n\t        return new mozRTCPeerConnection(pcConfig, pcConstraints);\n\t      };\n\t      window.RTCPeerConnection.prototype = mozRTCPeerConnection.prototype;\n\t\n\t      // wrap static methods. Currently just generateCertificate.\n\t      if (mozRTCPeerConnection.generateCertificate) {\n\t        Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', {\n\t          get: function() {\n\t            return mozRTCPeerConnection.generateCertificate;\n\t          }\n\t        });\n\t      }\n\t\n\t      window.RTCSessionDescription = mozRTCSessionDescription;\n\t      window.RTCIceCandidate = mozRTCIceCandidate;\n\t    }\n\t\n\t    // shim away need for obsolete RTCIceCandidate/RTCSessionDescription.\n\t    ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']\n\t        .forEach(function(method) {\n\t          var nativeMethod = RTCPeerConnection.prototype[method];\n\t          RTCPeerConnection.prototype[method] = function() {\n\t            arguments[0] = new ((method === 'addIceCandidate') ?\n\t                RTCIceCandidate : RTCSessionDescription)(arguments[0]);\n\t            return nativeMethod.apply(this, arguments);\n\t          };\n\t        });\n\t\n\t    // support for addIceCandidate(null)\n\t    var nativeAddIceCandidate =\n\t        RTCPeerConnection.prototype.addIceCandidate;\n\t    RTCPeerConnection.prototype.addIceCandidate = function() {\n\t      return arguments[0] === null ? Promise.resolve()\n\t          : nativeAddIceCandidate.apply(this, arguments);\n\t    };\n\t\n\t    // shim getStats with maplike support\n\t    var makeMapStats = function(stats) {\n\t      var map = new Map();\n\t      Object.keys(stats).forEach(function(key) {\n\t        map.set(key, stats[key]);\n\t        map[key] = stats[key];\n\t      });\n\t      return map;\n\t    };\n\t\n\t    var nativeGetStats = RTCPeerConnection.prototype.getStats;\n\t    RTCPeerConnection.prototype.getStats = function(selector, onSucc, onErr) {\n\t      return nativeGetStats.apply(this, [selector || null])\n\t        .then(function(stats) {\n\t          return makeMapStats(stats);\n\t        })\n\t        .then(onSucc, onErr);\n\t    };\n\t  },\n\t\n\t  // Attach a media stream to an element.\n\t  attachMediaStream: function(element, stream) {\n\t    logging('DEPRECATED, attachMediaStream will soon be removed.');\n\t    element.srcObject = stream;\n\t  },\n\t\n\t  reattachMediaStream: function(to, from) {\n\t    logging('DEPRECATED, reattachMediaStream will soon be removed.');\n\t    to.srcObject = from.srcObject;\n\t  }\n\t};\n\t\n\t// Expose public methods.\n\tmodule.exports = {\n\t  shimOnTrack: firefoxShim.shimOnTrack,\n\t  shimSourceObject: firefoxShim.shimSourceObject,\n\t  shimPeerConnection: firefoxShim.shimPeerConnection,\n\t  shimGetUserMedia: __webpack_require__(88),\n\t  attachMediaStream: firefoxShim.attachMediaStream,\n\t  reattachMediaStream: firefoxShim.reattachMediaStream\n\t};\n\n\n/***/ },\n/* 88 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t /* eslint-env node */\n\t'use strict';\n\t\n\tvar logging = __webpack_require__(1).log;\n\tvar browserDetails = __webpack_require__(1).browserDetails;\n\t\n\t// Expose public methods.\n\tmodule.exports = function() {\n\t  var shimError_ = function(e) {\n\t    return {\n\t      name: {\n\t        SecurityError: 'NotAllowedError',\n\t        PermissionDeniedError: 'NotAllowedError'\n\t      }[e.name] || e.name,\n\t      message: {\n\t        'The operation is insecure.': 'The request is not allowed by the ' +\n\t        'user agent or the platform in the current context.'\n\t      }[e.message] || e.message,\n\t      constraint: e.constraint,\n\t      toString: function() {\n\t        return this.name + (this.message && ': ') + this.message;\n\t      }\n\t    };\n\t  };\n\t\n\t  // getUserMedia constraints shim.\n\t  var getUserMedia_ = function(constraints, onSuccess, onError) {\n\t    var constraintsToFF37_ = function(c) {\n\t      if (typeof c !== 'object' || c.require) {\n\t        return c;\n\t      }\n\t      var require = [];\n\t      Object.keys(c).forEach(function(key) {\n\t        if (key === 'require' || key === 'advanced' || key === 'mediaSource') {\n\t          return;\n\t        }\n\t        var r = c[key] = (typeof c[key] === 'object') ?\n\t            c[key] : {ideal: c[key]};\n\t        if (r.min !== undefined ||\n\t            r.max !== undefined || r.exact !== undefined) {\n\t          require.push(key);\n\t        }\n\t        if (r.exact !== undefined) {\n\t          if (typeof r.exact === 'number') {\n\t            r. min = r.max = r.exact;\n\t          } else {\n\t            c[key] = r.exact;\n\t          }\n\t          delete r.exact;\n\t        }\n\t        if (r.ideal !== undefined) {\n\t          c.advanced = c.advanced || [];\n\t          var oc = {};\n\t          if (typeof r.ideal === 'number') {\n\t            oc[key] = {min: r.ideal, max: r.ideal};\n\t          } else {\n\t            oc[key] = r.ideal;\n\t          }\n\t          c.advanced.push(oc);\n\t          delete r.ideal;\n\t          if (!Object.keys(r).length) {\n\t            delete c[key];\n\t          }\n\t        }\n\t      });\n\t      if (require.length) {\n\t        c.require = require;\n\t      }\n\t      return c;\n\t    };\n\t    constraints = JSON.parse(JSON.stringify(constraints));\n\t    if (browserDetails.version < 38) {\n\t      logging('spec: ' + JSON.stringify(constraints));\n\t      if (constraints.audio) {\n\t        constraints.audio = constraintsToFF37_(constraints.audio);\n\t      }\n\t      if (constraints.video) {\n\t        constraints.video = constraintsToFF37_(constraints.video);\n\t      }\n\t      logging('ff37: ' + JSON.stringify(constraints));\n\t    }\n\t    return navigator.mozGetUserMedia(constraints, onSuccess, function(e) {\n\t      onError(shimError_(e));\n\t    });\n\t  };\n\t\n\t  // Returns the result of getUserMedia as a Promise.\n\t  var getUserMediaPromise_ = function(constraints) {\n\t    return new Promise(function(resolve, reject) {\n\t      getUserMedia_(constraints, resolve, reject);\n\t    });\n\t  };\n\t\n\t  // Shim for mediaDevices on older versions.\n\t  if (!navigator.mediaDevices) {\n\t    navigator.mediaDevices = {getUserMedia: getUserMediaPromise_,\n\t      addEventListener: function() { },\n\t      removeEventListener: function() { }\n\t    };\n\t  }\n\t  navigator.mediaDevices.enumerateDevices =\n\t      navigator.mediaDevices.enumerateDevices || function() {\n\t        return new Promise(function(resolve) {\n\t          var infos = [\n\t            {kind: 'audioinput', deviceId: 'default', label: '', groupId: ''},\n\t            {kind: 'videoinput', deviceId: 'default', label: '', groupId: ''}\n\t          ];\n\t          resolve(infos);\n\t        });\n\t      };\n\t\n\t  if (browserDetails.version < 41) {\n\t    // Work around http://bugzil.la/1169665\n\t    var orgEnumerateDevices =\n\t        navigator.mediaDevices.enumerateDevices.bind(navigator.mediaDevices);\n\t    navigator.mediaDevices.enumerateDevices = function() {\n\t      return orgEnumerateDevices().then(undefined, function(e) {\n\t        if (e.name === 'NotFoundError') {\n\t          return [];\n\t        }\n\t        throw e;\n\t      });\n\t    };\n\t  }\n\t  if (browserDetails.version < 49) {\n\t    var origGetUserMedia = navigator.mediaDevices.getUserMedia.\n\t        bind(navigator.mediaDevices);\n\t    navigator.mediaDevices.getUserMedia = function(c) {\n\t      return origGetUserMedia(c).catch(function(e) {\n\t        return Promise.reject(shimError_(e));\n\t      });\n\t    };\n\t  }\n\t  navigator.getUserMedia = function(constraints, onSuccess, onError) {\n\t    if (browserDetails.version < 44) {\n\t      return getUserMedia_(constraints, onSuccess, onError);\n\t    }\n\t    // Replace Firefox 44+'s deprecation warning with unprefixed version.\n\t    console.warn('navigator.getUserMedia has been replaced by ' +\n\t                 'navigator.mediaDevices.getUserMedia');\n\t    navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError);\n\t  };\n\t};\n\n\n/***/ },\n/* 89 */\n/***/ function(module, exports) {\n\n\t/*\n\t *  Copyright (c) 2016 The WebRTC project authors. All Rights Reserved.\n\t *\n\t *  Use of this source code is governed by a BSD-style license\n\t *  that can be found in the LICENSE file in the root of the source\n\t *  tree.\n\t */\n\t'use strict';\n\tvar safariShim = {\n\t  // TODO: DrAlex, should be here, double check against LayoutTests\n\t  // shimOnTrack: function() { },\n\t\n\t  // TODO: DrAlex\n\t  // attachMediaStream: function(element, stream) { },\n\t  // reattachMediaStream: function(to, from) { },\n\t\n\t  // TODO: once the back-end for the mac port is done, add.\n\t  // TODO: check for webkitGTK+\n\t  // shimPeerConnection: function() { },\n\t\n\t  shimGetUserMedia: function() {\n\t    navigator.getUserMedia = navigator.webkitGetUserMedia;\n\t  }\n\t};\n\t\n\t// Expose public methods.\n\tmodule.exports = {\n\t  shimGetUserMedia: safariShim.shimGetUserMedia\n\t  // TODO\n\t  // shimOnTrack: safariShim.shimOnTrack,\n\t  // shimPeerConnection: safariShim.shimPeerConnection,\n\t  // attachMediaStream: safariShim.attachMediaStream,\n\t  // reattachMediaStream: safariShim.reattachMediaStream\n\t};\n\n\n/***/ },\n/* 90 */\n/***/ function(module, exports) {\n\n\t/* (ignored) */\n\n/***/ }\n/******/ ]);\n//# sourceMappingURL=imperio.js.map"
  },
  {
    "path": "index.js",
    "content": "\"use strict\"; // eslint-disable-line\n/* eslint-disable no-console, global-require, no-param-reassign */\nfunction initializeImperio(server, options) {\n  console.log('imperio initialized');\n  const imperio = {};\n  imperio.connectionController = require('./lib/server/connectionController.js');\n  imperio.nonceController = require('./lib/server/nonceController.js');\n\n  // global object properties to cache active connect requests / connections\n  imperio.activeConnectRequests = {};\n  imperio.clientRooms = {};\n\n  // set global imperio config variables.\n  // default values are set. They will be overridden if options object exists\n  imperio.globalRoomLimit = 'unlimited';\n  imperio.connectRequestTimeout = 1000 * 60 * 5; // 5 minutes\n  imperio.roomCookieTimeout = 1000 * 60 * 60; // 1 hour\n  // override default values with options, if they exist\n  if (options && typeof options === 'object') {\n    if (options.hasOwnProperty('globalRoomLimit')) {\n      imperio.globalRoomLimit = options.globalRoomLimit;\n    }\n    if (options.hasOwnProperty('connectRequestTimeout')) {\n      imperio.connectRequestTimeout = options.connectRequestTimeout;\n    }\n    if (options.hasOwnProperty('roomCookieTimeout')) {\n      imperio.roomCookieTimeout = options.roomCookieTimeout;\n    }\n  }\n\n  /**\n   * Returns a function to be used as express middleware. Dependency middleware\n   * is invoked before imperio middleware is invoked. Middleware handles the\n   * creation of connection sessions and authenticates connections to these\n   * sessions.\n   * @return {function} express middleware\n   */\n  imperio.init = function imperioInit() {\n    console.log('imperio init called!');\n    const that = this;\n    // Include our dependency middleware\n    const bodyParser = require('body-parser');\n    const cookieParser = require('cookie-parser');\n    const useragent = require('express-useragent');\n\n    /**\n     * Handles socket room connection and authentication\n     * @param {Object} req - request object\n     * @param {Object} res - response object\n     * @param {function} next - callback function to continue middleware chain\n     */\n    function imperioMiddleware(req, res, next) {\n      // Provide useragent properties to the imperio object\n      req.imperio.isDesktop = req.useragent.isDesktop;\n      req.imperio.isMobile = req.useragent.isMobile;\n\n      if (req.method === 'GET') {\n        // check for nonce in param and query and create session if not found\n        that.connectionController.handleGet(req, res, that.activeConnectRequests);\n      } else if (req.method === 'POST') {\n        // Else if this is a post request (for now, at '/'), run these\n        // 'codeCheck' is our currently provided var in the body to attach the nonce\n        // TODO: make codeCheck configurable in the user config.\n        that.connectionController.handlePost(req, res, that.activeConnectRequests, 'codeCheck');\n      }\n\n      // Execute the next middleware function in the express middleware chain\n      next();\n    }\n\n    /**\n     * Returned function will invoke dependency middleware and then imperio's\n     * middleware. It will attach a parameter 'imperio' to the request object\n     * that imperio's middle will use to pass and store connection data.\n     * @param {Object} req - request object\n     * @param {Object} res - response object\n     * @param {function} next - callback function to continue middleware chain\n     */\n    return (req, res, next) => {\n      // Create an object on the req object that we can store stuff in\n      req.imperio = {};\n      req.imperio.connected = false;\n      req.imperio.roomCookieTimeout = that.roomCookieTimeout;\n      // Bind our middleware dependencies, then finally our middleware function\n      const boundImperioMiddleware = imperioMiddleware\n            .bind(null, req, res, next);\n      const boundCookieParserMiddleware = cookieParser()\n            .bind(null, req, res, boundImperioMiddleware);\n      const boundBodyParserJsonMiddleware = bodyParser.json()\n            .bind(null, req, res, boundCookieParserMiddleware);\n      const boundBodyParserUrlMiddleware = bodyParser.urlencoded({ extended: true })\n            .bind(null, req, res, boundBodyParserJsonMiddleware);\n      const boundUserAgentMiddleware = useragent.express()\n            .bind(null, req, res, boundBodyParserUrlMiddleware);\n\n      // Execute the bound chain of middleware\n      boundUserAgentMiddleware();\n    };\n  };\n\n  // Require socket.io and store a reference to the socket object on imperio\n  const io = require('socket.io')(server);\n  imperio.socket = io;\n  // Initialize some objects on the imperio object for data handling\n  imperio.openSockets = {};\n  imperio.roomData = {};\n\n  /* ------------------------\n   * --  Socket Listeners  --\n   * ------------------------ */\n  io.on('connection', socket => {\n    // keep track of sockets connected\n    console.log(`socket connected with id: ${socket.id}`);\n    // imperio.openSockets[socket.id] = null;\n    function log() {\n      const array = ['Message from server:'];\n      array.push.apply(array, arguments);\n      socket.emit('log', array);\n    }\n\n    socket.on('message', (message, room) => {\n      log('Client said: ', message);\n      socket.broadcast.to(room).emit('message', message);\n    });\n\n    socket.on('createRoom', clientData => {\n      handleCreateRoom(socket, clientData);\n    });\n    // Handles client disconnect\n    socket.on('disconnect', () => {\n      const room = imperio.clientRooms[socket.id] || false;\n      if (room) {\n        io.sockets.in(room).emit('updateRoomData', io.sockets.adapter.rooms[room]);\n        delete imperio.clientRooms[socket.id];\n      }\n    });\n\n    // client input socket listeners\n    const events = ['pan', 'pinch', 'press', 'pressUp', 'rotate', 'swipe', 'tap',\n                    'acceleration', 'gyroscope', 'geoLocation', 'data'];\n    events.forEach(event => {\n      socket.on(event, (room, eventObject) => {\n        io.sockets.in(room).emit(event, eventObject);\n      });\n    });\n\n    socket.on('updateNonceTimeouts', (room) => {\n      imperio.nonceController.handleNonceTimeout(\n        io, socket, room, imperio.activeConnectRequests, imperio.connectRequestTimeout\n      );\n    });\n  });\n\n  function handleCreateRoom(socket, clientData) {\n    console.log('handleCreateRoom invoked');\n    const room = clientData.room;\n    const clientRole = clientData.role;\n    let roomData = io.sockets.adapter.rooms[room];\n    console.log('numClients', io.engine.clientsCount);\n    // if no room exists, receiver will create it.\n    // OR if room exists and there's space in it, emitter will join\n    if (!roomData ||\n        imperio.globalRoomLimit === 'unlimited' ||\n        roomData.length < imperio.globalRoomLimit) {\n      if (clientRole === 'listener') {\n        socket.join(room);\n        io.sockets.in(socket.id).emit('created', room, socket.id);\n      } else if (clientRole === 'emitter') {\n        socket.join(room);\n        io.sockets.in(socket.id).emit('joined', room, socket.id);\n        socket.broadcast.to(room).emit('ready', room);\n        socket.broadcast.emit('ready', room);\n      }\n      roomData = io.sockets.adapter.rooms[room];\n      roomData.sockets[socket.id] = clientRole;\n      imperio.clientRooms[socket.id] = room;\n      console.log(`about to emit updateRoomData to ${room} from ${clientRole}`);\n      io.sockets.in(room).emit('updateRoomData', roomData);\n    } else {\n      roomData.limit = imperio.globalRoomLimit;\n      io.sockets.in(room).emit('roomFull', roomData);\n    }\n  }\n\n  // Return imperio object\n  return imperio;\n}\n\nmodule.exports = initializeImperio;\n"
  },
  {
    "path": "keys.js",
    "content": "const keys = {\n  secret: 'thisisadefaultsecret',\n};\n\nmodule.exports = keys;\n"
  },
  {
    "path": "lib/client/Emitters/emitAcceleration.js",
    "content": "// Adds a listener to the window on the mobile device in order to read the accelerometer data.\n// Will send accelerometer data to the socket in the form of {x: x, y:y, z:z}.\n// Accepts 3 arguments:\n// 1. The socket you would like to connect to as the first parameter.\n// 2. A room name that will inform the server which room to emit the acceleration event and data to.\n// 4. A callback function that will be run every time the tap event is triggered, by default\n// we will provide this function with the accelerometer data.\nconst emitAcceleration = {};\n\nconst handleDeviceMotionGravity = event => {\n  const localCallback = imperio.callbacks.gravityLocal;\n  const modifyDataCallback = imperio.callbacks.gravityModify;\n  const x = event.accelerationIncludingGravity.x;\n  const y = event.accelerationIncludingGravity.y;\n  const z = event.accelerationIncludingGravity.z;\n  let accObject = {\n    x,\n    y,\n    z,\n  };\n  if (modifyDataCallback) accObject = modifyDataCallback(accObject);\n  const webRTCData = {\n    data: accObject,\n    type: 'acceleration',\n  };\n  if (imperio.connectionType === 'webRTC') {\n    imperio.dataChannel.send(JSON.stringify(webRTCData));\n  } else imperio.socket.emit('acceleration', imperio.room, accObject);\n  if (localCallback) localCallback(accObject);\n};\n\nemitAcceleration.gravity = (localCallback, modifyDataCallback) => {\n  imperio.callbacks.gravityLocal = localCallback;\n  imperio.callbacks.gravityModify = modifyDataCallback;\n  window.addEventListener('devicemotion', handleDeviceMotionGravity);\n};\nemitAcceleration.removeGravity = () => {\n  delete imperio.callbacks.gravityLocal;\n  delete imperio.callbacks.gravityModify;\n  window.removeEventListener('devicemotion', handleDeviceMotionGravity);\n};\n\nconst handleDeviceMotionNoGravity = event => {\n  const localCallback = imperio.callbacks.noGravityLocal;\n  const modifyDataCallback = imperio.callbacks.noGravityModify;\n  const x = event.acceleration.x;\n  const y = event.acceleration.y;\n  const z = event.acceleration.z;\n  let accObject = {\n    x,\n    y,\n    z,\n  };\n  if (modifyDataCallback) accObject = modifyDataCallback(accObject);\n  const webRTCData = {\n    data: accObject,\n    type: 'acceleration',\n  };\n  if (imperio.connectionType === 'webRTC') {\n    imperio.dataChannel.send(JSON.stringify(webRTCData));\n  } else imperio.socket.emit('acceleration', imperio.room, accObject);\n  if (localCallback) localCallback(accObject);\n};\n\nemitAcceleration.noGravity = (localCallback, modifyDataCallback) => {\n  imperio.callbacks.noGravityLocal = localCallback;\n  imperio.callbacks.noGravityModify = modifyDataCallback;\n  window.addEventListener('devicemotion', handleDeviceMotionNoGravity);\n};\nemitAcceleration.removeNoGravity = () => {\n  delete imperio.callbacks.noGravityLocal;\n  delete imperio.callbacks.noGravityModify;\n  window.removeEventListener('devicemotion', handleDeviceMotionNoGravity);\n};\n\nmodule.exports = emitAcceleration;\n"
  },
  {
    "path": "lib/client/Emitters/emitData.js",
    "content": "const emitData = (callback, data) => {\n  if (imperio.connectionType === 'webRTC') {\n    const webRTCData = {\n      data,\n      type: 'data',\n    };\n    imperio.dataChannel.send(JSON.stringify(webRTCData));\n  } else imperio.socket.emit('data', imperio.room, data);\n  if (callback) callback(data);\n};\n\nmodule.exports = emitData;\n"
  },
  {
    "path": "lib/client/Emitters/emitGeoLocation.js",
    "content": "/**\n* This emits to the specified room, the location of\n* @param The getCurrentPosition.coords property has several properties eg:\n*        accuracy,altitude, altitudeAccuracy, heading, latitude, longitude\n*        & speed\n*/\n\nconst emitGeoLocation = (localCallback, modifyDataCallback) => {\n  if (!navigator.geolocation) {\n    console.log('This browser does not support Geolocation');\n    return;\n  }\n  navigator.geolocation.getCurrentPosition(position => {\n    let geoLocation = position;\n    if (modifyDataCallback) geoLocation = modifyDataCallback(geoLocation);\n    const webRTCData = {\n      data: geoLocation,\n      type: 'geoLocation',\n    };\n    if (imperio.connectionType === 'webRTC') {\n      imperio.dataChannel.send(JSON.stringify(webRTCData));\n    } else imperio.socket.emit('geoLocation', imperio.room, geoLocation);\n    if (localCallback) localCallback(geoLocation);\n  });\n};\n\nmodule.exports = emitGeoLocation;\n"
  },
  {
    "path": "lib/client/Emitters/emitGyroscope.js",
    "content": "// Adds a listener to the window on the mobile device in order to read the gyroscope data.\n// Will send gyroscope data to the socket in the form of {alpha: alpha, beta:beta, gamma:gamma}.\n// Accepts 1 argument:\n// 1. A callback function that will be run every time the tap event is triggered, by default\n// we will provide this function with the gyroscope data.\nconst emitGyroscope = {};\nconst handleDeviceOrientation = event => {\n  const localCallback = imperio.callbacks.gyroLocal;\n  const modifyDataCallback = imperio.callbacks.gyroModify;\n  const alpha = event.alpha;\n  const beta = event.beta;\n  const gamma = event.gamma;\n  let gyroObject = {\n    alpha,\n    beta,\n    gamma,\n  };\n  if (modifyDataCallback) gyroObject = modifyDataCallback(gyroObject);\n  const webRTCData = {\n    data: gyroObject,\n    type: 'gyroscope',\n  };\n  if (imperio.connectionType === 'webRTC') {\n    imperio.dataChannel.send(JSON.stringify(webRTCData));\n  } else imperio.socket.emit('gyroscope', imperio.room, gyroObject);\n  if (localCallback) localCallback(gyroObject);\n};\n\nemitGyroscope.start = (localCallback, modifyDataCallback) => {\n  imperio.callbacks.gyroLocal = localCallback;\n  imperio.callbacks.gyroModify = modifyDataCallback;\n  window.addEventListener('deviceorientation', handleDeviceOrientation);\n};\nemitGyroscope.remove = (localCallback, modifyDataCallback) => {\n  imperio.callbacks.gyroLocal = localCallback;\n  imperio.callbacks.gyroModify = modifyDataCallback;\n  window.removeEventListener('deviceorientation', handleDeviceOrientation);\n};\n\nmodule.exports = emitGyroscope;\n"
  },
  {
    "path": "lib/client/Emitters/emitRoomSetup.js",
    "content": "// Establishes a connection to the socket and shares the room it should connnect to.\n// Accepts 1 arguments:\n// 1. A callback that is invoked when the connect event is received\n// (happens once on first connect to socket).\n\nconst emitRoomSetup = callback => {\n  imperio.socket.on('connect', () => {\n    // only attempt to join room if room is defined in cookie and passed here\n    imperio.connectionType = 'sockets';\n    if (imperio.room) {\n      const clientData = {\n        room: imperio.room,\n        id: imperio.socket.id,\n        role: 'emitter',\n      };\n      imperio.socket.emit('createRoom', clientData);\n    }\n    if (callback) callback(imperio.socket);\n  });\n};\n\nmodule.exports = emitRoomSetup;\n"
  },
  {
    "path": "lib/client/Emitters/gesture.js",
    "content": "const emitPan = require('./gestures/emitPan.js');\nconst emitPinch = require('./gestures/emitPinch.js');\nconst emitPress = require('./gestures/emitPress.js');\nconst emitPressUp = require('./gestures/emitPressUp.js');\nconst emitRotate = require('./gestures/emitRotate.js');\nconst emitSwipe = require('./gestures/emitSwipe.js');\nconst emitTap = require('./gestures/emitTap.js');\n\nconst curse = (action, element, localCallback, modifyDataCallback) => {\n  if (action === 'pan') emitPan(element, localCallback, modifyDataCallback);\n  if (action === 'pinch') emitPinch(element, localCallback, modifyDataCallback);\n  if (action === 'press') emitPress(element, localCallback, modifyDataCallback);\n  if (action === 'pressUp') emitPressUp(element, localCallback, modifyDataCallback);\n  if (action === 'rotate') emitRotate(element, localCallback, modifyDataCallback);\n  if (action === 'swipe') emitSwipe(element, localCallback, modifyDataCallback);\n  if (action === 'tap') emitTap(element, localCallback, modifyDataCallback);\n};\n\nmodule.exports = curse;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitPan.js",
    "content": "const emitPan = (element, localCallback, modifyDataCallback) => {\n  const imperioControl = new Hammer(element);\n  imperioControl.get('pan').set({ direction: Hammer.DIRECTION_ALL });\n  const panEvents = ['pan', 'panstart', 'panend'];\n  panEvents.forEach(panEvent => {\n    imperioControl.on(panEvent, event => {\n      event.start = panEvent.indexOf('start') > -1;\n      event.end = panEvent.indexOf('end') > -1;\n      if (modifyDataCallback) event = modifyDataCallback(event);\n      if (imperio.connectionType === 'webRTC') {\n        const webRTCData = {};\n        webRTCData.data = event;\n        webRTCData.type = 'pan';\n        imperio.dataChannel.send(JSON.stringify(webRTCData));\n      } else imperio.socket.emit('pan', imperio.room, event);\n      if (localCallback) localCallback(event);\n    });\n  });\n};\n\nmodule.exports = emitPan;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitPinch.js",
    "content": "const emitPinch = (element, localCallback, modifyDataCallback) => {\n  const imperioControl = new Hammer(element);\n  const pinchEvents = ['pinch', 'pinchstart', 'pinchend'];\n  imperioControl.get('pinch').set({ enable: true });\n  pinchEvents.forEach(pinchEvent => {\n    imperioControl.on(pinchEvent, event => {\n      event.start = pinchEvent.indexOf('start') > -1;\n      event.end = pinchEvent.indexOf('end') > -1;\n      if (modifyDataCallback) event = modifyDataCallback(event);\n      if (imperio.connectionType === 'webRTC') {\n        const webRTCData = {};\n        webRTCData.data = event;\n        webRTCData.type = 'pinch';\n        imperio.dataChannel.send(JSON.stringify(webRTCData));\n      } else imperio.socket.emit('pinch', imperio.room, event);\n      if (localCallback) localCallback(event);\n    });\n  });\n};\n\nmodule.exports = emitPinch;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitPress.js",
    "content": "const emitPress = (element, localCallback, modifyDataCallback) => {\n  const imperioControl = new Hammer(element);\n  imperioControl.on('press', event => {\n    event.start = true;\n    event.end = false;\n    if (modifyDataCallback) event = modifyDataCallback(event);\n    if (imperio.connectionType === 'webRTC') {\n      const webRTCData = {};\n      webRTCData.data = event;\n      webRTCData.type = 'press';\n      imperio.dataChannel.send(JSON.stringify(webRTCData));\n    } else imperio.socket.emit('press', imperio.room, event);\n    if (localCallback) localCallback(event);\n  });\n};\n\nmodule.exports = emitPress;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitPressUp.js",
    "content": "const emitPressUp = (element, localCallback, modifyDataCallback) => {\n  const hammertime = new Hammer(element);\n  hammertime.on('pressup', event => {\n    event.start = false;\n    event.end = true;\n    if (modifyDataCallback) event = modifyDataCallback(event);\n    if (imperio.connectionType === 'webRTC') {\n      const webRTCData = {};\n      webRTCData.data = event;\n      webRTCData.type = 'pressUp';\n      imperio.dataChannel.send(JSON.stringify(webRTCData));\n    } else imperio.socket.emit('pressUp', imperio.room, event);\n    if (localCallback) localCallback(event);\n  });\n};\n\nmodule.exports = emitPressUp;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitRotate.js",
    "content": "const emitRotate = (element, localCallback, modifyDataCallback) => {\n  const imperioControl = new Hammer(element);\n  const rotateEvents = ['rotate', 'rotatestart', 'rotateend'];\n  imperioControl.get('rotate').set({ enable: true });\n  rotateEvents.forEach(rotateEvent => {\n    imperioControl.on(rotateEvent, event => {\n      event.start = rotateEvent.indexOf('start') > -1;\n      event.end = rotateEvent.indexOf('end') > -1;\n      if (modifyDataCallback) event = modifyDataCallback(event);\n      if (imperio.connectionType === 'webRTC') {\n        const webRTCData = {};\n        webRTCData.data = event;\n        webRTCData.type = 'rotate';\n        imperio.dataChannel.send(JSON.stringify(webRTCData));\n      } else imperio.socket.emit('rotate', imperio.room, event);\n      if (localCallback) localCallback(event);\n    });\n  });\n};\n\nmodule.exports = emitRotate;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitSwipe.js",
    "content": "const emitSwipe = (element, localCallback, modifyDataCallback) => {\n  const imperioControl = new Hammer(element);\n  imperioControl.on('swipe', event => {\n    event.start = true;\n    event.end = true;\n    if (modifyDataCallback) event = modifyDataCallback(event);\n    if (imperio.connectionType === 'webRTC') {\n      const webRTCData = {};\n      webRTCData.data = event;\n      webRTCData.type = 'swipe';\n      imperio.dataChannel.send(JSON.stringify(webRTCData));\n    } else imperio.socket.emit('swipe', imperio.room, event);\n    if (localCallback) localCallback(event);\n  });\n};\n\nmodule.exports = emitSwipe;\n"
  },
  {
    "path": "lib/client/Emitters/gestures/emitTap.js",
    "content": "// Attach to a tappable element and it will emit the tap event.\n// Accepts 1 argument:\n// 1. A callback function that will be run every time the tap event is triggered.\nconst emitTap = (element, localCallback, modifyDataCallback) => {\n  element.addEventListener('click', event => {\n    if (modifyDataCallback) event = modifyDataCallback(event);\n    if (imperio.connectionType === 'webRTC') {\n      const webRTCData = {\n        data: event,\n        type: 'tap',\n      };\n      imperio.dataChannel.send(JSON.stringify(webRTCData));\n    } else imperio.socket.emit('tap', imperio.room, event);\n    if (localCallback) localCallback(event);\n  });\n};\n\nmodule.exports = emitTap;\n"
  },
  {
    "path": "lib/client/Emitters/requestNonceTimeout.js",
    "content": "const requestNonceTimeout = callback => {\n  imperio.socket.emit('updateNonceTimeouts', imperio.room);\n  if (callback) callback();\n};\n\nmodule.exports = requestNonceTimeout;\n"
  },
  {
    "path": "lib/client/Listeners/accelerationListener.js",
    "content": "// Sets up a listener for the acceleration event and expects to receive an object\n// with the acceleration data in the form of {x: x, y:y, z:z}.\n// Accepts 1 argument:\n// 1. A callback function that will be run every time the acceleration event is triggered.\nconst accelerationListener = callback => {\n  imperio.callbacks.acceleration = callback;\n  imperio.socket.on('acceleration', accObject => {\n    if (callback) callback(accObject);\n  });\n};\n\nmodule.exports = accelerationListener;\n"
  },
  {
    "path": "lib/client/Listeners/dataListener.js",
    "content": "/**\n * Sets up a listener for a data event.\n * @param {Object} socket - The socket you would like to connect to\n * @param {function} callback - A callback function\n *        that will be run every time the tap event is triggered\n */\nconst dataListener = callback => {\n  imperio.callbacks.data = callback;\n  imperio.socket.on('data', data => {\n    if (callback) callback(data);\n  });\n};\n\nmodule.exports = dataListener;\n"
  },
  {
    "path": "lib/client/Listeners/geoLocationListener.js",
    "content": "// Sets up a listener for the location data and expects to receive an object\n// with the location data in the form of {cords: {accuracy:21, altitude:null,\n// altitudeAccuracy:null, heading:null, latitude:33.9794281, longitude:-118.42238250000001,\n// speed:null}, }.\n// Accepts 1 argument:\n// 1. A callback function that will be run every time the location event is triggered.\nconst geoLocationListener = callback => {\n  imperio.callbacks.geoLocation = callback;\n  imperio.socket.on('geoLocation', locationObj => {\n    if (callback) callback(locationObj);\n  });\n};\n\nmodule.exports = geoLocationListener;\n"
  },
  {
    "path": "lib/client/Listeners/gyroscopeListener.js",
    "content": "// Sets up a listener for the orientation data and expects to receive an object\n// with the gyroscope data in the form of {alpha: alpha, beta:beta, gamma:gamma}.\n// Accepts 1 argument:\n// 1. A callback function that will be run every time the gyroscope event is triggered.\nconst gyroscopeListener = callback => {\n  imperio.callbacks.gyroscope = callback;\n  imperio.socket.on('gyroscope', gyroObject => {\n    if (callback) callback(gyroObject);\n  });\n};\n\nmodule.exports = gyroscopeListener;\n"
  },
  {
    "path": "lib/client/Listeners/listenerRoomSetup.js",
    "content": "// Establishes a connection to the socket and shares the room it should connnect to.\n// Accepts 1 argument:\n// 1. A callback that is invoked when the connect event is received\n// (happens once on first connect to socket).\nconst listenerRoomSetup = callback => {\n  imperio.socket.on('connect', () => {\n    // only attempt to join room if room is defined in cookie and passed here\n    imperio.connectionType = 'sockets';\n    if (imperio.room) {\n      const clientData = {\n        room: imperio.room,\n        id: imperio.socket.id,\n        role: 'listener',\n      };\n      imperio.socket.emit('createRoom', clientData);\n    }\n    if (callback) callback();\n  });\n};\n\nmodule.exports = listenerRoomSetup;\n"
  },
  {
    "path": "lib/client/Listeners/nonceTimeoutUpdate.js",
    "content": "// Establishes a connection to the socket and shares the room it should connnect to.\n// Accepts 3 arguments:\n// 1. The socket you would like to connect to.\n// 2. A room name that will inform the server which room to create/join.\n// 3. A callback that is invoked when the connect event is received\nconst nonceTimeoutUpdate = callback => {\n  imperio.socket.on('updateNonceTimeouts', nonceTimeouts => {\n    if (callback) callback(nonceTimeouts);\n  });\n};\n\nmodule.exports = nonceTimeoutUpdate;\n"
  },
  {
    "path": "lib/client/Listeners/tapListener.js",
    "content": "/**\n * Sets up a listener for a tap event on the desktop.\n * @param {Object} socket - The socket you would like to connect to\n * @param {function} callback - A callback function\n *        that will be run every time the tap event is triggered\n */\nconst tapListener = callback => {\n  imperio.callbacks.tap = callback;\n  imperio.socket.on('tap', data => {\n    if (callback) callback(data);\n  });\n};\n\nmodule.exports = tapListener;\n"
  },
  {
    "path": "lib/client/cookies-js/.bower.json",
    "content": "{\n  \"name\": \"cookies-js\",\n  \"version\": \"1.2.2\",\n  \"main\": \"dist/cookies.js\",\n  \"ignore\": [\n    \"**/*\",\n    \"!dist/*\",\n    \"!bower.json\"\n  ],\n  \"homepage\": \"https://github.com/ScottHamper/Cookies\",\n  \"_release\": \"1.2.2\",\n  \"_resolution\": {\n    \"type\": \"version\",\n    \"tag\": \"1.2.2\",\n    \"commit\": \"ee51ba9d63b696c7b9f92c98f265926c6d3f76fa\"\n  },\n  \"_source\": \"https://github.com/ScottHamper/Cookies.git\",\n  \"_target\": \"^1.2.2\",\n  \"_originalSource\": \"cookies-js\"\n}"
  },
  {
    "path": "lib/client/cookies-js/bower.json",
    "content": "{\n    \"name\"      : \"cookies-js\",\n    \"version\"   : \"1.2.2\",\n    \"main\"      : \"dist/cookies.js\",\n    \"ignore\"    : [\n        \"**/*\",\n        \"!dist/*\",\n        \"!bower.json\"\n    ]\n}"
  },
  {
    "path": "lib/client/cookies-js/dist/cookies.d.ts",
    "content": "/*\n * Cookies.js TypeScript Declaration File\n * https://github.com/ScottHamper/Cookies\n *\n * This is free and unencumbered software released into the public domain.\n */\ninterface CookieOptions {\n    path?: string;\n    domain?: string;\n    expires?: any;\n    secure?: boolean;\n}\n\ninterface CookiesStatic {\n    (key:string, value?:any, options?:CookieOptions): any;\n\n    get(key:string): string;\n    set(key:string, value:any, options?:CookieOptions): CookiesStatic;\n    expire(key:string, options?:CookieOptions): CookiesStatic;\n\n    defaults: CookieOptions;\n    enabled: boolean;\n}\n\ndeclare var Cookies:CookiesStatic;\n\ndeclare module \"cookies\" {\n    export = Cookies;\n}\n\ndeclare module \"cookies-js\" {\n    export = Cookies;\n}\n"
  },
  {
    "path": "lib/client/cookies-js/dist/cookies.js",
    "content": "/*\n * Cookies.js - 1.2.2\n * https://github.com/ScottHamper/Cookies\n *\n * This is free and unencumbered software released into the public domain.\n */\n(function (global, undefined) {\n    'use strict';\n\n    var factory = function (window) {\n        if (typeof window.document !== 'object') {\n            throw new Error('Cookies.js requires a `window` with a `document` object');\n        }\n\n        var Cookies = function (key, value, options) {\n            return arguments.length === 1 ?\n                Cookies.get(key) : Cookies.set(key, value, options);\n        };\n\n        // Allows for setter injection in unit tests\n        Cookies._document = window.document;\n\n        // Used to ensure cookie keys do not collide with\n        // built-in `Object` properties\n        Cookies._cacheKeyPrefix = 'cookey.'; // Hurr hurr, :)\n        \n        Cookies._maxExpireDate = new Date('Fri, 31 Dec 9999 23:59:59 UTC');\n\n        Cookies.defaults = {\n            path: '/',\n            secure: false\n        };\n\n        Cookies.get = function (key) {\n            if (Cookies._cachedDocumentCookie !== Cookies._document.cookie) {\n                Cookies._renewCache();\n            }\n            \n            var value = Cookies._cache[Cookies._cacheKeyPrefix + key];\n\n            return value === undefined ? undefined : decodeURIComponent(value);\n        };\n\n        Cookies.set = function (key, value, options) {\n            options = Cookies._getExtendedOptions(options);\n            options.expires = Cookies._getExpiresDate(value === undefined ? -1 : options.expires);\n\n            Cookies._document.cookie = Cookies._generateCookieString(key, value, options);\n\n            return Cookies;\n        };\n\n        Cookies.expire = function (key, options) {\n            return Cookies.set(key, undefined, options);\n        };\n\n        Cookies._getExtendedOptions = function (options) {\n            return {\n                path: options && options.path || Cookies.defaults.path,\n                domain: options && options.domain || Cookies.defaults.domain,\n                expires: options && options.expires || Cookies.defaults.expires,\n                secure: options && options.secure !== undefined ?  options.secure : Cookies.defaults.secure\n            };\n        };\n\n        Cookies._isValidDate = function (date) {\n            return Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime());\n        };\n\n        Cookies._getExpiresDate = function (expires, now) {\n            now = now || new Date();\n\n            if (typeof expires === 'number') {\n                expires = expires === Infinity ?\n                    Cookies._maxExpireDate : new Date(now.getTime() + expires * 1000);\n            } else if (typeof expires === 'string') {\n                expires = new Date(expires);\n            }\n\n            if (expires && !Cookies._isValidDate(expires)) {\n                throw new Error('`expires` parameter cannot be converted to a valid Date instance');\n            }\n\n            return expires;\n        };\n\n        Cookies._generateCookieString = function (key, value, options) {\n            key = key.replace(/[^#$&+\\^`|]/g, encodeURIComponent);\n            key = key.replace(/\\(/g, '%28').replace(/\\)/g, '%29');\n            value = (value + '').replace(/[^!#$&-+\\--:<-\\[\\]-~]/g, encodeURIComponent);\n            options = options || {};\n\n            var cookieString = key + '=' + value;\n            cookieString += options.path ? ';path=' + options.path : '';\n            cookieString += options.domain ? ';domain=' + options.domain : '';\n            cookieString += options.expires ? ';expires=' + options.expires.toUTCString() : '';\n            cookieString += options.secure ? ';secure' : '';\n\n            return cookieString;\n        };\n\n        Cookies._getCacheFromString = function (documentCookie) {\n            var cookieCache = {};\n            var cookiesArray = documentCookie ? documentCookie.split('; ') : [];\n\n            for (var i = 0; i < cookiesArray.length; i++) {\n                var cookieKvp = Cookies._getKeyValuePairFromCookieString(cookiesArray[i]);\n\n                if (cookieCache[Cookies._cacheKeyPrefix + cookieKvp.key] === undefined) {\n                    cookieCache[Cookies._cacheKeyPrefix + cookieKvp.key] = cookieKvp.value;\n                }\n            }\n\n            return cookieCache;\n        };\n\n        Cookies._getKeyValuePairFromCookieString = function (cookieString) {\n            // \"=\" is a valid character in a cookie value according to RFC6265, so cannot `split('=')`\n            var separatorIndex = cookieString.indexOf('=');\n\n            // IE omits the \"=\" when the cookie value is an empty string\n            separatorIndex = separatorIndex < 0 ? cookieString.length : separatorIndex;\n\n            var key = cookieString.substr(0, separatorIndex);\n            var decodedKey;\n            try {\n                decodedKey = decodeURIComponent(key);\n            } catch (e) {\n                if (console && typeof console.error === 'function') {\n                    console.error('Could not decode cookie with key \"' + key + '\"', e);\n                }\n            }\n            \n            return {\n                key: decodedKey,\n                value: cookieString.substr(separatorIndex + 1) // Defer decoding value until accessed\n            };\n        };\n\n        Cookies._renewCache = function () {\n            Cookies._cache = Cookies._getCacheFromString(Cookies._document.cookie);\n            Cookies._cachedDocumentCookie = Cookies._document.cookie;\n        };\n\n        Cookies._areEnabled = function () {\n            var testKey = 'cookies.js';\n            var areEnabled = Cookies.set(testKey, 1).get(testKey) === '1';\n            Cookies.expire(testKey);\n            return areEnabled;\n        };\n\n        Cookies.enabled = Cookies._areEnabled();\n\n        return Cookies;\n    };\n\n    var cookiesExport = typeof global.document === 'object' ? factory(global) : factory;\n\n    // AMD support\n    if (typeof define === 'function' && define.amd) {\n        define(function () { return cookiesExport; });\n    // CommonJS/Node.js support\n    } else if (typeof exports === 'object') {\n        // Support Node.js specific `module.exports` (which can be a function)\n        if (typeof module === 'object' && typeof module.exports === 'object') {\n            exports = module.exports = cookiesExport;\n        }\n        // But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)\n        exports.Cookies = cookiesExport;\n    } else {\n        global.Cookies = cookiesExport;\n    }\n})(typeof window === 'undefined' ? this : window);"
  },
  {
    "path": "lib/client/getCookie.js",
    "content": "import Cookies from './cookies-js/dist/cookies.min.js';\n// Uses cookies-js to retrieve the cookie with the associated name.\n// Required to display the nonce for mobile connections and to pull the roomID\n// that sockets uses to establish the correct room.\nfunction getCookie(name) {\n  return Cookies.get(name);\n}\n\nmodule.exports = getCookie;\n"
  },
  {
    "path": "lib/client/mainClient.js",
    "content": "'use strict'; // eslint-disable-line\n// initialize library storage object\nconst imperio = {};\nconst Hammer = require('./hammer.min.js');\n// import our getCookie function which we will use to pull\n// out the roomID and nonce cookie for socket connection and display on client\nconst getCookie = require('./getCookie.js');\n// import io from 'socket.io';\nrequire('webrtc-adapter');\nconst io = require('socket.io-client');\n// instantiate our shared socket\nimperio.socket = io(); // eslint-disable-line\n// store roomID to pass to server for room creation and correctly routing the emissions\nimperio.room = getCookie('roomId');\n// store nonce to use to display and show emit user how to connect\nimperio.nonce = getCookie('nonce');\nimperio.myID = null;\nimperio.otherIDs = null;\n// check if webRTC is supported by client imperio.webRTCSupport will be true or false\nimperio.webRTCSupport = require('./webRTC/webRTCSupport.js');\n// ICE server config, will remove\n// TODO: set this to ENV variables\nimperio.webRTCConfiguration = { iceServers: [{ url: 'stun:stun.l.google.com:19302' }] };\n// determines if current connection is socket or rtc\nimperio.connectionType = null;\n// initiate webRTC connection\nimperio.webRTCConnect = require('./webRTC/webRTCConnect.js');\n// will store the dataChannel where webRTC data will be passed\nimperio.dataChannel = null;\n// peerConnection stored on imperio\nimperio.peerConnection = null;\n// storage place for pointers to callback functions passed into handler functions\nimperio.callbacks = {};\n// sets up listener for motion data and emits object containing x,y,z coords\nimperio.emitAcceleration = require('./Emitters/emitAcceleration.js');\n// sets up a listener for location data and emits object containing coordinates and time\nimperio.emitGeoLocation = require('./Emitters/emitGeoLocation.js');\n// sets up a listener for orientation data and emits object containing alpha, beta, and gamma data\nimperio.emitGyroscope = require('./Emitters/emitGyroscope.js');\n// establishes connection to socket and shares room it should connnect to\nimperio.emitRoomSetup = require('./Emitters/emitRoomSetup.js');\n// emit any data you want\nimperio.emitData = require('./Emitters/emitData.js');\n// emits socket event to request nonce timeout data\nimperio.requestNonceTimeout = require('./Emitters/requestNonceTimeout.js');\n// sets up listener for tap event on listener\nimperio.tapListener = require('./Listeners/tapListener.js');\n// sets up listener for accel event/data on listener\nimperio.geoLocationListener = require('./Listeners/geoLocationListener.js');\n// sets up listener for location event/data on listener\nimperio.accelerationListener = require('./Listeners/accelerationListener.js');\n// sets up listener for gyro event/data on listener\nimperio.gyroscopeListener = require('./Listeners/gyroscopeListener.js');\n// establishes connection to socket and shares room it should connnect to\nimperio.listenerRoomSetup = require('./Listeners/listenerRoomSetup.js');\n// listen for data event\nimperio.dataListener = require('./Listeners/dataListener.js');\n\nimperio.gesture = require('./Emitters/gesture.js');\nconst events = ['pan', 'pinch', 'press', 'pressUp', 'rotate', 'swipe'];\nevents.forEach(event => {\n  const eventHandler = `${event}Listener`;\n  imperio[eventHandler] = callback => {\n    imperio.callbacks[event] = callback;\n    imperio.socket.on(event, eventObject => {\n      if (callback) callback(eventObject);\n    });\n  };\n});\n// sets up listener for changes to client connections to the room\nimperio.roomUpdate = require('./roomUpdate.js');\n// sends updates on nonce timeouts to the browser\nimperio.nonceTimeoutUpdate = require('./Listeners/nonceTimeoutUpdate.js');\n// attaches our library object to the window so it is accessible when we use the script tag\nwindow.imperio = imperio;\n"
  },
  {
    "path": "lib/client/roomUpdate.js",
    "content": "// Sets up a listener for updates to client connections to the room.\n// Accepts 1 argument:\n// 1. A callback function to handle the roomData object passed with the event\nconst roomUpdate = callback => {\n  imperio.socket.on('updateRoomData', roomData => {\n    imperio.myID = imperio.socket.id;\n    imperio.otherIDs = Object.keys(roomData.sockets)\n      .map(socketID => socketID.substring(2))\n      .filter(socketID => socketID !== imperio.myID);\n    if (callback) callback(roomData);\n  });\n};\n\nmodule.exports = roomUpdate;\n"
  },
  {
    "path": "lib/client/socket.js",
    "content": "(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}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.io=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 a(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(_dereq_,module,exports){module.exports=_dereq_(\"./lib/\")},{\"./lib/\":2}],2:[function(_dereq_,module,exports){module.exports=_dereq_(\"./socket\");module.exports.parser=_dereq_(\"engine.io-parser\")},{\"./socket\":3,\"engine.io-parser\":19}],3:[function(_dereq_,module,exports){(function(global){var transports=_dereq_(\"./transports\");var Emitter=_dereq_(\"component-emitter\");var debug=_dereq_(\"debug\")(\"engine.io-client:socket\");var index=_dereq_(\"indexof\");var parser=_dereq_(\"engine.io-parser\");var parseuri=_dereq_(\"parseuri\");var parsejson=_dereq_(\"parsejson\");var parseqs=_dereq_(\"parseqs\");module.exports=Socket;function noop(){}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:global.location&&\"https:\"==location.protocol;if(opts.hostname&&!opts.port){opts.port=this.secure?\"443\":\"80\"}this.agent=opts.agent||false;this.hostname=opts.hostname||(global.location?location.hostname:\"localhost\");this.port=opts.port||(global.location&&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.timestampParam=opts.timestampParam||\"t\";this.timestampRequests=opts.timestampRequests;this.transports=opts.transports||[\"polling\",\"websocket\"];this.readyState=\"\";this.writeBuffer=[];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}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?null:opts.rejectUnauthorized;var freeGlobal=typeof global==\"object\"&&global;if(freeGlobal.global===freeGlobal){if(opts.extraHeaders&&Object.keys(opts.extraHeaders).length>0){this.extraHeaders=opts.extraHeaders}}this.open()}Socket.priorWebsocketSuccess=false;Emitter(Socket.prototype);Socket.protocol=parser.protocol;Socket.Socket=Socket;Socket.Transport=_dereq_(\"./transport\");Socket.transports=_dereq_(\"./transports\");Socket.parser=_dereq_(\"engine.io-parser\");Socket.prototype.createTransport=function(name){debug('creating transport \"%s\"',name);var query=clone(this.query);query.EIO=parser.protocol;query.transport=name;if(this.id)query.sid=this.id;var transport=new transports[name]({agent:this.agent,hostname:this.hostname,port:this.port,secure:this.secure,path:this.path,query:query,forceJSONP:this.forceJSONP,jsonp:this.jsonp,forceBase64:this.forceBase64,enablesXDR:this.enablesXDR,timestampRequests:this.timestampRequests,timestampParam:this.timestampParam,policyPort:this.policyPort,socket:this,pfx:this.pfx,key:this.key,passphrase:this.passphrase,cert:this.cert,ca:this.ca,ciphers:this.ciphers,rejectUnauthorized:this.rejectUnauthorized,perMessageDeflate:this.perMessageDeflate,extraHeaders:this.extraHeaders});return transport};function clone(obj){var o={};for(var i in obj){if(obj.hasOwnProperty(i)){o[i]=obj[i]}}return o}Socket.prototype.open=function(){var transport;if(this.rememberUpgrade&&Socket.priorWebsocketSuccess&&this.transports.indexOf(\"websocket\")!=-1){transport=\"websocket\"}else if(0===this.transports.length){var self=this;setTimeout(function(){self.emit(\"error\",\"No transports available\")},0);return}else{transport=this.transports[0]}this.readyState=\"opening\";try{transport=this.createTransport(transport)}catch(e){this.transports.shift();this.open();return}transport.open();this.setTransport(transport)};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()}this.transport=transport;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\")})};Socket.prototype.probe=function(name){debug('probing transport \"%s\"',name);var transport=this.createTransport(name,{probe:1}),failed=false,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;failed=true;cleanup();transport.close();transport=null}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\")}function onclose(){onerror(\"socket closed\")}function onupgrade(to){if(transport&&to.name!=transport.name){debug('\"%s\" works - aborting \"%s\"',to.name,transport.name);freezeTransport()}}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()};Socket.prototype.onOpen=function(){debug(\"socket open\");this.readyState=\"open\";Socket.priorWebsocketSuccess=\"websocket\"==this.transport.name;this.emit(\"open\");this.flush();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])}}};Socket.prototype.onPacket=function(packet){if(\"opening\"==this.readyState||\"open\"==this.readyState){debug('socket receive: type \"%s\", data \"%s\"',packet.type,packet.data);this.emit(\"packet\",packet);this.emit(\"heartbeat\");switch(packet.type){case\"open\":this.onHandshake(parsejson(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)}};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();if(\"closed\"==this.readyState)return;this.setPing();this.removeListener(\"heartbeat\",this.onHeartbeat);this.on(\"heartbeat\",this.onHeartbeat)};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)};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)};Socket.prototype.ping=function(){var self=this;this.sendPacket(\"ping\",function(){self.emit(\"ping\")})};Socket.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen);this.prevBufferLen=0;if(0===this.writeBuffer.length){this.emit(\"drain\")}else{this.flush()}};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);this.prevBufferLen=this.writeBuffer.length;this.emit(\"flush\")}};Socket.prototype.write=Socket.prototype.send=function(msg,options,fn){this.sendPacket(\"message\",msg,options,fn);return this};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()};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(){self.once(\"upgrade\",cleanupAndClose);self.once(\"upgradeError\",cleanupAndClose)}return this};Socket.prototype.onError=function(err){debug(\"socket error %j\",err);Socket.priorWebsocketSuccess=false;this.emit(\"error\",err);this.onClose(\"transport error\",err)};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;clearTimeout(this.pingIntervalTimer);clearTimeout(this.pingTimeoutTimer);this.transport.removeAllListeners(\"close\");this.transport.close();this.transport.removeAllListeners();this.readyState=\"closed\";this.id=null;this.emit(\"close\",reason,desc);self.writeBuffer=[];self.prevBufferLen=0}};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}}).call(this,typeof self!==\"undefined\"?self:typeof window!==\"undefined\"?window:typeof global!==\"undefined\"?global:{})},{\"./transport\":4,\"./transports\":5,\"component-emitter\":15,debug:17,\"engine.io-parser\":19,indexof:23,parsejson:26,parseqs:27,parseuri:28}],4:[function(_dereq_,module,exports){var parser=_dereq_(\"engine.io-parser\");var Emitter=_dereq_(\"component-emitter\");module.exports=Transport;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.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.extraHeaders=opts.extraHeaders}Emitter(Transport.prototype);Transport.prototype.onError=function(msg,desc){var err=new Error(msg);err.type=\"TransportError\";err.description=desc;this.emit(\"error\",err);return this};Transport.prototype.open=function(){if(\"closed\"==this.readyState||\"\"==this.readyState){this.readyState=\"opening\";this.doOpen()}return this};Transport.prototype.close=function(){if(\"opening\"==this.readyState||\"open\"==this.readyState){this.doClose();this.onClose()}return this};Transport.prototype.send=function(packets){if(\"open\"==this.readyState){this.write(packets)}else{throw new Error(\"Transport not open\")}};Transport.prototype.onOpen=function(){this.readyState=\"open\";this.writable=true;this.emit(\"open\")};Transport.prototype.onData=function(data){var packet=parser.decodePacket(data,this.socket.binaryType);this.onPacket(packet)};Transport.prototype.onPacket=function(packet){this.emit(\"packet\",packet)};Transport.prototype.onClose=function(){this.readyState=\"closed\";this.emit(\"close\")}},{\"component-emitter\":15,\"engine.io-parser\":19}],5:[function(_dereq_,module,exports){(function(global){var XMLHttpRequest=_dereq_(\"xmlhttprequest-ssl\");var XHR=_dereq_(\"./polling-xhr\");var JSONP=_dereq_(\"./polling-jsonp\");var websocket=_dereq_(\"./websocket\");exports.polling=polling;exports.websocket=websocket;function polling(opts){var xhr;var xd=false;var xs=false;var jsonp=false!==opts.jsonp;if(global.location){var isSSL=\"https:\"==location.protocol;var port=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)}}}).call(this,typeof self!==\"undefined\"?self:typeof window!==\"undefined\"?window:typeof global!==\"undefined\"?global:{})},{\"./polling-jsonp\":6,\"./polling-xhr\":7,\"./websocket\":9,\"xmlhttprequest-ssl\":10}],6:[function(_dereq_,module,exports){(function(global){var Polling=_dereq_(\"./polling\");var inherit=_dereq_(\"component-inherit\");module.exports=JSONPPolling;var rNewline=/\\n/g;var rEscapedNewline=/\\\\n/g;var callbacks;var index=0;function empty(){}function JSONPPolling(opts){Polling.call(this,opts);this.query=this.query||{};if(!callbacks){if(!global.___eio)global.___eio=[];callbacks=global.___eio}this.index=callbacks.length;var self=this;callbacks.push(function(msg){self.onData(msg)});this.query.j=this.index;if(global.document&&global.addEventListener){global.addEventListener(\"beforeunload\",function(){if(self.script)self.script.onerror=empty},false)}}inherit(JSONPPolling,Polling);JSONPPolling.prototype.supportsBinary=false;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)};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)}};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{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();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}}}).call(this,typeof self!==\"undefined\"?self:typeof window!==\"undefined\"?window:typeof global!==\"undefined\"?global:{})},{\"./polling\":8,\"component-inherit\":16}],7:[function(_dereq_,module,exports){(function(global){var XMLHttpRequest=_dereq_(\"xmlhttprequest-ssl\");var Polling=_dereq_(\"./polling\");var Emitter=_dereq_(\"component-emitter\");var inherit=_dereq_(\"component-inherit\");var debug=_dereq_(\"debug\")(\"engine.io-client:polling-xhr\");module.exports=XHR;module.exports.Request=Request;function empty(){}function XHR(opts){Polling.call(this,opts);if(global.location){var isSSL=\"https:\"==location.protocol;var port=location.port;if(!port){port=isSSL?443:80}this.xd=opts.hostname!=global.location.hostname||port!=opts.port;this.xs=opts.secure!=isSSL}else{this.extraHeaders=opts.extraHeaders}}inherit(XHR,Polling);XHR.prototype.supportsBinary=true;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.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.extraHeaders=this.extraHeaders;return new Request(opts)};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};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};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.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.extraHeaders=opts.extraHeaders;this.create()}Emitter(Request.prototype);Request.prototype.create=function(){var opts={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};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(true);for(var i in this.extraHeaders){if(this.extraHeaders.hasOwnProperty(i)){xhr.setRequestHeader(i,this.extraHeaders[i])}}}}catch(e){}if(this.supportsBinary){xhr.responseType=\"arraybuffer\"}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){}}if(\"withCredentials\"in xhr){xhr.withCredentials=true}if(this.hasXDR()){xhr.onload=function(){self.onLoad()};xhr.onerror=function(){self.onError(xhr.responseText)}}else{xhr.onreadystatechange=function(){if(4!=xhr.readyState)return;if(200==xhr.status||1223==xhr.status){self.onLoad()}else{setTimeout(function(){self.onError(xhr.status)},0)}}}debug(\"xhr data %s\",this.data);xhr.send(this.data)}catch(e){setTimeout(function(){self.onError(e)},0);return}if(global.document){this.index=Request.requestsCount++;Request.requests[this.index]=this}};Request.prototype.onSuccess=function(){this.emit(\"success\");this.cleanup()};Request.prototype.onData=function(data){this.emit(\"data\",data);this.onSuccess()};Request.prototype.onError=function(err){this.emit(\"error\",err);this.cleanup(true)};Request.prototype.cleanup=function(fromError){if(\"undefined\"==typeof this.xhr||null===this.xhr){return}if(this.hasXDR()){this.xhr.onload=this.xhr.onerror=empty}else{this.xhr.onreadystatechange=empty}if(fromError){try{this.xhr.abort()}catch(e){}}if(global.document){delete Request.requests[this.index]}this.xhr=null};Request.prototype.onLoad=function(){var data;try{var contentType;try{contentType=this.xhr.getResponseHeader(\"Content-Type\").split(\";\")[0]}catch(e){}if(contentType===\"application/octet-stream\"){data=this.xhr.response}else{if(!this.supportsBinary){data=this.xhr.responseText}else{try{data=String.fromCharCode.apply(null,new Uint8Array(this.xhr.response))}catch(e){var ui8Arr=new Uint8Array(this.xhr.response);var dataArray=[];for(var idx=0,length=ui8Arr.length;idx<length;idx++){dataArray.push(ui8Arr[idx])}data=String.fromCharCode.apply(null,dataArray)}}}}catch(e){this.onError(e)}if(null!=data){this.onData(data)}};Request.prototype.hasXDR=function(){return\"undefined\"!==typeof global.XDomainRequest&&!this.xs&&this.enablesXDR};Request.prototype.abort=function(){this.cleanup()};if(global.document){Request.requestsCount=0;Request.requests={};if(global.attachEvent){global.attachEvent(\"onunload\",unloadHandler)}else if(global.addEventListener){global.addEventListener(\"beforeunload\",unloadHandler,false)}}function unloadHandler(){for(var i in Request.requests){if(Request.requests.hasOwnProperty(i)){Request.requests[i].abort()}}}}).call(this,typeof self!==\"undefined\"?self:typeof window!==\"undefined\"?window:typeof global!==\"undefined\"?global:{})},{\"./polling\":8,\"component-emitter\":15,\"component-inherit\":16,debug:17,\"xmlhttprequest-ssl\":10}],8:[function(_dereq_,module,exports){var Transport=_dereq_(\"../transport\");var parseqs=_dereq_(\"parseqs\");var parser=_dereq_(\"engine.io-parser\");var inherit=_dereq_(\"component-inherit\");var yeast=_dereq_(\"yeast\");var debug=_dereq_(\"debug\")(\"engine.io-client:polling\");module.exports=Polling;var hasXHR2=function(){var XMLHttpRequest=_dereq_(\"xmlhttprequest-ssl\");var xhr=new XMLHttpRequest({xdomain:false});return null!=xhr.responseType}();function Polling(opts){var forceBase64=opts&&opts.forceBase64;if(!hasXHR2||forceBase64){this.supportsBinary=false}Transport.call(this,opts)}inherit(Polling,Transport);Polling.prototype.name=\"polling\";Polling.prototype.doOpen=function(){this.poll()};Polling.prototype.pause=function(onPause){var pending=0;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()}};Polling.prototype.poll=function(){debug(\"polling\");this.polling=true;this.doPoll();this.emit(\"poll\")};Polling.prototype.onData=function(data){var self=this;debug(\"polling got data %s\",data);var callback=function(packet,index,total){if(\"opening\"==self.readyState){self.onOpen()}if(\"close\"==packet.type){self.onClose();return false}self.onPacket(packet)};parser.decodePayload(data,this.socket.binaryType,callback);if(\"closed\"!=this.readyState){this.polling=false;this.emit(\"pollComplete\");if(\"open\"==this.readyState){this.poll()}else{debug('ignoring poll - transport state \"%s\"',this.readyState)}}};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{debug(\"transport not open - deferring close\");this.once(\"open\",close)}};Polling.prototype.write=function(packets){var self=this;this.writable=false;var callbackfn=function(){self.writable=true;self.emit(\"drain\")};var self=this;parser.encodePayload(packets,this.supportsBinary,function(data){self.doWrite(data,callbackfn)})};Polling.prototype.uri=function(){var query=this.query||{};var schema=this.secure?\"https\":\"http\";var port=\"\";if(false!==this.timestampRequests){query[this.timestampParam]=yeast()}if(!this.supportsBinary&&!query.sid){query.b64=1}query=parseqs.encode(query);if(this.port&&(\"https\"==schema&&this.port!=443||\"http\"==schema&&this.port!=80)){port=\":\"+this.port}if(query.length){query=\"?\"+query}var ipv6=this.hostname.indexOf(\":\")!==-1;return schema+\"://\"+(ipv6?\"[\"+this.hostname+\"]\":this.hostname)+port+this.path+query}},{\"../transport\":4,\"component-inherit\":16,debug:17,\"engine.io-parser\":19,parseqs:27,\"xmlhttprequest-ssl\":10,yeast:30}],9:[function(_dereq_,module,exports){(function(global){var Transport=_dereq_(\"../transport\");var parser=_dereq_(\"engine.io-parser\");var parseqs=_dereq_(\"parseqs\");var inherit=_dereq_(\"component-inherit\");var yeast=_dereq_(\"yeast\");var debug=_dereq_(\"debug\")(\"engine.io-client:websocket\");var BrowserWebSocket=global.WebSocket||global.MozWebSocket;var WebSocket=BrowserWebSocket;if(!WebSocket&&typeof window===\"undefined\"){try{WebSocket=_dereq_(\"ws\")}catch(e){}}module.exports=WS;function WS(opts){var forceBase64=opts&&opts.forceBase64;if(forceBase64){this.supportsBinary=false}this.perMessageDeflate=opts.perMessageDeflate;Transport.call(this,opts)}inherit(WS,Transport);WS.prototype.name=\"websocket\";WS.prototype.supportsBinary=true;WS.prototype.doOpen=function(){if(!this.check()){return}var self=this;var uri=this.uri();var protocols=void 0;var opts={agent:this.agent,perMessageDeflate:this.perMessageDeflate};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}this.ws=BrowserWebSocket?new WebSocket(uri):new WebSocket(uri,protocols,opts);if(this.ws.binaryType===undefined){this.supportsBinary=false}if(this.ws.supports&&this.ws.supports.binary){this.supportsBinary=true;this.ws.binaryType=\"buffer\"}else{this.ws.binaryType=\"arraybuffer\"}this.addEventListeners()};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)}};if(\"undefined\"!=typeof navigator&&/iPad|iPhone|iPod/i.test(navigator.userAgent)){WS.prototype.onData=function(data){var self=this;setTimeout(function(){Transport.prototype.onData.call(self,data)},0)}}WS.prototype.write=function(packets){var self=this;this.writable=false;var total=packets.length;for(var i=0,l=total;i<l;i++){(function(packet){parser.encodePacket(packet,self.supportsBinary,function(data){if(!BrowserWebSocket){var opts={};if(packet.options){opts.compress=packet.options.compress}if(self.perMessageDeflate){var len=\"string\"==typeof data?global.Buffer.byteLength(data):data.length;if(len<self.perMessageDeflate.threshold){opts.compress=false}}}try{if(BrowserWebSocket){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\");setTimeout(function(){self.writable=true;self.emit(\"drain\")},0)}};WS.prototype.onClose=function(){Transport.prototype.onClose.call(this)};WS.prototype.doClose=function(){if(typeof this.ws!==\"undefined\"){this.ws.close()}};WS.prototype.uri=function(){var query=this.query||{};var schema=this.secure?\"wss\":\"ws\";var port=\"\";if(this.port&&(\"wss\"==schema&&this.port!=443||\"ws\"==schema&&this.port!=80)){port=\":\"+this.port}if(this.timestampRequests){query[this.timestampParam]=yeast()}if(!this.supportsBinary){query.b64=1}query=parseqs.encode(query);if(query.length){query=\"?\"+query}var ipv6=this.hostname.indexOf(\":\")!==-1;return schema+\"://\"+(ipv6?\"[\"+this.hostname+\"]\":this.hostname)+port+this.path+query};WS.prototype.check=function(){return!!WebSocket&&!(\"__initialize\"in WebSocket&&this.name===WS.prototype.name)}}).call(this,typeof self!==\"undefined\"?self:typeof window!==\"undefined\"?window:typeof global!==\"undefined\"?global:{})},{\"../transport\":4,\"component-inherit\":16,debug:17,\"engine.io-parser\":19,parseqs:27,ws:undefined,yeast:30}],10:[function(_dereq_,module,exports){var hasCORS=_dereq_(\"has-cors\");module.exports=function(opts){var xdomain=opts.xdomain;var xscheme=opts.xscheme;var enablesXDR=opts.enablesXDR;try{if(\"undefined\"!=typeof XMLHttpRequest&&(!xdomain||hasCORS)){return new XMLHttpRequest}}catch(e){}try{if(\"undefined\"!=typeof XDomainRequest&&!xscheme&&enablesXDR){return new XDomainRequest}}catch(e){}if(!xdomain){try{return new ActiveXObject(\"Microsoft.XMLHTTP\")}catch(e){}}}},{\"has-cors\":22}],11:[function(_dereq_,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;if(err){bail=true;callback(err);callback=err_cb}else if(proxy.count===0&&!bail){callback(null,result)}}}function noop(){}},{}],12:[function(_dereq_,module,exports){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}},{}],13:[function(_dereq_,module,exports){(function(chars){\"use strict\";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];\n"
  },
  {
    "path": "lib/client/webRTC/createPeerConnection.js",
    "content": "const sendMessage = require('./sendMessage.js');\nconst logError = require('./logError.js');\nconst onDataChannelCreated = require('./onDataChannelCreated.js');\nconst onLocalSessionCreated = require('./onLocalSessionCreated.js');\n\n// const createPeerConnection\nmodule.exports = (isInitiator, config) => {\n  console.log('Creating Peer connection as initiator?', isInitiator, 'config:', config);\n  imperio.peerConnection = new RTCPeerConnection(config);\n  // send any ice candidates to the other peer\n  imperio.peerConnection.onicecandidate = event => {\n    console.log('icecandidate event:', event);\n    if (event.candidate) {\n      sendMessage({\n        type: 'candidate',\n        label: event.candidate.sdpMLineIndex,\n        id: event.candidate.sdpMid,\n        candidate: event.candidate.candidate,\n      });\n    } else {\n      console.log('End of candidates.');\n    }\n  };\n  if (isInitiator) {\n    console.log('Creating Data Channel');\n    imperio.dataChannel = imperio.peerConnection\n      .createDataChannel('phone data', { ordered: false, maxRetransmits: 0 });\n    onDataChannelCreated();\n    console.log('Creating an offer');\n    imperio.peerConnection.createOffer(onLocalSessionCreated, logError);\n  } else {\n    imperio.peerConnection.ondatachannel = event => {\n      console.log('ondatachannel:', event.channel);\n      imperio.dataChannel = event.channel;\n      onDataChannelCreated();\n    };\n  }\n};\n\n// module.export = createPeerConnection;\n"
  },
  {
    "path": "lib/client/webRTC/logError.js",
    "content": "module.exports = err => console.log(err.toString(), err);\n"
  },
  {
    "path": "lib/client/webRTC/onDataChannelCreated.js",
    "content": "const onDataChannelCreated = () => {\n  if (imperio.dataChannel) {\n    imperio.dataChannel.onopen = () => {\n      console.log('CHANNEL opened!!!');\n      imperio.connectionType = 'webRTC';\n      imperio.dataChannel.onmessage = event => {\n        const eventObject = JSON.parse(event.data);\n        const handlerOptions = ['acceleration', 'gyroscope', 'geoLocation', 'tap',\n              'pan', 'pinch', 'press', 'presUp', 'rotate', 'swipe', 'data'];\n        handlerOptions.forEach(handler => {\n          if (eventObject.type === handler) {\n            if (imperio.callbacks[handler]) imperio.callbacks[handler](eventObject.data);\n          }\n        });\n      };\n    };\n  }\n};\n\nmodule.exports = onDataChannelCreated;\n"
  },
  {
    "path": "lib/client/webRTC/onLocalSessionCreated.js",
    "content": "const sendMessage = require('./sendMessage.js');\nconst logError = require('./logError.js');\n\nconst onLocalSessionCreated = desc => {\n  imperio.peerConnection.setLocalDescription(desc, () => {\n    sendMessage(imperio.peerConnection.localDescription);\n  }, logError);\n};\n\nmodule.exports = onLocalSessionCreated;\n"
  },
  {
    "path": "lib/client/webRTC/sendMessage.js",
    "content": "const sendMessage = message => {\n  console.log(`Client sending message: ${message}`);\n  imperio.socket.emit('message', message, imperio.room);\n};\n\nmodule.exports = sendMessage;\n"
  },
  {
    "path": "lib/client/webRTC/signalingMessageCallback.js",
    "content": "const logError = require('./logError.js');\nconst onLocalSessionCreated = require('./onLocalSessionCreated.js');\n\nconst signalingMessageCallback = message => {\n  if (message.type === 'offer') {\n    console.log('Got offer. Sending answer to peer.');\n    imperio.peerConnection\n      .setRemoteDescription(new RTCSessionDescription(message), () => {}, logError);\n    imperio.peerConnection.createAnswer(onLocalSessionCreated, logError);\n  } else if (message.type === 'answer') {\n    console.log('Got answer.');\n    imperio.peerConnection\n      .setRemoteDescription(new RTCSessionDescription(message), () => {}, logError);\n  } else if (message.type === 'candidate') {\n    console.log('Setting candidate.');\n    imperio.peerConnection.addIceCandidate(new RTCIceCandidate({ candidate: message.candidate }));\n  } else if (message === 'bye') {\n  // TODO: do something when device disconnects?\n  }\n};\n\nmodule.exports = signalingMessageCallback;\n"
  },
  {
    "path": "lib/client/webRTC/webRTCConnect.js",
    "content": "const createPeerConnection = require('./createPeerConnection.js');\nconst signalingMessageCallback = require('./signalingMessageCallback.js');\nconst webRTCSupport = require('./webRTCSupport.js');\n\nconst webRTCConnect = () => {\n  if (webRTCSupport) {\n    imperio.socket.on('created', (room, clientId) => {\n      console.log(`Created room, ${room} - my client ID is, ${clientId}`);\n    });\n    imperio.socket.on('log', array => {\n      console.log.apply(console, array);\n    });\n    imperio.socket.on('joined', (room, clientId) => {\n      console.log(`This peer has joined room, ${room}, with client ID, ${clientId}`);\n      createPeerConnection(false, imperio.webRTCConfiguration);\n    });\n    imperio.socket.on('ready', () => {\n      console.log('Socket is ready');\n      createPeerConnection(true, imperio.webRTCConfiguration);\n    });\n    imperio.socket.on('message', message => {\n      console.log(`Client received message: ${message}`);\n      signalingMessageCallback(message);\n    });\n  } else console.log('WebRTC is not supported, will continue using Sockets.');\n};\n\nmodule.exports = webRTCConnect;\n"
  },
  {
    "path": "lib/client/webRTC/webRTCSupport.js",
    "content": "const peerConnectionSupported = window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection;\nconst getUserMediaSupported = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.msGetUserMedia || navigator.mozGetUserMedia;\n\n// export whether the browser supports peerconnection and dataConnection\nmodule.exports = !!peerConnectionSupported && !!getUserMediaSupported;\n"
  },
  {
    "path": "lib/server/connectionController.js",
    "content": "\"use strict\"; // eslint-disable-line\n/* eslint-disable no-param-reassign */\nconst jwtController = require('./jwtController.js');\nconst nonceController = require('./nonceController.js');\nconst connectionController = {};\n\n/**\n * Generates or joins a socket room when a get request is made to the page\n * Stores a cookie on the response object identifying the socket room id\n * Generates a nonce (password string) used to pair a device with this device\n * Stores a connection between the nonce and the room until a device uses it\n * @param {Object} req - request object\n * @param {Object} res - response object\n * @param {Object} connectRequests - a reference to the activeConnectRequests object\n */\nconnectionController.handleGet = (req, res, connectRequests) => {\n  // check to see if nonce is passed in as param or as part of query\n  // console.log('req params is', req.params);\n  let nonce = req.params.nonce || req.query.nonce;\n  // console.log('nonce is ', nonce);\n  let roomId;\n  if (nonce) {\n    // if nonce is provided, check to see if a connection has been made with that nonce\n    if (connectRequests.hasOwnProperty(nonce)) {\n      roomId = connectRequests[nonce].roomId;\n      req.imperio.connected = true;\n    } else {\n      // check if already in session, or create session\n      roomId = jwtController.handleSession(req);\n      // create new nonce\n      nonce = nonceController.generateNonce(5);\n      connectRequests[nonce] = nonceController.generateConnectRequest(roomId);\n    }\n  } else {\n    // check if already in session, or create session\n    roomId = jwtController.handleSession(req);\n    // create new nonce\n    nonce = nonceController.generateNonce(5);\n    connectRequests[nonce] = nonceController.generateConnectRequest(roomId);\n  }\n  res.cookie('roomId', roomId, { maxAge: req.imperio.roomCookieTimeout });\n  res.cookie('nonce', nonce, { maxAge: req.imperio.roomCookieTimeout });\n};\n\nconnectionController.handlePost = (req, res, connectRequests, bodyTag) => {\n  const nonce = req.body[bodyTag];\n  if (connectRequests.hasOwnProperty(nonce)) {\n    // roomId will become the place where we are supposed to connect socket;\n    const roomId = connectRequests[nonce].roomId;\n    jwtController.createTokenFrom(roomId, res);\n    res.cookie('roomId', roomId);\n    // TODO: Implement using JWT to establish connection?\n    req.imperio.connected = true;\n  }\n    // if incorrect then redirect to rootclient page with error message\n};\n\nmodule.exports = connectionController;\n"
  },
  {
    "path": "lib/server/jwtController.js",
    "content": "\"use strict\"; // eslint-disable-line\nconst jwt = require('jsonwebtoken');\nconst uuid = require('uuid');\nconst keys = require('./../../keys.js');\nconst jwtController = {};\n\n/**\n * Creates and jwt token and attaches it to the response in a cookie\n * @param {String} roomId - unique id of socket room\n * @param {Object} res - response object\n */\njwtController.createTokenFrom = (roomId, res) => {\n  const token = jwt.sign({ roomId }, keys.secret);\n  res.cookie('session', token, { httpOnly: true });\n};\n\n/**\n * Decodes jwt token string and returns the roomId string stored on it\n * @param  {String} token - jwt token from client\n * @return {String} roomId - unique id of socket room\n */\njwtController.getRoomIdFrom = token => {\n  const decoded = jwt.verify(token, keys.secret);\n  const roomId = decoded.roomId;\n  return roomId;\n};\n\n/**\n * If a roomId cookie exists,\n * Otherwise creates a room with a unique room id\n * @param {Object} req - request object\n * @param {Object} res - response object\n * @param {String} roomId - unique id of socket room\n */\njwtController.handleSession = (req) => {\n  let roomId = req.cookies.roomId;\n  if (!roomId) {\n    // create uuid for session\n    roomId = uuid.v1();\n  }\n  return roomId;\n};\n\n/**\n * If a token exists, extracts the existing room's id from the token\n * Otherwise creates a room with a unique room id and stores it in a token\n * @param {Object} req - request object\n * @param {Object} res - response object\n * @param {String} roomId - unique id of socket room\n */\njwtController.handleSessionWithJWT = (req, res) => {\n  const token = req.cookies.session;\n  let roomId;\n  if (token) {\n    roomId = jwtController.getRoomIdFrom(token);\n  } else {  // create new session\n    // create uuid for session\n    roomId = uuid.v1();\n    // store that id in the jwt->coooookie\n    jwtController.createTokenFrom(roomId, res);\n  }\n  return roomId;\n};\n\nmodule.exports = jwtController;\n"
  },
  {
    "path": "lib/server/nonceController.js",
    "content": "\"use strict\"; // eslint-disable-line\nconst nonceController = {};\n\n/**\n * Generates a random string of lowercase letters or numbers, of length 'length'\n * @param  {Number} length - desired length of string to be generated\n * @return {String} nonce - randomly generated nonce string\n */\nnonceController.generateNonce = length => {\n  const possibleChars = 'abcdefghijklmnopqrstuvwxyz0123456789';\n  const possibleCharsLength = possibleChars.length;\n  let nonce = '';\n  for (let i = 0; i < length; i++) {\n    nonce += possibleChars.charAt(\n      Math.floor(Math.random() * possibleCharsLength)\n    );\n  }\n  return nonce;\n};\n\n/**\n * Creates an object holding roomId and time created. Open connections should\n *   eventually time out based on this timestamp\n * @param  {String} roomId - stores the id for the socket room\n * @return {Object} connectRequest - holds roomId and creation timestamp\n */\nnonceController.generateConnectRequest = roomId => ({\n  roomId,\n  createdAt: Date.now(),\n});\n\n/**\n * Checks nonce string against property keys of connect request object\n * @param  {Object} connectRequest - holds roomId and creation timestamp\n * @param  {String} nonce - previously created nonce value to check for\n * @return {Boolean} valid - returns true if valid nonce\n */\nnonceController.connectRequestIsValid = (connectRequests, nonce) => {\n  const lowerCaseNonce = nonce.toLowerCase();\n  return connectRequests.hasOwnProperty(lowerCaseNonce);\n};\n\n/**\n * Sets a timeout on connect requests. Nonce <-> Room connections are destroyed\n * when their timeout has expired.\n * @param {Object} connectRequests - reference to the activeConnectRequests obj\n * @param {Number} timeout - time until nonce should timeout in milliseconds\n */\nnonceController.handleNonceTimeout = (io, socket, room, connectRequests, timeout) => {\n  const timeouts = [];\n  for (let nonce in connectRequests) { // eslint-disable-line\n    if (connectRequests.hasOwnProperty(nonce)) {\n      const roomShort = connectRequests[nonce].roomId.substr(0, 4);\n      const elapsed = Date.now() - connectRequests[nonce].createdAt;\n      const remaining = new Date(timeout - elapsed);\n      if (remaining < 0) {\n        delete connectRequests[nonce]; // eslint-disable-line\n      } else {\n        let timeoutUpdate = `${nonce} -> ${roomShort}... `;\n        timeoutUpdate += `timeout in: ${Math.ceil(remaining / 1000)} s`;\n        timeouts.push(timeoutUpdate);\n      }\n    }\n  }\n  io.sockets.in(room).emit('updateNonceTimeouts', timeouts);\n};\n\n\nmodule.exports = nonceController;\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"imperio\",\n  \"version\": \"0.3.5\",\n  \"description\": \"Control your desktop experience from a mobile device.\",\n  \"main\": \"index.js\",\n  \"scripts\": {\n    \"start\": \"webpack --watch & PROD_ENV=1 webpack --watch\",\n    \"test\": \"mocha ./test/test.js\"\n  },\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"git+https://github.com/imperiojs/imperio.git\"\n  },\n  \"authors\": [\n    \"Austin <austin.lyon@gmail.com>\",\n    \"Austin <anwaukoni@gmail.com>\",\n    \"Matt <mclaugmg@gmail.com>\",\n    \"Michael <michael.james.blanchard@gmail.com>\"\n  ],\n  \"license\": \"MIT\",\n  \"bugs\": {\n    \"url\": \"https://github.com/imperiojs/imperio/issues\"\n  },\n  \"homepage\": \"https://github.com/imperiojs/imperio#readme\",\n  \"dependencies\": {\n    \"body-parser\": \"1.15.2\",\n    \"cookie-parser\": \"1.4.3\",\n    \"express-useragent\": \"0.2.4\",\n    \"jsonwebtoken\": \"7.0.1\",\n    \"socket.io\": \"1.4.6\",\n    \"uuid\": \"^3.0.0\",\n    \"webrtc-adapter\": \"1.4.0\"\n  },\n  \"devDependencies\": {\n    \"chai\": \"3.5.0\",\n    \"nodemon\": \"1.9.2\",\n    \"webpack\": \"1.13.1\",\n    \"babel-core\": \"6.10.4\",\n    \"babel-loader\": \"6.2.4\",\n    \"babel-plugin-react-transform\": \"2.0.2\",\n    \"babel-preset-es2015\": \"6.9.0\",\n    \"babel-preset-react\": \"6.11.1\",\n    \"react-transform-hmr\": \"1.0.4\",\n    \"eslint\": \"2.13.1\",\n    \"eslint-config-airbnb\": \"9.0.1\",\n    \"eslint-plugin-import\": \"1.9.2\",\n    \"eslint-plugin-jsx-a11y\": \"1.5.3\",\n    \"eslint-plugin-react\": \"5.2.2\",\n    \"expect\": \"1.20.2\",\n    \"mocha\": \"2.5.3\",\n    \"socket.io-client\": \"1.4.6\",\n    \"supertest\": \"1.2.0\",\n    \"twilio\": \"2.9.1\"\n  }\n}\n"
  },
  {
    "path": "test/test.js",
    "content": "'use strict';\n\nconst expect = require ('chai').expect,\n  io = require('socket.io-client'),\n  url = 'http://localhost:3000',\n  body = require('../client/browser.js'),\n  options = {\n    transports: ['websocket'],\n    'force new connection': true,\n  },\n  user1 = {\n    name: 'Maam',\n  };\n\ndescribe('socket connection', ()=>{\n  it('should broadcast a string once connected', (done)=>{\n    const client1 = io.connect(url, options);\n\n    client1.on('tap', ()=>{\n      console.log('connected');\n      expect(body.classList.contains(\"class2\")).to.equal(true);\n    });\n  });\n});\n"
  },
  {
    "path": "webpack.config.js",
    "content": "const webpack = require('webpack');\n\nconst PROD = JSON.parse(process.env.PROD_ENV || '0');\n\nmodule.exports = [\n  {\n    devtool: 'source-map', // or use source-map-eval\n    entry: `${__dirname}/lib/client/mainClient.js`,\n    output: {\n      path: `${__dirname}/dist`,\n      filename: PROD ? 'imperio.min.js' : 'imperio.js',\n      // library: 'imperio',\n      // libraryTarget: 'umd', // This is exporting as a universal module\n      // umdNamedDefine: true,\n      // explore externals for things we may not want to include in our bundle\n    },\n    module: {\n      loaders: [\n        {\n          test: /\\.js$/,\n          exclude: /node_modules/,\n          loader: 'babel',\n        },\n        //{},\n      ],\n    },\n    plugins: PROD ? [\n      new webpack.BannerPlugin('Copyright Imperiojs'),\n      new webpack.optimize.OccurenceOrderPlugin(),\n      new webpack.optimize.UglifyJsPlugin({\n        compress: { warnings: false },\n      }),\n    ] : [\n      new webpack.BannerPlugin('Copyright Imperiojs'),\n      new webpack.optimize.OccurenceOrderPlugin(),\n    ],\n  // IF WE WANT TO USE THE WEBPACK SERVER - NOT USING FOR NOW SINCE WE HAVE OUR OWN SERVER.\n    // devServer: {\n    //   contentBase: './library/client/mainClient.js',\n    //   colors: true,\n    //   historyApiFallback: true,\n    //   inline: true,\n    //   hot: true,\n    // },\n  },\n];\n"
  }
]