Guest User

Untitled

a guest
Dec 7th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function(f) {
  2.     if (typeof exports === "object" && typeof module !== "undefined") {
  3.         module.exports = f()
  4.     } else if (typeof define === "function" && define.amd) {
  5.         define([], f)
  6.     } else {
  7.         var g;
  8.         if (typeof window !== "undefined") {
  9.             g = window
  10.         } else if (typeof global !== "undefined") {
  11.             g = global
  12.         } else if (typeof self !== "undefined") {
  13.             g = self
  14.         } else {
  15.             g = this
  16.         }
  17.         g.mqtt = f()
  18.     }
  19. })(function() {
  20.     var define, module, exports;
  21.     return function e(t, n, r) {
  22.         function s(o, u) {
  23.             if (!n[o]) {
  24.                 if (!t[o]) {
  25.                     var a = typeof require == "function" && require;
  26.                     if (!u && a) return a(o, !0);
  27.                     if (i) return i(o, !0);
  28.                     var f = new Error("Cannot find module '" + o + "'");
  29.                     throw f.code = "MODULE_NOT_FOUND", f
  30.                 }
  31.                 var l = n[o] = {
  32.                     exports: {}
  33.                 };
  34.                 t[o][0].call(l.exports, function(e) {
  35.                     var n = t[o][1][e];
  36.                     return s(n ? n : e)
  37.                 }, l, l.exports, e, t, n, r)
  38.             }
  39.             return n[o].exports
  40.         }
  41.         var i = typeof require == "function" && require;
  42.         for (var o = 0; o < r.length; o++) s(r[o]);
  43.         return s
  44.     }({
  45.         1: [function(require, module, exports) {
  46.             (function(process, global) {
  47.                 "use strict";
  48.                 var events = require("events");
  49.                 var Store = require("./store");
  50.                 var eos = require("end-of-stream");
  51.                 var mqttPacket = require("mqtt-packet");
  52.                 var Writable = require("readable-stream").Writable;
  53.                 var inherits = require("inherits");
  54.                 var reInterval = require("reinterval");
  55.                 var validations = require("./validations");
  56.                 var xtend = require("xtend");
  57.                 var setImmediate = global.setImmediate || function(callback) {
  58.                     process.nextTick(callback)
  59.                 };
  60.                 var defaultConnectOptions = {
  61.                     keepalive: 60,
  62.                     reschedulePings: true,
  63.                     protocolId: "MQTT",
  64.                     protocolVersion: 4,
  65.                     reconnectPeriod: 1e3,
  66.                     connectTimeout: 30 * 1e3,
  67.                     clean: true,
  68.                     resubscribe: true
  69.                 };
  70.  
  71.                 function defaultId() {
  72.                     return "mqttjs_" + Math.random().toString(16).substr(2, 8)
  73.                 }
  74.  
  75.                 function sendPacket(client, packet, cb) {
  76.                     client.emit("packetsend", packet);
  77.                     var result = mqttPacket.writeToStream(packet, client.stream);
  78.                     if (!result && cb) {
  79.                         client.stream.once("drain", cb)
  80.                     } else if (cb) {
  81.                         cb()
  82.                     }
  83.                 }
  84.  
  85.                 function flush(queue) {
  86.                     if (queue) {
  87.                         Object.keys(queue).forEach(function(messageId) {
  88.                             if (typeof queue[messageId] === "function") {
  89.                                 queue[messageId](new Error("Connection closed"));
  90.                                 delete queue[messageId]
  91.                             }
  92.                         })
  93.                     }
  94.                 }
  95.  
  96.                 function storeAndSend(client, packet, cb) {
  97.                     client.outgoingStore.put(packet, function storedPacket(err) {
  98.                         if (err) {
  99.                             return cb && cb(err)
  100.                         }
  101.                         sendPacket(client, packet, cb)
  102.                     })
  103.                 }
  104.  
  105.                 function nop() {}
  106.  
  107.                 function MqttClient(streamBuilder, options) {
  108.                     var k;
  109.                     var that = this;
  110.                     if (!(this instanceof MqttClient)) {
  111.                         return new MqttClient(streamBuilder, options)
  112.                     }
  113.                     this.options = options || {};
  114.                     for (k in defaultConnectOptions) {
  115.                         if (typeof this.options[k] === "undefined") {
  116.                             this.options[k] = defaultConnectOptions[k]
  117.                         } else {
  118.                             this.options[k] = options[k]
  119.                         }
  120.                     }
  121.                     this.options.clientId = typeof this.options.clientId === "string" ? this.options.clientId : defaultId();
  122.                     this.streamBuilder = streamBuilder;
  123.                     this.outgoingStore = this.options.outgoingStore || new Store;
  124.                     this.incomingStore = this.options.incomingStore || new Store;
  125.                     this.queueQoSZero = this.options.queueQoSZero === undefined ? true : this.options.queueQoSZero;
  126.                     this._resubscribeTopics = {};
  127.                     this.messageIdToTopic = {};
  128.                     this.pingTimer = null;
  129.                     this.connected = false;
  130.                     this.disconnecting = false;
  131.                     this.queue = [];
  132.                     this.connackTimer = null;
  133.                     this.reconnectTimer = null;
  134.                     this.nextId = Math.floor(Math.random() * 65535);
  135.                     this.outgoing = {};
  136.                     this.on("connect", function() {
  137.                         if (this.disconnected) {
  138.                             return
  139.                         }
  140.                         this.connected = true;
  141.                         var outStore = null;
  142.                         outStore = this.outgoingStore.createStream();
  143.                         outStore.once("readable", function() {
  144.                             function storeDeliver() {
  145.                                 var packet = outStore.read(1);
  146.                                 var cb;
  147.                                 if (!packet) {
  148.                                     return
  149.                                 }
  150.                                 if (!that.disconnecting && !that.reconnectTimer && that.options.reconnectPeriod > 0) {
  151.                                     outStore.read(0);
  152.                                     cb = that.outgoing[packet.messageId];
  153.                                     that.outgoing[packet.messageId] = function(err, status) {
  154.                                         if (cb) {
  155.                                             cb(err, status)
  156.                                         }
  157.                                         storeDeliver()
  158.                                     };
  159.                                     that._sendPacket(packet)
  160.                                 } else if (outStore.destroy) {
  161.                                     outStore.destroy()
  162.                                 }
  163.                             }
  164.                             storeDeliver()
  165.                         }).on("error", this.emit.bind(this, "error"))
  166.                     });
  167.                     this.on("close", function() {
  168.                         this.connected = false;
  169.                         clearTimeout(this.connackTimer)
  170.                     });
  171.                     this.on("connect", this._setupPingTimer);
  172.                     this.on("connect", function() {
  173.                         var queue = this.queue;
  174.  
  175.                         function deliver() {
  176.                             var entry = queue.shift();
  177.                             var packet = null;
  178.                             if (!entry) {
  179.                                 return
  180.                             }
  181.                             packet = entry.packet;
  182.                             that._sendPacket(packet, function(err) {
  183.                                 if (entry.cb) {
  184.                                     entry.cb(err)
  185.                                 }
  186.                                 deliver()
  187.                             })
  188.                         }
  189.                         deliver()
  190.                     });
  191.                     var firstConnection = true;
  192.                     this.on("connect", function() {
  193.                         if (!firstConnection && this.options.clean && Object.keys(this._resubscribeTopics).length > 0) {
  194.                             if (this.options.resubscribe) {
  195.                                 this._resubscribeTopics.resubscribe = true;
  196.                                 this.subscribe(this._resubscribeTopics)
  197.                             } else {
  198.                                 this._resubscribeTopics = {}
  199.                             }
  200.                         }
  201.                         firstConnection = false
  202.                     });
  203.                     this.on("close", function() {
  204.                         if (that.pingTimer !== null) {
  205.                             that.pingTimer.clear();
  206.                             that.pingTimer = null
  207.                         }
  208.                     });
  209.                     this.on("close", this._setupReconnect);
  210.                     events.EventEmitter.call(this);
  211.                     this._setupStream()
  212.                 }
  213.                 inherits(MqttClient, events.EventEmitter);
  214.                 MqttClient.prototype._setupStream = function() {
  215.                     var connectPacket;
  216.                     var that = this;
  217.                     var writable = new Writable;
  218.                     var parser = mqttPacket.parser(this.options);
  219.                     var completeParse = null;
  220.                     var packets = [];
  221.                     this._clearReconnect();
  222.                     this.stream = this.streamBuilder(this);
  223.                     parser.on("packet", function(packet) {
  224.                         packets.push(packet)
  225.                     });
  226.  
  227.                     function nextTickWork() {
  228.                         process.nextTick(work)
  229.                     }
  230.  
  231.                     function work() {
  232.                         var packet = packets.shift();
  233.                         var done = completeParse;
  234.                         if (packet) {
  235.                             that._handlePacket(packet, nextTickWork)
  236.                         } else {
  237.                             completeParse = null;
  238.                             done()
  239.                         }
  240.                     }
  241.                     writable._write = function(buf, enc, done) {
  242.                         completeParse = done;
  243.                         parser.parse(buf);
  244.                         work()
  245.                     };
  246.                     this.stream.pipe(writable);
  247.                     this.stream.on("error", nop);
  248.                     eos(this.stream, this.emit.bind(this, "close"));
  249.                     connectPacket = Object.create(this.options);
  250.                     connectPacket.cmd = "connect";
  251.                     sendPacket(this, connectPacket);
  252.                     parser.on("error", this.emit.bind(this, "error"));
  253.                     this.stream.setMaxListeners(1e3);
  254.                     clearTimeout(this.connackTimer);
  255.                     this.connackTimer = setTimeout(function() {
  256.                         that._cleanUp(true)
  257.                     }, this.options.connectTimeout)
  258.                 };
  259.                 MqttClient.prototype._handlePacket = function(packet, done) {
  260.                     this.emit("packetreceive", packet);
  261.                     switch (packet.cmd) {
  262.                         case "publish":
  263.                             this._handlePublish(packet, done);
  264.                             break;
  265.                         case "puback":
  266.                         case "pubrec":
  267.                         case "pubcomp":
  268.                         case "suback":
  269.                         case "unsuback":
  270.                             this._handleAck(packet);
  271.                             done();
  272.                             break;
  273.                         case "pubrel":
  274.                             this._handlePubrel(packet, done);
  275.                             break;
  276.                         case "connack":
  277.                             this._handleConnack(packet);
  278.                             done();
  279.                             break;
  280.                         case "pingresp":
  281.                             this._handlePingresp(packet);
  282.                             done();
  283.                             break;
  284.                         default:
  285.                             break
  286.                     }
  287.                 };
  288.                 MqttClient.prototype._checkDisconnecting = function(callback) {
  289.                     if (this.disconnecting) {
  290.                         if (callback) {
  291.                             callback(new Error("client disconnecting"))
  292.                         } else {
  293.                             this.emit("error", new Error("client disconnecting"))
  294.                         }
  295.                     }
  296.                     return this.disconnecting
  297.                 };
  298.                 MqttClient.prototype.publish = function(topic, message, opts, callback) {
  299.                     var packet;
  300.                     if (typeof opts === "function") {
  301.                         callback = opts;
  302.                         opts = null
  303.                     }
  304.                     var defaultOpts = {
  305.                         qos: 0,
  306.                         retain: false,
  307.                         dup: false
  308.                     };
  309.                     opts = xtend(defaultOpts, opts);
  310.                     if (this._checkDisconnecting(callback)) {
  311.                         return this
  312.                     }
  313.                     packet = {
  314.                         cmd: "publish",
  315.                         topic: topic,
  316.                         payload: message,
  317.                         qos: opts.qos,
  318.                         retain: opts.retain,
  319.                         messageId: this._nextId(),
  320.                         dup: opts.dup
  321.                     };
  322.                     switch (opts.qos) {
  323.                         case 1:
  324.                         case 2:
  325.                             this.outgoing[packet.messageId] = callback || nop;
  326.                             this._sendPacket(packet);
  327.                             break;
  328.                         default:
  329.                             this._sendPacket(packet, callback);
  330.                             break
  331.                     }
  332.                     return this
  333.                 };
  334.                 MqttClient.prototype.subscribe = function() {
  335.                     var packet;
  336.                     var args = Array.prototype.slice.call(arguments);
  337.                     var subs = [];
  338.                     var obj = args.shift();
  339.                     var resubscribe = obj.resubscribe;
  340.                     var callback = args.pop() || nop;
  341.                     var opts = args.pop();
  342.                     var invalidTopic;
  343.                     var that = this;
  344.                     delete obj.resubscribe;
  345.                     if (typeof obj === "string") {
  346.                         obj = [obj]
  347.                     }
  348.                     if (typeof callback !== "function") {
  349.                         opts = callback;
  350.                         callback = nop
  351.                     }
  352.                     invalidTopic = validations.validateTopics(obj);
  353.                     if (invalidTopic !== null) {
  354.                         setImmediate(callback, new Error("Invalid topic " + invalidTopic));
  355.                         return this
  356.                     }
  357.                     if (this._checkDisconnecting(callback)) {
  358.                         return this
  359.                     }
  360.                     var defaultOpts = {
  361.                         qos: 0
  362.                     };
  363.                     opts = xtend(defaultOpts, opts);
  364.                     if (Array.isArray(obj)) {
  365.                         obj.forEach(function(topic) {
  366.                             if (that._resubscribeTopics[topic] < opts.qos || !that._resubscribeTopics.hasOwnProperty(topic) || resubscribe) {
  367.                                 subs.push({
  368.                                     topic: topic,
  369.                                     qos: opts.qos
  370.                                 })
  371.                             }
  372.                         })
  373.                     } else {
  374.                         Object.keys(obj).forEach(function(k) {
  375.                             if (that._resubscribeTopics[k] < obj[k] || !that._resubscribeTopics.hasOwnProperty(k) || resubscribe) {
  376.                                 subs.push({
  377.                                     topic: k,
  378.                                     qos: obj[k]
  379.                                 })
  380.                             }
  381.                         })
  382.                     }
  383.                     packet = {
  384.                         cmd: "subscribe",
  385.                         subscriptions: subs,
  386.                         qos: 1,
  387.                         retain: false,
  388.                         dup: false,
  389.                         messageId: this._nextId()
  390.                     };
  391.                     if (!subs.length) {
  392.                         callback(null, []);
  393.                         return
  394.                     }
  395.                     if (this.options.resubscribe) {
  396.                         var topics = [];
  397.                         subs.forEach(function(sub) {
  398.                             if (that.options.reconnectPeriod > 0) {
  399.                                 that._resubscribeTopics[sub.topic] = sub.qos;
  400.                                 topics.push(sub.topic)
  401.                             }
  402.                         });
  403.                         that.messageIdToTopic[packet.messageId] = topics
  404.                     }
  405.                     this.outgoing[packet.messageId] = function(err, packet) {
  406.                         if (!err) {
  407.                             var granted = packet.granted;
  408.                             for (var i = 0; i < granted.length; i += 1) {
  409.                                 subs[i].qos = granted[i]
  410.                             }
  411.                         }
  412.                         callback(err, subs)
  413.                     };
  414.                     this._sendPacket(packet);
  415.                     return this
  416.                 };
  417.                 MqttClient.prototype.unsubscribe = function(topic, callback) {
  418.                     var packet = {
  419.                         cmd: "unsubscribe",
  420.                         qos: 1,
  421.                         messageId: this._nextId()
  422.                     };
  423.                     var that = this;
  424.                     callback = callback || nop;
  425.                     if (this._checkDisconnecting(callback)) {
  426.                         return this
  427.                     }
  428.                     if (typeof topic === "string") {
  429.                         packet.unsubscriptions = [topic]
  430.                     } else if (typeof topic === "object" && topic.length) {
  431.                         packet.unsubscriptions = topic
  432.                     }
  433.                     if (this.options.resubscribe) {
  434.                         packet.unsubscriptions.forEach(function(topic) {
  435.                             delete that._resubscribeTopics[topic]
  436.                         })
  437.                     }
  438.                     this.outgoing[packet.messageId] = callback;
  439.                     this._sendPacket(packet);
  440.                     return this
  441.                 };
  442.                 MqttClient.prototype.end = function(force, cb) {
  443.                     var that = this;
  444.                     if (typeof force === "function") {
  445.                         cb = force;
  446.                         force = false
  447.                     }
  448.  
  449.                     function closeStores() {
  450.                         that.disconnected = true;
  451.                         that.incomingStore.close(function() {
  452.                             that.outgoingStore.close(function() {
  453.                                 if (cb) {
  454.                                     cb.apply(null, arguments)
  455.                                 }
  456.                                 that.emit("end")
  457.                             })
  458.                         });
  459.                         if (that._deferredReconnect) {
  460.                             that._deferredReconnect()
  461.                         }
  462.                     }
  463.  
  464.                     function finish() {
  465.                         that._cleanUp(force, setImmediate.bind(null, closeStores))
  466.                     }
  467.                     if (this.disconnecting) {
  468.                         return this
  469.                     }
  470.                     this._clearReconnect();
  471.                     this.disconnecting = true;
  472.                     if (!force && Object.keys(this.outgoing).length > 0) {
  473.                         this.once("outgoingEmpty", setTimeout.bind(null, finish, 10))
  474.                     } else {
  475.                         finish()
  476.                     }
  477.                     return this
  478.                 };
  479.                 MqttClient.prototype.removeOutgoingMessage = function(mid) {
  480.                     var cb = this.outgoing[mid];
  481.                     delete this.outgoing[mid];
  482.                     this.outgoingStore.del({
  483.                         messageId: mid
  484.                     }, function() {
  485.                         cb(new Error("Message removed"))
  486.                     });
  487.                     return this
  488.                 };
  489.                 MqttClient.prototype.reconnect = function(opts) {
  490.                     var that = this;
  491.                     var f = function() {
  492.                         if (opts) {
  493.                             that.options.incomingStore = opts.incomingStore;
  494.                             that.options.outgoingStore = opts.outgoingStore
  495.                         } else {
  496.                             that.options.incomingStore = null;
  497.                             that.options.outgoingStore = null
  498.                         }
  499.                         that.incomingStore = that.options.incomingStore || new Store;
  500.                         that.outgoingStore = that.options.outgoingStore || new Store;
  501.                         that.disconnecting = false;
  502.                         that.disconnected = false;
  503.                         that._deferredReconnect = null;
  504.                         that._reconnect()
  505.                     };
  506.                     if (this.disconnecting && !this.disconnected) {
  507.                         this._deferredReconnect = f
  508.                     } else {
  509.                         f()
  510.                     }
  511.                     return this
  512.                 };
  513.                 MqttClient.prototype._reconnect = function() {
  514.                     this.emit("reconnect");
  515.                     this._setupStream()
  516.                 };
  517.                 MqttClient.prototype._setupReconnect = function() {
  518.                     var that = this;
  519.                     if (!that.disconnecting && !that.reconnectTimer && that.options.reconnectPeriod > 0) {
  520.                         if (!this.reconnecting) {
  521.                             this.emit("offline");
  522.                             this.reconnecting = true
  523.                         }
  524.                         that.reconnectTimer = setInterval(function() {
  525.                             that._reconnect()
  526.                         }, that.options.reconnectPeriod)
  527.                     }
  528.                 };
  529.                 MqttClient.prototype._clearReconnect = function() {
  530.                     if (this.reconnectTimer) {
  531.                         clearInterval(this.reconnectTimer);
  532.                         this.reconnectTimer = null
  533.                     }
  534.                 };
  535.                 MqttClient.prototype._cleanUp = function(forced, done) {
  536.                     if (done) {
  537.                         this.stream.on("close", done)
  538.                     }
  539.                     if (forced) {
  540.                         if (this.options.reconnectPeriod === 0 && this.options.clean) {
  541.                             flush(this.outgoing)
  542.                         }
  543.                         this.stream.destroy()
  544.                     } else {
  545.                         this._sendPacket({
  546.                             cmd: "disconnect"
  547.                         }, setImmediate.bind(null, this.stream.end.bind(this.stream)))
  548.                     }
  549.                     if (!this.disconnecting) {
  550.                         this._clearReconnect();
  551.                         this._setupReconnect()
  552.                     }
  553.                     if (this.pingTimer !== null) {
  554.                         this.pingTimer.clear();
  555.                         this.pingTimer = null
  556.                     }
  557.                     if (done && !this.connected) {
  558.                         this.stream.removeListener("close", done);
  559.                         done()
  560.                     }
  561.                 };
  562.                 MqttClient.prototype._sendPacket = function(packet, cb) {
  563.                     if (!this.connected) {
  564.                         if ((packet.qos || 0) === 0 && this.queueQoSZero || packet.cmd !== "publish") {
  565.                             this.queue.push({
  566.                                 packet: packet,
  567.                                 cb: cb
  568.                             })
  569.                         } else if (packet.qos > 0) {
  570.                             cb = this.outgoing[packet.messageId];
  571.                             this.outgoingStore.put(packet, function(err) {
  572.                                 if (err) {
  573.                                     return cb && cb(err)
  574.                                 }
  575.                             })
  576.                         } else if (cb) {
  577.                             cb(new Error("No connection to broker"))
  578.                         }
  579.                         return
  580.                     }
  581.                     this._shiftPingInterval();
  582.                     if (packet.cmd !== "publish") {
  583.                         sendPacket(this, packet, cb);
  584.                         return
  585.                     }
  586.                     switch (packet.qos) {
  587.                         case 2:
  588.                         case 1:
  589.                             storeAndSend(this, packet, cb);
  590.                             break;
  591.                         case 0:
  592.                         default:
  593.                             sendPacket(this, packet, cb);
  594.                             break
  595.                     }
  596.                 };
  597.                 MqttClient.prototype._setupPingTimer = function() {
  598.                     var that = this;
  599.                     if (!this.pingTimer && this.options.keepalive) {
  600.                         this.pingResp = true;
  601.                         this.pingTimer = reInterval(function() {
  602.                             that._checkPing()
  603.                         }, this.options.keepalive * 1e3)
  604.                     }
  605.                 };
  606.                 MqttClient.prototype._shiftPingInterval = function() {
  607.                     if (this.pingTimer && this.options.keepalive && this.options.reschedulePings) {
  608.                         this.pingTimer.reschedule(this.options.keepalive * 1e3)
  609.                     }
  610.                 };
  611.                 MqttClient.prototype._checkPing = function() {
  612.                     if (this.pingResp) {
  613.                         this.pingResp = false;
  614.                         this._sendPacket({
  615.                             cmd: "pingreq"
  616.                         })
  617.                     } else {
  618.                         this._cleanUp(true)
  619.                     }
  620.                 };
  621.                 MqttClient.prototype._handlePingresp = function() {
  622.                     this.pingResp = true
  623.                 };
  624.                 MqttClient.prototype._handleConnack = function(packet) {
  625.                     var rc = packet.returnCode;
  626.                     var errors = ["", "Unacceptable protocol version", "Identifier rejected", "Server unavailable", "Bad username or password", "Not authorized"];
  627.                     clearTimeout(this.connackTimer);
  628.                     if (rc === 0) {
  629.                         this.reconnecting = false;
  630.                         this.emit("connect", packet)
  631.                     } else if (rc > 0) {
  632.                         var err = new Error("Connection refused: " + errors[rc]);
  633.                         err.code = rc;
  634.                         this.emit("error", err)
  635.                     }
  636.                 };
  637.                 MqttClient.prototype._handlePublish = function(packet, done) {
  638.                     var topic = packet.topic.toString();
  639.                     var message = packet.payload;
  640.                     var qos = packet.qos;
  641.                     var mid = packet.messageId;
  642.                     var that = this;
  643.                     switch (qos) {
  644.                         case 2:
  645.                             this.incomingStore.put(packet, function() {
  646.                                 that._sendPacket({
  647.                                     cmd: "pubrec",
  648.                                     messageId: mid
  649.                                 }, done)
  650.                             });
  651.                             break;
  652.                         case 1:
  653.                             this.emit("message", topic, message, packet);
  654.                             this.handleMessage(packet, function(err) {
  655.                                 if (err) {
  656.                                     return done && done(err)
  657.                                 }
  658.                                 that._sendPacket({
  659.                                     cmd: "puback",
  660.                                     messageId: mid
  661.                                 }, done)
  662.                             });
  663.                             break;
  664.                         case 0:
  665.                             this.emit("message", topic, message, packet);
  666.                             this.handleMessage(packet, done);
  667.                             break;
  668.                         default:
  669.                             break
  670.                     }
  671.                 };
  672.                 MqttClient.prototype.handleMessage = function(packet, callback) {
  673.                     callback()
  674.                 };
  675.                 MqttClient.prototype._handleAck = function(packet) {
  676.                     var mid = packet.messageId;
  677.                     var type = packet.cmd;
  678.                     var response = null;
  679.                     var cb = this.outgoing[mid];
  680.                     var that = this;
  681.                     if (!cb) {
  682.                         return
  683.                     }
  684.                     switch (type) {
  685.                         case "pubcomp":
  686.                         case "puback":
  687.                             delete this.outgoing[mid];
  688.                             this.outgoingStore.del(packet, cb);
  689.                             break;
  690.                         case "pubrec":
  691.                             response = {
  692.                                 cmd: "pubrel",
  693.                                 qos: 2,
  694.                                 messageId: mid
  695.                             };
  696.                             this._sendPacket(response);
  697.                             break;
  698.                         case "suback":
  699.                             delete this.outgoing[mid];
  700.                             if (packet.granted.length === 1 && (packet.granted[0] & 128) !== 0) {
  701.                                 var topics = this.messageIdToTopic[mid];
  702.                                 if (topics) {
  703.                                     topics.forEach(function(topic) {
  704.                                         delete that._resubscribeTopics[topic]
  705.                                     })
  706.                                 }
  707.                             }
  708.                             cb(null, packet);
  709.                             break;
  710.                         case "unsuback":
  711.                             delete this.outgoing[mid];
  712.                             cb(null);
  713.                             break;
  714.                         default:
  715.                             that.emit("error", new Error("unrecognized packet type"))
  716.                     }
  717.                     if (this.disconnecting && Object.keys(this.outgoing).length === 0) {
  718.                         this.emit("outgoingEmpty")
  719.                     }
  720.                 };
  721.                 MqttClient.prototype._handlePubrel = function(packet, callback) {
  722.                     var mid = packet.messageId;
  723.                     var that = this;
  724.                     var comp = {
  725.                         cmd: "pubcomp",
  726.                         messageId: mid
  727.                     };
  728.                     that.incomingStore.get(packet, function(err, pub) {
  729.                         if (!err && pub.cmd !== "pubrel") {
  730.                             that.emit("message", pub.topic, pub.payload, pub);
  731.                             that.incomingStore.put(packet);
  732.                             that.handleMessage(pub, function(err) {
  733.                                 if (err) {
  734.                                     return callback && callback(err)
  735.                                 }
  736.                                 that._sendPacket(comp, callback)
  737.                             })
  738.                         } else {
  739.                             that._sendPacket(comp, callback)
  740.                         }
  741.                     })
  742.                 };
  743.                 MqttClient.prototype._nextId = function() {
  744.                     var id = this.nextId++;
  745.                     if (id === 65535) {
  746.                         this.nextId = 1
  747.                     }
  748.                     return id
  749.                 };
  750.                 MqttClient.prototype.getLastMessageId = function() {
  751.                     return this.nextId === 1 ? 65535 : this.nextId - 1
  752.                 };
  753.                 module.exports = MqttClient
  754.             }).call(this, require("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  755.         }, {
  756.             "./store": 6,
  757.             "./validations": 7,
  758.             _process: 30,
  759.             "end-of-stream": 16,
  760.             events: 12,
  761.             inherits: 18,
  762.             "mqtt-packet": 23,
  763.             "readable-stream": 45,
  764.             reinterval: 46,
  765.             xtend: 59
  766.         }],
  767.         2: [function(require, module, exports) {
  768.             "use strict";
  769.             var net = require("net");
  770.  
  771.             function buildBuilder(client, opts) {
  772.                 var port, host;
  773.                 opts.port = opts.port || 1883;
  774.                 opts.hostname = opts.hostname || opts.host || "localhost";
  775.                 port = opts.port;
  776.                 host = opts.hostname;
  777.                 return net.createConnection(port, host)
  778.             }
  779.             module.exports = buildBuilder
  780.         }, {
  781.             net: 11
  782.         }],
  783.         3: [function(require, module, exports) {
  784.             "use strict";
  785.             var tls = require("tls");
  786.  
  787.             function buildBuilder(mqttClient, opts) {
  788.                 var connection;
  789.                 opts.port = opts.port || 8883;
  790.                 opts.host = opts.hostname || opts.host || "localhost";
  791.                 opts.rejectUnauthorized = opts.rejectUnauthorized !== false;
  792.                 delete opts.path;
  793.                 connection = tls.connect(opts);
  794.                 connection.on("secureConnect", function() {
  795.                     if (opts.rejectUnauthorized && !connection.authorized) {
  796.                         connection.emit("error", new Error("TLS not authorized"))
  797.                     } else {
  798.                         connection.removeListener("error", handleTLSerrors)
  799.                     }
  800.                 });
  801.  
  802.                 function handleTLSerrors(err) {
  803.                     if (opts.rejectUnauthorized) {
  804.                         mqttClient.emit("error", err)
  805.                     }
  806.                     connection.end()
  807.                 }
  808.                 connection.on("error", handleTLSerrors);
  809.                 return connection
  810.             }
  811.             module.exports = buildBuilder
  812.         }, {
  813.             tls: 11
  814.         }],
  815.         4: [function(require, module, exports) {
  816.             (function(process) {
  817.                 "use strict";
  818.                 var websocket = require("websocket-stream");
  819.                 var urlModule = require("url");
  820.                 var WSS_OPTIONS = ["rejectUnauthorized", "ca", "cert", "key", "pfx", "passphrase"];
  821.                 var IS_BROWSER = process.title === "browser";
  822.  
  823.                 function buildUrl(opts, client) {
  824.                     var url = opts.protocol + "://" + opts.hostname + ":" + opts.port + opts.path;
  825.                     if (typeof opts.transformWsUrl === "function") {
  826.                         url = opts.transformWsUrl(url, opts, client)
  827.                     }
  828.                     return url
  829.                 }
  830.  
  831.                 function setDefaultOpts(opts) {
  832.                     if (!opts.hostname) {
  833.                         opts.hostname = "localhost"
  834.                     }
  835.                     if (!opts.port) {
  836.                         if (opts.protocol === "wss") {
  837.                             opts.port = 443
  838.                         } else {
  839.                             opts.port = 80
  840.                         }
  841.                     }
  842.                     if (!opts.path) {
  843.                         opts.path = "/"
  844.                     }
  845.                     if (!opts.wsOptions) {
  846.                         opts.wsOptions = {}
  847.                     }
  848.                     if (!IS_BROWSER && opts.protocol === "wss") {
  849.                         WSS_OPTIONS.forEach(function(prop) {
  850.                             if (opts.hasOwnProperty(prop) && !opts.wsOptions.hasOwnProperty(prop)) {
  851.                                 opts.wsOptions[prop] = opts[prop]
  852.                             }
  853.                         })
  854.                     }
  855.                 }
  856.  
  857.                 function createWebSocket(client, opts) {
  858.                     var websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
  859.                     setDefaultOpts(opts);
  860.                     var url = buildUrl(opts, client);
  861.                     return websocket(url, [websocketSubProtocol], opts.wsOptions)
  862.                 }
  863.  
  864.                 function buildBuilder(client, opts) {
  865.                     return createWebSocket(client, opts)
  866.                 }
  867.  
  868.                 function buildBuilderBrowser(client, opts) {
  869.                     if (!opts.hostname) {
  870.                         opts.hostname = opts.host
  871.                     }
  872.                     if (!opts.hostname) {
  873.                         if (typeof document === "undefined") {
  874.                             throw new Error("Could not determine host. Specify host manually.")
  875.                         }
  876.                         var parsed = urlModule.parse(document.URL);
  877.                         opts.hostname = parsed.hostname;
  878.                         if (!opts.port) {
  879.                             opts.port = parsed.port
  880.                         }
  881.                     }
  882.                     return createWebSocket(client, opts)
  883.                 }
  884.                 if (IS_BROWSER) {
  885.                     module.exports = buildBuilderBrowser
  886.                 } else {
  887.                     module.exports = buildBuilder
  888.                 }
  889.             }).call(this, require("_process"))
  890.         }, {
  891.             _process: 30,
  892.             url: 50,
  893.             "websocket-stream": 56
  894.         }],
  895.         5: [function(require, module, exports) {
  896.             "use strict";
  897.             var socketOpen = false;
  898.             var socketMsgQueue = [];
  899.  
  900.             function sendSocketMessage(msg) {
  901.                 if (socketOpen) {
  902.                     wx.sendSocketMessage({
  903.                         data: msg
  904.                     })
  905.                 } else {
  906.                     socketMsgQueue.push(msg)
  907.                 }
  908.             }
  909.  
  910.             function WebSocket(url, protocols) {
  911.                 var ws = {
  912.                     OPEN: 1,
  913.                     CLOSING: 2,
  914.                     CLOSED: 3,
  915.                     readyState: socketOpen ? 1 : 0,
  916.                     send: sendSocketMessage,
  917.                     close: wx.closeSocket,
  918.                     onopen: null,
  919.                     onmessage: null,
  920.                     onclose: null,
  921.                     onerror: null
  922.                 };
  923.                 wx.connectSocket({
  924.                     url: url,
  925.                     protocols: protocols
  926.                 });
  927.                 wx.onSocketOpen(function(res) {
  928.                     ws.readyState = ws.OPEN;
  929.                     socketOpen = true;
  930.                     for (var i = 0; i < socketMsgQueue.length; i++) {
  931.                         sendSocketMessage(socketMsgQueue[i])
  932.                     }
  933.                     socketMsgQueue = [];
  934.                     ws.onopen && ws.onopen.apply(ws, arguments)
  935.                 });
  936.                 wx.onSocketMessage(function(res) {
  937.                     ws.onmessage && ws.onmessage.apply(ws, arguments)
  938.                 });
  939.                 wx.onSocketClose(function() {
  940.                     ws.onclose && ws.onclose.apply(ws, arguments);
  941.                     ws.readyState = ws.CLOSED;
  942.                     socketOpen = false
  943.                 });
  944.                 wx.onSocketError(function() {
  945.                     ws.onerror && ws.onerror.apply(ws, arguments);
  946.                     ws.readyState = ws.CLOSED;
  947.                     socketOpen = false
  948.                 });
  949.                 return ws
  950.             }
  951.             var websocket = require("websocket-stream");
  952.             var urlModule = require("url");
  953.  
  954.             function buildUrl(opts, client) {
  955.                 var protocol = opts.protocol === "wxs" ? "wss" : "ws";
  956.                 var url = protocol + "://" + opts.hostname + ":" + opts.port + opts.path;
  957.                 if (typeof opts.transformWsUrl === "function") {
  958.                     url = opts.transformWsUrl(url, opts, client)
  959.                 }
  960.                 return url
  961.             }
  962.  
  963.             function setDefaultOpts(opts) {
  964.                 if (!opts.hostname) {
  965.                     opts.hostname = "localhost"
  966.                 }
  967.                 if (!opts.port) {
  968.                     if (opts.protocol === "wss") {
  969.                         opts.port = 443
  970.                     } else {
  971.                         opts.port = 80
  972.                     }
  973.                 }
  974.                 if (!opts.path) {
  975.                     opts.path = "/"
  976.                 }
  977.                 if (!opts.wsOptions) {
  978.                     opts.wsOptions = {}
  979.                 }
  980.             }
  981.  
  982.             function createWebSocket(client, opts) {
  983.                 var websocketSubProtocol = opts.protocolId === "MQIsdp" && opts.protocolVersion === 3 ? "mqttv3.1" : "mqtt";
  984.                 setDefaultOpts(opts);
  985.                 var url = buildUrl(opts, client);
  986.                 return websocket(WebSocket(url, [websocketSubProtocol]))
  987.             }
  988.  
  989.             function buildBuilder(client, opts) {
  990.                 if (!opts.hostname) {
  991.                     opts.hostname = opts.host
  992.                 }
  993.                 if (!opts.hostname) {
  994.                     if (typeof document === "undefined") {
  995.                         throw new Error("Could not determine host. Specify host manually.")
  996.                     }
  997.                     var parsed = urlModule.parse(document.URL);
  998.                     opts.hostname = parsed.hostname;
  999.                     if (!opts.port) {
  1000.                         opts.port = parsed.port
  1001.                     }
  1002.                 }
  1003.                 return createWebSocket(client, opts)
  1004.             }
  1005.             module.exports = buildBuilder
  1006.         }, {
  1007.             url: 50,
  1008.             "websocket-stream": 56
  1009.         }],
  1010.         6: [function(require, module, exports) {
  1011.             (function(process) {
  1012.                 "use strict";
  1013.                 var xtend = require("xtend");
  1014.                 var Readable = require("readable-stream").Readable;
  1015.                 var streamsOpts = {
  1016.                     objectMode: true
  1017.                 };
  1018.                 var defaultStoreOptions = {
  1019.                     clean: true
  1020.                 };
  1021.  
  1022.                 function Store(options) {
  1023.                     if (!(this instanceof Store)) {
  1024.                         return new Store(options)
  1025.                     }
  1026.                     this.options = options || {};
  1027.                     this.options = xtend(defaultStoreOptions, options);
  1028.                     this._inflights = {}
  1029.                 }
  1030.                 Store.prototype.put = function(packet, cb) {
  1031.                     this._inflights[packet.messageId] = packet;
  1032.                     if (cb) {
  1033.                         cb()
  1034.                     }
  1035.                     return this
  1036.                 };
  1037.                 Store.prototype.createStream = function() {
  1038.                     var stream = new Readable(streamsOpts);
  1039.                     var inflights = this._inflights;
  1040.                     var ids = Object.keys(this._inflights);
  1041.                     var destroyed = false;
  1042.                     var i = 0;
  1043.                     stream._read = function() {
  1044.                         if (!destroyed && i < ids.length) {
  1045.                             this.push(inflights[ids[i++]])
  1046.                         } else {
  1047.                             this.push(null)
  1048.                         }
  1049.                     };
  1050.                     stream.destroy = function() {
  1051.                         if (destroyed) {
  1052.                             return
  1053.                         }
  1054.                         var self = this;
  1055.                         destroyed = true;
  1056.                         process.nextTick(function() {
  1057.                             self.emit("close")
  1058.                         })
  1059.                     };
  1060.                     return stream
  1061.                 };
  1062.                 Store.prototype.del = function(packet, cb) {
  1063.                     packet = this._inflights[packet.messageId];
  1064.                     if (packet) {
  1065.                         delete this._inflights[packet.messageId];
  1066.                         cb(null, packet)
  1067.                     } else if (cb) {
  1068.                         cb(new Error("missing packet"))
  1069.                     }
  1070.                     return this
  1071.                 };
  1072.                 Store.prototype.get = function(packet, cb) {
  1073.                     packet = this._inflights[packet.messageId];
  1074.                     if (packet) {
  1075.                         cb(null, packet)
  1076.                     } else if (cb) {
  1077.                         cb(new Error("missing packet"))
  1078.                     }
  1079.                     return this
  1080.                 };
  1081.                 Store.prototype.close = function(cb) {
  1082.                     if (this.options.clean) {
  1083.                         this._inflights = null
  1084.                     }
  1085.                     if (cb) {
  1086.                         cb()
  1087.                     }
  1088.                 };
  1089.                 module.exports = Store
  1090.             }).call(this, require("_process"))
  1091.         }, {
  1092.             _process: 30,
  1093.             "readable-stream": 45,
  1094.             xtend: 59
  1095.         }],
  1096.         7: [function(require, module, exports) {
  1097.             "use strict";
  1098.  
  1099.             function validateTopic(topic) {
  1100.                 var parts = topic.split("/");
  1101.                 for (var i = 0; i < parts.length; i++) {
  1102.                     if (parts[i] === "+") {
  1103.                         continue
  1104.                     }
  1105.                     if (parts[i] === "#") {
  1106.                         return i === parts.length - 1
  1107.                     }
  1108.                     if (parts[i].indexOf("+") !== -1 || parts[i].indexOf("#") !== -1) {
  1109.                         return false
  1110.                     }
  1111.                 }
  1112.                 return true
  1113.             }
  1114.  
  1115.             function validateTopics(topics) {
  1116.                 if (topics.length === 0) {
  1117.                     return "empty_topic_list"
  1118.                 }
  1119.                 for (var i = 0; i < topics.length; i++) {
  1120.                     if (!validateTopic(topics[i])) {
  1121.                         return topics[i]
  1122.                     }
  1123.                 }
  1124.                 return null
  1125.             }
  1126.             module.exports = {
  1127.                 validateTopics: validateTopics
  1128.             }
  1129.         }, {}],
  1130.         8: [function(require, module, exports) {
  1131.             (function(process) {
  1132.                 "use strict";
  1133.                 var MqttClient = require("../client");
  1134.                 var Store = require("../store");
  1135.                 var url = require("url");
  1136.                 var xtend = require("xtend");
  1137.                 var protocols = {};
  1138.                 if (process.title !== "browser") {
  1139.                     protocols.mqtt = require("./tcp");
  1140.                     protocols.tcp = require("./tcp");
  1141.                     protocols.ssl = require("./tls");
  1142.                     protocols.tls = require("./tls");
  1143.                     protocols.mqtts = require("./tls")
  1144.                 } else {
  1145.                     protocols.wx = require("./wx");
  1146.                     protocols.wxs = require("./wx")
  1147.                 }
  1148.                 protocols.ws = require("./ws");
  1149.                 protocols.wss = require("./ws");
  1150.  
  1151.                 function parseAuthOptions(opts) {
  1152.                     var matches;
  1153.                     if (opts.auth) {
  1154.                         matches = opts.auth.match(/^(.+):(.+)$/);
  1155.                         if (matches) {
  1156.                             opts.username = matches[1];
  1157.                             opts.password = matches[2]
  1158.                         } else {
  1159.                             opts.username = opts.auth
  1160.                         }
  1161.                     }
  1162.                 }
  1163.  
  1164.                 function connect(brokerUrl, opts) {
  1165.                     if (typeof brokerUrl === "object" && !opts) {
  1166.                         opts = brokerUrl;
  1167.                         brokerUrl = null
  1168.                     }
  1169.                     opts = opts || {};
  1170.                     if (brokerUrl) {
  1171.                         var parsed = url.parse(brokerUrl, true);
  1172.                         if (parsed.port != null) {
  1173.                             parsed.port = Number(parsed.port)
  1174.                         }
  1175.                         opts = xtend(parsed, opts);
  1176.                         if (opts.protocol === null) {
  1177.                             throw new Error("Missing protocol")
  1178.                         }
  1179.                         opts.protocol = opts.protocol.replace(/:$/, "")
  1180.                     }
  1181.                     parseAuthOptions(opts);
  1182.                     if (opts.query && typeof opts.query.clientId === "string") {
  1183.                         opts.clientId = opts.query.clientId
  1184.                     }
  1185.                     if (opts.cert && opts.key) {
  1186.                         if (opts.protocol) {
  1187.                             if (["mqtts", "wss", "wxs"].indexOf(opts.protocol) === -1) {
  1188.                                 switch (opts.protocol) {
  1189.                                     case "mqtt":
  1190.                                         opts.protocol = "mqtts";
  1191.                                         break;
  1192.                                     case "ws":
  1193.                                         opts.protocol = "wss";
  1194.                                         break;
  1195.                                     case "wx":
  1196.                                         opts.protocol = "wxs";
  1197.                                         break;
  1198.                                     default:
  1199.                                         throw new Error('Unknown protocol for secure connection: "' + opts.protocol + '"!')
  1200.                                 }
  1201.                             }
  1202.                         } else {
  1203.                             throw new Error("Missing secure protocol key")
  1204.                         }
  1205.                     }
  1206.                     if (!protocols[opts.protocol]) {
  1207.                         var isSecure = ["mqtts", "wss"].indexOf(opts.protocol) !== -1;
  1208.                         opts.protocol = ["mqtt", "mqtts", "ws", "wss", "wx", "wxs"].filter(function(key, index) {
  1209.                             if (isSecure && index % 2 === 0) {
  1210.                                 return false
  1211.                             }
  1212.                             return typeof protocols[key] === "function"
  1213.                         })[0]
  1214.                     }
  1215.                     if (opts.clean === false && !opts.clientId) {
  1216.                         throw new Error("Missing clientId for unclean clients")
  1217.                     }
  1218.  
  1219.                     function wrapper(client) {
  1220.                         if (opts.servers) {
  1221.                             if (!client._reconnectCount || client._reconnectCount === opts.servers.length) {
  1222.                                 client._reconnectCount = 0
  1223.                             }
  1224.                             opts.host = opts.servers[client._reconnectCount].host;
  1225.                             opts.port = opts.servers[client._reconnectCount].port;
  1226.                             opts.hostname = opts.host;
  1227.                             client._reconnectCount++
  1228.                         }
  1229.                         return protocols[opts.protocol](client, opts)
  1230.                     }
  1231.                     return new MqttClient(wrapper, opts)
  1232.                 }
  1233.                 module.exports = connect;
  1234.                 module.exports.connect = connect;
  1235.                 module.exports.MqttClient = MqttClient;
  1236.                 module.exports.Store = Store
  1237.             }).call(this, require("_process"))
  1238.         }, {
  1239.             "../client": 1,
  1240.             "../store": 6,
  1241.             "./tcp": 2,
  1242.             "./tls": 3,
  1243.             "./ws": 4,
  1244.             "./wx": 5,
  1245.             _process: 30,
  1246.             url: 50,
  1247.             xtend: 59
  1248.         }],
  1249.         9: [function(require, module, exports) {
  1250.             "use strict";
  1251.             exports.byteLength = byteLength;
  1252.             exports.toByteArray = toByteArray;
  1253.             exports.fromByteArray = fromByteArray;
  1254.             var lookup = [];
  1255.             var revLookup = [];
  1256.             var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
  1257.             var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
  1258.             for (var i = 0, len = code.length; i < len; ++i) {
  1259.                 lookup[i] = code[i];
  1260.                 revLookup[code.charCodeAt(i)] = i
  1261.             }
  1262.             revLookup["-".charCodeAt(0)] = 62;
  1263.             revLookup["_".charCodeAt(0)] = 63;
  1264.  
  1265.             function placeHoldersCount(b64) {
  1266.                 var len = b64.length;
  1267.                 if (len % 4 > 0) {
  1268.                     throw new Error("Invalid string. Length must be a multiple of 4")
  1269.                 }
  1270.                 return b64[len - 2] === "=" ? 2 : b64[len - 1] === "=" ? 1 : 0
  1271.             }
  1272.  
  1273.             function byteLength(b64) {
  1274.                 return b64.length * 3 / 4 - placeHoldersCount(b64)
  1275.             }
  1276.  
  1277.             function toByteArray(b64) {
  1278.                 var i, l, tmp, placeHolders, arr;
  1279.                 var len = b64.length;
  1280.                 placeHolders = placeHoldersCount(b64);
  1281.                 arr = new Arr(len * 3 / 4 - placeHolders);
  1282.                 l = placeHolders > 0 ? len - 4 : len;
  1283.                 var L = 0;
  1284.                 for (i = 0; i < l; i += 4) {
  1285.                     tmp = revLookup[b64.charCodeAt(i)] << 18 | revLookup[b64.charCodeAt(i + 1)] << 12 | revLookup[b64.charCodeAt(i + 2)] << 6 | revLookup[b64.charCodeAt(i + 3)];
  1286.                     arr[L++] = tmp >> 16 & 255;
  1287.                     arr[L++] = tmp >> 8 & 255;
  1288.                     arr[L++] = tmp & 255
  1289.                 }
  1290.                 if (placeHolders === 2) {
  1291.                     tmp = revLookup[b64.charCodeAt(i)] << 2 | revLookup[b64.charCodeAt(i + 1)] >> 4;
  1292.                     arr[L++] = tmp & 255
  1293.                 } else if (placeHolders === 1) {
  1294.                     tmp = revLookup[b64.charCodeAt(i)] << 10 | revLookup[b64.charCodeAt(i + 1)] << 4 | revLookup[b64.charCodeAt(i + 2)] >> 2;
  1295.                     arr[L++] = tmp >> 8 & 255;
  1296.                     arr[L++] = tmp & 255
  1297.                 }
  1298.                 return arr
  1299.             }
  1300.  
  1301.             function tripletToBase64(num) {
  1302.                 return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]
  1303.             }
  1304.  
  1305.             function encodeChunk(uint8, start, end) {
  1306.                 var tmp;
  1307.                 var output = [];
  1308.                 for (var i = start; i < end; i += 3) {
  1309.                     tmp = (uint8[i] << 16) + (uint8[i + 1] << 8) + uint8[i + 2];
  1310.                     output.push(tripletToBase64(tmp))
  1311.                 }
  1312.                 return output.join("")
  1313.             }
  1314.  
  1315.             function fromByteArray(uint8) {
  1316.                 var tmp;
  1317.                 var len = uint8.length;
  1318.                 var extraBytes = len % 3;
  1319.                 var output = "";
  1320.                 var parts = [];
  1321.                 var maxChunkLength = 16383;
  1322.                 for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {
  1323.                     parts.push(encodeChunk(uint8, i, i + maxChunkLength > len2 ? len2 : i + maxChunkLength))
  1324.                 }
  1325.                 if (extraBytes === 1) {
  1326.                     tmp = uint8[len - 1];
  1327.                     output += lookup[tmp >> 2];
  1328.                     output += lookup[tmp << 4 & 63];
  1329.                     output += "=="
  1330.                 } else if (extraBytes === 2) {
  1331.                     tmp = (uint8[len - 2] << 8) + uint8[len - 1];
  1332.                     output += lookup[tmp >> 10];
  1333.                     output += lookup[tmp >> 4 & 63];
  1334.                     output += lookup[tmp << 2 & 63];
  1335.                     output += "="
  1336.                 }
  1337.                 parts.push(output);
  1338.                 return parts.join("")
  1339.             }
  1340.         }, {}],
  1341.         10: [function(require, module, exports) {
  1342.             (function(Buffer) {
  1343.                 var DuplexStream = require("readable-stream/duplex"),
  1344.                     util = require("util");
  1345.  
  1346.                 function BufferList(callback) {
  1347.                     if (!(this instanceof BufferList)) return new BufferList(callback);
  1348.                     this._bufs = [];
  1349.                     this.length = 0;
  1350.                     if (typeof callback == "function") {
  1351.                         this._callback = callback;
  1352.                         var piper = function piper(err) {
  1353.                             if (this._callback) {
  1354.                                 this._callback(err);
  1355.                                 this._callback = null
  1356.                             }
  1357.                         }.bind(this);
  1358.                         this.on("pipe", function onPipe(src) {
  1359.                             src.on("error", piper)
  1360.                         });
  1361.                         this.on("unpipe", function onUnpipe(src) {
  1362.                             src.removeListener("error", piper)
  1363.                         })
  1364.                     } else {
  1365.                         this.append(callback)
  1366.                     }
  1367.                     DuplexStream.call(this)
  1368.                 }
  1369.                 util.inherits(BufferList, DuplexStream);
  1370.                 BufferList.prototype._offset = function _offset(offset) {
  1371.                     var tot = 0,
  1372.                         i = 0,
  1373.                         _t;
  1374.                     if (offset === 0) return [0, 0];
  1375.                     for (; i < this._bufs.length; i++) {
  1376.                         _t = tot + this._bufs[i].length;
  1377.                         if (offset < _t || i == this._bufs.length - 1) return [i, offset - tot];
  1378.                         tot = _t
  1379.                     }
  1380.                 };
  1381.                 BufferList.prototype.append = function append(buf) {
  1382.                     var i = 0;
  1383.                     if (Buffer.isBuffer(buf)) {
  1384.                         this._appendBuffer(buf)
  1385.                     } else if (Array.isArray(buf)) {
  1386.                         for (; i < buf.length; i++) this.append(buf[i])
  1387.                     } else if (buf instanceof BufferList) {
  1388.                         for (; i < buf._bufs.length; i++) this.append(buf._bufs[i])
  1389.                     } else if (buf != null) {
  1390.                         if (typeof buf == "number") buf = buf.toString();
  1391.                         this._appendBuffer(new Buffer(buf))
  1392.                     }
  1393.                     return this
  1394.                 };
  1395.                 BufferList.prototype._appendBuffer = function appendBuffer(buf) {
  1396.                     this._bufs.push(buf);
  1397.                     this.length += buf.length
  1398.                 };
  1399.                 BufferList.prototype._write = function _write(buf, encoding, callback) {
  1400.                     this._appendBuffer(buf);
  1401.                     if (typeof callback == "function") callback()
  1402.                 };
  1403.                 BufferList.prototype._read = function _read(size) {
  1404.                     if (!this.length) return this.push(null);
  1405.                     size = Math.min(size, this.length);
  1406.                     this.push(this.slice(0, size));
  1407.                     this.consume(size)
  1408.                 };
  1409.                 BufferList.prototype.end = function end(chunk) {
  1410.                     DuplexStream.prototype.end.call(this, chunk);
  1411.                     if (this._callback) {
  1412.                         this._callback(null, this.slice());
  1413.                         this._callback = null
  1414.                     }
  1415.                 };
  1416.                 BufferList.prototype.get = function get(index) {
  1417.                     return this.slice(index, index + 1)[0]
  1418.                 };
  1419.                 BufferList.prototype.slice = function slice(start, end) {
  1420.                     if (typeof start == "number" && start < 0) start += this.length;
  1421.                     if (typeof end == "number" && end < 0) end += this.length;
  1422.                     return this.copy(null, 0, start, end)
  1423.                 };
  1424.                 BufferList.prototype.copy = function copy(dst, dstStart, srcStart, srcEnd) {
  1425.                     if (typeof srcStart != "number" || srcStart < 0) srcStart = 0;
  1426.                     if (typeof srcEnd != "number" || srcEnd > this.length) srcEnd = this.length;
  1427.                     if (srcStart >= this.length) return dst || new Buffer(0);
  1428.                     if (srcEnd <= 0) return dst || new Buffer(0);
  1429.                     var copy = !!dst,
  1430.                         off = this._offset(srcStart),
  1431.                         len = srcEnd - srcStart,
  1432.                         bytes = len,
  1433.                         bufoff = copy && dstStart || 0,
  1434.                         start = off[1],
  1435.                         l, i;
  1436.                     if (srcStart === 0 && srcEnd == this.length) {
  1437.                         if (!copy) {
  1438.                             return this._bufs.length === 1 ? this._bufs[0] : Buffer.concat(this._bufs, this.length)
  1439.                         }
  1440.                         for (i = 0; i < this._bufs.length; i++) {
  1441.                             this._bufs[i].copy(dst, bufoff);
  1442.                             bufoff += this._bufs[i].length
  1443.                         }
  1444.                         return dst
  1445.                     }
  1446.                     if (bytes <= this._bufs[off[0]].length - start) {
  1447.                         return copy ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) : this._bufs[off[0]].slice(start, start + bytes)
  1448.                     }
  1449.                     if (!copy) dst = new Buffer(len);
  1450.                     for (i = off[0]; i < this._bufs.length; i++) {
  1451.                         l = this._bufs[i].length - start;
  1452.                         if (bytes > l) {
  1453.                             this._bufs[i].copy(dst, bufoff, start)
  1454.                         } else {
  1455.                             this._bufs[i].copy(dst, bufoff, start, start + bytes);
  1456.                             break
  1457.                         }
  1458.                         bufoff += l;
  1459.                         bytes -= l;
  1460.                         if (start) start = 0
  1461.                     }
  1462.                     return dst
  1463.                 };
  1464.                 BufferList.prototype.shallowSlice = function shallowSlice(start, end) {
  1465.                     start = start || 0;
  1466.                     end = end || this.length;
  1467.                     if (start < 0) start += this.length;
  1468.                     if (end < 0) end += this.length;
  1469.                     var startOffset = this._offset(start),
  1470.                         endOffset = this._offset(end),
  1471.                         buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1);
  1472.                     if (endOffset[1] == 0) buffers.pop();
  1473.                     else buffers[buffers.length - 1] = buffers[buffers.length - 1].slice(0, endOffset[1]);
  1474.                     if (startOffset[1] != 0) buffers[0] = buffers[0].slice(startOffset[1]);
  1475.                     return new BufferList(buffers)
  1476.                 };
  1477.                 BufferList.prototype.toString = function toString(encoding, start, end) {
  1478.                     return this.slice(start, end).toString(encoding)
  1479.                 };
  1480.                 BufferList.prototype.consume = function consume(bytes) {
  1481.                     while (this._bufs.length) {
  1482.                         if (bytes >= this._bufs[0].length) {
  1483.                             bytes -= this._bufs[0].length;
  1484.                             this.length -= this._bufs[0].length;
  1485.                             this._bufs.shift()
  1486.                         } else {
  1487.                             this._bufs[0] = this._bufs[0].slice(bytes);
  1488.                             this.length -= bytes;
  1489.                             break
  1490.                         }
  1491.                     }
  1492.                     return this
  1493.                 };
  1494.                 BufferList.prototype.duplicate = function duplicate() {
  1495.                     var i = 0,
  1496.                         copy = new BufferList;
  1497.                     for (; i < this._bufs.length; i++) copy.append(this._bufs[i]);
  1498.                     return copy
  1499.                 };
  1500.                 BufferList.prototype.destroy = function destroy() {
  1501.                     this._bufs.length = 0;
  1502.                     this.length = 0;
  1503.                     this.push(null)
  1504.                 };
  1505.                 (function() {
  1506.                     var methods = {
  1507.                         readDoubleBE: 8,
  1508.                         readDoubleLE: 8,
  1509.                         readFloatBE: 4,
  1510.                         readFloatLE: 4,
  1511.                         readInt32BE: 4,
  1512.                         readInt32LE: 4,
  1513.                         readUInt32BE: 4,
  1514.                         readUInt32LE: 4,
  1515.                         readInt16BE: 2,
  1516.                         readInt16LE: 2,
  1517.                         readUInt16BE: 2,
  1518.                         readUInt16LE: 2,
  1519.                         readInt8: 1,
  1520.                         readUInt8: 1
  1521.                     };
  1522.                     for (var m in methods) {
  1523.                         (function(m) {
  1524.                             BufferList.prototype[m] = function(offset) {
  1525.                                 return this.slice(offset, offset + methods[m])[m](0)
  1526.                             }
  1527.                         })(m)
  1528.                     }
  1529.                 })();
  1530.                 module.exports = BufferList
  1531.             }).call(this, require("buffer").Buffer)
  1532.         }, {
  1533.             buffer: 13,
  1534.             "readable-stream/duplex": 35,
  1535.             util: 55
  1536.         }],
  1537.         11: [function(require, module, exports) {}, {}],
  1538.         12: [function(require, module, exports) {
  1539.             var objectCreate = Object.create || objectCreatePolyfill;
  1540.             var objectKeys = Object.keys || objectKeysPolyfill;
  1541.             var bind = Function.prototype.bind || functionBindPolyfill;
  1542.  
  1543.             function EventEmitter() {
  1544.                 if (!this._events || !Object.prototype.hasOwnProperty.call(this, "_events")) {
  1545.                     this._events = objectCreate(null);
  1546.                     this._eventsCount = 0
  1547.                 }
  1548.                 this._maxListeners = this._maxListeners || undefined
  1549.             }
  1550.             module.exports = EventEmitter;
  1551.             EventEmitter.EventEmitter = EventEmitter;
  1552.             EventEmitter.prototype._events = undefined;
  1553.             EventEmitter.prototype._maxListeners = undefined;
  1554.             var defaultMaxListeners = 10;
  1555.             var hasDefineProperty;
  1556.             try {
  1557.                 var o = {};
  1558.                 if (Object.defineProperty) Object.defineProperty(o, "x", {
  1559.                     value: 0
  1560.                 });
  1561.                 hasDefineProperty = o.x === 0
  1562.             } catch (err) {
  1563.                 hasDefineProperty = false
  1564.             }
  1565.             if (hasDefineProperty) {
  1566.                 Object.defineProperty(EventEmitter, "defaultMaxListeners", {
  1567.                     enumerable: true,
  1568.                     get: function() {
  1569.                         return defaultMaxListeners
  1570.                     },
  1571.                     set: function(arg) {
  1572.                         if (typeof arg !== "number" || arg < 0 || arg !== arg) throw new TypeError('"defaultMaxListeners" must be a positive number');
  1573.                         defaultMaxListeners = arg
  1574.                     }
  1575.                 })
  1576.             } else {
  1577.                 EventEmitter.defaultMaxListeners = defaultMaxListeners
  1578.             }
  1579.             EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {
  1580.                 if (typeof n !== "number" || n < 0 || isNaN(n)) throw new TypeError('"n" argument must be a positive number');
  1581.                 this._maxListeners = n;
  1582.                 return this
  1583.             };
  1584.  
  1585.             function $getMaxListeners(that) {
  1586.                 if (that._maxListeners === undefined) return EventEmitter.defaultMaxListeners;
  1587.                 return that._maxListeners
  1588.             }
  1589.             EventEmitter.prototype.getMaxListeners = function getMaxListeners() {
  1590.                 return $getMaxListeners(this)
  1591.             };
  1592.  
  1593.             function emitNone(handler, isFn, self) {
  1594.                 if (isFn) handler.call(self);
  1595.                 else {
  1596.                     var len = handler.length;
  1597.                     var listeners = arrayClone(handler, len);
  1598.                     for (var i = 0; i < len; ++i) listeners[i].call(self)
  1599.                 }
  1600.             }
  1601.  
  1602.             function emitOne(handler, isFn, self, arg1) {
  1603.                 if (isFn) handler.call(self, arg1);
  1604.                 else {
  1605.                     var len = handler.length;
  1606.                     var listeners = arrayClone(handler, len);
  1607.                     for (var i = 0; i < len; ++i) listeners[i].call(self, arg1)
  1608.                 }
  1609.             }
  1610.  
  1611.             function emitTwo(handler, isFn, self, arg1, arg2) {
  1612.                 if (isFn) handler.call(self, arg1, arg2);
  1613.                 else {
  1614.                     var len = handler.length;
  1615.                     var listeners = arrayClone(handler, len);
  1616.                     for (var i = 0; i < len; ++i) listeners[i].call(self, arg1, arg2)
  1617.                 }
  1618.             }
  1619.  
  1620.             function emitThree(handler, isFn, self, arg1, arg2, arg3) {
  1621.                 if (isFn) handler.call(self, arg1, arg2, arg3);
  1622.                 else {
  1623.                     var len = handler.length;
  1624.                     var listeners = arrayClone(handler, len);
  1625.                     for (var i = 0; i < len; ++i) listeners[i].call(self, arg1, arg2, arg3)
  1626.                 }
  1627.             }
  1628.  
  1629.             function emitMany(handler, isFn, self, args) {
  1630.                 if (isFn) handler.apply(self, args);
  1631.                 else {
  1632.                     var len = handler.length;
  1633.                     var listeners = arrayClone(handler, len);
  1634.                     for (var i = 0; i < len; ++i) listeners[i].apply(self, args)
  1635.                 }
  1636.             }
  1637.             EventEmitter.prototype.emit = function emit(type) {
  1638.                 var er, handler, len, args, i, events;
  1639.                 var doError = type === "error";
  1640.                 events = this._events;
  1641.                 if (events) doError = doError && events.error == null;
  1642.                 else if (!doError) return false;
  1643.                 if (doError) {
  1644.                     if (arguments.length > 1) er = arguments[1];
  1645.                     if (er instanceof Error) {
  1646.                         throw er
  1647.                     } else {
  1648.                         var err = new Error('Unhandled "error" event. (' + er + ")");
  1649.                         err.context = er;
  1650.                         throw err
  1651.                     }
  1652.                     return false
  1653.                 }
  1654.                 handler = events[type];
  1655.                 if (!handler) return false;
  1656.                 var isFn = typeof handler === "function";
  1657.                 len = arguments.length;
  1658.                 switch (len) {
  1659.                     case 1:
  1660.                         emitNone(handler, isFn, this);
  1661.                         break;
  1662.                     case 2:
  1663.                         emitOne(handler, isFn, this, arguments[1]);
  1664.                         break;
  1665.                     case 3:
  1666.                         emitTwo(handler, isFn, this, arguments[1], arguments[2]);
  1667.                         break;
  1668.                     case 4:
  1669.                         emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]);
  1670.                         break;
  1671.                     default:
  1672.                         args = new Array(len - 1);
  1673.                         for (i = 1; i < len; i++) args[i - 1] = arguments[i];
  1674.                         emitMany(handler, isFn, this, args)
  1675.                 }
  1676.                 return true
  1677.             };
  1678.  
  1679.             function _addListener(target, type, listener, prepend) {
  1680.                 var m;
  1681.                 var events;
  1682.                 var existing;
  1683.                 if (typeof listener !== "function") throw new TypeError('"listener" argument must be a function');
  1684.                 events = target._events;
  1685.                 if (!events) {
  1686.                     events = target._events = objectCreate(null);
  1687.                     target._eventsCount = 0
  1688.                 } else {
  1689.                     if (events.newListener) {
  1690.                         target.emit("newListener", type, listener.listener ? listener.listener : listener);
  1691.                         events = target._events
  1692.                     }
  1693.                     existing = events[type]
  1694.                 }
  1695.                 if (!existing) {
  1696.                     existing = events[type] = listener;
  1697.                     ++target._eventsCount
  1698.                 } else {
  1699.                     if (typeof existing === "function") {
  1700.                         existing = events[type] = prepend ? [listener, existing] : [existing, listener]
  1701.                     } else {
  1702.                         if (prepend) {
  1703.                             existing.unshift(listener)
  1704.                         } else {
  1705.                             existing.push(listener)
  1706.                         }
  1707.                     }
  1708.                     if (!existing.warned) {
  1709.                         m = $getMaxListeners(target);
  1710.                         if (m && m > 0 && existing.length > m) {
  1711.                             existing.warned = true;
  1712.                             var w = new Error("Possible EventEmitter memory leak detected. " + existing.length + ' "' + String(type) + '" listeners ' + "added. Use emitter.setMaxListeners() to " + "increase limit.");
  1713.                             w.name = "MaxListenersExceededWarning";
  1714.                             w.emitter = target;
  1715.                             w.type = type;
  1716.                             w.count = existing.length;
  1717.                             if (typeof console === "object" && console.warn) {
  1718.                                 console.warn("%s: %s", w.name, w.message)
  1719.                             }
  1720.                         }
  1721.                     }
  1722.                 }
  1723.                 return target
  1724.             }
  1725.             EventEmitter.prototype.addListener = function addListener(type, listener) {
  1726.                 return _addListener(this, type, listener, false)
  1727.             };
  1728.             EventEmitter.prototype.on = EventEmitter.prototype.addListener;
  1729.             EventEmitter.prototype.prependListener = function prependListener(type, listener) {
  1730.                 return _addListener(this, type, listener, true)
  1731.             };
  1732.  
  1733.             function onceWrapper() {
  1734.                 if (!this.fired) {
  1735.                     this.target.removeListener(this.type, this.wrapFn);
  1736.                     this.fired = true;
  1737.                     switch (arguments.length) {
  1738.                         case 0:
  1739.                             return this.listener.call(this.target);
  1740.                         case 1:
  1741.                             return this.listener.call(this.target, arguments[0]);
  1742.                         case 2:
  1743.                             return this.listener.call(this.target, arguments[0], arguments[1]);
  1744.                         case 3:
  1745.                             return this.listener.call(this.target, arguments[0], arguments[1], arguments[2]);
  1746.                         default:
  1747.                             var args = new Array(arguments.length);
  1748.                             for (var i = 0; i < args.length; ++i) args[i] = arguments[i];
  1749.                             this.listener.apply(this.target, args)
  1750.                     }
  1751.                 }
  1752.             }
  1753.  
  1754.             function _onceWrap(target, type, listener) {
  1755.                 var state = {
  1756.                     fired: false,
  1757.                     wrapFn: undefined,
  1758.                     target: target,
  1759.                     type: type,
  1760.                     listener: listener
  1761.                 };
  1762.                 var wrapped = bind.call(onceWrapper, state);
  1763.                 wrapped.listener = listener;
  1764.                 state.wrapFn = wrapped;
  1765.                 return wrapped
  1766.             }
  1767.             EventEmitter.prototype.once = function once(type, listener) {
  1768.                 if (typeof listener !== "function") throw new TypeError('"listener" argument must be a function');
  1769.                 this.on(type, _onceWrap(this, type, listener));
  1770.                 return this
  1771.             };
  1772.             EventEmitter.prototype.prependOnceListener = function prependOnceListener(type, listener) {
  1773.                 if (typeof listener !== "function") throw new TypeError('"listener" argument must be a function');
  1774.                 this.prependListener(type, _onceWrap(this, type, listener));
  1775.                 return this
  1776.             };
  1777.             EventEmitter.prototype.removeListener = function removeListener(type, listener) {
  1778.                 var list, events, position, i, originalListener;
  1779.                 if (typeof listener !== "function") throw new TypeError('"listener" argument must be a function');
  1780.                 events = this._events;
  1781.                 if (!events) return this;
  1782.                 list = events[type];
  1783.                 if (!list) return this;
  1784.                 if (list === listener || list.listener === listener) {
  1785.                     if (--this._eventsCount === 0) this._events = objectCreate(null);
  1786.                     else {
  1787.                         delete events[type];
  1788.                         if (events.removeListener) this.emit("removeListener", type, list.listener || listener)
  1789.                     }
  1790.                 } else if (typeof list !== "function") {
  1791.                     position = -1;
  1792.                     for (i = list.length - 1; i >= 0; i--) {
  1793.                         if (list[i] === listener || list[i].listener === listener) {
  1794.                             originalListener = list[i].listener;
  1795.                             position = i;
  1796.                             break
  1797.                         }
  1798.                     }
  1799.                     if (position < 0) return this;
  1800.                     if (position === 0) list.shift();
  1801.                     else spliceOne(list, position);
  1802.                     if (list.length === 1) events[type] = list[0];
  1803.                     if (events.removeListener) this.emit("removeListener", type, originalListener || listener)
  1804.                 }
  1805.                 return this
  1806.             };
  1807.             EventEmitter.prototype.removeAllListeners = function removeAllListeners(type) {
  1808.                 var listeners, events, i;
  1809.                 events = this._events;
  1810.                 if (!events) return this;
  1811.                 if (!events.removeListener) {
  1812.                     if (arguments.length === 0) {
  1813.                         this._events = objectCreate(null);
  1814.                         this._eventsCount = 0
  1815.                     } else if (events[type]) {
  1816.                         if (--this._eventsCount === 0) this._events = objectCreate(null);
  1817.                         else delete events[type]
  1818.                     }
  1819.                     return this
  1820.                 }
  1821.                 if (arguments.length === 0) {
  1822.                     var keys = objectKeys(events);
  1823.                     var key;
  1824.                     for (i = 0; i < keys.length; ++i) {
  1825.                         key = keys[i];
  1826.                         if (key === "removeListener") continue;
  1827.                         this.removeAllListeners(key)
  1828.                     }
  1829.                     this.removeAllListeners("removeListener");
  1830.                     this._events = objectCreate(null);
  1831.                     this._eventsCount = 0;
  1832.                     return this
  1833.                 }
  1834.                 listeners = events[type];
  1835.                 if (typeof listeners === "function") {
  1836.                     this.removeListener(type, listeners)
  1837.                 } else if (listeners) {
  1838.                     for (i = listeners.length - 1; i >= 0; i--) {
  1839.                         this.removeListener(type, listeners[i])
  1840.                     }
  1841.                 }
  1842.                 return this
  1843.             };
  1844.             EventEmitter.prototype.listeners = function listeners(type) {
  1845.                 var evlistener;
  1846.                 var ret;
  1847.                 var events = this._events;
  1848.                 if (!events) ret = [];
  1849.                 else {
  1850.                     evlistener = events[type];
  1851.                     if (!evlistener) ret = [];
  1852.                     else if (typeof evlistener === "function") ret = [evlistener.listener || evlistener];
  1853.                     else ret = unwrapListeners(evlistener)
  1854.                 }
  1855.                 return ret
  1856.             };
  1857.             EventEmitter.listenerCount = function(emitter, type) {
  1858.                 if (typeof emitter.listenerCount === "function") {
  1859.                     return emitter.listenerCount(type)
  1860.                 } else {
  1861.                     return listenerCount.call(emitter, type)
  1862.                 }
  1863.             };
  1864.             EventEmitter.prototype.listenerCount = listenerCount;
  1865.  
  1866.             function listenerCount(type) {
  1867.                 var events = this._events;
  1868.                 if (events) {
  1869.                     var evlistener = events[type];
  1870.                     if (typeof evlistener === "function") {
  1871.                         return 1
  1872.                     } else if (evlistener) {
  1873.                         return evlistener.length
  1874.                     }
  1875.                 }
  1876.                 return 0
  1877.             }
  1878.             EventEmitter.prototype.eventNames = function eventNames() {
  1879.                 return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []
  1880.             };
  1881.  
  1882.             function spliceOne(list, index) {
  1883.                 for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) list[i] = list[k];
  1884.                 list.pop()
  1885.             }
  1886.  
  1887.             function arrayClone(arr, n) {
  1888.                 var copy = new Array(n);
  1889.                 for (var i = 0; i < n; ++i) copy[i] = arr[i];
  1890.                 return copy
  1891.             }
  1892.  
  1893.             function unwrapListeners(arr) {
  1894.                 var ret = new Array(arr.length);
  1895.                 for (var i = 0; i < ret.length; ++i) {
  1896.                     ret[i] = arr[i].listener || arr[i]
  1897.                 }
  1898.                 return ret
  1899.             }
  1900.  
  1901.             function objectCreatePolyfill(proto) {
  1902.                 var F = function() {};
  1903.                 F.prototype = proto;
  1904.                 return new F
  1905.             }
  1906.  
  1907.             function objectKeysPolyfill(obj) {
  1908.                 var keys = [];
  1909.                 for (var k in obj)
  1910.                     if (Object.prototype.hasOwnProperty.call(obj, k)) {
  1911.                         keys.push(k)
  1912.                     } return k
  1913.             }
  1914.  
  1915.             function functionBindPolyfill(context) {
  1916.                 var fn = this;
  1917.                 return function() {
  1918.                     return fn.apply(context, arguments)
  1919.                 }
  1920.             }
  1921.         }, {}],
  1922.         13: [function(require, module, exports) {
  1923.             "use strict";
  1924.             var base64 = require("base64-js");
  1925.             var ieee754 = require("ieee754");
  1926.             exports.Buffer = Buffer;
  1927.             exports.SlowBuffer = SlowBuffer;
  1928.             exports.INSPECT_MAX_BYTES = 50;
  1929.             var K_MAX_LENGTH = 2147483647;
  1930.             exports.kMaxLength = K_MAX_LENGTH;
  1931.             Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport();
  1932.             if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== "undefined" && typeof console.error === "function") {
  1933.                 console.error("This browser lacks typed array (Uint8Array) support which is required by " + "`buffer` v5.x. Use `buffer` v4.x if you require old browser support.")
  1934.             }
  1935.  
  1936.             function typedArraySupport() {
  1937.                 try {
  1938.                     var arr = new Uint8Array(1);
  1939.                     arr.__proto__ = {
  1940.                         __proto__: Uint8Array.prototype,
  1941.                         foo: function() {
  1942.                             return 42
  1943.                         }
  1944.                     };
  1945.                     return arr.foo() === 42
  1946.                 } catch (e) {
  1947.                     return false
  1948.                 }
  1949.             }
  1950.             Object.defineProperty(Buffer.prototype, "parent", {
  1951.                 get: function() {
  1952.                     if (!(this instanceof Buffer)) {
  1953.                         return undefined
  1954.                     }
  1955.                     return this.buffer
  1956.                 }
  1957.             });
  1958.             Object.defineProperty(Buffer.prototype, "offset", {
  1959.                 get: function() {
  1960.                     if (!(this instanceof Buffer)) {
  1961.                         return undefined
  1962.                     }
  1963.                     return this.byteOffset
  1964.                 }
  1965.             });
  1966.  
  1967.             function createBuffer(length) {
  1968.                 if (length > K_MAX_LENGTH) {
  1969.                     throw new RangeError("Invalid typed array length")
  1970.                 }
  1971.                 var buf = new Uint8Array(length);
  1972.                 buf.__proto__ = Buffer.prototype;
  1973.                 return buf
  1974.             }
  1975.  
  1976.             function Buffer(arg, encodingOrOffset, length) {
  1977.                 if (typeof arg === "number") {
  1978.                     if (typeof encodingOrOffset === "string") {
  1979.                         throw new Error("If encoding is specified then the first argument must be a string")
  1980.                     }
  1981.                     return allocUnsafe(arg)
  1982.                 }
  1983.                 return from(arg, encodingOrOffset, length)
  1984.             }
  1985.             if (typeof Symbol !== "undefined" && Symbol.species && Buffer[Symbol.species] === Buffer) {
  1986.                 Object.defineProperty(Buffer, Symbol.species, {
  1987.                     value: null,
  1988.                     configurable: true,
  1989.                     enumerable: false,
  1990.                     writable: false
  1991.                 })
  1992.             }
  1993.             Buffer.poolSize = 8192;
  1994.  
  1995.             function from(value, encodingOrOffset, length) {
  1996.                 if (typeof value === "number") {
  1997.                     throw new TypeError('"value" argument must not be a number')
  1998.                 }
  1999.                 if (isArrayBuffer(value) || value && isArrayBuffer(value.buffer)) {
  2000.                     return fromArrayBuffer(value, encodingOrOffset, length)
  2001.                 }
  2002.                 if (typeof value === "string") {
  2003.                     return fromString(value, encodingOrOffset)
  2004.                 }
  2005.                 return fromObject(value)
  2006.             }
  2007.             Buffer.from = function(value, encodingOrOffset, length) {
  2008.                 return from(value, encodingOrOffset, length)
  2009.             };
  2010.             Buffer.prototype.__proto__ = Uint8Array.prototype;
  2011.             Buffer.__proto__ = Uint8Array;
  2012.  
  2013.             function assertSize(size) {
  2014.                 if (typeof size !== "number") {
  2015.                     throw new TypeError('"size" argument must be of type number')
  2016.                 } else if (size < 0) {
  2017.                     throw new RangeError('"size" argument must not be negative')
  2018.                 }
  2019.             }
  2020.  
  2021.             function alloc(size, fill, encoding) {
  2022.                 assertSize(size);
  2023.                 if (size <= 0) {
  2024.                     return createBuffer(size)
  2025.                 }
  2026.                 if (fill !== undefined) {
  2027.                     return typeof encoding === "string" ? createBuffer(size).fill(fill, encoding) : createBuffer(size).fill(fill)
  2028.                 }
  2029.                 return createBuffer(size)
  2030.             }
  2031.             Buffer.alloc = function(size, fill, encoding) {
  2032.                 return alloc(size, fill, encoding)
  2033.             };
  2034.  
  2035.             function allocUnsafe(size) {
  2036.                 assertSize(size);
  2037.                 return createBuffer(size < 0 ? 0 : checked(size) | 0)
  2038.             }
  2039.             Buffer.allocUnsafe = function(size) {
  2040.                 return allocUnsafe(size)
  2041.             };
  2042.             Buffer.allocUnsafeSlow = function(size) {
  2043.                 return allocUnsafe(size)
  2044.             };
  2045.  
  2046.             function fromString(string, encoding) {
  2047.                 if (typeof encoding !== "string" || encoding === "") {
  2048.                     encoding = "utf8"
  2049.                 }
  2050.                 if (!Buffer.isEncoding(encoding)) {
  2051.                     throw new TypeError("Unknown encoding: " + encoding)
  2052.                 }
  2053.                 var length = byteLength(string, encoding) | 0;
  2054.                 var buf = createBuffer(length);
  2055.                 var actual = buf.write(string, encoding);
  2056.                 if (actual !== length) {
  2057.                     buf = buf.slice(0, actual)
  2058.                 }
  2059.                 return buf
  2060.             }
  2061.  
  2062.             function fromArrayLike(array) {
  2063.                 var length = array.length < 0 ? 0 : checked(array.length) | 0;
  2064.                 var buf = createBuffer(length);
  2065.                 for (var i = 0; i < length; i += 1) {
  2066.                     buf[i] = array[i] & 255
  2067.                 }
  2068.                 return buf
  2069.             }
  2070.  
  2071.             function fromArrayBuffer(array, byteOffset, length) {
  2072.                 if (byteOffset < 0 || array.byteLength < byteOffset) {
  2073.                     throw new RangeError('"offset" is outside of buffer bounds')
  2074.                 }
  2075.                 if (array.byteLength < byteOffset + (length || 0)) {
  2076.                     throw new RangeError('"length" is outside of buffer bounds')
  2077.                 }
  2078.                 var buf;
  2079.                 if (byteOffset === undefined && length === undefined) {
  2080.                     buf = new Uint8Array(array)
  2081.                 } else if (length === undefined) {
  2082.                     buf = new Uint8Array(array, byteOffset)
  2083.                 } else {
  2084.                     buf = new Uint8Array(array, byteOffset, length)
  2085.                 }
  2086.                 buf.__proto__ = Buffer.prototype;
  2087.                 return buf
  2088.             }
  2089.  
  2090.             function fromObject(obj) {
  2091.                 if (Buffer.isBuffer(obj)) {
  2092.                     var len = checked(obj.length) | 0;
  2093.                     var buf = createBuffer(len);
  2094.                     if (buf.length === 0) {
  2095.                         return buf
  2096.                     }
  2097.                     obj.copy(buf, 0, 0, len);
  2098.                     return buf
  2099.                 }
  2100.                 if (obj) {
  2101.                     if (ArrayBuffer.isView(obj) || "length" in obj) {
  2102.                         if (typeof obj.length !== "number" || numberIsNaN(obj.length)) {
  2103.                             return createBuffer(0)
  2104.                         }
  2105.                         return fromArrayLike(obj)
  2106.                     }
  2107.                     if (obj.type === "Buffer" && Array.isArray(obj.data)) {
  2108.                         return fromArrayLike(obj.data)
  2109.                     }
  2110.                 }
  2111.                 throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")
  2112.             }
  2113.  
  2114.             function checked(length) {
  2115.                 if (length >= K_MAX_LENGTH) {
  2116.                     throw new RangeError("Attempt to allocate Buffer larger than maximum " + "size: 0x" + K_MAX_LENGTH.toString(16) + " bytes")
  2117.                 }
  2118.                 return length | 0
  2119.             }
  2120.  
  2121.             function SlowBuffer(length) {
  2122.                 if (+length != length) {
  2123.                     length = 0
  2124.                 }
  2125.                 return Buffer.alloc(+length)
  2126.             }
  2127.             Buffer.isBuffer = function isBuffer(b) {
  2128.                 return b != null && b._isBuffer === true
  2129.             };
  2130.             Buffer.compare = function compare(a, b) {
  2131.                 if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {
  2132.                     throw new TypeError("Arguments must be Buffers")
  2133.                 }
  2134.                 if (a === b) return 0;
  2135.                 var x = a.length;
  2136.                 var y = b.length;
  2137.                 for (var i = 0, len = Math.min(x, y); i < len; ++i) {
  2138.                     if (a[i] !== b[i]) {
  2139.                         x = a[i];
  2140.                         y = b[i];
  2141.                         break
  2142.                     }
  2143.                 }
  2144.                 if (x < y) return -1;
  2145.                 if (y < x) return 1;
  2146.                 return 0
  2147.             };
  2148.             Buffer.isEncoding = function isEncoding(encoding) {
  2149.                 switch (String(encoding).toLowerCase()) {
  2150.                     case "hex":
  2151.                     case "utf8":
  2152.                     case "utf-8":
  2153.                     case "ascii":
  2154.                     case "latin1":
  2155.                     case "binary":
  2156.                     case "base64":
  2157.                     case "ucs2":
  2158.                     case "ucs-2":
  2159.                     case "utf16le":
  2160.                     case "utf-16le":
  2161.                         return true;
  2162.                     default:
  2163.                         return false
  2164.                 }
  2165.             };
  2166.             Buffer.concat = function concat(list, length) {
  2167.                 if (!Array.isArray(list)) {
  2168.                     throw new TypeError('"list" argument must be an Array of Buffers')
  2169.                 }
  2170.                 if (list.length === 0) {
  2171.                     return Buffer.alloc(0)
  2172.                 }
  2173.                 var i;
  2174.                 if (length === undefined) {
  2175.                     length = 0;
  2176.                     for (i = 0; i < list.length; ++i) {
  2177.                         length += list[i].length
  2178.                     }
  2179.                 }
  2180.                 var buffer = Buffer.allocUnsafe(length);
  2181.                 var pos = 0;
  2182.                 for (i = 0; i < list.length; ++i) {
  2183.                     var buf = list[i];
  2184.                     if (ArrayBuffer.isView(buf)) {
  2185.                         buf = Buffer.from(buf)
  2186.                     }
  2187.                     if (!Buffer.isBuffer(buf)) {
  2188.                         throw new TypeError('"list" argument must be an Array of Buffers')
  2189.                     }
  2190.                     buf.copy(buffer, pos);
  2191.                     pos += buf.length
  2192.                 }
  2193.                 return buffer
  2194.             };
  2195.  
  2196.             function byteLength(string, encoding) {
  2197.                 if (Buffer.isBuffer(string)) {
  2198.                     return string.length
  2199.                 }
  2200.                 if (ArrayBuffer.isView(string) || isArrayBuffer(string)) {
  2201.                     return string.byteLength
  2202.                 }
  2203.                 if (typeof string !== "string") {
  2204.                     string = "" + string
  2205.                 }
  2206.                 var len = string.length;
  2207.                 if (len === 0) return 0;
  2208.                 var loweredCase = false;
  2209.                 for (;;) {
  2210.                     switch (encoding) {
  2211.                         case "ascii":
  2212.                         case "latin1":
  2213.                         case "binary":
  2214.                             return len;
  2215.                         case "utf8":
  2216.                         case "utf-8":
  2217.                         case undefined:
  2218.                             return utf8ToBytes(string).length;
  2219.                         case "ucs2":
  2220.                         case "ucs-2":
  2221.                         case "utf16le":
  2222.                         case "utf-16le":
  2223.                             return len * 2;
  2224.                         case "hex":
  2225.                             return len >>> 1;
  2226.                         case "base64":
  2227.                             return base64ToBytes(string).length;
  2228.                         default:
  2229.                             if (loweredCase) return utf8ToBytes(string).length;
  2230.                             encoding = ("" + encoding).toLowerCase();
  2231.                             loweredCase = true
  2232.                     }
  2233.                 }
  2234.             }
  2235.             Buffer.byteLength = byteLength;
  2236.  
  2237.             function slowToString(encoding, start, end) {
  2238.                 var loweredCase = false;
  2239.                 if (start === undefined || start < 0) {
  2240.                     start = 0
  2241.                 }
  2242.                 if (start > this.length) {
  2243.                     return ""
  2244.                 }
  2245.                 if (end === undefined || end > this.length) {
  2246.                     end = this.length
  2247.                 }
  2248.                 if (end <= 0) {
  2249.                     return ""
  2250.                 }
  2251.                 end >>>= 0;
  2252.                 start >>>= 0;
  2253.                 if (end <= start) {
  2254.                     return ""
  2255.                 }
  2256.                 if (!encoding) encoding = "utf8";
  2257.                 while (true) {
  2258.                     switch (encoding) {
  2259.                         case "hex":
  2260.                             return hexSlice(this, start, end);
  2261.                         case "utf8":
  2262.                         case "utf-8":
  2263.                             return utf8Slice(this, start, end);
  2264.                         case "ascii":
  2265.                             return asciiSlice(this, start, end);
  2266.                         case "latin1":
  2267.                         case "binary":
  2268.                             return latin1Slice(this, start, end);
  2269.                         case "base64":
  2270.                             return base64Slice(this, start, end);
  2271.                         case "ucs2":
  2272.                         case "ucs-2":
  2273.                         case "utf16le":
  2274.                         case "utf-16le":
  2275.                             return utf16leSlice(this, start, end);
  2276.                         default:
  2277.                             if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
  2278.                             encoding = (encoding + "").toLowerCase();
  2279.                             loweredCase = true
  2280.                     }
  2281.                 }
  2282.             }
  2283.             Buffer.prototype._isBuffer = true;
  2284.  
  2285.             function swap(b, n, m) {
  2286.                 var i = b[n];
  2287.                 b[n] = b[m];
  2288.                 b[m] = i
  2289.             }
  2290.             Buffer.prototype.swap16 = function swap16() {
  2291.                 var len = this.length;
  2292.                 if (len % 2 !== 0) {
  2293.                     throw new RangeError("Buffer size must be a multiple of 16-bits")
  2294.                 }
  2295.                 for (var i = 0; i < len; i += 2) {
  2296.                     swap(this, i, i + 1)
  2297.                 }
  2298.                 return this
  2299.             };
  2300.             Buffer.prototype.swap32 = function swap32() {
  2301.                 var len = this.length;
  2302.                 if (len % 4 !== 0) {
  2303.                     throw new RangeError("Buffer size must be a multiple of 32-bits")
  2304.                 }
  2305.                 for (var i = 0; i < len; i += 4) {
  2306.                     swap(this, i, i + 3);
  2307.                     swap(this, i + 1, i + 2)
  2308.                 }
  2309.                 return this
  2310.             };
  2311.             Buffer.prototype.swap64 = function swap64() {
  2312.                 var len = this.length;
  2313.                 if (len % 8 !== 0) {
  2314.                     throw new RangeError("Buffer size must be a multiple of 64-bits")
  2315.                 }
  2316.                 for (var i = 0; i < len; i += 8) {
  2317.                     swap(this, i, i + 7);
  2318.                     swap(this, i + 1, i + 6);
  2319.                     swap(this, i + 2, i + 5);
  2320.                     swap(this, i + 3, i + 4)
  2321.                 }
  2322.                 return this
  2323.             };
  2324.             Buffer.prototype.toString = function toString() {
  2325.                 var length = this.length;
  2326.                 if (length === 0) return "";
  2327.                 if (arguments.length === 0) return utf8Slice(this, 0, length);
  2328.                 return slowToString.apply(this, arguments)
  2329.             };
  2330.             Buffer.prototype.toLocaleString = Buffer.prototype.toString;
  2331.             Buffer.prototype.equals = function equals(b) {
  2332.                 if (!Buffer.isBuffer(b)) throw new TypeError("Argument must be a Buffer");
  2333.                 if (this === b) return true;
  2334.                 return Buffer.compare(this, b) === 0
  2335.             };
  2336.             Buffer.prototype.inspect = function inspect() {
  2337.                 var str = "";
  2338.                 var max = exports.INSPECT_MAX_BYTES;
  2339.                 if (this.length > 0) {
  2340.                     str = this.toString("hex", 0, max).match(/.{2}/g).join(" ");
  2341.                     if (this.length > max) str += " ... "
  2342.                 }
  2343.                 return "<Buffer " + str + ">"
  2344.             };
  2345.             Buffer.prototype.compare = function compare(target, start, end, thisStart, thisEnd) {
  2346.                 if (!Buffer.isBuffer(target)) {
  2347.                     throw new TypeError("Argument must be a Buffer")
  2348.                 }
  2349.                 if (start === undefined) {
  2350.                     start = 0
  2351.                 }
  2352.                 if (end === undefined) {
  2353.                     end = target ? target.length : 0
  2354.                 }
  2355.                 if (thisStart === undefined) {
  2356.                     thisStart = 0
  2357.                 }
  2358.                 if (thisEnd === undefined) {
  2359.                     thisEnd = this.length
  2360.                 }
  2361.                 if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {
  2362.                     throw new RangeError("out of range index")
  2363.                 }
  2364.                 if (thisStart >= thisEnd && start >= end) {
  2365.                     return 0
  2366.                 }
  2367.                 if (thisStart >= thisEnd) {
  2368.                     return -1
  2369.                 }
  2370.                 if (start >= end) {
  2371.                     return 1
  2372.                 }
  2373.                 start >>>= 0;
  2374.                 end >>>= 0;
  2375.                 thisStart >>>= 0;
  2376.                 thisEnd >>>= 0;
  2377.                 if (this === target) return 0;
  2378.                 var x = thisEnd - thisStart;
  2379.                 var y = end - start;
  2380.                 var len = Math.min(x, y);
  2381.                 var thisCopy = this.slice(thisStart, thisEnd);
  2382.                 var targetCopy = target.slice(start, end);
  2383.                 for (var i = 0; i < len; ++i) {
  2384.                     if (thisCopy[i] !== targetCopy[i]) {
  2385.                         x = thisCopy[i];
  2386.                         y = targetCopy[i];
  2387.                         break
  2388.                     }
  2389.                 }
  2390.                 if (x < y) return -1;
  2391.                 if (y < x) return 1;
  2392.                 return 0
  2393.             };
  2394.  
  2395.             function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) {
  2396.                 if (buffer.length === 0) return -1;
  2397.                 if (typeof byteOffset === "string") {
  2398.                     encoding = byteOffset;
  2399.                     byteOffset = 0
  2400.                 } else if (byteOffset > 2147483647) {
  2401.                     byteOffset = 2147483647
  2402.                 } else if (byteOffset < -2147483648) {
  2403.                     byteOffset = -2147483648
  2404.                 }
  2405.                 byteOffset = +byteOffset;
  2406.                 if (numberIsNaN(byteOffset)) {
  2407.                     byteOffset = dir ? 0 : buffer.length - 1
  2408.                 }
  2409.                 if (byteOffset < 0) byteOffset = buffer.length + byteOffset;
  2410.                 if (byteOffset >= buffer.length) {
  2411.                     if (dir) return -1;
  2412.                     else byteOffset = buffer.length - 1
  2413.                 } else if (byteOffset < 0) {
  2414.                     if (dir) byteOffset = 0;
  2415.                     else return -1
  2416.                 }
  2417.                 if (typeof val === "string") {
  2418.                     val = Buffer.from(val, encoding)
  2419.                 }
  2420.                 if (Buffer.isBuffer(val)) {
  2421.                     if (val.length === 0) {
  2422.                         return -1
  2423.                     }
  2424.                     return arrayIndexOf(buffer, val, byteOffset, encoding, dir)
  2425.                 } else if (typeof val === "number") {
  2426.                     val = val & 255;
  2427.                     if (typeof Uint8Array.prototype.indexOf === "function") {
  2428.                         if (dir) {
  2429.                             return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)
  2430.                         } else {
  2431.                             return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)
  2432.                         }
  2433.                     }
  2434.                     return arrayIndexOf(buffer, [val], byteOffset, encoding, dir)
  2435.                 }
  2436.                 throw new TypeError("val must be string, number or Buffer")
  2437.             }
  2438.  
  2439.             function arrayIndexOf(arr, val, byteOffset, encoding, dir) {
  2440.                 var indexSize = 1;
  2441.                 var arrLength = arr.length;
  2442.                 var valLength = val.length;
  2443.                 if (encoding !== undefined) {
  2444.                     encoding = String(encoding).toLowerCase();
  2445.                     if (encoding === "ucs2" || encoding === "ucs-2" || encoding === "utf16le" || encoding === "utf-16le") {
  2446.                         if (arr.length < 2 || val.length < 2) {
  2447.                             return -1
  2448.                         }
  2449.                         indexSize = 2;
  2450.                         arrLength /= 2;
  2451.                         valLength /= 2;
  2452.                         byteOffset /= 2
  2453.                     }
  2454.                 }
  2455.  
  2456.                 function read(buf, i) {
  2457.                     if (indexSize === 1) {
  2458.                         return buf[i]
  2459.                     } else {
  2460.                         return buf.readUInt16BE(i * indexSize)
  2461.                     }
  2462.                 }
  2463.                 var i;
  2464.                 if (dir) {
  2465.                     var foundIndex = -1;
  2466.                     for (i = byteOffset; i < arrLength; i++) {
  2467.                         if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {
  2468.                             if (foundIndex === -1) foundIndex = i;
  2469.                             if (i - foundIndex + 1 === valLength) return foundIndex * indexSize
  2470.                         } else {
  2471.                             if (foundIndex !== -1) i -= i - foundIndex;
  2472.                             foundIndex = -1
  2473.                         }
  2474.                     }
  2475.                 } else {
  2476.                     if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength;
  2477.                     for (i = byteOffset; i >= 0; i--) {
  2478.                         var found = true;
  2479.                         for (var j = 0; j < valLength; j++) {
  2480.                             if (read(arr, i + j) !== read(val, j)) {
  2481.                                 found = false;
  2482.                                 break
  2483.                             }
  2484.                         }
  2485.                         if (found) return i
  2486.                     }
  2487.                 }
  2488.                 return -1
  2489.             }
  2490.             Buffer.prototype.includes = function includes(val, byteOffset, encoding) {
  2491.                 return this.indexOf(val, byteOffset, encoding) !== -1
  2492.             };
  2493.             Buffer.prototype.indexOf = function indexOf(val, byteOffset, encoding) {
  2494.                 return bidirectionalIndexOf(this, val, byteOffset, encoding, true)
  2495.             };
  2496.             Buffer.prototype.lastIndexOf = function lastIndexOf(val, byteOffset, encoding) {
  2497.                 return bidirectionalIndexOf(this, val, byteOffset, encoding, false)
  2498.             };
  2499.  
  2500.             function hexWrite(buf, string, offset, length) {
  2501.                 offset = Number(offset) || 0;
  2502.                 var remaining = buf.length - offset;
  2503.                 if (!length) {
  2504.                     length = remaining
  2505.                 } else {
  2506.                     length = Number(length);
  2507.                     if (length > remaining) {
  2508.                         length = remaining
  2509.                     }
  2510.                 }
  2511.                 var strLen = string.length;
  2512.                 if (length > strLen / 2) {
  2513.                     length = strLen / 2
  2514.                 }
  2515.                 for (var i = 0; i < length; ++i) {
  2516.                     var parsed = parseInt(string.substr(i * 2, 2), 16);
  2517.                     if (numberIsNaN(parsed)) return i;
  2518.                     buf[offset + i] = parsed
  2519.                 }
  2520.                 return i
  2521.             }
  2522.  
  2523.             function utf8Write(buf, string, offset, length) {
  2524.                 return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)
  2525.             }
  2526.  
  2527.             function asciiWrite(buf, string, offset, length) {
  2528.                 return blitBuffer(asciiToBytes(string), buf, offset, length)
  2529.             }
  2530.  
  2531.             function latin1Write(buf, string, offset, length) {
  2532.                 return asciiWrite(buf, string, offset, length)
  2533.             }
  2534.  
  2535.             function base64Write(buf, string, offset, length) {
  2536.                 return blitBuffer(base64ToBytes(string), buf, offset, length)
  2537.             }
  2538.  
  2539.             function ucs2Write(buf, string, offset, length) {
  2540.                 return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)
  2541.             }
  2542.             Buffer.prototype.write = function write(string, offset, length, encoding) {
  2543.                 if (offset === undefined) {
  2544.                     encoding = "utf8";
  2545.                     length = this.length;
  2546.                     offset = 0
  2547.                 } else if (length === undefined && typeof offset === "string") {
  2548.                     encoding = offset;
  2549.                     length = this.length;
  2550.                     offset = 0
  2551.                 } else if (isFinite(offset)) {
  2552.                     offset = offset >>> 0;
  2553.                     if (isFinite(length)) {
  2554.                         length = length >>> 0;
  2555.                         if (encoding === undefined) encoding = "utf8"
  2556.                     } else {
  2557.                         encoding = length;
  2558.                         length = undefined
  2559.                     }
  2560.                 } else {
  2561.                     throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported")
  2562.                 }
  2563.                 var remaining = this.length - offset;
  2564.                 if (length === undefined || length > remaining) length = remaining;
  2565.                 if (string.length > 0 && (length < 0 || offset < 0) || offset > this.length) {
  2566.                     throw new RangeError("Attempt to write outside buffer bounds")
  2567.                 }
  2568.                 if (!encoding) encoding = "utf8";
  2569.                 var loweredCase = false;
  2570.                 for (;;) {
  2571.                     switch (encoding) {
  2572.                         case "hex":
  2573.                             return hexWrite(this, string, offset, length);
  2574.                         case "utf8":
  2575.                         case "utf-8":
  2576.                             return utf8Write(this, string, offset, length);
  2577.                         case "ascii":
  2578.                             return asciiWrite(this, string, offset, length);
  2579.                         case "latin1":
  2580.                         case "binary":
  2581.                             return latin1Write(this, string, offset, length);
  2582.                         case "base64":
  2583.                             return base64Write(this, string, offset, length);
  2584.                         case "ucs2":
  2585.                         case "ucs-2":
  2586.                         case "utf16le":
  2587.                         case "utf-16le":
  2588.                             return ucs2Write(this, string, offset, length);
  2589.                         default:
  2590.                             if (loweredCase) throw new TypeError("Unknown encoding: " + encoding);
  2591.                             encoding = ("" + encoding).toLowerCase();
  2592.                             loweredCase = true
  2593.                     }
  2594.                 }
  2595.             };
  2596.             Buffer.prototype.toJSON = function toJSON() {
  2597.                 return {
  2598.                     type: "Buffer",
  2599.                     data: Array.prototype.slice.call(this._arr || this, 0)
  2600.                 }
  2601.             };
  2602.  
  2603.             function base64Slice(buf, start, end) {
  2604.                 if (start === 0 && end === buf.length) {
  2605.                     return base64.fromByteArray(buf)
  2606.                 } else {
  2607.                     return base64.fromByteArray(buf.slice(start, end))
  2608.                 }
  2609.             }
  2610.  
  2611.             function utf8Slice(buf, start, end) {
  2612.                 end = Math.min(buf.length, end);
  2613.                 var res = [];
  2614.                 var i = start;
  2615.                 while (i < end) {
  2616.                     var firstByte = buf[i];
  2617.                     var codePoint = null;
  2618.                     var bytesPerSequence = firstByte > 239 ? 4 : firstByte > 223 ? 3 : firstByte > 191 ? 2 : 1;
  2619.                     if (i + bytesPerSequence <= end) {
  2620.                         var secondByte, thirdByte, fourthByte, tempCodePoint;
  2621.                         switch (bytesPerSequence) {
  2622.                             case 1:
  2623.                                 if (firstByte < 128) {
  2624.                                     codePoint = firstByte
  2625.                                 }
  2626.                                 break;
  2627.                             case 2:
  2628.                                 secondByte = buf[i + 1];
  2629.                                 if ((secondByte & 192) === 128) {
  2630.                                     tempCodePoint = (firstByte & 31) << 6 | secondByte & 63;
  2631.                                     if (tempCodePoint > 127) {
  2632.                                         codePoint = tempCodePoint
  2633.                                     }
  2634.                                 }
  2635.                                 break;
  2636.                             case 3:
  2637.                                 secondByte = buf[i + 1];
  2638.                                 thirdByte = buf[i + 2];
  2639.                                 if ((secondByte & 192) === 128 && (thirdByte & 192) === 128) {
  2640.                                     tempCodePoint = (firstByte & 15) << 12 | (secondByte & 63) << 6 | thirdByte & 63;
  2641.                                     if (tempCodePoint > 2047 && (tempCodePoint < 55296 || tempCodePoint > 57343)) {
  2642.                                         codePoint = tempCodePoint
  2643.                                     }
  2644.                                 }
  2645.                                 break;
  2646.                             case 4:
  2647.                                 secondByte = buf[i + 1];
  2648.                                 thirdByte = buf[i + 2];
  2649.                                 fourthByte = buf[i + 3];
  2650.                                 if ((secondByte & 192) === 128 && (thirdByte & 192) === 128 && (fourthByte & 192) === 128) {
  2651.                                     tempCodePoint = (firstByte & 15) << 18 | (secondByte & 63) << 12 | (thirdByte & 63) << 6 | fourthByte & 63;
  2652.                                     if (tempCodePoint > 65535 && tempCodePoint < 1114112) {
  2653.                                         codePoint = tempCodePoint
  2654.                                     }
  2655.                                 }
  2656.                         }
  2657.                     }
  2658.                     if (codePoint === null) {
  2659.                         codePoint = 65533;
  2660.                         bytesPerSequence = 1
  2661.                     } else if (codePoint > 65535) {
  2662.                         codePoint -= 65536;
  2663.                         res.push(codePoint >>> 10 & 1023 | 55296);
  2664.                         codePoint = 56320 | codePoint & 1023
  2665.                     }
  2666.                     res.push(codePoint);
  2667.                     i += bytesPerSequence
  2668.                 }
  2669.                 return decodeCodePointsArray(res)
  2670.             }
  2671.             var MAX_ARGUMENTS_LENGTH = 4096;
  2672.  
  2673.             function decodeCodePointsArray(codePoints) {
  2674.                 var len = codePoints.length;
  2675.                 if (len <= MAX_ARGUMENTS_LENGTH) {
  2676.                     return String.fromCharCode.apply(String, codePoints)
  2677.                 }
  2678.                 var res = "";
  2679.                 var i = 0;
  2680.                 while (i < len) {
  2681.                     res += String.fromCharCode.apply(String, codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH))
  2682.                 }
  2683.                 return res
  2684.             }
  2685.  
  2686.             function asciiSlice(buf, start, end) {
  2687.                 var ret = "";
  2688.                 end = Math.min(buf.length, end);
  2689.                 for (var i = start; i < end; ++i) {
  2690.                     ret += String.fromCharCode(buf[i] & 127)
  2691.                 }
  2692.                 return ret
  2693.             }
  2694.  
  2695.             function latin1Slice(buf, start, end) {
  2696.                 var ret = "";
  2697.                 end = Math.min(buf.length, end);
  2698.                 for (var i = start; i < end; ++i) {
  2699.                     ret += String.fromCharCode(buf[i])
  2700.                 }
  2701.                 return ret
  2702.             }
  2703.  
  2704.             function hexSlice(buf, start, end) {
  2705.                 var len = buf.length;
  2706.                 if (!start || start < 0) start = 0;
  2707.                 if (!end || end < 0 || end > len) end = len;
  2708.                 var out = "";
  2709.                 for (var i = start; i < end; ++i) {
  2710.                     out += toHex(buf[i])
  2711.                 }
  2712.                 return out
  2713.             }
  2714.  
  2715.             function utf16leSlice(buf, start, end) {
  2716.                 var bytes = buf.slice(start, end);
  2717.                 var res = "";
  2718.                 for (var i = 0; i < bytes.length; i += 2) {
  2719.                     res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
  2720.                 }
  2721.                 return res
  2722.             }
  2723.             Buffer.prototype.slice = function slice(start, end) {
  2724.                 var len = this.length;
  2725.                 start = ~~start;
  2726.                 end = end === undefined ? len : ~~end;
  2727.                 if (start < 0) {
  2728.                     start += len;
  2729.                     if (start < 0) start = 0
  2730.                 } else if (start > len) {
  2731.                     start = len
  2732.                 }
  2733.                 if (end < 0) {
  2734.                     end += len;
  2735.                     if (end < 0) end = 0
  2736.                 } else if (end > len) {
  2737.                     end = len
  2738.                 }
  2739.                 if (end < start) end = start;
  2740.                 var newBuf = this.subarray(start, end);
  2741.                 newBuf.__proto__ = Buffer.prototype;
  2742.                 return newBuf
  2743.             };
  2744.  
  2745.             function checkOffset(offset, ext, length) {
  2746.                 if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
  2747.                 if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length")
  2748.             }
  2749.             Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength, noAssert) {
  2750.                 offset = offset >>> 0;
  2751.                 byteLength = byteLength >>> 0;
  2752.                 if (!noAssert) checkOffset(offset, byteLength, this.length);
  2753.                 var val = this[offset];
  2754.                 var mul = 1;
  2755.                 var i = 0;
  2756.                 while (++i < byteLength && (mul *= 256)) {
  2757.                     val += this[offset + i] * mul
  2758.                 }
  2759.                 return val
  2760.             };
  2761.             Buffer.prototype.readUIntBE = function readUIntBE(offset, byteLength, noAssert) {
  2762.                 offset = offset >>> 0;
  2763.                 byteLength = byteLength >>> 0;
  2764.                 if (!noAssert) {
  2765.                     checkOffset(offset, byteLength, this.length)
  2766.                 }
  2767.                 var val = this[offset + --byteLength];
  2768.                 var mul = 1;
  2769.                 while (byteLength > 0 && (mul *= 256)) {
  2770.                     val += this[offset + --byteLength] * mul
  2771.                 }
  2772.                 return val
  2773.             };
  2774.             Buffer.prototype.readUInt8 = function readUInt8(offset, noAssert) {
  2775.                 offset = offset >>> 0;
  2776.                 if (!noAssert) checkOffset(offset, 1, this.length);
  2777.                 return this[offset]
  2778.             };
  2779.             Buffer.prototype.readUInt16LE = function readUInt16LE(offset, noAssert) {
  2780.                 offset = offset >>> 0;
  2781.                 if (!noAssert) checkOffset(offset, 2, this.length);
  2782.                 return this[offset] | this[offset + 1] << 8
  2783.             };
  2784.             Buffer.prototype.readUInt16BE = function readUInt16BE(offset, noAssert) {
  2785.                 offset = offset >>> 0;
  2786.                 if (!noAssert) checkOffset(offset, 2, this.length);
  2787.                 return this[offset] << 8 | this[offset + 1]
  2788.             };
  2789.             Buffer.prototype.readUInt32LE = function readUInt32LE(offset, noAssert) {
  2790.                 offset = offset >>> 0;
  2791.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2792.                 return (this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16) + this[offset + 3] * 16777216
  2793.             };
  2794.             Buffer.prototype.readUInt32BE = function readUInt32BE(offset, noAssert) {
  2795.                 offset = offset >>> 0;
  2796.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2797.                 return this[offset] * 16777216 + (this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3])
  2798.             };
  2799.             Buffer.prototype.readIntLE = function readIntLE(offset, byteLength, noAssert) {
  2800.                 offset = offset >>> 0;
  2801.                 byteLength = byteLength >>> 0;
  2802.                 if (!noAssert) checkOffset(offset, byteLength, this.length);
  2803.                 var val = this[offset];
  2804.                 var mul = 1;
  2805.                 var i = 0;
  2806.                 while (++i < byteLength && (mul *= 256)) {
  2807.                     val += this[offset + i] * mul
  2808.                 }
  2809.                 mul *= 128;
  2810.                 if (val >= mul) val -= Math.pow(2, 8 * byteLength);
  2811.                 return val
  2812.             };
  2813.             Buffer.prototype.readIntBE = function readIntBE(offset, byteLength, noAssert) {
  2814.                 offset = offset >>> 0;
  2815.                 byteLength = byteLength >>> 0;
  2816.                 if (!noAssert) checkOffset(offset, byteLength, this.length);
  2817.                 var i = byteLength;
  2818.                 var mul = 1;
  2819.                 var val = this[offset + --i];
  2820.                 while (i > 0 && (mul *= 256)) {
  2821.                     val += this[offset + --i] * mul
  2822.                 }
  2823.                 mul *= 128;
  2824.                 if (val >= mul) val -= Math.pow(2, 8 * byteLength);
  2825.                 return val
  2826.             };
  2827.             Buffer.prototype.readInt8 = function readInt8(offset, noAssert) {
  2828.                 offset = offset >>> 0;
  2829.                 if (!noAssert) checkOffset(offset, 1, this.length);
  2830.                 if (!(this[offset] & 128)) return this[offset];
  2831.                 return (255 - this[offset] + 1) * -1
  2832.             };
  2833.             Buffer.prototype.readInt16LE = function readInt16LE(offset, noAssert) {
  2834.                 offset = offset >>> 0;
  2835.                 if (!noAssert) checkOffset(offset, 2, this.length);
  2836.                 var val = this[offset] | this[offset + 1] << 8;
  2837.                 return val & 32768 ? val | 4294901760 : val
  2838.             };
  2839.             Buffer.prototype.readInt16BE = function readInt16BE(offset, noAssert) {
  2840.                 offset = offset >>> 0;
  2841.                 if (!noAssert) checkOffset(offset, 2, this.length);
  2842.                 var val = this[offset + 1] | this[offset] << 8;
  2843.                 return val & 32768 ? val | 4294901760 : val
  2844.             };
  2845.             Buffer.prototype.readInt32LE = function readInt32LE(offset, noAssert) {
  2846.                 offset = offset >>> 0;
  2847.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2848.                 return this[offset] | this[offset + 1] << 8 | this[offset + 2] << 16 | this[offset + 3] << 24
  2849.             };
  2850.             Buffer.prototype.readInt32BE = function readInt32BE(offset, noAssert) {
  2851.                 offset = offset >>> 0;
  2852.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2853.                 return this[offset] << 24 | this[offset + 1] << 16 | this[offset + 2] << 8 | this[offset + 3]
  2854.             };
  2855.             Buffer.prototype.readFloatLE = function readFloatLE(offset, noAssert) {
  2856.                 offset = offset >>> 0;
  2857.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2858.                 return ieee754.read(this, offset, true, 23, 4)
  2859.             };
  2860.             Buffer.prototype.readFloatBE = function readFloatBE(offset, noAssert) {
  2861.                 offset = offset >>> 0;
  2862.                 if (!noAssert) checkOffset(offset, 4, this.length);
  2863.                 return ieee754.read(this, offset, false, 23, 4)
  2864.             };
  2865.             Buffer.prototype.readDoubleLE = function readDoubleLE(offset, noAssert) {
  2866.                 offset = offset >>> 0;
  2867.                 if (!noAssert) checkOffset(offset, 8, this.length);
  2868.                 return ieee754.read(this, offset, true, 52, 8)
  2869.             };
  2870.             Buffer.prototype.readDoubleBE = function readDoubleBE(offset, noAssert) {
  2871.                 offset = offset >>> 0;
  2872.                 if (!noAssert) checkOffset(offset, 8, this.length);
  2873.                 return ieee754.read(this, offset, false, 52, 8)
  2874.             };
  2875.  
  2876.             function checkInt(buf, value, offset, ext, max, min) {
  2877.                 if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance');
  2878.                 if (value > max || value < min) throw new RangeError('"value" argument is out of bounds');
  2879.                 if (offset + ext > buf.length) throw new RangeError("Index out of range")
  2880.             }
  2881.             Buffer.prototype.writeUIntLE = function writeUIntLE(value, offset, byteLength, noAssert) {
  2882.                 value = +value;
  2883.                 offset = offset >>> 0;
  2884.                 byteLength = byteLength >>> 0;
  2885.                 if (!noAssert) {
  2886.                     var maxBytes = Math.pow(2, 8 * byteLength) - 1;
  2887.                     checkInt(this, value, offset, byteLength, maxBytes, 0)
  2888.                 }
  2889.                 var mul = 1;
  2890.                 var i = 0;
  2891.                 this[offset] = value & 255;
  2892.                 while (++i < byteLength && (mul *= 256)) {
  2893.                     this[offset + i] = value / mul & 255
  2894.                 }
  2895.                 return offset + byteLength
  2896.             };
  2897.             Buffer.prototype.writeUIntBE = function writeUIntBE(value, offset, byteLength, noAssert) {
  2898.                 value = +value;
  2899.                 offset = offset >>> 0;
  2900.                 byteLength = byteLength >>> 0;
  2901.                 if (!noAssert) {
  2902.                     var maxBytes = Math.pow(2, 8 * byteLength) - 1;
  2903.                     checkInt(this, value, offset, byteLength, maxBytes, 0)
  2904.                 }
  2905.                 var i = byteLength - 1;
  2906.                 var mul = 1;
  2907.                 this[offset + i] = value & 255;
  2908.                 while (--i >= 0 && (mul *= 256)) {
  2909.                     this[offset + i] = value / mul & 255
  2910.                 }
  2911.                 return offset + byteLength
  2912.             };
  2913.             Buffer.prototype.writeUInt8 = function writeUInt8(value, offset, noAssert) {
  2914.                 value = +value;
  2915.                 offset = offset >>> 0;
  2916.                 if (!noAssert) checkInt(this, value, offset, 1, 255, 0);
  2917.                 this[offset] = value & 255;
  2918.                 return offset + 1
  2919.             };
  2920.             Buffer.prototype.writeUInt16LE = function writeUInt16LE(value, offset, noAssert) {
  2921.                 value = +value;
  2922.                 offset = offset >>> 0;
  2923.                 if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
  2924.                 this[offset] = value & 255;
  2925.                 this[offset + 1] = value >>> 8;
  2926.                 return offset + 2
  2927.             };
  2928.             Buffer.prototype.writeUInt16BE = function writeUInt16BE(value, offset, noAssert) {
  2929.                 value = +value;
  2930.                 offset = offset >>> 0;
  2931.                 if (!noAssert) checkInt(this, value, offset, 2, 65535, 0);
  2932.                 this[offset] = value >>> 8;
  2933.                 this[offset + 1] = value & 255;
  2934.                 return offset + 2
  2935.             };
  2936.             Buffer.prototype.writeUInt32LE = function writeUInt32LE(value, offset, noAssert) {
  2937.                 value = +value;
  2938.                 offset = offset >>> 0;
  2939.                 if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
  2940.                 this[offset + 3] = value >>> 24;
  2941.                 this[offset + 2] = value >>> 16;
  2942.                 this[offset + 1] = value >>> 8;
  2943.                 this[offset] = value & 255;
  2944.                 return offset + 4
  2945.             };
  2946.             Buffer.prototype.writeUInt32BE = function writeUInt32BE(value, offset, noAssert) {
  2947.                 value = +value;
  2948.                 offset = offset >>> 0;
  2949.                 if (!noAssert) checkInt(this, value, offset, 4, 4294967295, 0);
  2950.                 this[offset] = value >>> 24;
  2951.                 this[offset + 1] = value >>> 16;
  2952.                 this[offset + 2] = value >>> 8;
  2953.                 this[offset + 3] = value & 255;
  2954.                 return offset + 4
  2955.             };
  2956.             Buffer.prototype.writeIntLE = function writeIntLE(value, offset, byteLength, noAssert) {
  2957.                 value = +value;
  2958.                 offset = offset >>> 0;
  2959.                 if (!noAssert) {
  2960.                     var limit = Math.pow(2, 8 * byteLength - 1);
  2961.                     checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2962.                 }
  2963.                 var i = 0;
  2964.                 var mul = 1;
  2965.                 var sub = 0;
  2966.                 this[offset] = value & 255;
  2967.                 while (++i < byteLength && (mul *= 256)) {
  2968.                     if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {
  2969.                         sub = 1
  2970.                     }
  2971.                     this[offset + i] = (value / mul >> 0) - sub & 255
  2972.                 }
  2973.                 return offset + byteLength
  2974.             };
  2975.             Buffer.prototype.writeIntBE = function writeIntBE(value, offset, byteLength, noAssert) {
  2976.                 value = +value;
  2977.                 offset = offset >>> 0;
  2978.                 if (!noAssert) {
  2979.                     var limit = Math.pow(2, 8 * byteLength - 1);
  2980.                     checkInt(this, value, offset, byteLength, limit - 1, -limit)
  2981.                 }
  2982.                 var i = byteLength - 1;
  2983.                 var mul = 1;
  2984.                 var sub = 0;
  2985.                 this[offset + i] = value & 255;
  2986.                 while (--i >= 0 && (mul *= 256)) {
  2987.                     if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {
  2988.                         sub = 1
  2989.                     }
  2990.                     this[offset + i] = (value / mul >> 0) - sub & 255
  2991.                 }
  2992.                 return offset + byteLength
  2993.             };
  2994.             Buffer.prototype.writeInt8 = function writeInt8(value, offset, noAssert) {
  2995.                 value = +value;
  2996.                 offset = offset >>> 0;
  2997.                 if (!noAssert) checkInt(this, value, offset, 1, 127, -128);
  2998.                 if (value < 0) value = 255 + value + 1;
  2999.                 this[offset] = value & 255;
  3000.                 return offset + 1
  3001.             };
  3002.             Buffer.prototype.writeInt16LE = function writeInt16LE(value, offset, noAssert) {
  3003.                 value = +value;
  3004.                 offset = offset >>> 0;
  3005.                 if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
  3006.                 this[offset] = value & 255;
  3007.                 this[offset + 1] = value >>> 8;
  3008.                 return offset + 2
  3009.             };
  3010.             Buffer.prototype.writeInt16BE = function writeInt16BE(value, offset, noAssert) {
  3011.                 value = +value;
  3012.                 offset = offset >>> 0;
  3013.                 if (!noAssert) checkInt(this, value, offset, 2, 32767, -32768);
  3014.                 this[offset] = value >>> 8;
  3015.                 this[offset + 1] = value & 255;
  3016.                 return offset + 2
  3017.             };
  3018.             Buffer.prototype.writeInt32LE = function writeInt32LE(value, offset, noAssert) {
  3019.                 value = +value;
  3020.                 offset = offset >>> 0;
  3021.                 if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
  3022.                 this[offset] = value & 255;
  3023.                 this[offset + 1] = value >>> 8;
  3024.                 this[offset + 2] = value >>> 16;
  3025.                 this[offset + 3] = value >>> 24;
  3026.                 return offset + 4
  3027.             };
  3028.             Buffer.prototype.writeInt32BE = function writeInt32BE(value, offset, noAssert) {
  3029.                 value = +value;
  3030.                 offset = offset >>> 0;
  3031.                 if (!noAssert) checkInt(this, value, offset, 4, 2147483647, -2147483648);
  3032.                 if (value < 0) value = 4294967295 + value + 1;
  3033.                 this[offset] = value >>> 24;
  3034.                 this[offset + 1] = value >>> 16;
  3035.                 this[offset + 2] = value >>> 8;
  3036.                 this[offset + 3] = value & 255;
  3037.                 return offset + 4
  3038.             };
  3039.  
  3040.             function checkIEEE754(buf, value, offset, ext, max, min) {
  3041.                 if (offset + ext > buf.length) throw new RangeError("Index out of range");
  3042.                 if (offset < 0) throw new RangeError("Index out of range")
  3043.             }
  3044.  
  3045.             function writeFloat(buf, value, offset, littleEndian, noAssert) {
  3046.                 value = +value;
  3047.                 offset = offset >>> 0;
  3048.                 if (!noAssert) {
  3049.                     checkIEEE754(buf, value, offset, 4, 3.4028234663852886e38, -3.4028234663852886e38)
  3050.                 }
  3051.                 ieee754.write(buf, value, offset, littleEndian, 23, 4);
  3052.                 return offset + 4
  3053.             }
  3054.             Buffer.prototype.writeFloatLE = function writeFloatLE(value, offset, noAssert) {
  3055.                 return writeFloat(this, value, offset, true, noAssert)
  3056.             };
  3057.             Buffer.prototype.writeFloatBE = function writeFloatBE(value, offset, noAssert) {
  3058.                 return writeFloat(this, value, offset, false, noAssert)
  3059.             };
  3060.  
  3061.             function writeDouble(buf, value, offset, littleEndian, noAssert) {
  3062.                 value = +value;
  3063.                 offset = offset >>> 0;
  3064.                 if (!noAssert) {
  3065.                     checkIEEE754(buf, value, offset, 8, 1.7976931348623157e308, -1.7976931348623157e308)
  3066.                 }
  3067.                 ieee754.write(buf, value, offset, littleEndian, 52, 8);
  3068.                 return offset + 8
  3069.             }
  3070.             Buffer.prototype.writeDoubleLE = function writeDoubleLE(value, offset, noAssert) {
  3071.                 return writeDouble(this, value, offset, true, noAssert)
  3072.             };
  3073.             Buffer.prototype.writeDoubleBE = function writeDoubleBE(value, offset, noAssert) {
  3074.                 return writeDouble(this, value, offset, false, noAssert)
  3075.             };
  3076.             Buffer.prototype.copy = function copy(target, targetStart, start, end) {
  3077.                 if (!Buffer.isBuffer(target)) throw new TypeError("argument should be a Buffer");
  3078.                 if (!start) start = 0;
  3079.                 if (!end && end !== 0) end = this.length;
  3080.                 if (targetStart >= target.length) targetStart = target.length;
  3081.                 if (!targetStart) targetStart = 0;
  3082.                 if (end > 0 && end < start) end = start;
  3083.                 if (end === start) return 0;
  3084.                 if (target.length === 0 || this.length === 0) return 0;
  3085.                 if (targetStart < 0) {
  3086.                     throw new RangeError("targetStart out of bounds")
  3087.                 }
  3088.                 if (start < 0 || start >= this.length) throw new RangeError("Index out of range");
  3089.                 if (end < 0) throw new RangeError("sourceEnd out of bounds");
  3090.                 if (end > this.length) end = this.length;
  3091.                 if (target.length - targetStart < end - start) {
  3092.                     end = target.length - targetStart + start
  3093.                 }
  3094.                 var len = end - start;
  3095.                 if (this === target && typeof Uint8Array.prototype.copyWithin === "function") {
  3096.                     this.copyWithin(targetStart, start, end)
  3097.                 } else if (this === target && start < targetStart && targetStart < end) {
  3098.                     for (var i = len - 1; i >= 0; --i) {
  3099.                         target[i + targetStart] = this[i + start]
  3100.                     }
  3101.                 } else {
  3102.                     Uint8Array.prototype.set.call(target, this.subarray(start, end), targetStart)
  3103.                 }
  3104.                 return len
  3105.             };
  3106.             Buffer.prototype.fill = function fill(val, start, end, encoding) {
  3107.                 if (typeof val === "string") {
  3108.                     if (typeof start === "string") {
  3109.                         encoding = start;
  3110.                         start = 0;
  3111.                         end = this.length
  3112.                     } else if (typeof end === "string") {
  3113.                         encoding = end;
  3114.                         end = this.length
  3115.                     }
  3116.                     if (encoding !== undefined && typeof encoding !== "string") {
  3117.                         throw new TypeError("encoding must be a string")
  3118.                     }
  3119.                     if (typeof encoding === "string" && !Buffer.isEncoding(encoding)) {
  3120.                         throw new TypeError("Unknown encoding: " + encoding)
  3121.                     }
  3122.                     if (val.length === 1) {
  3123.                         var code = val.charCodeAt(0);
  3124.                         if (encoding === "utf8" && code < 128 || encoding === "latin1") {
  3125.                             val = code
  3126.                         }
  3127.                     }
  3128.                 } else if (typeof val === "number") {
  3129.                     val = val & 255
  3130.                 }
  3131.                 if (start < 0 || this.length < start || this.length < end) {
  3132.                     throw new RangeError("Out of range index")
  3133.                 }
  3134.                 if (end <= start) {
  3135.                     return this
  3136.                 }
  3137.                 start = start >>> 0;
  3138.                 end = end === undefined ? this.length : end >>> 0;
  3139.                 if (!val) val = 0;
  3140.                 var i;
  3141.                 if (typeof val === "number") {
  3142.                     for (i = start; i < end; ++i) {
  3143.                         this[i] = val
  3144.                     }
  3145.                 } else {
  3146.                     var bytes = Buffer.isBuffer(val) ? val : new Buffer(val, encoding);
  3147.                     var len = bytes.length;
  3148.                     if (len === 0) {
  3149.                         throw new TypeError('The value "' + val + '" is invalid for argument "value"')
  3150.                     }
  3151.                     for (i = 0; i < end - start; ++i) {
  3152.                         this[i + start] = bytes[i % len]
  3153.                     }
  3154.                 }
  3155.                 return this
  3156.             };
  3157.             var INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g;
  3158.  
  3159.             function base64clean(str) {
  3160.                 str = str.split("=")[0];
  3161.                 str = str.trim().replace(INVALID_BASE64_RE, "");
  3162.                 if (str.length < 2) return "";
  3163.                 while (str.length % 4 !== 0) {
  3164.                     str = str + "="
  3165.                 }
  3166.                 return str
  3167.             }
  3168.  
  3169.             function toHex(n) {
  3170.                 if (n < 16) return "0" + n.toString(16);
  3171.                 return n.toString(16)
  3172.             }
  3173.  
  3174.             function utf8ToBytes(string, units) {
  3175.                 units = units || Infinity;
  3176.                 var codePoint;
  3177.                 var length = string.length;
  3178.                 var leadSurrogate = null;
  3179.                 var bytes = [];
  3180.                 for (var i = 0; i < length; ++i) {
  3181.                     codePoint = string.charCodeAt(i);
  3182.                     if (codePoint > 55295 && codePoint < 57344) {
  3183.                         if (!leadSurrogate) {
  3184.                             if (codePoint > 56319) {
  3185.                                 if ((units -= 3) > -1) bytes.push(239, 191, 189);
  3186.                                 continue
  3187.                             } else if (i + 1 === length) {
  3188.                                 if ((units -= 3) > -1) bytes.push(239, 191, 189);
  3189.                                 continue
  3190.                             }
  3191.                             leadSurrogate = codePoint;
  3192.                             continue
  3193.                         }
  3194.                         if (codePoint < 56320) {
  3195.                             if ((units -= 3) > -1) bytes.push(239, 191, 189);
  3196.                             leadSurrogate = codePoint;
  3197.                             continue
  3198.                         }
  3199.                         codePoint = (leadSurrogate - 55296 << 10 | codePoint - 56320) + 65536
  3200.                     } else if (leadSurrogate) {
  3201.                         if ((units -= 3) > -1) bytes.push(239, 191, 189)
  3202.                     }
  3203.                     leadSurrogate = null;
  3204.                     if (codePoint < 128) {
  3205.                         if ((units -= 1) < 0) break;
  3206.                         bytes.push(codePoint)
  3207.                     } else if (codePoint < 2048) {
  3208.                         if ((units -= 2) < 0) break;
  3209.                         bytes.push(codePoint >> 6 | 192, codePoint & 63 | 128)
  3210.                     } else if (codePoint < 65536) {
  3211.                         if ((units -= 3) < 0) break;
  3212.                         bytes.push(codePoint >> 12 | 224, codePoint >> 6 & 63 | 128, codePoint & 63 | 128)
  3213.                     } else if (codePoint < 1114112) {
  3214.                         if ((units -= 4) < 0) break;
  3215.                         bytes.push(codePoint >> 18 | 240, codePoint >> 12 & 63 | 128, codePoint >> 6 & 63 | 128, codePoint & 63 | 128)
  3216.                     } else {
  3217.                         throw new Error("Invalid code point")
  3218.                     }
  3219.                 }
  3220.                 return bytes
  3221.             }
  3222.  
  3223.             function asciiToBytes(str) {
  3224.                 var byteArray = [];
  3225.                 for (var i = 0; i < str.length; ++i) {
  3226.                     byteArray.push(str.charCodeAt(i) & 255)
  3227.                 }
  3228.                 return byteArray
  3229.             }
  3230.  
  3231.             function utf16leToBytes(str, units) {
  3232.                 var c, hi, lo;
  3233.                 var byteArray = [];
  3234.                 for (var i = 0; i < str.length; ++i) {
  3235.                     if ((units -= 2) < 0) break;
  3236.                     c = str.charCodeAt(i);
  3237.                     hi = c >> 8;
  3238.                     lo = c % 256;
  3239.                     byteArray.push(lo);
  3240.                     byteArray.push(hi)
  3241.                 }
  3242.                 return byteArray
  3243.             }
  3244.  
  3245.             function base64ToBytes(str) {
  3246.                 return base64.toByteArray(base64clean(str))
  3247.             }
  3248.  
  3249.             function blitBuffer(src, dst, offset, length) {
  3250.                 for (var i = 0; i < length; ++i) {
  3251.                     if (i + offset >= dst.length || i >= src.length) break;
  3252.                     dst[i + offset] = src[i]
  3253.                 }
  3254.                 return i
  3255.             }
  3256.  
  3257.             function isArrayBuffer(obj) {
  3258.                 return obj instanceof ArrayBuffer || obj != null && obj.constructor != null && obj.constructor.name === "ArrayBuffer" && typeof obj.byteLength === "number"
  3259.             }
  3260.  
  3261.             function numberIsNaN(obj) {
  3262.                 return obj !== obj
  3263.             }
  3264.         }, {
  3265.             "base64-js": 9,
  3266.             ieee754: 17
  3267.         }],
  3268.         14: [function(require, module, exports) {
  3269.             (function(Buffer) {
  3270.                 function isArray(arg) {
  3271.                     if (Array.isArray) {
  3272.                         return Array.isArray(arg)
  3273.                     }
  3274.                     return objectToString(arg) === "[object Array]"
  3275.                 }
  3276.                 exports.isArray = isArray;
  3277.  
  3278.                 function isBoolean(arg) {
  3279.                     return typeof arg === "boolean"
  3280.                 }
  3281.                 exports.isBoolean = isBoolean;
  3282.  
  3283.                 function isNull(arg) {
  3284.                     return arg === null
  3285.                 }
  3286.                 exports.isNull = isNull;
  3287.  
  3288.                 function isNullOrUndefined(arg) {
  3289.                     return arg == null
  3290.                 }
  3291.                 exports.isNullOrUndefined = isNullOrUndefined;
  3292.  
  3293.                 function isNumber(arg) {
  3294.                     return typeof arg === "number"
  3295.                 }
  3296.                 exports.isNumber = isNumber;
  3297.  
  3298.                 function isString(arg) {
  3299.                     return typeof arg === "string"
  3300.                 }
  3301.                 exports.isString = isString;
  3302.  
  3303.                 function isSymbol(arg) {
  3304.                     return typeof arg === "symbol"
  3305.                 }
  3306.                 exports.isSymbol = isSymbol;
  3307.  
  3308.                 function isUndefined(arg) {
  3309.                     return arg === void 0
  3310.                 }
  3311.                 exports.isUndefined = isUndefined;
  3312.  
  3313.                 function isRegExp(re) {
  3314.                     return objectToString(re) === "[object RegExp]"
  3315.                 }
  3316.                 exports.isRegExp = isRegExp;
  3317.  
  3318.                 function isObject(arg) {
  3319.                     return typeof arg === "object" && arg !== null
  3320.                 }
  3321.                 exports.isObject = isObject;
  3322.  
  3323.                 function isDate(d) {
  3324.                     return objectToString(d) === "[object Date]"
  3325.                 }
  3326.                 exports.isDate = isDate;
  3327.  
  3328.                 function isError(e) {
  3329.                     return objectToString(e) === "[object Error]" || e instanceof Error
  3330.                 }
  3331.                 exports.isError = isError;
  3332.  
  3333.                 function isFunction(arg) {
  3334.                     return typeof arg === "function"
  3335.                 }
  3336.                 exports.isFunction = isFunction;
  3337.  
  3338.                 function isPrimitive(arg) {
  3339.                     return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined"
  3340.                 }
  3341.                 exports.isPrimitive = isPrimitive;
  3342.                 exports.isBuffer = Buffer.isBuffer;
  3343.  
  3344.                 function objectToString(o) {
  3345.                     return Object.prototype.toString.call(o)
  3346.                 }
  3347.             }).call(this, {
  3348.                 isBuffer: require("../../is-buffer/index.js")
  3349.             })
  3350.         }, {
  3351.             "../../is-buffer/index.js": 19
  3352.         }],
  3353.         15: [function(require, module, exports) {
  3354.             (function(process, Buffer) {
  3355.                 var stream = require("readable-stream");
  3356.                 var eos = require("end-of-stream");
  3357.                 var inherits = require("inherits");
  3358.                 var shift = require("stream-shift");
  3359.                 var SIGNAL_FLUSH = new Buffer([0]);
  3360.                 var onuncork = function(self, fn) {
  3361.                     if (self._corked) self.once("uncork", fn);
  3362.                     else fn()
  3363.                 };
  3364.                 var destroyer = function(self, end) {
  3365.                     return function(err) {
  3366.                         if (err) self.destroy(err.message === "premature close" ? null : err);
  3367.                         else if (end && !self._ended) self.end()
  3368.                     }
  3369.                 };
  3370.                 var end = function(ws, fn) {
  3371.                     if (!ws) return fn();
  3372.                     if (ws._writableState && ws._writableState.finished) return fn();
  3373.                     if (ws._writableState) return ws.end(fn);
  3374.                     ws.end();
  3375.                     fn()
  3376.                 };
  3377.                 var toStreams2 = function(rs) {
  3378.                     return new stream.Readable({
  3379.                         objectMode: true,
  3380.                         highWaterMark: 16
  3381.                     }).wrap(rs)
  3382.                 };
  3383.                 var Duplexify = function(writable, readable, opts) {
  3384.                     if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts);
  3385.                     stream.Duplex.call(this, opts);
  3386.                     this._writable = null;
  3387.                     this._readable = null;
  3388.                     this._readable2 = null;
  3389.                     this._forwardDestroy = !opts || opts.destroy !== false;
  3390.                     this._forwardEnd = !opts || opts.end !== false;
  3391.                     this._corked = 1;
  3392.                     this._ondrain = null;
  3393.                     this._drained = false;
  3394.                     this._forwarding = false;
  3395.                     this._unwrite = null;
  3396.                     this._unread = null;
  3397.                     this._ended = false;
  3398.                     this.destroyed = false;
  3399.                     if (writable) this.setWritable(writable);
  3400.                     if (readable) this.setReadable(readable)
  3401.                 };
  3402.                 inherits(Duplexify, stream.Duplex);
  3403.                 Duplexify.obj = function(writable, readable, opts) {
  3404.                     if (!opts) opts = {};
  3405.                     opts.objectMode = true;
  3406.                     opts.highWaterMark = 16;
  3407.                     return new Duplexify(writable, readable, opts)
  3408.                 };
  3409.                 Duplexify.prototype.cork = function() {
  3410.                     if (++this._corked === 1) this.emit("cork")
  3411.                 };
  3412.                 Duplexify.prototype.uncork = function() {
  3413.                     if (this._corked && --this._corked === 0) this.emit("uncork")
  3414.                 };
  3415.                 Duplexify.prototype.setWritable = function(writable) {
  3416.                     if (this._unwrite) this._unwrite();
  3417.                     if (this.destroyed) {
  3418.                         if (writable && writable.destroy) writable.destroy();
  3419.                         return
  3420.                     }
  3421.                     if (writable === null || writable === false) {
  3422.                         this.end();
  3423.                         return
  3424.                     }
  3425.                     var self = this;
  3426.                     var unend = eos(writable, {
  3427.                         writable: true,
  3428.                         readable: false
  3429.                     }, destroyer(this, this._forwardEnd));
  3430.                     var ondrain = function() {
  3431.                         var ondrain = self._ondrain;
  3432.                         self._ondrain = null;
  3433.                         if (ondrain) ondrain()
  3434.                     };
  3435.                     var clear = function() {
  3436.                         self._writable.removeListener("drain", ondrain);
  3437.                         unend()
  3438.                     };
  3439.                     if (this._unwrite) process.nextTick(ondrain);
  3440.                     this._writable = writable;
  3441.                     this._writable.on("drain", ondrain);
  3442.                     this._unwrite = clear;
  3443.                     this.uncork()
  3444.                 };
  3445.                 Duplexify.prototype.setReadable = function(readable) {
  3446.                     if (this._unread) this._unread();
  3447.                     if (this.destroyed) {
  3448.                         if (readable && readable.destroy) readable.destroy();
  3449.                         return
  3450.                     }
  3451.                     if (readable === null || readable === false) {
  3452.                         this.push(null);
  3453.                         this.resume();
  3454.                         return
  3455.                     }
  3456.                     var self = this;
  3457.                     var unend = eos(readable, {
  3458.                         writable: false,
  3459.                         readable: true
  3460.                     }, destroyer(this));
  3461.                     var onreadable = function() {
  3462.                         self._forward()
  3463.                     };
  3464.                     var onend = function() {
  3465.                         self.push(null)
  3466.                     };
  3467.                     var clear = function() {
  3468.                         self._readable2.removeListener("readable", onreadable);
  3469.                         self._readable2.removeListener("end", onend);
  3470.                         unend()
  3471.                     };
  3472.                     this._drained = true;
  3473.                     this._readable = readable;
  3474.                     this._readable2 = readable._readableState ? readable : toStreams2(readable);
  3475.                     this._readable2.on("readable", onreadable);
  3476.                     this._readable2.on("end", onend);
  3477.                     this._unread = clear;
  3478.                     this._forward()
  3479.                 };
  3480.                 Duplexify.prototype._read = function() {
  3481.                     this._drained = true;
  3482.                     this._forward()
  3483.                 };
  3484.                 Duplexify.prototype._forward = function() {
  3485.                     if (this._forwarding || !this._readable2 || !this._drained) return;
  3486.                     this._forwarding = true;
  3487.                     var data;
  3488.                     while (this._drained && (data = shift(this._readable2)) !== null) {
  3489.                         if (this.destroyed) continue;
  3490.                         this._drained = this.push(data)
  3491.                     }
  3492.                     this._forwarding = false
  3493.                 };
  3494.                 Duplexify.prototype.destroy = function(err) {
  3495.                     if (this.destroyed) return;
  3496.                     this.destroyed = true;
  3497.                     var self = this;
  3498.                     process.nextTick(function() {
  3499.                         self._destroy(err)
  3500.                     })
  3501.                 };
  3502.                 Duplexify.prototype._destroy = function(err) {
  3503.                     if (err) {
  3504.                         var ondrain = this._ondrain;
  3505.                         this._ondrain = null;
  3506.                         if (ondrain) ondrain(err);
  3507.                         else this.emit("error", err)
  3508.                     }
  3509.                     if (this._forwardDestroy) {
  3510.                         if (this._readable && this._readable.destroy) this._readable.destroy();
  3511.                         if (this._writable && this._writable.destroy) this._writable.destroy()
  3512.                     }
  3513.                     this.emit("close")
  3514.                 };
  3515.                 Duplexify.prototype._write = function(data, enc, cb) {
  3516.                     if (this.destroyed) return cb();
  3517.                     if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb));
  3518.                     if (data === SIGNAL_FLUSH) return this._finish(cb);
  3519.                     if (!this._writable) return cb();
  3520.                     if (this._writable.write(data) === false) this._ondrain = cb;
  3521.                     else cb()
  3522.                 };
  3523.                 Duplexify.prototype._finish = function(cb) {
  3524.                     var self = this;
  3525.                     this.emit("preend");
  3526.                     onuncork(this, function() {
  3527.                         end(self._forwardEnd && self._writable, function() {
  3528.                             if (self._writableState.prefinished === false) self._writableState.prefinished = true;
  3529.                             self.emit("prefinish");
  3530.                             onuncork(self, cb)
  3531.                         })
  3532.                     })
  3533.                 };
  3534.                 Duplexify.prototype.end = function(data, enc, cb) {
  3535.                     if (typeof data === "function") return this.end(null, null, data);
  3536.                     if (typeof enc === "function") return this.end(data, null, enc);
  3537.                     this._ended = true;
  3538.                     if (data) this.write(data);
  3539.                     if (!this._writableState.ending) this.write(SIGNAL_FLUSH);
  3540.                     return stream.Writable.prototype.end.call(this, cb)
  3541.                 };
  3542.                 module.exports = Duplexify
  3543.             }).call(this, require("_process"), require("buffer").Buffer)
  3544.         }, {
  3545.             _process: 30,
  3546.             buffer: 13,
  3547.             "end-of-stream": 16,
  3548.             inherits: 18,
  3549.             "readable-stream": 45,
  3550.             "stream-shift": 48
  3551.         }],
  3552.         16: [function(require, module, exports) {
  3553.             var once = require("once");
  3554.             var noop = function() {};
  3555.             var isRequest = function(stream) {
  3556.                 return stream.setHeader && typeof stream.abort === "function"
  3557.             };
  3558.             var isChildProcess = function(stream) {
  3559.                 return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  3560.             };
  3561.             var eos = function(stream, opts, callback) {
  3562.                 if (typeof opts === "function") return eos(stream, null, opts);
  3563.                 if (!opts) opts = {};
  3564.                 callback = once(callback || noop);
  3565.                 var ws = stream._writableState;
  3566.                 var rs = stream._readableState;
  3567.                 var readable = opts.readable || opts.readable !== false && stream.readable;
  3568.                 var writable = opts.writable || opts.writable !== false && stream.writable;
  3569.                 var onlegacyfinish = function() {
  3570.                     if (!stream.writable) onfinish()
  3571.                 };
  3572.                 var onfinish = function() {
  3573.                     writable = false;
  3574.                     if (!readable) callback.call(stream)
  3575.                 };
  3576.                 var onend = function() {
  3577.                     readable = false;
  3578.                     if (!writable) callback.call(stream)
  3579.                 };
  3580.                 var onexit = function(exitCode) {
  3581.                     callback.call(stream, exitCode ? new Error("exited with error code: " + exitCode) : null)
  3582.                 };
  3583.                 var onerror = function(err) {
  3584.                     callback.call(stream, err)
  3585.                 };
  3586.                 var onclose = function() {
  3587.                     if (readable && !(rs && rs.ended)) return callback.call(stream, new Error("premature close"));
  3588.                     if (writable && !(ws && ws.ended)) return callback.call(stream, new Error("premature close"))
  3589.                 };
  3590.                 var onrequest = function() {
  3591.                     stream.req.on("finish", onfinish)
  3592.                 };
  3593.                 if (isRequest(stream)) {
  3594.                     stream.on("complete", onfinish);
  3595.                     stream.on("abort", onclose);
  3596.                     if (stream.req) onrequest();
  3597.                     else stream.on("request", onrequest)
  3598.                 } else if (writable && !ws) {
  3599.                     stream.on("end", onlegacyfinish);
  3600.                     stream.on("close", onlegacyfinish)
  3601.                 }
  3602.                 if (isChildProcess(stream)) stream.on("exit", onexit);
  3603.                 stream.on("end", onend);
  3604.                 stream.on("finish", onfinish);
  3605.                 if (opts.error !== false) stream.on("error", onerror);
  3606.                 stream.on("close", onclose);
  3607.                 return function() {
  3608.                     stream.removeListener("complete", onfinish);
  3609.                     stream.removeListener("abort", onclose);
  3610.                     stream.removeListener("request", onrequest);
  3611.                     if (stream.req) stream.req.removeListener("finish", onfinish);
  3612.                     stream.removeListener("end", onlegacyfinish);
  3613.                     stream.removeListener("close", onlegacyfinish);
  3614.                     stream.removeListener("finish", onfinish);
  3615.                     stream.removeListener("exit", onexit);
  3616.                     stream.removeListener("end", onend);
  3617.                     stream.removeListener("error", onerror);
  3618.                     stream.removeListener("close", onclose)
  3619.                 }
  3620.             };
  3621.             module.exports = eos
  3622.         }, {
  3623.             once: 29
  3624.         }],
  3625.         17: [function(require, module, exports) {
  3626.             exports.read = function(buffer, offset, isLE, mLen, nBytes) {
  3627.                 var e, m;
  3628.                 var eLen = nBytes * 8 - mLen - 1;
  3629.                 var eMax = (1 << eLen) - 1;
  3630.                 var eBias = eMax >> 1;
  3631.                 var nBits = -7;
  3632.                 var i = isLE ? nBytes - 1 : 0;
  3633.                 var d = isLE ? -1 : 1;
  3634.                 var s = buffer[offset + i];
  3635.                 i += d;
  3636.                 e = s & (1 << -nBits) - 1;
  3637.                 s >>= -nBits;
  3638.                 nBits += eLen;
  3639.                 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  3640.                 m = e & (1 << -nBits) - 1;
  3641.                 e >>= -nBits;
  3642.                 nBits += mLen;
  3643.                 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {}
  3644.                 if (e === 0) {
  3645.                     e = 1 - eBias
  3646.                 } else if (e === eMax) {
  3647.                     return m ? NaN : (s ? -1 : 1) * Infinity
  3648.                 } else {
  3649.                     m = m + Math.pow(2, mLen);
  3650.                     e = e - eBias
  3651.                 }
  3652.                 return (s ? -1 : 1) * m * Math.pow(2, e - mLen)
  3653.             };
  3654.             exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
  3655.                 var e, m, c;
  3656.                 var eLen = nBytes * 8 - mLen - 1;
  3657.                 var eMax = (1 << eLen) - 1;
  3658.                 var eBias = eMax >> 1;
  3659.                 var rt = mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0;
  3660.                 var i = isLE ? 0 : nBytes - 1;
  3661.                 var d = isLE ? 1 : -1;
  3662.                 var s = value < 0 || value === 0 && 1 / value < 0 ? 1 : 0;
  3663.                 value = Math.abs(value);
  3664.                 if (isNaN(value) || value === Infinity) {
  3665.                     m = isNaN(value) ? 1 : 0;
  3666.                     e = eMax
  3667.                 } else {
  3668.                     e = Math.floor(Math.log(value) / Math.LN2);
  3669.                     if (value * (c = Math.pow(2, -e)) < 1) {
  3670.                         e--;
  3671.                         c *= 2
  3672.                     }
  3673.                     if (e + eBias >= 1) {
  3674.                         value += rt / c
  3675.                     } else {
  3676.                         value += rt * Math.pow(2, 1 - eBias)
  3677.                     }
  3678.                     if (value * c >= 2) {
  3679.                         e++;
  3680.                         c /= 2
  3681.                     }
  3682.                     if (e + eBias >= eMax) {
  3683.                         m = 0;
  3684.                         e = eMax
  3685.                     } else if (e + eBias >= 1) {
  3686.                         m = (value * c - 1) * Math.pow(2, mLen);
  3687.                         e = e + eBias
  3688.                     } else {
  3689.                         m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
  3690.                         e = 0
  3691.                     }
  3692.                 }
  3693.                 for (; mLen >= 8; buffer[offset + i] = m & 255, i += d, m /= 256, mLen -= 8) {}
  3694.                 e = e << mLen | m;
  3695.                 eLen += mLen;
  3696.                 for (; eLen > 0; buffer[offset + i] = e & 255, i += d, e /= 256, eLen -= 8) {}
  3697.                 buffer[offset + i - d] |= s * 128
  3698.             }
  3699.         }, {}],
  3700.         18: [function(require, module, exports) {
  3701.             if (typeof Object.create === "function") {
  3702.                 module.exports = function inherits(ctor, superCtor) {
  3703.                     ctor.super_ = superCtor;
  3704.                     ctor.prototype = Object.create(superCtor.prototype, {
  3705.                         constructor: {
  3706.                             value: ctor,
  3707.                             enumerable: false,
  3708.                             writable: true,
  3709.                             configurable: true
  3710.                         }
  3711.                     })
  3712.                 }
  3713.             } else {
  3714.                 module.exports = function inherits(ctor, superCtor) {
  3715.                     ctor.super_ = superCtor;
  3716.                     var TempCtor = function() {};
  3717.                     TempCtor.prototype = superCtor.prototype;
  3718.                     ctor.prototype = new TempCtor;
  3719.                     ctor.prototype.constructor = ctor
  3720.                 }
  3721.             }
  3722.         }, {}],
  3723.         19: [function(require, module, exports) {
  3724.             module.exports = function(obj) {
  3725.                 return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)
  3726.             };
  3727.  
  3728.             function isBuffer(obj) {
  3729.                 return !!obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj)
  3730.             }
  3731.  
  3732.             function isSlowBuffer(obj) {
  3733.                 return typeof obj.readFloatLE === "function" && typeof obj.slice === "function" && isBuffer(obj.slice(0, 0))
  3734.             }
  3735.         }, {}],
  3736.         20: [function(require, module, exports) {
  3737.             var toString = {}.toString;
  3738.             module.exports = Array.isArray || function(arr) {
  3739.                 return toString.call(arr) == "[object Array]"
  3740.             }
  3741.         }, {}],
  3742.         21: [function(require, module, exports) {
  3743.             "use strict";
  3744.             var Buffer = require("safe-buffer").Buffer;
  3745.             var protocol = module.exports;
  3746.             protocol.types = {
  3747.                 0: "reserved",
  3748.                 1: "connect",
  3749.                 2: "connack",
  3750.                 3: "publish",
  3751.                 4: "puback",
  3752.                 5: "pubrec",
  3753.                 6: "pubrel",
  3754.                 7: "pubcomp",
  3755.                 8: "subscribe",
  3756.                 9: "suback",
  3757.                 10: "unsubscribe",
  3758.                 11: "unsuback",
  3759.                 12: "pingreq",
  3760.                 13: "pingresp",
  3761.                 14: "disconnect",
  3762.                 15: "reserved"
  3763.             };
  3764.             protocol.codes = {};
  3765.             for (var k in protocol.types) {
  3766.                 var v = protocol.types[k];
  3767.                 protocol.codes[v] = k
  3768.             }
  3769.             protocol.CMD_SHIFT = 4;
  3770.             protocol.CMD_MASK = 240;
  3771.             protocol.DUP_MASK = 8;
  3772.             protocol.QOS_MASK = 3;
  3773.             protocol.QOS_SHIFT = 1;
  3774.             protocol.RETAIN_MASK = 1;
  3775.             protocol.LENGTH_MASK = 127;
  3776.             protocol.LENGTH_FIN_MASK = 128;
  3777.             protocol.SESSIONPRESENT_MASK = 1;
  3778.             protocol.SESSIONPRESENT_HEADER = Buffer.from([protocol.SESSIONPRESENT_MASK]);
  3779.             protocol.CONNACK_HEADER = Buffer.from([protocol.codes["connack"] << protocol.CMD_SHIFT]);
  3780.             protocol.USERNAME_MASK = 128;
  3781.             protocol.PASSWORD_MASK = 64;
  3782.             protocol.WILL_RETAIN_MASK = 32;
  3783.             protocol.WILL_QOS_MASK = 24;
  3784.             protocol.WILL_QOS_SHIFT = 3;
  3785.             protocol.WILL_FLAG_MASK = 4;
  3786.             protocol.CLEAN_SESSION_MASK = 2;
  3787.             protocol.CONNECT_HEADER = Buffer.from([protocol.codes["connect"] << protocol.CMD_SHIFT]);
  3788.  
  3789.             function genHeader(type) {
  3790.                 return [0, 1, 2].map(function(qos) {
  3791.                     return [0, 1].map(function(dup) {
  3792.                         return [0, 1].map(function(retain) {
  3793.                             var buf = new Buffer(1);
  3794.                             buf.writeUInt8(protocol.codes[type] << protocol.CMD_SHIFT | (dup ? protocol.DUP_MASK : 0) | qos << protocol.QOS_SHIFT | retain, 0, true);
  3795.                             return buf
  3796.                         })
  3797.                     })
  3798.                 })
  3799.             }
  3800.             protocol.PUBLISH_HEADER = genHeader("publish");
  3801.             protocol.SUBSCRIBE_HEADER = genHeader("subscribe");
  3802.             protocol.UNSUBSCRIBE_HEADER = genHeader("unsubscribe");
  3803.             protocol.ACKS = {
  3804.                 unsuback: genHeader("unsuback"),
  3805.                 puback: genHeader("puback"),
  3806.                 pubcomp: genHeader("pubcomp"),
  3807.                 pubrel: genHeader("pubrel"),
  3808.                 pubrec: genHeader("pubrec")
  3809.             };
  3810.             protocol.SUBACK_HEADER = Buffer.from([protocol.codes["suback"] << protocol.CMD_SHIFT]);
  3811.             protocol.VERSION3 = Buffer.from([3]);
  3812.             protocol.VERSION4 = Buffer.from([4]);
  3813.             protocol.QOS = [0, 1, 2].map(function(qos) {
  3814.                 return Buffer.from([qos])
  3815.             });
  3816.             protocol.EMPTY = {
  3817.                 pingreq: Buffer.from([protocol.codes["pingreq"] << 4, 0]),
  3818.                 pingresp: Buffer.from([protocol.codes["pingresp"] << 4, 0]),
  3819.                 disconnect: Buffer.from([protocol.codes["disconnect"] << 4, 0])
  3820.             }
  3821.         }, {
  3822.             "safe-buffer": 47
  3823.         }],
  3824.         22: [function(require, module, exports) {
  3825.             "use strict";
  3826.             var Buffer = require("safe-buffer").Buffer;
  3827.             var writeToStream = require("./writeToStream");
  3828.             var EE = require("events").EventEmitter;
  3829.             var inherits = require("inherits");
  3830.  
  3831.             function generate(packet) {
  3832.                 var stream = new Accumulator;
  3833.                 writeToStream(packet, stream);
  3834.                 return stream.concat()
  3835.             }
  3836.  
  3837.             function Accumulator() {
  3838.                 this._array = new Array(20);
  3839.                 this._i = 0
  3840.             }
  3841.             inherits(Accumulator, EE);
  3842.             Accumulator.prototype.write = function(chunk) {
  3843.                 this._array[this._i++] = chunk;
  3844.                 return true
  3845.             };
  3846.             Accumulator.prototype.concat = function() {
  3847.                 var length = 0;
  3848.                 var lengths = new Array(this._array.length);
  3849.                 var list = this._array;
  3850.                 var pos = 0;
  3851.                 var i;
  3852.                 var result;
  3853.                 for (i = 0; i < list.length && list[i] !== undefined; i++) {
  3854.                     if (typeof list[i] !== "string") lengths[i] = list[i].length;
  3855.                     else lengths[i] = Buffer.byteLength(list[i]);
  3856.                     length += lengths[i]
  3857.                 }
  3858.                 result = Buffer.allocUnsafe(length);
  3859.                 for (i = 0; i < list.length && list[i] !== undefined; i++) {
  3860.                     if (typeof list[i] !== "string") {
  3861.                         list[i].copy(result, pos);
  3862.                         pos += lengths[i]
  3863.                     } else {
  3864.                         result.write(list[i], pos);
  3865.                         pos += lengths[i]
  3866.                     }
  3867.                 }
  3868.                 return result
  3869.             };
  3870.             module.exports = generate
  3871.         }, {
  3872.             "./writeToStream": 28,
  3873.             events: 12,
  3874.             inherits: 18,
  3875.             "safe-buffer": 47
  3876.         }],
  3877.         23: [function(require, module, exports) {
  3878.             "use strict";
  3879.             exports.parser = require("./parser");
  3880.             exports.generate = require("./generate");
  3881.             exports.writeToStream = require("./writeToStream")
  3882.         }, {
  3883.             "./generate": 22,
  3884.             "./parser": 27,
  3885.             "./writeToStream": 28
  3886.         }],
  3887.         24: [function(require, module, exports) {
  3888.             (function(process) {
  3889.                 "use strict";
  3890.                 if (!process.version || process.version.indexOf("v0.") === 0 || process.version.indexOf("v1.") === 0 && process.version.indexOf("v1.8.") !== 0) {
  3891.                     module.exports = {
  3892.                         nextTick: nextTick
  3893.                     }
  3894.                 } else {
  3895.                     module.exports = process
  3896.                 }
  3897.  
  3898.                 function nextTick(fn, arg1, arg2, arg3) {
  3899.                     if (typeof fn !== "function") {
  3900.                         throw new TypeError('"callback" argument must be a function')
  3901.                     }
  3902.                     var len = arguments.length;
  3903.                     var args, i;
  3904.                     switch (len) {
  3905.                         case 0:
  3906.                         case 1:
  3907.                             return process.nextTick(fn);
  3908.                         case 2:
  3909.                             return process.nextTick(function afterTickOne() {
  3910.                                 fn.call(null, arg1)
  3911.                             });
  3912.                         case 3:
  3913.                             return process.nextTick(function afterTickTwo() {
  3914.                                 fn.call(null, arg1, arg2)
  3915.                             });
  3916.                         case 4:
  3917.                             return process.nextTick(function afterTickThree() {
  3918.                                 fn.call(null, arg1, arg2, arg3)
  3919.                             });
  3920.                         default:
  3921.                             args = new Array(len - 1);
  3922.                             i = 0;
  3923.                             while (i < args.length) {
  3924.                                 args[i++] = arguments[i]
  3925.                             }
  3926.                             return process.nextTick(function afterTick() {
  3927.                                 fn.apply(null, args)
  3928.                             })
  3929.                     }
  3930.                 }
  3931.             }).call(this, require("_process"))
  3932.         }, {
  3933.             _process: 30
  3934.         }],
  3935.         25: [function(require, module, exports) {
  3936.             "use strict";
  3937.             var Buffer = require("safe-buffer").Buffer;
  3938.             var max = 65536;
  3939.             var cache = {};
  3940.  
  3941.             function generateBuffer(i) {
  3942.                 var buffer = Buffer.allocUnsafe(2);
  3943.                 buffer.writeUInt8(i >> 8, 0, true);
  3944.                 buffer.writeUInt8(i & 255, 0 + 1, true);
  3945.                 return buffer
  3946.             }
  3947.  
  3948.             function generateCache() {
  3949.                 for (var i = 0; i < max; i++) {
  3950.                     cache[i] = generateBuffer(i)
  3951.                 }
  3952.             }
  3953.             module.exports = {
  3954.                 cache: cache,
  3955.                 generateCache: generateCache,
  3956.                 generateNumber: generateBuffer
  3957.             }
  3958.         }, {
  3959.             "safe-buffer": 47
  3960.         }],
  3961.         26: [function(require, module, exports) {
  3962.             function Packet() {
  3963.                 this.cmd = null;
  3964.                 this.retain = false;
  3965.                 this.qos = 0;
  3966.                 this.dup = false;
  3967.                 this.length = -1;
  3968.                 this.topic = null;
  3969.                 this.payload = null
  3970.             }
  3971.             module.exports = Packet
  3972.         }, {}],
  3973.         27: [function(require, module, exports) {
  3974.             "use strict";
  3975.             var bl = require("bl");
  3976.             var inherits = require("inherits");
  3977.             var EE = require("events").EventEmitter;
  3978.             var Packet = require("./packet");
  3979.             var constants = require("./constants");
  3980.  
  3981.             function Parser() {
  3982.                 if (!(this instanceof Parser)) return new Parser;
  3983.                 this._states = ["_parseHeader", "_parseLength", "_parsePayload", "_newPacket"];
  3984.                 this._resetState()
  3985.             }
  3986.             inherits(Parser, EE);
  3987.             Parser.prototype._resetState = function() {
  3988.                 this.packet = new Packet;
  3989.                 this.error = null;
  3990.                 this._list = bl();
  3991.                 this._stateCounter = 0
  3992.             };
  3993.             Parser.prototype.parse = function(buf) {
  3994.                 if (this.error) this._resetState();
  3995.                 this._list.append(buf);
  3996.                 while ((this.packet.length !== -1 || this._list.length > 0) && this[this._states[this._stateCounter]]() && !this.error) {
  3997.                     this._stateCounter++;
  3998.                     if (this._stateCounter >= this._states.length) this._stateCounter = 0
  3999.                 }
  4000.                 return this._list.length
  4001.             };
  4002.             Parser.prototype._parseHeader = function() {
  4003.                 var zero = this._list.readUInt8(0);
  4004.                 this.packet.cmd = constants.types[zero >> constants.CMD_SHIFT];
  4005.                 this.packet.retain = (zero & constants.RETAIN_MASK) !== 0;
  4006.                 this.packet.qos = zero >> constants.QOS_SHIFT & constants.QOS_MASK;
  4007.                 this.packet.dup = (zero & constants.DUP_MASK) !== 0;
  4008.                 this._list.consume(1);
  4009.                 return true
  4010.             };
  4011.             Parser.prototype._parseLength = function() {
  4012.                 var bytes = 0;
  4013.                 var mul = 1;
  4014.                 var length = 0;
  4015.                 var result = true;
  4016.                 var current;
  4017.                 while (bytes < 5) {
  4018.                     current = this._list.readUInt8(bytes++);
  4019.                     length += mul * (current & constants.LENGTH_MASK);
  4020.                     mul *= 128;
  4021.                     if ((current & constants.LENGTH_FIN_MASK) === 0) break;
  4022.                     if (this._list.length <= bytes) {
  4023.                         result = false;
  4024.                         break
  4025.                     }
  4026.                 }
  4027.                 if (result) {
  4028.                     this.packet.length = length;
  4029.                     this._list.consume(bytes)
  4030.                 }
  4031.                 return result
  4032.             };
  4033.             Parser.prototype._parsePayload = function() {
  4034.                 var result = false;
  4035.                 if (this.packet.length === 0 || this._list.length >= this.packet.length) {
  4036.                     this._pos = 0;
  4037.                     switch (this.packet.cmd) {
  4038.                         case "connect":
  4039.                             this._parseConnect();
  4040.                             break;
  4041.                         case "connack":
  4042.                             this._parseConnack();
  4043.                             break;
  4044.                         case "publish":
  4045.                             this._parsePublish();
  4046.                             break;
  4047.                         case "puback":
  4048.                         case "pubrec":
  4049.                         case "pubrel":
  4050.                         case "pubcomp":
  4051.                             this._parseMessageId();
  4052.                             break;
  4053.                         case "subscribe":
  4054.                             this._parseSubscribe();
  4055.                             break;
  4056.                         case "suback":
  4057.                             this._parseSuback();
  4058.                             break;
  4059.                         case "unsubscribe":
  4060.                             this._parseUnsubscribe();
  4061.                             break;
  4062.                         case "unsuback":
  4063.                             this._parseUnsuback();
  4064.                             break;
  4065.                         case "pingreq":
  4066.                         case "pingresp":
  4067.                         case "disconnect":
  4068.                             break;
  4069.                         default:
  4070.                             this._emitError(new Error("Not supported"))
  4071.                     }
  4072.                     result = true
  4073.                 }
  4074.                 return result
  4075.             };
  4076.             Parser.prototype._parseConnect = function() {
  4077.                 var protocolId;
  4078.                 var clientId;
  4079.                 var topic;
  4080.                 var payload;
  4081.                 var password;
  4082.                 var username;
  4083.                 var flags = {};
  4084.                 var packet = this.packet;
  4085.                 protocolId = this._parseString();
  4086.                 if (protocolId === null) return this._emitError(new Error("Cannot parse protocolId"));
  4087.                 if (protocolId !== "MQTT" && protocolId !== "MQIsdp") {
  4088.                     return this._emitError(new Error("Invalid protocolId"))
  4089.                 }
  4090.                 packet.protocolId = protocolId;
  4091.                 if (this._pos >= this._list.length) return this._emitError(new Error("Packet too short"));
  4092.                 packet.protocolVersion = this._list.readUInt8(this._pos);
  4093.                 if (packet.protocolVersion !== 3 && packet.protocolVersion !== 4) {
  4094.                     return this._emitError(new Error("Invalid protocol version"))
  4095.                 }
  4096.                 this._pos++;
  4097.                 if (this._pos >= this._list.length) {
  4098.                     return this._emitError(new Error("Packet too short"))
  4099.                 }
  4100.                 flags.username = this._list.readUInt8(this._pos) & constants.USERNAME_MASK;
  4101.                 flags.password = this._list.readUInt8(this._pos) & constants.PASSWORD_MASK;
  4102.                 flags.will = this._list.readUInt8(this._pos) & constants.WILL_FLAG_MASK;
  4103.                 if (flags.will) {
  4104.                     packet.will = {};
  4105.                     packet.will.retain = (this._list.readUInt8(this._pos) & constants.WILL_RETAIN_MASK) !== 0;
  4106.                     packet.will.qos = (this._list.readUInt8(this._pos) & constants.WILL_QOS_MASK) >> constants.WILL_QOS_SHIFT
  4107.                 }
  4108.                 packet.clean = (this._list.readUInt8(this._pos) & constants.CLEAN_SESSION_MASK) !== 0;
  4109.                 this._pos++;
  4110.                 packet.keepalive = this._parseNum();
  4111.                 if (packet.keepalive === -1) return this._emitError(new Error("Packet too short"));
  4112.                 clientId = this._parseString();
  4113.                 if (clientId === null) return this._emitError(new Error("Packet too short"));
  4114.                 packet.clientId = clientId;
  4115.                 if (flags.will) {
  4116.                     topic = this._parseString();
  4117.                     if (topic === null) return this._emitError(new Error("Cannot parse will topic"));
  4118.                     packet.will.topic = topic;
  4119.                     payload = this._parseBuffer();
  4120.                     if (payload === null) return this._emitError(new Error("Cannot parse will payload"));
  4121.                     packet.will.payload = payload
  4122.                 }
  4123.                 if (flags.username) {
  4124.                     username = this._parseString();
  4125.                     if (username === null) return this._emitError(new Error("Cannot parse username"));
  4126.                     packet.username = username
  4127.                 }
  4128.                 if (flags.password) {
  4129.                     password = this._parseBuffer();
  4130.                     if (password === null) return this._emitError(new Error("Cannot parse password"));
  4131.                     packet.password = password
  4132.                 }
  4133.                 return packet
  4134.             };
  4135.             Parser.prototype._parseConnack = function() {
  4136.                 var packet = this.packet;
  4137.                 if (this._list.length < 2) return null;
  4138.                 packet.sessionPresent = !!(this._list.readUInt8(this._pos++) & constants.SESSIONPRESENT_MASK);
  4139.                 packet.returnCode = this._list.readUInt8(this._pos);
  4140.                 if (packet.returnCode === -1) return this._emitError(new Error("Cannot parse return code"))
  4141.             };
  4142.             Parser.prototype._parsePublish = function() {
  4143.                 var packet = this.packet;
  4144.                 packet.topic = this._parseString();
  4145.                 if (packet.topic === null) return this._emitError(new Error("Cannot parse topic"));
  4146.                 if (packet.qos > 0)
  4147.                     if (!this._parseMessageId()) {
  4148.                         return
  4149.                     } packet.payload = this._list.slice(this._pos, packet.length)
  4150.             };
  4151.             Parser.prototype._parseSubscribe = function() {
  4152.                 var packet = this.packet;
  4153.                 var topic;
  4154.                 var qos;
  4155.                 if (packet.qos !== 1) {
  4156.                     return this._emitError(new Error("Wrong subscribe header"))
  4157.                 }
  4158.                 packet.subscriptions = [];
  4159.                 if (!this._parseMessageId()) {
  4160.                     return
  4161.                 }
  4162.                 while (this._pos < packet.length) {
  4163.                     topic = this._parseString();
  4164.                     if (topic === null) return this._emitError(new Error("Cannot parse topic"));
  4165.                     qos = this._list.readUInt8(this._pos++);
  4166.                     packet.subscriptions.push({
  4167.                         topic: topic,
  4168.                         qos: qos
  4169.                     })
  4170.                 }
  4171.             };
  4172.             Parser.prototype._parseSuback = function() {
  4173.                 this.packet.granted = [];
  4174.                 if (!this._parseMessageId()) {
  4175.                     return
  4176.                 }
  4177.                 while (this._pos < this.packet.length) {
  4178.                     this.packet.granted.push(this._list.readUInt8(this._pos++))
  4179.                 }
  4180.             };
  4181.             Parser.prototype._parseUnsubscribe = function() {
  4182.                 var packet = this.packet;
  4183.                 packet.unsubscriptions = [];
  4184.                 if (!this._parseMessageId()) {
  4185.                     return
  4186.                 }
  4187.                 while (this._pos < packet.length) {
  4188.                     var topic;
  4189.                     topic = this._parseString();
  4190.                     if (topic === null) return this._emitError(new Error("Cannot parse topic"));
  4191.                     packet.unsubscriptions.push(topic)
  4192.                 }
  4193.             };
  4194.             Parser.prototype._parseUnsuback = function() {
  4195.                 if (!this._parseMessageId()) return this._emitError(new Error("Cannot parse messageId"))
  4196.             };
  4197.             Parser.prototype._parseMessageId = function() {
  4198.                 var packet = this.packet;
  4199.                 packet.messageId = this._parseNum();
  4200.                 if (packet.messageId === null) {
  4201.                     this._emitError(new Error("Cannot parse messageId"));
  4202.                     return false
  4203.                 }
  4204.                 return true
  4205.             };
  4206.             Parser.prototype._parseString = function(maybeBuffer) {
  4207.                 var length = this._parseNum();
  4208.                 var result;
  4209.                 var end = length + this._pos;
  4210.                 if (length === -1 || end > this._list.length || end > this.packet.length) return null;
  4211.                 result = this._list.toString("utf8", this._pos, end);
  4212.                 this._pos += length;
  4213.                 return result
  4214.             };
  4215.             Parser.prototype._parseBuffer = function() {
  4216.                 var length = this._parseNum();
  4217.                 var result;
  4218.                 var end = length + this._pos;
  4219.                 if (length === -1 || end > this._list.length || end > this.packet.length) return null;
  4220.                 result = this._list.slice(this._pos, end);
  4221.                 this._pos += length;
  4222.                 return result
  4223.             };
  4224.             Parser.prototype._parseNum = function() {
  4225.                 if (this._list.length - this._pos < 2) return -1;
  4226.                 var result = this._list.readUInt16BE(this._pos);
  4227.                 this._pos += 2;
  4228.                 return result
  4229.             };
  4230.             Parser.prototype._newPacket = function() {
  4231.                 if (this.packet) {
  4232.                     this._list.consume(this.packet.length);
  4233.                     this.emit("packet", this.packet)
  4234.                 }
  4235.                 this.packet = new Packet;
  4236.                 return true
  4237.             };
  4238.             Parser.prototype._emitError = function(err) {
  4239.                 this.error = err;
  4240.                 this.emit("error", err)
  4241.             };
  4242.             module.exports = Parser
  4243.         }, {
  4244.             "./constants": 21,
  4245.             "./packet": 26,
  4246.             bl: 10,
  4247.             events: 12,
  4248.             inherits: 18
  4249.         }],
  4250.         28: [function(require, module, exports) {
  4251.             "use strict";
  4252.             var protocol = require("./constants");
  4253.             var Buffer = require("safe-buffer").Buffer;
  4254.             var empty = Buffer.allocUnsafe(0);
  4255.             var zeroBuf = Buffer.from([0]);
  4256.             var numbers = require("./numbers");
  4257.             var nextTick = require("process-nextick-args").nextTick;
  4258.             var numCache = numbers.cache;
  4259.             var generateNumber = numbers.generateNumber;
  4260.             var generateCache = numbers.generateCache;
  4261.             var writeNumber = writeNumberCached;
  4262.             var toGenerate = true;
  4263.  
  4264.             function generate(packet, stream) {
  4265.                 if (stream.cork) {
  4266.                     stream.cork();
  4267.                     nextTick(uncork, stream)
  4268.                 }
  4269.                 if (toGenerate) {
  4270.                     toGenerate = false;
  4271.                     generateCache()
  4272.                 }
  4273.                 switch (packet.cmd) {
  4274.                     case "connect":
  4275.                         return connect(packet, stream);
  4276.                     case "connack":
  4277.                         return connack(packet, stream);
  4278.                     case "publish":
  4279.                         return publish(packet, stream);
  4280.                     case "puback":
  4281.                     case "pubrec":
  4282.                     case "pubrel":
  4283.                     case "pubcomp":
  4284.                     case "unsuback":
  4285.                         return confirmation(packet, stream);
  4286.                     case "subscribe":
  4287.                         return subscribe(packet, stream);
  4288.                     case "suback":
  4289.                         return suback(packet, stream);
  4290.                     case "unsubscribe":
  4291.                         return unsubscribe(packet, stream);
  4292.                     case "pingreq":
  4293.                     case "pingresp":
  4294.                     case "disconnect":
  4295.                         return emptyPacket(packet, stream);
  4296.                     default:
  4297.                         stream.emit("error", new Error("Unknown command"));
  4298.                         return false
  4299.                 }
  4300.             }
  4301.             Object.defineProperty(generate, "cacheNumbers", {
  4302.                 get: function() {
  4303.                     return writeNumber === writeNumberCached
  4304.                 },
  4305.                 set: function(value) {
  4306.                     if (value) {
  4307.                         if (!numCache || Object.keys(numCache).length === 0) toGenerate = true;
  4308.                         writeNumber = writeNumberCached
  4309.                     } else {
  4310.                         toGenerate = false;
  4311.                         writeNumber = writeNumberGenerated
  4312.                     }
  4313.                 }
  4314.             });
  4315.  
  4316.             function uncork(stream) {
  4317.                 stream.uncork()
  4318.             }
  4319.  
  4320.             function connect(opts, stream) {
  4321.                 var settings = opts || {};
  4322.                 var protocolId = settings.protocolId || "MQTT";
  4323.                 var protocolVersion = settings.protocolVersion || 4;
  4324.                 var will = settings.will;
  4325.                 var clean = settings.clean;
  4326.                 var keepalive = settings.keepalive || 0;
  4327.                 var clientId = settings.clientId || "";
  4328.                 var username = settings.username;
  4329.                 var password = settings.password;
  4330.                 if (clean === undefined) clean = true;
  4331.                 var length = 0;
  4332.                 if (!protocolId || typeof protocolId !== "string" && !Buffer.isBuffer(protocolId)) {
  4333.                     stream.emit("error", new Error("Invalid protocolId"));
  4334.                     return false
  4335.                 } else length += protocolId.length + 2;
  4336.                 if (protocolVersion !== 3 && protocolVersion !== 4) {
  4337.                     stream.emit("error", new Error("Invalid protocol version"));
  4338.                     return false
  4339.                 } else length += 1;
  4340.                 if ((typeof clientId === "string" || Buffer.isBuffer(clientId)) && (clientId || protocolVersion === 4) && (clientId || clean)) {
  4341.                     length += clientId.length + 2
  4342.                 } else {
  4343.                     if (protocolVersion < 4) {
  4344.                         stream.emit("error", new Error("clientId must be supplied before 3.1.1"));
  4345.                         return false
  4346.                     }
  4347.                     if (clean * 1 === 0) {
  4348.                         stream.emit("error", new Error("clientId must be given if cleanSession set to 0"));
  4349.                         return false
  4350.                     }
  4351.                 }
  4352.                 if (typeof keepalive !== "number" || keepalive < 0 || keepalive > 65535 || keepalive % 1 !== 0) {
  4353.                     stream.emit("error", new Error("Invalid keepalive"));
  4354.                     return false
  4355.                 } else length += 2;
  4356.                 length += 1;
  4357.                 if (will) {
  4358.                     if (typeof will !== "object") {
  4359.                         stream.emit("error", new Error("Invalid will"));
  4360.                         return false
  4361.                     }
  4362.                     if (!will.topic || typeof will.topic !== "string") {
  4363.                         stream.emit("error", new Error("Invalid will topic"));
  4364.                         return false
  4365.                     } else {
  4366.                         length += Buffer.byteLength(will.topic) + 2
  4367.                     }
  4368.                     if (will.payload && will.payload) {
  4369.                         if (will.payload.length >= 0) {
  4370.                             if (typeof will.payload === "string") {
  4371.                                 length += Buffer.byteLength(will.payload) + 2
  4372.                             } else {
  4373.                                 length += will.payload.length + 2
  4374.                             }
  4375.                         } else {
  4376.                             stream.emit("error", new Error("Invalid will payload"));
  4377.                             return false
  4378.                         }
  4379.                     } else {
  4380.                         length += 2
  4381.                     }
  4382.                 }
  4383.                 var providedUsername = false;
  4384.                 if (username != null) {
  4385.                     if (isStringOrBuffer(username)) {
  4386.                         providedUsername = true;
  4387.                         length += Buffer.byteLength(username) + 2
  4388.                     } else {
  4389.                         stream.emit("error", new Error("Invalid username"));
  4390.                         return false
  4391.                     }
  4392.                 }
  4393.                 if (password != null) {
  4394.                     if (!providedUsername) {
  4395.                         stream.emit("error", new Error("Username is required to use password"));
  4396.                         return false
  4397.                     }
  4398.                     if (isStringOrBuffer(password)) {
  4399.                         length += byteLength(password) + 2
  4400.                     } else {
  4401.                         stream.emit("error", new Error("Invalid password"));
  4402.                         return false
  4403.                     }
  4404.                 }
  4405.                 stream.write(protocol.CONNECT_HEADER);
  4406.                 writeLength(stream, length);
  4407.                 writeStringOrBuffer(stream, protocolId);
  4408.                 stream.write(protocolVersion === 4 ? protocol.VERSION4 : protocol.VERSION3);
  4409.                 var flags = 0;
  4410.                 flags |= username != null ? protocol.USERNAME_MASK : 0;
  4411.                 flags |= password != null ? protocol.PASSWORD_MASK : 0;
  4412.                 flags |= will && will.retain ? protocol.WILL_RETAIN_MASK : 0;
  4413.                 flags |= will && will.qos ? will.qos << protocol.WILL_QOS_SHIFT : 0;
  4414.                 flags |= will ? protocol.WILL_FLAG_MASK : 0;
  4415.                 flags |= clean ? protocol.CLEAN_SESSION_MASK : 0;
  4416.                 stream.write(Buffer.from([flags]));
  4417.                 writeNumber(stream, keepalive);
  4418.                 writeStringOrBuffer(stream, clientId);
  4419.                 if (will) {
  4420.                     writeString(stream, will.topic);
  4421.                     writeStringOrBuffer(stream, will.payload)
  4422.                 }
  4423.                 if (username != null) {
  4424.                     writeStringOrBuffer(stream, username)
  4425.                 }
  4426.                 if (password != null) {
  4427.                     writeStringOrBuffer(stream, password)
  4428.                 }
  4429.                 return true
  4430.             }
  4431.  
  4432.             function connack(opts, stream) {
  4433.                 var settings = opts || {};
  4434.                 var rc = settings.returnCode;
  4435.                 if (typeof rc !== "number") {
  4436.                     stream.emit("error", new Error("Invalid return code"));
  4437.                     return false
  4438.                 }
  4439.                 stream.write(protocol.CONNACK_HEADER);
  4440.                 writeLength(stream, 2);
  4441.                 stream.write(opts.sessionPresent ? protocol.SESSIONPRESENT_HEADER : zeroBuf);
  4442.                 return stream.write(Buffer.from([rc]))
  4443.             }
  4444.  
  4445.             function publish(opts, stream) {
  4446.                 var settings = opts || {};
  4447.                 var qos = settings.qos || 0;
  4448.                 var retain = settings.retain ? protocol.RETAIN_MASK : 0;
  4449.                 var topic = settings.topic;
  4450.                 var payload = settings.payload || empty;
  4451.                 var id = settings.messageId;
  4452.                 var length = 0;
  4453.                 if (typeof topic === "string") length += Buffer.byteLength(topic) + 2;
  4454.                 else if (Buffer.isBuffer(topic)) length += topic.length + 2;
  4455.                 else {
  4456.                     stream.emit("error", new Error("Invalid topic"));
  4457.                     return false
  4458.                 }
  4459.                 if (!Buffer.isBuffer(payload)) length += Buffer.byteLength(payload);
  4460.                 else length += payload.length;
  4461.                 if (qos && typeof id !== "number") {
  4462.                     stream.emit("error", new Error("Invalid messageId"));
  4463.                     return false
  4464.                 } else if (qos) length += 2;
  4465.                 stream.write(protocol.PUBLISH_HEADER[qos][opts.dup ? 1 : 0][retain ? 1 : 0]);
  4466.                 writeLength(stream, length);
  4467.                 writeNumber(stream, byteLength(topic));
  4468.                 stream.write(topic);
  4469.                 if (qos > 0) writeNumber(stream, id);
  4470.                 return stream.write(payload)
  4471.             }
  4472.  
  4473.             function confirmation(opts, stream) {
  4474.                 var settings = opts || {};
  4475.                 var type = settings.cmd || "puback";
  4476.                 var id = settings.messageId;
  4477.                 var dup = settings.dup && type === "pubrel" ? protocol.DUP_MASK : 0;
  4478.                 var qos = 0;
  4479.                 if (type === "pubrel") qos = 1;
  4480.                 if (typeof id !== "number") {
  4481.                     stream.emit("error", new Error("Invalid messageId"));
  4482.                     return false
  4483.                 }
  4484.                 stream.write(protocol.ACKS[type][qos][dup][0]);
  4485.                 writeLength(stream, 2);
  4486.                 return writeNumber(stream, id)
  4487.             }
  4488.  
  4489.             function subscribe(opts, stream) {
  4490.                 var settings = opts || {};
  4491.                 var dup = settings.dup ? protocol.DUP_MASK : 0;
  4492.                 var id = settings.messageId;
  4493.                 var subs = settings.subscriptions;
  4494.                 var length = 0;
  4495.                 if (typeof id !== "number") {
  4496.                     stream.emit("error", new Error("Invalid messageId"));
  4497.                     return false
  4498.                 } else length += 2;
  4499.                 if (typeof subs === "object" && subs.length) {
  4500.                     for (var i = 0; i < subs.length; i += 1) {
  4501.                         var itopic = subs[i].topic;
  4502.                         var iqos = subs[i].qos;
  4503.                         if (typeof itopic !== "string") {
  4504.                             stream.emit("error", new Error("Invalid subscriptions - invalid topic"));
  4505.                             return false
  4506.                         }
  4507.                         if (typeof iqos !== "number") {
  4508.                             stream.emit("error", new Error("Invalid subscriptions - invalid qos"));
  4509.                             return false
  4510.                         }
  4511.                         length += Buffer.byteLength(itopic) + 2 + 1
  4512.                     }
  4513.                 } else {
  4514.                     stream.emit("error", new Error("Invalid subscriptions"));
  4515.                     return false
  4516.                 }
  4517.                 stream.write(protocol.SUBSCRIBE_HEADER[1][dup ? 1 : 0][0]);
  4518.                 writeLength(stream, length);
  4519.                 writeNumber(stream, id);
  4520.                 var result = true;
  4521.                 for (var j = 0; j < subs.length; j++) {
  4522.                     var sub = subs[j];
  4523.                     var jtopic = sub.topic;
  4524.                     var jqos = sub.qos;
  4525.                     writeString(stream, jtopic);
  4526.                     result = stream.write(protocol.QOS[jqos])
  4527.                 }
  4528.                 return result
  4529.             }
  4530.  
  4531.             function suback(opts, stream) {
  4532.                 var settings = opts || {};
  4533.                 var id = settings.messageId;
  4534.                 var granted = settings.granted;
  4535.                 var length = 0;
  4536.                 if (typeof id !== "number") {
  4537.                     stream.emit("error", new Error("Invalid messageId"));
  4538.                     return false
  4539.                 } else length += 2;
  4540.                 if (typeof granted === "object" && granted.length) {
  4541.                     for (var i = 0; i < granted.length; i += 1) {
  4542.                         if (typeof granted[i] !== "number") {
  4543.                             stream.emit("error", new Error("Invalid qos vector"));
  4544.                             return false
  4545.                         }
  4546.                         length += 1
  4547.                     }
  4548.                 } else {
  4549.                     stream.emit("error", new Error("Invalid qos vector"));
  4550.                     return false
  4551.                 }
  4552.                 stream.write(protocol.SUBACK_HEADER);
  4553.                 writeLength(stream, length);
  4554.                 writeNumber(stream, id);
  4555.                 return stream.write(Buffer.from(granted))
  4556.             }
  4557.  
  4558.             function unsubscribe(opts, stream) {
  4559.                 var settings = opts || {};
  4560.                 var id = settings.messageId;
  4561.                 var dup = settings.dup ? protocol.DUP_MASK : 0;
  4562.                 var unsubs = settings.unsubscriptions;
  4563.                 var length = 0;
  4564.                 if (typeof id !== "number") {
  4565.                     stream.emit("error", new Error("Invalid messageId"));
  4566.                     return false
  4567.                 } else {
  4568.                     length += 2
  4569.                 }
  4570.                 if (typeof unsubs === "object" && unsubs.length) {
  4571.                     for (var i = 0; i < unsubs.length; i += 1) {
  4572.                         if (typeof unsubs[i] !== "string") {
  4573.                             stream.emit("error", new Error("Invalid unsubscriptions"));
  4574.                             return false
  4575.                         }
  4576.                         length += Buffer.byteLength(unsubs[i]) + 2
  4577.                     }
  4578.                 } else {
  4579.                     stream.emit("error", new Error("Invalid unsubscriptions"));
  4580.                     return false
  4581.                 }
  4582.                 stream.write(protocol.UNSUBSCRIBE_HEADER[1][dup ? 1 : 0][0]);
  4583.                 writeLength(stream, length);
  4584.                 writeNumber(stream, id);
  4585.                 var result = true;
  4586.                 for (var j = 0; j < unsubs.length; j++) {
  4587.                     result = writeString(stream, unsubs[j])
  4588.                 }
  4589.                 return result
  4590.             }
  4591.  
  4592.             function emptyPacket(opts, stream) {
  4593.                 return stream.write(protocol.EMPTY[opts.cmd])
  4594.             }
  4595.  
  4596.             function calcLengthLength(length) {
  4597.                 if (length >= 0 && length < 128) return 1;
  4598.                 else if (length >= 128 && length < 16384) return 2;
  4599.                 else if (length >= 16384 && length < 2097152) return 3;
  4600.                 else if (length >= 2097152 && length < 268435456) return 4;
  4601.                 else return 0
  4602.             }
  4603.  
  4604.             function genBufLength(length) {
  4605.                 var digit = 0;
  4606.                 var pos = 0;
  4607.                 var buffer = Buffer.allocUnsafe(calcLengthLength(length));
  4608.                 do {
  4609.                     digit = length % 128 | 0;
  4610.                     length = length / 128 | 0;
  4611.                     if (length > 0) digit = digit | 128;
  4612.                     buffer.writeUInt8(digit, pos++, true)
  4613.                 } while (length > 0);
  4614.                 return buffer
  4615.             }
  4616.             var lengthCache = {};
  4617.  
  4618.             function writeLength(stream, length) {
  4619.                 var buffer = lengthCache[length];
  4620.                 if (!buffer) {
  4621.                     buffer = genBufLength(length);
  4622.                     if (length < 16384) lengthCache[length] = buffer
  4623.                 }
  4624.                 stream.write(buffer)
  4625.             }
  4626.  
  4627.             function writeString(stream, string) {
  4628.                 var strlen = Buffer.byteLength(string);
  4629.                 writeNumber(stream, strlen);
  4630.                 stream.write(string, "utf8")
  4631.             }
  4632.  
  4633.             function writeNumberCached(stream, number) {
  4634.                 return stream.write(numCache[number])
  4635.             }
  4636.  
  4637.             function writeNumberGenerated(stream, number) {
  4638.                 return stream.write(generateNumber(number))
  4639.             }
  4640.  
  4641.             function writeStringOrBuffer(stream, toWrite) {
  4642.                 if (typeof toWrite === "string") {
  4643.                     writeString(stream, toWrite)
  4644.                 } else if (toWrite) {
  4645.                     writeNumber(stream, toWrite.length);
  4646.                     stream.write(toWrite)
  4647.                 } else writeNumber(stream, 0)
  4648.             }
  4649.  
  4650.             function byteLength(bufOrString) {
  4651.                 if (!bufOrString) return 0;
  4652.                 else if (bufOrString instanceof Buffer) return bufOrString.length;
  4653.                 else return Buffer.byteLength(bufOrString)
  4654.             }
  4655.  
  4656.             function isStringOrBuffer(field) {
  4657.                 return typeof field === "string" || field instanceof Buffer
  4658.             }
  4659.             module.exports = generate
  4660.         }, {
  4661.             "./constants": 21,
  4662.             "./numbers": 25,
  4663.             "process-nextick-args": 24,
  4664.             "safe-buffer": 47
  4665.         }],
  4666.         29: [function(require, module, exports) {
  4667.             var wrappy = require("wrappy");
  4668.             module.exports = wrappy(once);
  4669.             module.exports.strict = wrappy(onceStrict);
  4670.             once.proto = once(function() {
  4671.                 Object.defineProperty(Function.prototype, "once", {
  4672.                     value: function() {
  4673.                         return once(this)
  4674.                     },
  4675.                     configurable: true
  4676.                 });
  4677.                 Object.defineProperty(Function.prototype, "onceStrict", {
  4678.                     value: function() {
  4679.                         return onceStrict(this)
  4680.                     },
  4681.                     configurable: true
  4682.                 })
  4683.             });
  4684.  
  4685.             function once(fn) {
  4686.                 var f = function() {
  4687.                     if (f.called) return f.value;
  4688.                     f.called = true;
  4689.                     return f.value = fn.apply(this, arguments)
  4690.                 };
  4691.                 f.called = false;
  4692.                 return f
  4693.             }
  4694.  
  4695.             function onceStrict(fn) {
  4696.                 var f = function() {
  4697.                     if (f.called) throw new Error(f.onceError);
  4698.                     f.called = true;
  4699.                     return f.value = fn.apply(this, arguments)
  4700.                 };
  4701.                 var name = fn.name || "Function wrapped with `once`";
  4702.                 f.onceError = name + " shouldn't be called more than once";
  4703.                 f.called = false;
  4704.                 return f
  4705.             }
  4706.         }, {
  4707.             wrappy: 58
  4708.         }],
  4709.         30: [function(require, module, exports) {
  4710.             var process = module.exports = {};
  4711.             var cachedSetTimeout;
  4712.             var cachedClearTimeout;
  4713.  
  4714.             function defaultSetTimout() {
  4715.                 throw new Error("setTimeout has not been defined")
  4716.             }
  4717.  
  4718.             function defaultClearTimeout() {
  4719.                 throw new Error("clearTimeout has not been defined")
  4720.             }(function() {
  4721.                 try {
  4722.                     if (typeof setTimeout === "function") {
  4723.                         cachedSetTimeout = setTimeout
  4724.                     } else {
  4725.                         cachedSetTimeout = defaultSetTimout
  4726.                     }
  4727.                 } catch (e) {
  4728.                     cachedSetTimeout = defaultSetTimout
  4729.                 }
  4730.                 try {
  4731.                     if (typeof clearTimeout === "function") {
  4732.                         cachedClearTimeout = clearTimeout
  4733.                     } else {
  4734.                         cachedClearTimeout = defaultClearTimeout
  4735.                     }
  4736.                 } catch (e) {
  4737.                     cachedClearTimeout = defaultClearTimeout
  4738.                 }
  4739.             })();
  4740.  
  4741.             function runTimeout(fun) {
  4742.                 if (cachedSetTimeout === setTimeout) {
  4743.                     return setTimeout(fun, 0)
  4744.                 }
  4745.                 if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {
  4746.                     cachedSetTimeout = setTimeout;
  4747.                     return setTimeout(fun, 0)
  4748.                 }
  4749.                 try {
  4750.                     return cachedSetTimeout(fun, 0)
  4751.                 } catch (e) {
  4752.                     try {
  4753.                         return cachedSetTimeout.call(null, fun, 0)
  4754.                     } catch (e) {
  4755.                         return cachedSetTimeout.call(this, fun, 0)
  4756.                     }
  4757.                 }
  4758.             }
  4759.  
  4760.             function runClearTimeout(marker) {
  4761.                 if (cachedClearTimeout === clearTimeout) {
  4762.                     return clearTimeout(marker)
  4763.                 }
  4764.                 if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {
  4765.                     cachedClearTimeout = clearTimeout;
  4766.                     return clearTimeout(marker)
  4767.                 }
  4768.                 try {
  4769.                     return cachedClearTimeout(marker)
  4770.                 } catch (e) {
  4771.                     try {
  4772.                         return cachedClearTimeout.call(null, marker)
  4773.                     } catch (e) {
  4774.                         return cachedClearTimeout.call(this, marker)
  4775.                     }
  4776.                 }
  4777.             }
  4778.             var queue = [];
  4779.             var draining = false;
  4780.             var currentQueue;
  4781.             var queueIndex = -1;
  4782.  
  4783.             function cleanUpNextTick() {
  4784.                 if (!draining || !currentQueue) {
  4785.                     return
  4786.                 }
  4787.                 draining = false;
  4788.                 if (currentQueue.length) {
  4789.                     queue = currentQueue.concat(queue)
  4790.                 } else {
  4791.                     queueIndex = -1
  4792.                 }
  4793.                 if (queue.length) {
  4794.                     drainQueue()
  4795.                 }
  4796.             }
  4797.  
  4798.             function drainQueue() {
  4799.                 if (draining) {
  4800.                     return
  4801.                 }
  4802.                 var timeout = runTimeout(cleanUpNextTick);
  4803.                 draining = true;
  4804.                 var len = queue.length;
  4805.                 while (len) {
  4806.                     currentQueue = queue;
  4807.                     queue = [];
  4808.                     while (++queueIndex < len) {
  4809.                         if (currentQueue) {
  4810.                             currentQueue[queueIndex].run()
  4811.                         }
  4812.                     }
  4813.                     queueIndex = -1;
  4814.                     len = queue.length
  4815.                 }
  4816.                 currentQueue = null;
  4817.                 draining = false;
  4818.                 runClearTimeout(timeout)
  4819.             }
  4820.             process.nextTick = function(fun) {
  4821.                 var args = new Array(arguments.length - 1);
  4822.                 if (arguments.length > 1) {
  4823.                     for (var i = 1; i < arguments.length; i++) {
  4824.                         args[i - 1] = arguments[i]
  4825.                     }
  4826.                 }
  4827.                 queue.push(new Item(fun, args));
  4828.                 if (queue.length === 1 && !draining) {
  4829.                     runTimeout(drainQueue)
  4830.                 }
  4831.             };
  4832.  
  4833.             function Item(fun, array) {
  4834.                 this.fun = fun;
  4835.                 this.array = array
  4836.             }
  4837.             Item.prototype.run = function() {
  4838.                 this.fun.apply(null, this.array)
  4839.             };
  4840.             process.title = "browser";
  4841.             process.browser = true;
  4842.             process.env = {};
  4843.             process.argv = [];
  4844.             process.version = "";
  4845.             process.versions = {};
  4846.  
  4847.             function noop() {}
  4848.             process.on = noop;
  4849.             process.addListener = noop;
  4850.             process.once = noop;
  4851.             process.off = noop;
  4852.             process.removeListener = noop;
  4853.             process.removeAllListeners = noop;
  4854.             process.emit = noop;
  4855.             process.prependListener = noop;
  4856.             process.prependOnceListener = noop;
  4857.             process.listeners = function(name) {
  4858.                 return []
  4859.             };
  4860.             process.binding = function(name) {
  4861.                 throw new Error("process.binding is not supported")
  4862.             };
  4863.             process.cwd = function() {
  4864.                 return "/"
  4865.             };
  4866.             process.chdir = function(dir) {
  4867.                 throw new Error("process.chdir is not supported")
  4868.             };
  4869.             process.umask = function() {
  4870.                 return 0
  4871.             }
  4872.         }, {}],
  4873.         31: [function(require, module, exports) {
  4874.             (function(global) {
  4875.                 (function(root) {
  4876.                     var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports;
  4877.                     var freeModule = typeof module == "object" && module && !module.nodeType && module;
  4878.                     var freeGlobal = typeof global == "object" && global;
  4879.                     if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal) {
  4880.                         root = freeGlobal
  4881.                     }
  4882.                     var punycode, maxInt = 2147483647,
  4883.                         base = 36,
  4884.                         tMin = 1,
  4885.                         tMax = 26,
  4886.                         skew = 38,
  4887.                         damp = 700,
  4888.                         initialBias = 72,
  4889.                         initialN = 128,
  4890.                         delimiter = "-",
  4891.                         regexPunycode = /^xn--/,
  4892.                         regexNonASCII = /[^\x20-\x7E]/,
  4893.                         regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g,
  4894.                         errors = {
  4895.                             overflow: "Overflow: input needs wider integers to process",
  4896.                             "not-basic": "Illegal input >= 0x80 (not a basic code point)",
  4897.                             "invalid-input": "Invalid input"
  4898.                         },
  4899.                         baseMinusTMin = base - tMin,
  4900.                         floor = Math.floor,
  4901.                         stringFromCharCode = String.fromCharCode,
  4902.                         key;
  4903.  
  4904.                     function error(type) {
  4905.                         throw new RangeError(errors[type])
  4906.                     }
  4907.  
  4908.                     function map(array, fn) {
  4909.                         var length = array.length;
  4910.                         var result = [];
  4911.                         while (length--) {
  4912.                             result[length] = fn(array[length])
  4913.                         }
  4914.                         return result
  4915.                     }
  4916.  
  4917.                     function mapDomain(string, fn) {
  4918.                         var parts = string.split("@");
  4919.                         var result = "";
  4920.                         if (parts.length > 1) {
  4921.                             result = parts[0] + "@";
  4922.                             string = parts[1]
  4923.                         }
  4924.                         string = string.replace(regexSeparators, ".");
  4925.                         var labels = string.split(".");
  4926.                         var encoded = map(labels, fn).join(".");
  4927.                         return result + encoded
  4928.                     }
  4929.  
  4930.                     function ucs2decode(string) {
  4931.                         var output = [],
  4932.                             counter = 0,
  4933.                             length = string.length,
  4934.                             value, extra;
  4935.                         while (counter < length) {
  4936.                             value = string.charCodeAt(counter++);
  4937.                             if (value >= 55296 && value <= 56319 && counter < length) {
  4938.                                 extra = string.charCodeAt(counter++);
  4939.                                 if ((extra & 64512) == 56320) {
  4940.                                     output.push(((value & 1023) << 10) + (extra & 1023) + 65536)
  4941.                                 } else {
  4942.                                     output.push(value);
  4943.                                     counter--
  4944.                                 }
  4945.                             } else {
  4946.                                 output.push(value)
  4947.                             }
  4948.                         }
  4949.                         return output
  4950.                     }
  4951.  
  4952.                     function ucs2encode(array) {
  4953.                         return map(array, function(value) {
  4954.                             var output = "";
  4955.                             if (value > 65535) {
  4956.                                 value -= 65536;
  4957.                                 output += stringFromCharCode(value >>> 10 & 1023 | 55296);
  4958.                                 value = 56320 | value & 1023
  4959.                             }
  4960.                             output += stringFromCharCode(value);
  4961.                             return output
  4962.                         }).join("")
  4963.                     }
  4964.  
  4965.                     function basicToDigit(codePoint) {
  4966.                         if (codePoint - 48 < 10) {
  4967.                             return codePoint - 22
  4968.                         }
  4969.                         if (codePoint - 65 < 26) {
  4970.                             return codePoint - 65
  4971.                         }
  4972.                         if (codePoint - 97 < 26) {
  4973.                             return codePoint - 97
  4974.                         }
  4975.                         return base
  4976.                     }
  4977.  
  4978.                     function digitToBasic(digit, flag) {
  4979.                         return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5)
  4980.                     }
  4981.  
  4982.                     function adapt(delta, numPoints, firstTime) {
  4983.                         var k = 0;
  4984.                         delta = firstTime ? floor(delta / damp) : delta >> 1;
  4985.                         delta += floor(delta / numPoints);
  4986.                         for (; delta > baseMinusTMin * tMax >> 1; k += base) {
  4987.                             delta = floor(delta / baseMinusTMin)
  4988.                         }
  4989.                         return floor(k + (baseMinusTMin + 1) * delta / (delta + skew))
  4990.                     }
  4991.  
  4992.                     function decode(input) {
  4993.                         var output = [],
  4994.                             inputLength = input.length,
  4995.                             out, i = 0,
  4996.                             n = initialN,
  4997.                             bias = initialBias,
  4998.                             basic, j, index, oldi, w, k, digit, t, baseMinusT;
  4999.                         basic = input.lastIndexOf(delimiter);
  5000.                         if (basic < 0) {
  5001.                             basic = 0
  5002.                         }
  5003.                         for (j = 0; j < basic; ++j) {
  5004.                             if (input.charCodeAt(j) >= 128) {
  5005.                                 error("not-basic")
  5006.                             }
  5007.                             output.push(input.charCodeAt(j))
  5008.                         }
  5009.                         for (index = basic > 0 ? basic + 1 : 0; index < inputLength;) {
  5010.                             for (oldi = i, w = 1, k = base;; k += base) {
  5011.                                 if (index >= inputLength) {
  5012.                                     error("invalid-input")
  5013.                                 }
  5014.                                 digit = basicToDigit(input.charCodeAt(index++));
  5015.                                 if (digit >= base || digit > floor((maxInt - i) / w)) {
  5016.                                     error("overflow")
  5017.                                 }
  5018.                                 i += digit * w;
  5019.                                 t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  5020.                                 if (digit < t) {
  5021.                                     break
  5022.                                 }
  5023.                                 baseMinusT = base - t;
  5024.                                 if (w > floor(maxInt / baseMinusT)) {
  5025.                                     error("overflow")
  5026.                                 }
  5027.                                 w *= baseMinusT
  5028.                             }
  5029.                             out = output.length + 1;
  5030.                             bias = adapt(i - oldi, out, oldi == 0);
  5031.                             if (floor(i / out) > maxInt - n) {
  5032.                                 error("overflow")
  5033.                             }
  5034.                             n += floor(i / out);
  5035.                             i %= out;
  5036.                             output.splice(i++, 0, n)
  5037.                         }
  5038.                         return ucs2encode(output)
  5039.                     }
  5040.  
  5041.                     function encode(input) {
  5042.                         var n, delta, handledCPCount, basicLength, bias, j, m, q, k, t, currentValue, output = [],
  5043.                             inputLength, handledCPCountPlusOne, baseMinusT, qMinusT;
  5044.                         input = ucs2decode(input);
  5045.                         inputLength = input.length;
  5046.                         n = initialN;
  5047.                         delta = 0;
  5048.                         bias = initialBias;
  5049.                         for (j = 0; j < inputLength; ++j) {
  5050.                             currentValue = input[j];
  5051.                             if (currentValue < 128) {
  5052.                                 output.push(stringFromCharCode(currentValue))
  5053.                             }
  5054.                         }
  5055.                         handledCPCount = basicLength = output.length;
  5056.                         if (basicLength) {
  5057.                             output.push(delimiter)
  5058.                         }
  5059.                         while (handledCPCount < inputLength) {
  5060.                             for (m = maxInt, j = 0; j < inputLength; ++j) {
  5061.                                 currentValue = input[j];
  5062.                                 if (currentValue >= n && currentValue < m) {
  5063.                                     m = currentValue
  5064.                                 }
  5065.                             }
  5066.                             handledCPCountPlusOne = handledCPCount + 1;
  5067.                             if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
  5068.                                 error("overflow")
  5069.                             }
  5070.                             delta += (m - n) * handledCPCountPlusOne;
  5071.                             n = m;
  5072.                             for (j = 0; j < inputLength; ++j) {
  5073.                                 currentValue = input[j];
  5074.                                 if (currentValue < n && ++delta > maxInt) {
  5075.                                     error("overflow")
  5076.                                 }
  5077.                                 if (currentValue == n) {
  5078.                                     for (q = delta, k = base;; k += base) {
  5079.                                         t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
  5080.                                         if (q < t) {
  5081.                                             break
  5082.                                         }
  5083.                                         qMinusT = q - t;
  5084.                                         baseMinusT = base - t;
  5085.                                         output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
  5086.                                         q = floor(qMinusT / baseMinusT)
  5087.                                     }
  5088.                                     output.push(stringFromCharCode(digitToBasic(q, 0)));
  5089.                                     bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
  5090.                                     delta = 0;
  5091.                                     ++handledCPCount
  5092.                                 }
  5093.                             }++delta;
  5094.                             ++n
  5095.                         }
  5096.                         return output.join("")
  5097.                     }
  5098.  
  5099.                     function toUnicode(input) {
  5100.                         return mapDomain(input, function(string) {
  5101.                             return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string
  5102.                         })
  5103.                     }
  5104.  
  5105.                     function toASCII(input) {
  5106.                         return mapDomain(input, function(string) {
  5107.                             return regexNonASCII.test(string) ? "xn--" + encode(string) : string
  5108.                         })
  5109.                     }
  5110.                     punycode = {
  5111.                         version: "1.4.1",
  5112.                         ucs2: {
  5113.                             decode: ucs2decode,
  5114.                             encode: ucs2encode
  5115.                         },
  5116.                         decode: decode,
  5117.                         encode: encode,
  5118.                         toASCII: toASCII,
  5119.                         toUnicode: toUnicode
  5120.                     };
  5121.                     if (typeof define == "function" && typeof define.amd == "object" && define.amd) {
  5122.                         define("punycode", function() {
  5123.                             return punycode
  5124.                         })
  5125.                     } else if (freeExports && freeModule) {
  5126.                         if (module.exports == freeExports) {
  5127.                             freeModule.exports = punycode
  5128.                         } else {
  5129.                             for (key in punycode) {
  5130.                                 punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key])
  5131.                             }
  5132.                         }
  5133.                     } else {
  5134.                         root.punycode = punycode
  5135.                     }
  5136.                 })(this)
  5137.             }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  5138.         }, {}],
  5139.         32: [function(require, module, exports) {
  5140.             "use strict";
  5141.  
  5142.             function hasOwnProperty(obj, prop) {
  5143.                 return Object.prototype.hasOwnProperty.call(obj, prop)
  5144.             }
  5145.             module.exports = function(qs, sep, eq, options) {
  5146.                 sep = sep || "&";
  5147.                 eq = eq || "=";
  5148.                 var obj = {};
  5149.                 if (typeof qs !== "string" || qs.length === 0) {
  5150.                     return obj
  5151.                 }
  5152.                 var regexp = /\+/g;
  5153.                 qs = qs.split(sep);
  5154.                 var maxKeys = 1e3;
  5155.                 if (options && typeof options.maxKeys === "number") {
  5156.                     maxKeys = options.maxKeys
  5157.                 }
  5158.                 var len = qs.length;
  5159.                 if (maxKeys > 0 && len > maxKeys) {
  5160.                     len = maxKeys
  5161.                 }
  5162.                 for (var i = 0; i < len; ++i) {
  5163.                     var x = qs[i].replace(regexp, "%20"),
  5164.                         idx = x.indexOf(eq),
  5165.                         kstr, vstr, k, v;
  5166.                     if (idx >= 0) {
  5167.                         kstr = x.substr(0, idx);
  5168.                         vstr = x.substr(idx + 1)
  5169.                     } else {
  5170.                         kstr = x;
  5171.                         vstr = ""
  5172.                     }
  5173.                     k = decodeURIComponent(kstr);
  5174.                     v = decodeURIComponent(vstr);
  5175.                     if (!hasOwnProperty(obj, k)) {
  5176.                         obj[k] = v
  5177.                     } else if (isArray(obj[k])) {
  5178.                         obj[k].push(v)
  5179.                     } else {
  5180.                         obj[k] = [obj[k], v]
  5181.                     }
  5182.                 }
  5183.                 return obj
  5184.             };
  5185.             var isArray = Array.isArray || function(xs) {
  5186.                 return Object.prototype.toString.call(xs) === "[object Array]"
  5187.             }
  5188.         }, {}],
  5189.         33: [function(require, module, exports) {
  5190.             "use strict";
  5191.             var stringifyPrimitive = function(v) {
  5192.                 switch (typeof v) {
  5193.                     case "string":
  5194.                         return v;
  5195.                     case "boolean":
  5196.                         return v ? "true" : "false";
  5197.                     case "number":
  5198.                         return isFinite(v) ? v : "";
  5199.                     default:
  5200.                         return ""
  5201.                 }
  5202.             };
  5203.             module.exports = function(obj, sep, eq, name) {
  5204.                 sep = sep || "&";
  5205.                 eq = eq || "=";
  5206.                 if (obj === null) {
  5207.                     obj = undefined
  5208.                 }
  5209.                 if (typeof obj === "object") {
  5210.                     return map(objectKeys(obj), function(k) {
  5211.                         var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;
  5212.                         if (isArray(obj[k])) {
  5213.                             return map(obj[k], function(v) {
  5214.                                 return ks + encodeURIComponent(stringifyPrimitive(v))
  5215.                             }).join(sep)
  5216.                         } else {
  5217.                             return ks + encodeURIComponent(stringifyPrimitive(obj[k]))
  5218.                         }
  5219.                     }).join(sep)
  5220.                 }
  5221.                 if (!name) return "";
  5222.                 return encodeURIComponent(stringifyPrimitive(name)) + eq + encodeURIComponent(stringifyPrimitive(obj))
  5223.             };
  5224.             var isArray = Array.isArray || function(xs) {
  5225.                 return Object.prototype.toString.call(xs) === "[object Array]"
  5226.             };
  5227.  
  5228.             function map(xs, f) {
  5229.                 if (xs.map) return xs.map(f);
  5230.                 var res = [];
  5231.                 for (var i = 0; i < xs.length; i++) {
  5232.                     res.push(f(xs[i], i))
  5233.                 }
  5234.                 return res
  5235.             }
  5236.             var objectKeys = Object.keys || function(obj) {
  5237.                 var res = [];
  5238.                 for (var key in obj) {
  5239.                     if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key)
  5240.                 }
  5241.                 return res
  5242.             }
  5243.         }, {}],
  5244.         34: [function(require, module, exports) {
  5245.             "use strict";
  5246.             exports.decode = exports.parse = require("./decode");
  5247.             exports.encode = exports.stringify = require("./encode")
  5248.         }, {
  5249.             "./decode": 32,
  5250.             "./encode": 33
  5251.         }],
  5252.         35: [function(require, module, exports) {
  5253.             module.exports = require("./lib/_stream_duplex.js")
  5254.         }, {
  5255.             "./lib/_stream_duplex.js": 36
  5256.         }],
  5257.         36: [function(require, module, exports) {
  5258.             "use strict";
  5259.             var pna = require("process-nextick-args");
  5260.             var objectKeys = Object.keys || function(obj) {
  5261.                 var keys = [];
  5262.                 for (var key in obj) {
  5263.                     keys.push(key)
  5264.                 }
  5265.                 return keys
  5266.             };
  5267.             module.exports = Duplex;
  5268.             var util = require("core-util-is");
  5269.             util.inherits = require("inherits");
  5270.             var Readable = require("./_stream_readable");
  5271.             var Writable = require("./_stream_writable");
  5272.             util.inherits(Duplex, Readable);
  5273.             var keys = objectKeys(Writable.prototype);
  5274.             for (var v = 0; v < keys.length; v++) {
  5275.                 var method = keys[v];
  5276.                 if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]
  5277.             }
  5278.  
  5279.             function Duplex(options) {
  5280.                 if (!(this instanceof Duplex)) return new Duplex(options);
  5281.                 Readable.call(this, options);
  5282.                 Writable.call(this, options);
  5283.                 if (options && options.readable === false) this.readable = false;
  5284.                 if (options && options.writable === false) this.writable = false;
  5285.                 this.allowHalfOpen = true;
  5286.                 if (options && options.allowHalfOpen === false) this.allowHalfOpen = false;
  5287.                 this.once("end", onend)
  5288.             }
  5289.  
  5290.             function onend() {
  5291.                 if (this.allowHalfOpen || this._writableState.ended) return;
  5292.                 pna.nextTick(onEndNT, this)
  5293.             }
  5294.  
  5295.             function onEndNT(self) {
  5296.                 self.end()
  5297.             }
  5298.             Object.defineProperty(Duplex.prototype, "destroyed", {
  5299.                 get: function() {
  5300.                     if (this._readableState === undefined || this._writableState === undefined) {
  5301.                         return false
  5302.                     }
  5303.                     return this._readableState.destroyed && this._writableState.destroyed
  5304.                 },
  5305.                 set: function(value) {
  5306.                     if (this._readableState === undefined || this._writableState === undefined) {
  5307.                         return
  5308.                     }
  5309.                     this._readableState.destroyed = value;
  5310.                     this._writableState.destroyed = value
  5311.                 }
  5312.             });
  5313.             Duplex.prototype._destroy = function(err, cb) {
  5314.                 this.push(null);
  5315.                 this.end();
  5316.                 pna.nextTick(cb, err)
  5317.             };
  5318.  
  5319.             function forEach(xs, f) {
  5320.                 for (var i = 0, l = xs.length; i < l; i++) {
  5321.                     f(xs[i], i)
  5322.                 }
  5323.             }
  5324.         }, {
  5325.             "./_stream_readable": 38,
  5326.             "./_stream_writable": 40,
  5327.             "core-util-is": 14,
  5328.             inherits: 18,
  5329.             "process-nextick-args": 44
  5330.         }],
  5331.         37: [function(require, module, exports) {
  5332.             "use strict";
  5333.             module.exports = PassThrough;
  5334.             var Transform = require("./_stream_transform");
  5335.             var util = require("core-util-is");
  5336.             util.inherits = require("inherits");
  5337.             util.inherits(PassThrough, Transform);
  5338.  
  5339.             function PassThrough(options) {
  5340.                 if (!(this instanceof PassThrough)) return new PassThrough(options);
  5341.                 Transform.call(this, options)
  5342.             }
  5343.             PassThrough.prototype._transform = function(chunk, encoding, cb) {
  5344.                 cb(null, chunk)
  5345.             }
  5346.         }, {
  5347.             "./_stream_transform": 39,
  5348.             "core-util-is": 14,
  5349.             inherits: 18
  5350.         }],
  5351.         38: [function(require, module, exports) {
  5352.             (function(process, global) {
  5353.                 "use strict";
  5354.                 var pna = require("process-nextick-args");
  5355.                 module.exports = Readable;
  5356.                 var isArray = require("isarray");
  5357.                 var Duplex;
  5358.                 Readable.ReadableState = ReadableState;
  5359.                 var EE = require("events").EventEmitter;
  5360.                 var EElistenerCount = function(emitter, type) {
  5361.                     return emitter.listeners(type).length
  5362.                 };
  5363.                 var Stream = require("./internal/streams/stream");
  5364.                 var Buffer = require("safe-buffer").Buffer;
  5365.                 var OurUint8Array = global.Uint8Array || function() {};
  5366.  
  5367.                 function _uint8ArrayToBuffer(chunk) {
  5368.                     return Buffer.from(chunk)
  5369.                 }
  5370.  
  5371.                 function _isUint8Array(obj) {
  5372.                     return Buffer.isBuffer(obj) || obj instanceof OurUint8Array
  5373.                 }
  5374.                 var util = require("core-util-is");
  5375.                 util.inherits = require("inherits");
  5376.                 var debugUtil = require("util");
  5377.                 var debug = void 0;
  5378.                 if (debugUtil && debugUtil.debuglog) {
  5379.                     debug = debugUtil.debuglog("stream")
  5380.                 } else {
  5381.                     debug = function() {}
  5382.                 }
  5383.                 var BufferList = require("./internal/streams/BufferList");
  5384.                 var destroyImpl = require("./internal/streams/destroy");
  5385.                 var StringDecoder;
  5386.                 util.inherits(Readable, Stream);
  5387.                 var kProxyEvents = ["error", "close", "destroy", "pause", "resume"];
  5388.  
  5389.                 function prependListener(emitter, event, fn) {
  5390.                     if (typeof emitter.prependListener === "function") return emitter.prependListener(event, fn);
  5391.                     if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);
  5392.                     else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);
  5393.                     else emitter._events[event] = [fn, emitter._events[event]]
  5394.                 }
  5395.  
  5396.                 function ReadableState(options, stream) {
  5397.                     Duplex = Duplex || require("./_stream_duplex");
  5398.                     options = options || {};
  5399.                     var isDuplex = stream instanceof Duplex;
  5400.                     this.objectMode = !!options.objectMode;
  5401.                     if (isDuplex) this.objectMode = this.objectMode || !!options.readableObjectMode;
  5402.                     var hwm = options.highWaterMark;
  5403.                     var readableHwm = options.readableHighWaterMark;
  5404.                     var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  5405.                     if (hwm || hwm === 0) this.highWaterMark = hwm;
  5406.                     else if (isDuplex && (readableHwm || readableHwm === 0)) this.highWaterMark = readableHwm;
  5407.                     else this.highWaterMark = defaultHwm;
  5408.                     this.highWaterMark = Math.floor(this.highWaterMark);
  5409.                     this.buffer = new BufferList;
  5410.                     this.length = 0;
  5411.                     this.pipes = null;
  5412.                     this.pipesCount = 0;
  5413.                     this.flowing = null;
  5414.                     this.ended = false;
  5415.                     this.endEmitted = false;
  5416.                     this.reading = false;
  5417.                     this.sync = true;
  5418.                     this.needReadable = false;
  5419.                     this.emittedReadable = false;
  5420.                     this.readableListening = false;
  5421.                     this.resumeScheduled = false;
  5422.                     this.destroyed = false;
  5423.                     this.defaultEncoding = options.defaultEncoding || "utf8";
  5424.                     this.awaitDrain = 0;
  5425.                     this.readingMore = false;
  5426.                     this.decoder = null;
  5427.                     this.encoding = null;
  5428.                     if (options.encoding) {
  5429.                         if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder;
  5430.                         this.decoder = new StringDecoder(options.encoding);
  5431.                         this.encoding = options.encoding
  5432.                     }
  5433.                 }
  5434.  
  5435.                 function Readable(options) {
  5436.                     Duplex = Duplex || require("./_stream_duplex");
  5437.                     if (!(this instanceof Readable)) return new Readable(options);
  5438.                     this._readableState = new ReadableState(options, this);
  5439.                     this.readable = true;
  5440.                     if (options) {
  5441.                         if (typeof options.read === "function") this._read = options.read;
  5442.                         if (typeof options.destroy === "function") this._destroy = options.destroy
  5443.                     }
  5444.                     Stream.call(this)
  5445.                 }
  5446.                 Object.defineProperty(Readable.prototype, "destroyed", {
  5447.                     get: function() {
  5448.                         if (this._readableState === undefined) {
  5449.                             return false
  5450.                         }
  5451.                         return this._readableState.destroyed
  5452.                     },
  5453.                     set: function(value) {
  5454.                         if (!this._readableState) {
  5455.                             return
  5456.                         }
  5457.                         this._readableState.destroyed = value
  5458.                     }
  5459.                 });
  5460.                 Readable.prototype.destroy = destroyImpl.destroy;
  5461.                 Readable.prototype._undestroy = destroyImpl.undestroy;
  5462.                 Readable.prototype._destroy = function(err, cb) {
  5463.                     this.push(null);
  5464.                     cb(err)
  5465.                 };
  5466.                 Readable.prototype.push = function(chunk, encoding) {
  5467.                     var state = this._readableState;
  5468.                     var skipChunkCheck;
  5469.                     if (!state.objectMode) {
  5470.                         if (typeof chunk === "string") {
  5471.                             encoding = encoding || state.defaultEncoding;
  5472.                             if (encoding !== state.encoding) {
  5473.                                 chunk = Buffer.from(chunk, encoding);
  5474.                                 encoding = ""
  5475.                             }
  5476.                             skipChunkCheck = true
  5477.                         }
  5478.                     } else {
  5479.                         skipChunkCheck = true
  5480.                     }
  5481.                     return readableAddChunk(this, chunk, encoding, false, skipChunkCheck)
  5482.                 };
  5483.                 Readable.prototype.unshift = function(chunk) {
  5484.                     return readableAddChunk(this, chunk, null, true, false)
  5485.                 };
  5486.  
  5487.                 function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
  5488.                     var state = stream._readableState;
  5489.                     if (chunk === null) {
  5490.                         state.reading = false;
  5491.                         onEofChunk(stream, state)
  5492.                     } else {
  5493.                         var er;
  5494.                         if (!skipChunkCheck) er = chunkInvalid(state, chunk);
  5495.                         if (er) {
  5496.                             stream.emit("error", er)
  5497.                         } else if (state.objectMode || chunk && chunk.length > 0) {
  5498.                             if (typeof chunk !== "string" && !state.objectMode && Object.getPrototypeOf(chunk) !== Buffer.prototype) {
  5499.                                 chunk = _uint8ArrayToBuffer(chunk)
  5500.                             }
  5501.                             if (addToFront) {
  5502.                                 if (state.endEmitted) stream.emit("error", new Error("stream.unshift() after end event"));
  5503.                                 else addChunk(stream, state, chunk, true)
  5504.                             } else if (state.ended) {
  5505.                                 stream.emit("error", new Error("stream.push() after EOF"))
  5506.                             } else {
  5507.                                 state.reading = false;
  5508.                                 if (state.decoder && !encoding) {
  5509.                                     chunk = state.decoder.write(chunk);
  5510.                                     if (state.objectMode || chunk.length !== 0) addChunk(stream, state, chunk, false);
  5511.                                     else maybeReadMore(stream, state)
  5512.                                 } else {
  5513.                                     addChunk(stream, state, chunk, false)
  5514.                                 }
  5515.                             }
  5516.                         } else if (!addToFront) {
  5517.                             state.reading = false
  5518.                         }
  5519.                     }
  5520.                     return needMoreData(state)
  5521.                 }
  5522.  
  5523.                 function addChunk(stream, state, chunk, addToFront) {
  5524.                     if (state.flowing && state.length === 0 && !state.sync) {
  5525.                         stream.emit("data", chunk);
  5526.                         stream.read(0)
  5527.                     } else {
  5528.                         state.length += state.objectMode ? 1 : chunk.length;
  5529.                         if (addToFront) state.buffer.unshift(chunk);
  5530.                         else state.buffer.push(chunk);
  5531.                         if (state.needReadable) emitReadable(stream)
  5532.                     }
  5533.                     maybeReadMore(stream, state)
  5534.                 }
  5535.  
  5536.                 function chunkInvalid(state, chunk) {
  5537.                     var er;
  5538.                     if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
  5539.                         er = new TypeError("Invalid non-string/buffer chunk")
  5540.                     }
  5541.                     return er
  5542.                 }
  5543.  
  5544.                 function needMoreData(state) {
  5545.                     return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0)
  5546.                 }
  5547.                 Readable.prototype.isPaused = function() {
  5548.                     return this._readableState.flowing === false
  5549.                 };
  5550.                 Readable.prototype.setEncoding = function(enc) {
  5551.                     if (!StringDecoder) StringDecoder = require("string_decoder/").StringDecoder;
  5552.                     this._readableState.decoder = new StringDecoder(enc);
  5553.                     this._readableState.encoding = enc;
  5554.                     return this
  5555.                 };
  5556.                 var MAX_HWM = 8388608;
  5557.  
  5558.                 function computeNewHighWaterMark(n) {
  5559.                     if (n >= MAX_HWM) {
  5560.                         n = MAX_HWM
  5561.                     } else {
  5562.                         n--;
  5563.                         n |= n >>> 1;
  5564.                         n |= n >>> 2;
  5565.                         n |= n >>> 4;
  5566.                         n |= n >>> 8;
  5567.                         n |= n >>> 16;
  5568.                         n++
  5569.                     }
  5570.                     return n
  5571.                 }
  5572.  
  5573.                 function howMuchToRead(n, state) {
  5574.                     if (n <= 0 || state.length === 0 && state.ended) return 0;
  5575.                     if (state.objectMode) return 1;
  5576.                     if (n !== n) {
  5577.                         if (state.flowing && state.length) return state.buffer.head.data.length;
  5578.                         else return state.length
  5579.                     }
  5580.                     if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n);
  5581.                     if (n <= state.length) return n;
  5582.                     if (!state.ended) {
  5583.                         state.needReadable = true;
  5584.                         return 0
  5585.                     }
  5586.                     return state.length
  5587.                 }
  5588.                 Readable.prototype.read = function(n) {
  5589.                     debug("read", n);
  5590.                     n = parseInt(n, 10);
  5591.                     var state = this._readableState;
  5592.                     var nOrig = n;
  5593.                     if (n !== 0) state.emittedReadable = false;
  5594.                     if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
  5595.                         debug("read: emitReadable", state.length, state.ended);
  5596.                         if (state.length === 0 && state.ended) endReadable(this);
  5597.                         else emitReadable(this);
  5598.                         return null
  5599.                     }
  5600.                     n = howMuchToRead(n, state);
  5601.                     if (n === 0 && state.ended) {
  5602.                         if (state.length === 0) endReadable(this);
  5603.                         return null
  5604.                     }
  5605.                     var doRead = state.needReadable;
  5606.                     debug("need readable", doRead);
  5607.                     if (state.length === 0 || state.length - n < state.highWaterMark) {
  5608.                         doRead = true;
  5609.                         debug("length less than watermark", doRead)
  5610.                     }
  5611.                     if (state.ended || state.reading) {
  5612.                         doRead = false;
  5613.                         debug("reading or ended", doRead)
  5614.                     } else if (doRead) {
  5615.                         debug("do read");
  5616.                         state.reading = true;
  5617.                         state.sync = true;
  5618.                         if (state.length === 0) state.needReadable = true;
  5619.                         this._read(state.highWaterMark);
  5620.                         state.sync = false;
  5621.                         if (!state.reading) n = howMuchToRead(nOrig, state)
  5622.                     }
  5623.                     var ret;
  5624.                     if (n > 0) ret = fromList(n, state);
  5625.                     else ret = null;
  5626.                     if (ret === null) {
  5627.                         state.needReadable = true;
  5628.                         n = 0
  5629.                     } else {
  5630.                         state.length -= n
  5631.                     }
  5632.                     if (state.length === 0) {
  5633.                         if (!state.ended) state.needReadable = true;
  5634.                         if (nOrig !== n && state.ended) endReadable(this)
  5635.                     }
  5636.                     if (ret !== null) this.emit("data", ret);
  5637.                     return ret
  5638.                 };
  5639.  
  5640.                 function onEofChunk(stream, state) {
  5641.                     if (state.ended) return;
  5642.                     if (state.decoder) {
  5643.                         var chunk = state.decoder.end();
  5644.                         if (chunk && chunk.length) {
  5645.                             state.buffer.push(chunk);
  5646.                             state.length += state.objectMode ? 1 : chunk.length
  5647.                         }
  5648.                     }
  5649.                     state.ended = true;
  5650.                     emitReadable(stream)
  5651.                 }
  5652.  
  5653.                 function emitReadable(stream) {
  5654.                     var state = stream._readableState;
  5655.                     state.needReadable = false;
  5656.                     if (!state.emittedReadable) {
  5657.                         debug("emitReadable", state.flowing);
  5658.                         state.emittedReadable = true;
  5659.                         if (state.sync) pna.nextTick(emitReadable_, stream);
  5660.                         else emitReadable_(stream)
  5661.                     }
  5662.                 }
  5663.  
  5664.                 function emitReadable_(stream) {
  5665.                     debug("emit readable");
  5666.                     stream.emit("readable");
  5667.                     flow(stream)
  5668.                 }
  5669.  
  5670.                 function maybeReadMore(stream, state) {
  5671.                     if (!state.readingMore) {
  5672.                         state.readingMore = true;
  5673.                         pna.nextTick(maybeReadMore_, stream, state)
  5674.                     }
  5675.                 }
  5676.  
  5677.                 function maybeReadMore_(stream, state) {
  5678.                     var len = state.length;
  5679.                     while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
  5680.                         debug("maybeReadMore read 0");
  5681.                         stream.read(0);
  5682.                         if (len === state.length) break;
  5683.                         else len = state.length
  5684.                     }
  5685.                     state.readingMore = false
  5686.                 }
  5687.                 Readable.prototype._read = function(n) {
  5688.                     this.emit("error", new Error("_read() is not implemented"))
  5689.                 };
  5690.                 Readable.prototype.pipe = function(dest, pipeOpts) {
  5691.                     var src = this;
  5692.                     var state = this._readableState;
  5693.                     switch (state.pipesCount) {
  5694.                         case 0:
  5695.                             state.pipes = dest;
  5696.                             break;
  5697.                         case 1:
  5698.                             state.pipes = [state.pipes, dest];
  5699.                             break;
  5700.                         default:
  5701.                             state.pipes.push(dest);
  5702.                             break
  5703.                     }
  5704.                     state.pipesCount += 1;
  5705.                     debug("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
  5706.                     var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
  5707.                     var endFn = doEnd ? onend : unpipe;
  5708.                     if (state.endEmitted) pna.nextTick(endFn);
  5709.                     else src.once("end", endFn);
  5710.                     dest.on("unpipe", onunpipe);
  5711.  
  5712.                     function onunpipe(readable, unpipeInfo) {
  5713.                         debug("onunpipe");
  5714.                         if (readable === src) {
  5715.                             if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
  5716.                                 unpipeInfo.hasUnpiped = true;
  5717.                                 cleanup()
  5718.                             }
  5719.                         }
  5720.                     }
  5721.  
  5722.                     function onend() {
  5723.                         debug("onend");
  5724.                         dest.end()
  5725.                     }
  5726.                     var ondrain = pipeOnDrain(src);
  5727.                     dest.on("drain", ondrain);
  5728.                     var cleanedUp = false;
  5729.  
  5730.                     function cleanup() {
  5731.                         debug("cleanup");
  5732.                         dest.removeListener("close", onclose);
  5733.                         dest.removeListener("finish", onfinish);
  5734.                         dest.removeListener("drain", ondrain);
  5735.                         dest.removeListener("error", onerror);
  5736.                         dest.removeListener("unpipe", onunpipe);
  5737.                         src.removeListener("end", onend);
  5738.                         src.removeListener("end", unpipe);
  5739.                         src.removeListener("data", ondata);
  5740.                         cleanedUp = true;
  5741.                         if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain()
  5742.                     }
  5743.                     var increasedAwaitDrain = false;
  5744.                     src.on("data", ondata);
  5745.  
  5746.                     function ondata(chunk) {
  5747.                         debug("ondata");
  5748.                         increasedAwaitDrain = false;
  5749.                         var ret = dest.write(chunk);
  5750.                         if (false === ret && !increasedAwaitDrain) {
  5751.                             if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
  5752.                                 debug("false write response, pause", src._readableState.awaitDrain);
  5753.                                 src._readableState.awaitDrain++;
  5754.                                 increasedAwaitDrain = true
  5755.                             }
  5756.                             src.pause()
  5757.                         }
  5758.                     }
  5759.  
  5760.                     function onerror(er) {
  5761.                         debug("onerror", er);
  5762.                         unpipe();
  5763.                         dest.removeListener("error", onerror);
  5764.                         if (EElistenerCount(dest, "error") === 0) dest.emit("error", er)
  5765.                     }
  5766.                     prependListener(dest, "error", onerror);
  5767.  
  5768.                     function onclose() {
  5769.                         dest.removeListener("finish", onfinish);
  5770.                         unpipe()
  5771.                     }
  5772.                     dest.once("close", onclose);
  5773.  
  5774.                     function onfinish() {
  5775.                         debug("onfinish");
  5776.                         dest.removeListener("close", onclose);
  5777.                         unpipe()
  5778.                     }
  5779.                     dest.once("finish", onfinish);
  5780.  
  5781.                     function unpipe() {
  5782.                         debug("unpipe");
  5783.                         src.unpipe(dest)
  5784.                     }
  5785.                     dest.emit("pipe", src);
  5786.                     if (!state.flowing) {
  5787.                         debug("pipe resume");
  5788.                         src.resume()
  5789.                     }
  5790.                     return dest
  5791.                 };
  5792.  
  5793.                 function pipeOnDrain(src) {
  5794.                     return function() {
  5795.                         var state = src._readableState;
  5796.                         debug("pipeOnDrain", state.awaitDrain);
  5797.                         if (state.awaitDrain) state.awaitDrain--;
  5798.                         if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
  5799.                             state.flowing = true;
  5800.                             flow(src)
  5801.                         }
  5802.                     }
  5803.                 }
  5804.                 Readable.prototype.unpipe = function(dest) {
  5805.                     var state = this._readableState;
  5806.                     var unpipeInfo = {
  5807.                         hasUnpiped: false
  5808.                     };
  5809.                     if (state.pipesCount === 0) return this;
  5810.                     if (state.pipesCount === 1) {
  5811.                         if (dest && dest !== state.pipes) return this;
  5812.                         if (!dest) dest = state.pipes;
  5813.                         state.pipes = null;
  5814.                         state.pipesCount = 0;
  5815.                         state.flowing = false;
  5816.                         if (dest) dest.emit("unpipe", this, unpipeInfo);
  5817.                         return this
  5818.                     }
  5819.                     if (!dest) {
  5820.                         var dests = state.pipes;
  5821.                         var len = state.pipesCount;
  5822.                         state.pipes = null;
  5823.                         state.pipesCount = 0;
  5824.                         state.flowing = false;
  5825.                         for (var i = 0; i < len; i++) {
  5826.                             dests[i].emit("unpipe", this, unpipeInfo)
  5827.                         }
  5828.                         return this
  5829.                     }
  5830.                     var index = indexOf(state.pipes, dest);
  5831.                     if (index === -1) return this;
  5832.                     state.pipes.splice(index, 1);
  5833.                     state.pipesCount -= 1;
  5834.                     if (state.pipesCount === 1) state.pipes = state.pipes[0];
  5835.                     dest.emit("unpipe", this, unpipeInfo);
  5836.                     return this
  5837.                 };
  5838.                 Readable.prototype.on = function(ev, fn) {
  5839.                     var res = Stream.prototype.on.call(this, ev, fn);
  5840.                     if (ev === "data") {
  5841.                         if (this._readableState.flowing !== false) this.resume()
  5842.                     } else if (ev === "readable") {
  5843.                         var state = this._readableState;
  5844.                         if (!state.endEmitted && !state.readableListening) {
  5845.                             state.readableListening = state.needReadable = true;
  5846.                             state.emittedReadable = false;
  5847.                             if (!state.reading) {
  5848.                                 pna.nextTick(nReadingNextTick, this)
  5849.                             } else if (state.length) {
  5850.                                 emitReadable(this)
  5851.                             }
  5852.                         }
  5853.                     }
  5854.                     return res
  5855.                 };
  5856.                 Readable.prototype.addListener = Readable.prototype.on;
  5857.  
  5858.                 function nReadingNextTick(self) {
  5859.                     debug("readable nexttick read 0");
  5860.                     self.read(0)
  5861.                 }
  5862.                 Readable.prototype.resume = function() {
  5863.                     var state = this._readableState;
  5864.                     if (!state.flowing) {
  5865.                         debug("resume");
  5866.                         state.flowing = true;
  5867.                         resume(this, state)
  5868.                     }
  5869.                     return this
  5870.                 };
  5871.  
  5872.                 function resume(stream, state) {
  5873.                     if (!state.resumeScheduled) {
  5874.                         state.resumeScheduled = true;
  5875.                         pna.nextTick(resume_, stream, state)
  5876.                     }
  5877.                 }
  5878.  
  5879.                 function resume_(stream, state) {
  5880.                     if (!state.reading) {
  5881.                         debug("resume read 0");
  5882.                         stream.read(0)
  5883.                     }
  5884.                     state.resumeScheduled = false;
  5885.                     state.awaitDrain = 0;
  5886.                     stream.emit("resume");
  5887.                     flow(stream);
  5888.                     if (state.flowing && !state.reading) stream.read(0)
  5889.                 }
  5890.                 Readable.prototype.pause = function() {
  5891.                     debug("call pause flowing=%j", this._readableState.flowing);
  5892.                     if (false !== this._readableState.flowing) {
  5893.                         debug("pause");
  5894.                         this._readableState.flowing = false;
  5895.                         this.emit("pause")
  5896.                     }
  5897.                     return this
  5898.                 };
  5899.  
  5900.                 function flow(stream) {
  5901.                     var state = stream._readableState;
  5902.                     debug("flow", state.flowing);
  5903.                     while (state.flowing && stream.read() !== null) {}
  5904.                 }
  5905.                 Readable.prototype.wrap = function(stream) {
  5906.                     var _this = this;
  5907.                     var state = this._readableState;
  5908.                     var paused = false;
  5909.                     stream.on("end", function() {
  5910.                         debug("wrapped end");
  5911.                         if (state.decoder && !state.ended) {
  5912.                             var chunk = state.decoder.end();
  5913.                             if (chunk && chunk.length) _this.push(chunk)
  5914.                         }
  5915.                         _this.push(null)
  5916.                     });
  5917.                     stream.on("data", function(chunk) {
  5918.                         debug("wrapped data");
  5919.                         if (state.decoder) chunk = state.decoder.write(chunk);
  5920.                         if (state.objectMode && (chunk === null || chunk === undefined)) return;
  5921.                         else if (!state.objectMode && (!chunk || !chunk.length)) return;
  5922.                         var ret = _this.push(chunk);
  5923.                         if (!ret) {
  5924.                             paused = true;
  5925.                             stream.pause()
  5926.                         }
  5927.                     });
  5928.                     for (var i in stream) {
  5929.                         if (this[i] === undefined && typeof stream[i] === "function") {
  5930.                             this[i] = function(method) {
  5931.                                 return function() {
  5932.                                     return stream[method].apply(stream, arguments)
  5933.                                 }
  5934.                             }(i)
  5935.                         }
  5936.                     }
  5937.                     for (var n = 0; n < kProxyEvents.length; n++) {
  5938.                         stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]))
  5939.                     }
  5940.                     this._read = function(n) {
  5941.                         debug("wrapped _read", n);
  5942.                         if (paused) {
  5943.                             paused = false;
  5944.                             stream.resume()
  5945.                         }
  5946.                     };
  5947.                     return this
  5948.                 };
  5949.                 Readable._fromList = fromList;
  5950.  
  5951.                 function fromList(n, state) {
  5952.                     if (state.length === 0) return null;
  5953.                     var ret;
  5954.                     if (state.objectMode) ret = state.buffer.shift();
  5955.                     else if (!n || n >= state.length) {
  5956.                         if (state.decoder) ret = state.buffer.join("");
  5957.                         else if (state.buffer.length === 1) ret = state.buffer.head.data;
  5958.                         else ret = state.buffer.concat(state.length);
  5959.                         state.buffer.clear()
  5960.                     } else {
  5961.                         ret = fromListPartial(n, state.buffer, state.decoder)
  5962.                     }
  5963.                     return ret
  5964.                 }
  5965.  
  5966.                 function fromListPartial(n, list, hasStrings) {
  5967.                     var ret;
  5968.                     if (n < list.head.data.length) {
  5969.                         ret = list.head.data.slice(0, n);
  5970.                         list.head.data = list.head.data.slice(n)
  5971.                     } else if (n === list.head.data.length) {
  5972.                         ret = list.shift()
  5973.                     } else {
  5974.                         ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list)
  5975.                     }
  5976.                     return ret
  5977.                 }
  5978.  
  5979.                 function copyFromBufferString(n, list) {
  5980.                     var p = list.head;
  5981.                     var c = 1;
  5982.                     var ret = p.data;
  5983.                     n -= ret.length;
  5984.                     while (p = p.next) {
  5985.                         var str = p.data;
  5986.                         var nb = n > str.length ? str.length : n;
  5987.                         if (nb === str.length) ret += str;
  5988.                         else ret += str.slice(0, n);
  5989.                         n -= nb;
  5990.                         if (n === 0) {
  5991.                             if (nb === str.length) {
  5992.                                 ++c;
  5993.                                 if (p.next) list.head = p.next;
  5994.                                 else list.head = list.tail = null
  5995.                             } else {
  5996.                                 list.head = p;
  5997.                                 p.data = str.slice(nb)
  5998.                             }
  5999.                             break
  6000.                         }++c
  6001.                     }
  6002.                     list.length -= c;
  6003.                     return ret
  6004.                 }
  6005.  
  6006.                 function copyFromBuffer(n, list) {
  6007.                     var ret = Buffer.allocUnsafe(n);
  6008.                     var p = list.head;
  6009.                     var c = 1;
  6010.                     p.data.copy(ret);
  6011.                     n -= p.data.length;
  6012.                     while (p = p.next) {
  6013.                         var buf = p.data;
  6014.                         var nb = n > buf.length ? buf.length : n;
  6015.                         buf.copy(ret, ret.length - n, 0, nb);
  6016.                         n -= nb;
  6017.                         if (n === 0) {
  6018.                             if (nb === buf.length) {
  6019.                                 ++c;
  6020.                                 if (p.next) list.head = p.next;
  6021.                                 else list.head = list.tail = null
  6022.                             } else {
  6023.                                 list.head = p;
  6024.                                 p.data = buf.slice(nb)
  6025.                             }
  6026.                             break
  6027.                         }++c
  6028.                     }
  6029.                     list.length -= c;
  6030.                     return ret
  6031.                 }
  6032.  
  6033.                 function endReadable(stream) {
  6034.                     var state = stream._readableState;
  6035.                     if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream');
  6036.                     if (!state.endEmitted) {
  6037.                         state.ended = true;
  6038.                         pna.nextTick(endReadableNT, state, stream)
  6039.                     }
  6040.                 }
  6041.  
  6042.                 function endReadableNT(state, stream) {
  6043.                     if (!state.endEmitted && state.length === 0) {
  6044.                         state.endEmitted = true;
  6045.                         stream.readable = false;
  6046.                         stream.emit("end")
  6047.                     }
  6048.                 }
  6049.  
  6050.                 function forEach(xs, f) {
  6051.                     for (var i = 0, l = xs.length; i < l; i++) {
  6052.                         f(xs[i], i)
  6053.                     }
  6054.                 }
  6055.  
  6056.                 function indexOf(xs, x) {
  6057.                     for (var i = 0, l = xs.length; i < l; i++) {
  6058.                         if (xs[i] === x) return i
  6059.                     }
  6060.                     return -1
  6061.                 }
  6062.             }).call(this, require("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  6063.         }, {
  6064.             "./_stream_duplex": 36,
  6065.             "./internal/streams/BufferList": 41,
  6066.             "./internal/streams/destroy": 42,
  6067.             "./internal/streams/stream": 43,
  6068.             _process: 30,
  6069.             "core-util-is": 14,
  6070.             events: 12,
  6071.             inherits: 18,
  6072.             isarray: 20,
  6073.             "process-nextick-args": 44,
  6074.             "safe-buffer": 47,
  6075.             "string_decoder/": 49,
  6076.             util: 11
  6077.         }],
  6078.         39: [function(require, module, exports) {
  6079.             "use strict";
  6080.             module.exports = Transform;
  6081.             var Duplex = require("./_stream_duplex");
  6082.             var util = require("core-util-is");
  6083.             util.inherits = require("inherits");
  6084.             util.inherits(Transform, Duplex);
  6085.  
  6086.             function afterTransform(er, data) {
  6087.                 var ts = this._transformState;
  6088.                 ts.transforming = false;
  6089.                 var cb = ts.writecb;
  6090.                 if (!cb) {
  6091.                     return this.emit("error", new Error("write callback called multiple times"))
  6092.                 }
  6093.                 ts.writechunk = null;
  6094.                 ts.writecb = null;
  6095.                 if (data != null) this.push(data);
  6096.                 cb(er);
  6097.                 var rs = this._readableState;
  6098.                 rs.reading = false;
  6099.                 if (rs.needReadable || rs.length < rs.highWaterMark) {
  6100.                     this._read(rs.highWaterMark)
  6101.                 }
  6102.             }
  6103.  
  6104.             function Transform(options) {
  6105.                 if (!(this instanceof Transform)) return new Transform(options);
  6106.                 Duplex.call(this, options);
  6107.                 this._transformState = {
  6108.                     afterTransform: afterTransform.bind(this),
  6109.                     needTransform: false,
  6110.                     transforming: false,
  6111.                     writecb: null,
  6112.                     writechunk: null,
  6113.                     writeencoding: null
  6114.                 };
  6115.                 this._readableState.needReadable = true;
  6116.                 this._readableState.sync = false;
  6117.                 if (options) {
  6118.                     if (typeof options.transform === "function") this._transform = options.transform;
  6119.                     if (typeof options.flush === "function") this._flush = options.flush
  6120.                 }
  6121.                 this.on("prefinish", prefinish)
  6122.             }
  6123.  
  6124.             function prefinish() {
  6125.                 var _this = this;
  6126.                 if (typeof this._flush === "function") {
  6127.                     this._flush(function(er, data) {
  6128.                         done(_this, er, data)
  6129.                     })
  6130.                 } else {
  6131.                     done(this, null, null)
  6132.                 }
  6133.             }
  6134.             Transform.prototype.push = function(chunk, encoding) {
  6135.                 this._transformState.needTransform = false;
  6136.                 return Duplex.prototype.push.call(this, chunk, encoding)
  6137.             };
  6138.             Transform.prototype._transform = function(chunk, encoding, cb) {
  6139.                 throw new Error("_transform() is not implemented")
  6140.             };
  6141.             Transform.prototype._write = function(chunk, encoding, cb) {
  6142.                 var ts = this._transformState;
  6143.                 ts.writecb = cb;
  6144.                 ts.writechunk = chunk;
  6145.                 ts.writeencoding = encoding;
  6146.                 if (!ts.transforming) {
  6147.                     var rs = this._readableState;
  6148.                     if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark)
  6149.                 }
  6150.             };
  6151.             Transform.prototype._read = function(n) {
  6152.                 var ts = this._transformState;
  6153.                 if (ts.writechunk !== null && ts.writecb && !ts.transforming) {
  6154.                     ts.transforming = true;
  6155.                     this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform)
  6156.                 } else {
  6157.                     ts.needTransform = true
  6158.                 }
  6159.             };
  6160.             Transform.prototype._destroy = function(err, cb) {
  6161.                 var _this2 = this;
  6162.                 Duplex.prototype._destroy.call(this, err, function(err2) {
  6163.                     cb(err2);
  6164.                     _this2.emit("close")
  6165.                 })
  6166.             };
  6167.  
  6168.             function done(stream, er, data) {
  6169.                 if (er) return stream.emit("error", er);
  6170.                 if (data != null) stream.push(data);
  6171.                 if (stream._writableState.length) throw new Error("Calling transform done when ws.length != 0");
  6172.                 if (stream._transformState.transforming) throw new Error("Calling transform done when still transforming");
  6173.                 return stream.push(null)
  6174.             }
  6175.         }, {
  6176.             "./_stream_duplex": 36,
  6177.             "core-util-is": 14,
  6178.             inherits: 18
  6179.         }],
  6180.         40: [function(require, module, exports) {
  6181.             (function(process, global) {
  6182.                 "use strict";
  6183.                 var pna = require("process-nextick-args");
  6184.                 module.exports = Writable;
  6185.  
  6186.                 function WriteReq(chunk, encoding, cb) {
  6187.                     this.chunk = chunk;
  6188.                     this.encoding = encoding;
  6189.                     this.callback = cb;
  6190.                     this.next = null
  6191.                 }
  6192.  
  6193.                 function CorkedRequest(state) {
  6194.                     var _this = this;
  6195.                     this.next = null;
  6196.                     this.entry = null;
  6197.                     this.finish = function() {
  6198.                         onCorkedFinish(_this, state)
  6199.                     }
  6200.                 }
  6201.                 var asyncWrite = !process.browser && ["v0.10", "v0.9."].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : pna.nextTick;
  6202.                 var Duplex;
  6203.                 Writable.WritableState = WritableState;
  6204.                 var util = require("core-util-is");
  6205.                 util.inherits = require("inherits");
  6206.                 var internalUtil = {
  6207.                     deprecate: require("util-deprecate")
  6208.                 };
  6209.                 var Stream = require("./internal/streams/stream");
  6210.                 var Buffer = require("safe-buffer").Buffer;
  6211.                 var OurUint8Array = global.Uint8Array || function() {};
  6212.  
  6213.                 function _uint8ArrayToBuffer(chunk) {
  6214.                     return Buffer.from(chunk)
  6215.                 }
  6216.  
  6217.                 function _isUint8Array(obj) {
  6218.                     return Buffer.isBuffer(obj) || obj instanceof OurUint8Array
  6219.                 }
  6220.                 var destroyImpl = require("./internal/streams/destroy");
  6221.                 util.inherits(Writable, Stream);
  6222.  
  6223.                 function nop() {}
  6224.  
  6225.                 function WritableState(options, stream) {
  6226.                     Duplex = Duplex || require("./_stream_duplex");
  6227.                     options = options || {};
  6228.                     var isDuplex = stream instanceof Duplex;
  6229.                     this.objectMode = !!options.objectMode;
  6230.                     if (isDuplex) this.objectMode = this.objectMode || !!options.writableObjectMode;
  6231.                     var hwm = options.highWaterMark;
  6232.                     var writableHwm = options.writableHighWaterMark;
  6233.                     var defaultHwm = this.objectMode ? 16 : 16 * 1024;
  6234.                     if (hwm || hwm === 0) this.highWaterMark = hwm;
  6235.                     else if (isDuplex && (writableHwm || writableHwm === 0)) this.highWaterMark = writableHwm;
  6236.                     else this.highWaterMark = defaultHwm;
  6237.                     this.highWaterMark = Math.floor(this.highWaterMark);
  6238.                     this.finalCalled = false;
  6239.                     this.needDrain = false;
  6240.                     this.ending = false;
  6241.                     this.ended = false;
  6242.                     this.finished = false;
  6243.                     this.destroyed = false;
  6244.                     var noDecode = options.decodeStrings === false;
  6245.                     this.decodeStrings = !noDecode;
  6246.                     this.defaultEncoding = options.defaultEncoding || "utf8";
  6247.                     this.length = 0;
  6248.                     this.writing = false;
  6249.                     this.corked = 0;
  6250.                     this.sync = true;
  6251.                     this.bufferProcessing = false;
  6252.                     this.onwrite = function(er) {
  6253.                         onwrite(stream, er)
  6254.                     };
  6255.                     this.writecb = null;
  6256.                     this.writelen = 0;
  6257.                     this.bufferedRequest = null;
  6258.                     this.lastBufferedRequest = null;
  6259.                     this.pendingcb = 0;
  6260.                     this.prefinished = false;
  6261.                     this.errorEmitted = false;
  6262.                     this.bufferedRequestCount = 0;
  6263.                     this.corkedRequestsFree = new CorkedRequest(this)
  6264.                 }
  6265.                 WritableState.prototype.getBuffer = function getBuffer() {
  6266.                     var current = this.bufferedRequest;
  6267.                     var out = [];
  6268.                     while (current) {
  6269.                         out.push(current);
  6270.                         current = current.next
  6271.                     }
  6272.                     return out
  6273.                 };
  6274.                 (function() {
  6275.                     try {
  6276.                         Object.defineProperty(WritableState.prototype, "buffer", {
  6277.                             get: internalUtil.deprecate(function() {
  6278.                                 return this.getBuffer()
  6279.                             }, "_writableState.buffer is deprecated. Use _writableState.getBuffer " + "instead.", "DEP0003")
  6280.                         })
  6281.                     } catch (_) {}
  6282.                 })();
  6283.                 var realHasInstance;
  6284.                 if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") {
  6285.                     realHasInstance = Function.prototype[Symbol.hasInstance];
  6286.                     Object.defineProperty(Writable, Symbol.hasInstance, {
  6287.                         value: function(object) {
  6288.                             if (realHasInstance.call(this, object)) return true;
  6289.                             if (this !== Writable) return false;
  6290.                             return object && object._writableState instanceof WritableState
  6291.                         }
  6292.                     })
  6293.                 } else {
  6294.                     realHasInstance = function(object) {
  6295.                         return object instanceof this
  6296.                     }
  6297.                 }
  6298.  
  6299.                 function Writable(options) {
  6300.                     Duplex = Duplex || require("./_stream_duplex");
  6301.                     if (!realHasInstance.call(Writable, this) && !(this instanceof Duplex)) {
  6302.                         return new Writable(options)
  6303.                     }
  6304.                     this._writableState = new WritableState(options, this);
  6305.                     this.writable = true;
  6306.                     if (options) {
  6307.                         if (typeof options.write === "function") this._write = options.write;
  6308.                         if (typeof options.writev === "function") this._writev = options.writev;
  6309.                         if (typeof options.destroy === "function") this._destroy = options.destroy;
  6310.                         if (typeof options.final === "function") this._final = options.final
  6311.                     }
  6312.                     Stream.call(this)
  6313.                 }
  6314.                 Writable.prototype.pipe = function() {
  6315.                     this.emit("error", new Error("Cannot pipe, not readable"))
  6316.                 };
  6317.  
  6318.                 function writeAfterEnd(stream, cb) {
  6319.                     var er = new Error("write after end");
  6320.                     stream.emit("error", er);
  6321.                     pna.nextTick(cb, er)
  6322.                 }
  6323.  
  6324.                 function validChunk(stream, state, chunk, cb) {
  6325.                     var valid = true;
  6326.                     var er = false;
  6327.                     if (chunk === null) {
  6328.                         er = new TypeError("May not write null values to stream")
  6329.                     } else if (typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
  6330.                         er = new TypeError("Invalid non-string/buffer chunk")
  6331.                     }
  6332.                     if (er) {
  6333.                         stream.emit("error", er);
  6334.                         pna.nextTick(cb, er);
  6335.                         valid = false
  6336.                     }
  6337.                     return valid
  6338.                 }
  6339.                 Writable.prototype.write = function(chunk, encoding, cb) {
  6340.                     var state = this._writableState;
  6341.                     var ret = false;
  6342.                     var isBuf = !state.objectMode && _isUint8Array(chunk);
  6343.                     if (isBuf && !Buffer.isBuffer(chunk)) {
  6344.                         chunk = _uint8ArrayToBuffer(chunk)
  6345.                     }
  6346.                     if (typeof encoding === "function") {
  6347.                         cb = encoding;
  6348.                         encoding = null
  6349.                     }
  6350.                     if (isBuf) encoding = "buffer";
  6351.                     else if (!encoding) encoding = state.defaultEncoding;
  6352.                     if (typeof cb !== "function") cb = nop;
  6353.                     if (state.ended) writeAfterEnd(this, cb);
  6354.                     else if (isBuf || validChunk(this, state, chunk, cb)) {
  6355.                         state.pendingcb++;
  6356.                         ret = writeOrBuffer(this, state, isBuf, chunk, encoding, cb)
  6357.                     }
  6358.                     return ret
  6359.                 };
  6360.                 Writable.prototype.cork = function() {
  6361.                     var state = this._writableState;
  6362.                     state.corked++
  6363.                 };
  6364.                 Writable.prototype.uncork = function() {
  6365.                     var state = this._writableState;
  6366.                     if (state.corked) {
  6367.                         state.corked--;
  6368.                         if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state)
  6369.                     }
  6370.                 };
  6371.                 Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) {
  6372.                     if (typeof encoding === "string") encoding = encoding.toLowerCase();
  6373.                     if (!(["hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw"].indexOf((encoding + "").toLowerCase()) > -1)) throw new TypeError("Unknown encoding: " + encoding);
  6374.                     this._writableState.defaultEncoding = encoding;
  6375.                     return this
  6376.                 };
  6377.  
  6378.                 function decodeChunk(state, chunk, encoding) {
  6379.                     if (!state.objectMode && state.decodeStrings !== false && typeof chunk === "string") {
  6380.                         chunk = Buffer.from(chunk, encoding)
  6381.                     }
  6382.                     return chunk
  6383.                 }
  6384.  
  6385.                 function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) {
  6386.                     if (!isBuf) {
  6387.                         var newChunk = decodeChunk(state, chunk, encoding);
  6388.                         if (chunk !== newChunk) {
  6389.                             isBuf = true;
  6390.                             encoding = "buffer";
  6391.                             chunk = newChunk
  6392.                         }
  6393.                     }
  6394.                     var len = state.objectMode ? 1 : chunk.length;
  6395.                     state.length += len;
  6396.                     var ret = state.length < state.highWaterMark;
  6397.                     if (!ret) state.needDrain = true;
  6398.                     if (state.writing || state.corked) {
  6399.                         var last = state.lastBufferedRequest;
  6400.                         state.lastBufferedRequest = {
  6401.                             chunk: chunk,
  6402.                             encoding: encoding,
  6403.                             isBuf: isBuf,
  6404.                             callback: cb,
  6405.                             next: null
  6406.                         };
  6407.                         if (last) {
  6408.                             last.next = state.lastBufferedRequest
  6409.                         } else {
  6410.                             state.bufferedRequest = state.lastBufferedRequest
  6411.                         }
  6412.                         state.bufferedRequestCount += 1
  6413.                     } else {
  6414.                         doWrite(stream, state, false, len, chunk, encoding, cb)
  6415.                     }
  6416.                     return ret
  6417.                 }
  6418.  
  6419.                 function doWrite(stream, state, writev, len, chunk, encoding, cb) {
  6420.                     state.writelen = len;
  6421.                     state.writecb = cb;
  6422.                     state.writing = true;
  6423.                     state.sync = true;
  6424.                     if (writev) stream._writev(chunk, state.onwrite);
  6425.                     else stream._write(chunk, encoding, state.onwrite);
  6426.                     state.sync = false
  6427.                 }
  6428.  
  6429.                 function onwriteError(stream, state, sync, er, cb) {
  6430.                     --state.pendingcb;
  6431.                     if (sync) {
  6432.                         pna.nextTick(cb, er);
  6433.                         pna.nextTick(finishMaybe, stream, state);
  6434.                         stream._writableState.errorEmitted = true;
  6435.                         stream.emit("error", er)
  6436.                     } else {
  6437.                         cb(er);
  6438.                         stream._writableState.errorEmitted = true;
  6439.                         stream.emit("error", er);
  6440.                         finishMaybe(stream, state)
  6441.                     }
  6442.                 }
  6443.  
  6444.                 function onwriteStateUpdate(state) {
  6445.                     state.writing = false;
  6446.                     state.writecb = null;
  6447.                     state.length -= state.writelen;
  6448.                     state.writelen = 0
  6449.                 }
  6450.  
  6451.                 function onwrite(stream, er) {
  6452.                     var state = stream._writableState;
  6453.                     var sync = state.sync;
  6454.                     var cb = state.writecb;
  6455.                     onwriteStateUpdate(state);
  6456.                     if (er) onwriteError(stream, state, sync, er, cb);
  6457.                     else {
  6458.                         var finished = needFinish(state);
  6459.                         if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) {
  6460.                             clearBuffer(stream, state)
  6461.                         }
  6462.                         if (sync) {
  6463.                             asyncWrite(afterWrite, stream, state, finished, cb)
  6464.                         } else {
  6465.                             afterWrite(stream, state, finished, cb)
  6466.                         }
  6467.                     }
  6468.                 }
  6469.  
  6470.                 function afterWrite(stream, state, finished, cb) {
  6471.                     if (!finished) onwriteDrain(stream, state);
  6472.                     state.pendingcb--;
  6473.                     cb();
  6474.                     finishMaybe(stream, state)
  6475.                 }
  6476.  
  6477.                 function onwriteDrain(stream, state) {
  6478.                     if (state.length === 0 && state.needDrain) {
  6479.                         state.needDrain = false;
  6480.                         stream.emit("drain")
  6481.                     }
  6482.                 }
  6483.  
  6484.                 function clearBuffer(stream, state) {
  6485.                     state.bufferProcessing = true;
  6486.                     var entry = state.bufferedRequest;
  6487.                     if (stream._writev && entry && entry.next) {
  6488.                         var l = state.bufferedRequestCount;
  6489.                         var buffer = new Array(l);
  6490.                         var holder = state.corkedRequestsFree;
  6491.                         holder.entry = entry;
  6492.                         var count = 0;
  6493.                         var allBuffers = true;
  6494.                         while (entry) {
  6495.                             buffer[count] = entry;
  6496.                             if (!entry.isBuf) allBuffers = false;
  6497.                             entry = entry.next;
  6498.                             count += 1
  6499.                         }
  6500.                         buffer.allBuffers = allBuffers;
  6501.                         doWrite(stream, state, true, state.length, buffer, "", holder.finish);
  6502.                         state.pendingcb++;
  6503.                         state.lastBufferedRequest = null;
  6504.                         if (holder.next) {
  6505.                             state.corkedRequestsFree = holder.next;
  6506.                             holder.next = null
  6507.                         } else {
  6508.                             state.corkedRequestsFree = new CorkedRequest(state)
  6509.                         }
  6510.                         state.bufferedRequestCount = 0
  6511.                     } else {
  6512.                         while (entry) {
  6513.                             var chunk = entry.chunk;
  6514.                             var encoding = entry.encoding;
  6515.                             var cb = entry.callback;
  6516.                             var len = state.objectMode ? 1 : chunk.length;
  6517.                             doWrite(stream, state, false, len, chunk, encoding, cb);
  6518.                             entry = entry.next;
  6519.                             state.bufferedRequestCount--;
  6520.                             if (state.writing) {
  6521.                                 break
  6522.                             }
  6523.                         }
  6524.                         if (entry === null) state.lastBufferedRequest = null
  6525.                     }
  6526.                     state.bufferedRequest = entry;
  6527.                     state.bufferProcessing = false
  6528.                 }
  6529.                 Writable.prototype._write = function(chunk, encoding, cb) {
  6530.                     cb(new Error("_write() is not implemented"))
  6531.                 };
  6532.                 Writable.prototype._writev = null;
  6533.                 Writable.prototype.end = function(chunk, encoding, cb) {
  6534.                     var state = this._writableState;
  6535.                     if (typeof chunk === "function") {
  6536.                         cb = chunk;
  6537.                         chunk = null;
  6538.                         encoding = null
  6539.                     } else if (typeof encoding === "function") {
  6540.                         cb = encoding;
  6541.                         encoding = null
  6542.                     }
  6543.                     if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
  6544.                     if (state.corked) {
  6545.                         state.corked = 1;
  6546.                         this.uncork()
  6547.                     }
  6548.                     if (!state.ending && !state.finished) endWritable(this, state, cb)
  6549.                 };
  6550.  
  6551.                 function needFinish(state) {
  6552.                     return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing
  6553.                 }
  6554.  
  6555.                 function callFinal(stream, state) {
  6556.                     stream._final(function(err) {
  6557.                         state.pendingcb--;
  6558.                         if (err) {
  6559.                             stream.emit("error", err)
  6560.                         }
  6561.                         state.prefinished = true;
  6562.                         stream.emit("prefinish");
  6563.                         finishMaybe(stream, state)
  6564.                     })
  6565.                 }
  6566.  
  6567.                 function prefinish(stream, state) {
  6568.                     if (!state.prefinished && !state.finalCalled) {
  6569.                         if (typeof stream._final === "function") {
  6570.                             state.pendingcb++;
  6571.                             state.finalCalled = true;
  6572.                             pna.nextTick(callFinal, stream, state)
  6573.                         } else {
  6574.                             state.prefinished = true;
  6575.                             stream.emit("prefinish")
  6576.                         }
  6577.                     }
  6578.                 }
  6579.  
  6580.                 function finishMaybe(stream, state) {
  6581.                     var need = needFinish(state);
  6582.                     if (need) {
  6583.                         prefinish(stream, state);
  6584.                         if (state.pendingcb === 0) {
  6585.                             state.finished = true;
  6586.                             stream.emit("finish")
  6587.                         }
  6588.                     }
  6589.                     return need
  6590.                 }
  6591.  
  6592.                 function endWritable(stream, state, cb) {
  6593.                     state.ending = true;
  6594.                     finishMaybe(stream, state);
  6595.                     if (cb) {
  6596.                         if (state.finished) pna.nextTick(cb);
  6597.                         else stream.once("finish", cb)
  6598.                     }
  6599.                     state.ended = true;
  6600.                     stream.writable = false
  6601.                 }
  6602.  
  6603.                 function onCorkedFinish(corkReq, state, err) {
  6604.                     var entry = corkReq.entry;
  6605.                     corkReq.entry = null;
  6606.                     while (entry) {
  6607.                         var cb = entry.callback;
  6608.                         state.pendingcb--;
  6609.                         cb(err);
  6610.                         entry = entry.next
  6611.                     }
  6612.                     if (state.corkedRequestsFree) {
  6613.                         state.corkedRequestsFree.next = corkReq
  6614.                     } else {
  6615.                         state.corkedRequestsFree = corkReq
  6616.                     }
  6617.                 }
  6618.                 Object.defineProperty(Writable.prototype, "destroyed", {
  6619.                     get: function() {
  6620.                         if (this._writableState === undefined) {
  6621.                             return false
  6622.                         }
  6623.                         return this._writableState.destroyed
  6624.                     },
  6625.                     set: function(value) {
  6626.                         if (!this._writableState) {
  6627.                             return
  6628.                         }
  6629.                         this._writableState.destroyed = value
  6630.                     }
  6631.                 });
  6632.                 Writable.prototype.destroy = destroyImpl.destroy;
  6633.                 Writable.prototype._undestroy = destroyImpl.undestroy;
  6634.                 Writable.prototype._destroy = function(err, cb) {
  6635.                     this.end();
  6636.                     cb(err)
  6637.                 }
  6638.             }).call(this, require("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  6639.         }, {
  6640.             "./_stream_duplex": 36,
  6641.             "./internal/streams/destroy": 42,
  6642.             "./internal/streams/stream": 43,
  6643.             _process: 30,
  6644.             "core-util-is": 14,
  6645.             inherits: 18,
  6646.             "process-nextick-args": 44,
  6647.             "safe-buffer": 47,
  6648.             "util-deprecate": 52
  6649.         }],
  6650.         41: [function(require, module, exports) {
  6651.             "use strict";
  6652.  
  6653.             function _classCallCheck(instance, Constructor) {
  6654.                 if (!(instance instanceof Constructor)) {
  6655.                     throw new TypeError("Cannot call a class as a function")
  6656.                 }
  6657.             }
  6658.             var Buffer = require("safe-buffer").Buffer;
  6659.             var util = require("util");
  6660.  
  6661.             function copyBuffer(src, target, offset) {
  6662.                 src.copy(target, offset)
  6663.             }
  6664.             module.exports = function() {
  6665.                 function BufferList() {
  6666.                     _classCallCheck(this, BufferList);
  6667.                     this.head = null;
  6668.                     this.tail = null;
  6669.                     this.length = 0
  6670.                 }
  6671.                 BufferList.prototype.push = function push(v) {
  6672.                     var entry = {
  6673.                         data: v,
  6674.                         next: null
  6675.                     };
  6676.                     if (this.length > 0) this.tail.next = entry;
  6677.                     else this.head = entry;
  6678.                     this.tail = entry;
  6679.                     ++this.length
  6680.                 };
  6681.                 BufferList.prototype.unshift = function unshift(v) {
  6682.                     var entry = {
  6683.                         data: v,
  6684.                         next: this.head
  6685.                     };
  6686.                     if (this.length === 0) this.tail = entry;
  6687.                     this.head = entry;
  6688.                     ++this.length
  6689.                 };
  6690.                 BufferList.prototype.shift = function shift() {
  6691.                     if (this.length === 0) return;
  6692.                     var ret = this.head.data;
  6693.                     if (this.length === 1) this.head = this.tail = null;
  6694.                     else this.head = this.head.next;
  6695.                     --this.length;
  6696.                     return ret
  6697.                 };
  6698.                 BufferList.prototype.clear = function clear() {
  6699.                     this.head = this.tail = null;
  6700.                     this.length = 0
  6701.                 };
  6702.                 BufferList.prototype.join = function join(s) {
  6703.                     if (this.length === 0) return "";
  6704.                     var p = this.head;
  6705.                     var ret = "" + p.data;
  6706.                     while (p = p.next) {
  6707.                         ret += s + p.data
  6708.                     }
  6709.                     return ret
  6710.                 };
  6711.                 BufferList.prototype.concat = function concat(n) {
  6712.                     if (this.length === 0) return Buffer.alloc(0);
  6713.                     if (this.length === 1) return this.head.data;
  6714.                     var ret = Buffer.allocUnsafe(n >>> 0);
  6715.                     var p = this.head;
  6716.                     var i = 0;
  6717.                     while (p) {
  6718.                         copyBuffer(p.data, ret, i);
  6719.                         i += p.data.length;
  6720.                         p = p.next
  6721.                     }
  6722.                     return ret
  6723.                 };
  6724.                 return BufferList
  6725.             }();
  6726.             if (util && util.inspect && util.inspect.custom) {
  6727.                 module.exports.prototype[util.inspect.custom] = function() {
  6728.                     var obj = util.inspect({
  6729.                         length: this.length
  6730.                     });
  6731.                     return this.constructor.name + " " + obj
  6732.                 }
  6733.             }
  6734.         }, {
  6735.             "safe-buffer": 47,
  6736.             util: 11
  6737.         }],
  6738.         42: [function(require, module, exports) {
  6739.             "use strict";
  6740.             var pna = require("process-nextick-args");
  6741.  
  6742.             function destroy(err, cb) {
  6743.                 var _this = this;
  6744.                 var readableDestroyed = this._readableState && this._readableState.destroyed;
  6745.                 var writableDestroyed = this._writableState && this._writableState.destroyed;
  6746.                 if (readableDestroyed || writableDestroyed) {
  6747.                     if (cb) {
  6748.                         cb(err)
  6749.                     } else if (err && (!this._writableState || !this._writableState.errorEmitted)) {
  6750.                         pna.nextTick(emitErrorNT, this, err)
  6751.                     }
  6752.                     return this
  6753.                 }
  6754.                 if (this._readableState) {
  6755.                     this._readableState.destroyed = true
  6756.                 }
  6757.                 if (this._writableState) {
  6758.                     this._writableState.destroyed = true
  6759.                 }
  6760.                 this._destroy(err || null, function(err) {
  6761.                     if (!cb && err) {
  6762.                         pna.nextTick(emitErrorNT, _this, err);
  6763.                         if (_this._writableState) {
  6764.                             _this._writableState.errorEmitted = true
  6765.                         }
  6766.                     } else if (cb) {
  6767.                         cb(err)
  6768.                     }
  6769.                 });
  6770.                 return this
  6771.             }
  6772.  
  6773.             function undestroy() {
  6774.                 if (this._readableState) {
  6775.                     this._readableState.destroyed = false;
  6776.                     this._readableState.reading = false;
  6777.                     this._readableState.ended = false;
  6778.                     this._readableState.endEmitted = false
  6779.                 }
  6780.                 if (this._writableState) {
  6781.                     this._writableState.destroyed = false;
  6782.                     this._writableState.ended = false;
  6783.                     this._writableState.ending = false;
  6784.                     this._writableState.finished = false;
  6785.                     this._writableState.errorEmitted = false
  6786.                 }
  6787.             }
  6788.  
  6789.             function emitErrorNT(self, err) {
  6790.                 self.emit("error", err)
  6791.             }
  6792.             module.exports = {
  6793.                 destroy: destroy,
  6794.                 undestroy: undestroy
  6795.             }
  6796.         }, {
  6797.             "process-nextick-args": 44
  6798.         }],
  6799.         43: [function(require, module, exports) {
  6800.             module.exports = require("events").EventEmitter
  6801.         }, {
  6802.             events: 12
  6803.         }],
  6804.         44: [function(require, module, exports) {
  6805.             arguments[4][24][0].apply(exports, arguments)
  6806.         }, {
  6807.             _process: 30,
  6808.             dup: 24
  6809.         }],
  6810.         45: [function(require, module, exports) {
  6811.             exports = module.exports = require("./lib/_stream_readable.js");
  6812.             exports.Stream = exports;
  6813.             exports.Readable = exports;
  6814.             exports.Writable = require("./lib/_stream_writable.js");
  6815.             exports.Duplex = require("./lib/_stream_duplex.js");
  6816.             exports.Transform = require("./lib/_stream_transform.js");
  6817.             exports.PassThrough = require("./lib/_stream_passthrough.js")
  6818.         }, {
  6819.             "./lib/_stream_duplex.js": 36,
  6820.             "./lib/_stream_passthrough.js": 37,
  6821.             "./lib/_stream_readable.js": 38,
  6822.             "./lib/_stream_transform.js": 39,
  6823.             "./lib/_stream_writable.js": 40
  6824.         }],
  6825.         46: [function(require, module, exports) {
  6826.             "use strict";
  6827.  
  6828.             function ReInterval(callback, interval, args) {
  6829.                 var self = this;
  6830.                 this._callback = callback;
  6831.                 this._args = args;
  6832.                 this._interval = setInterval(callback, interval, this._args);
  6833.                 this.reschedule = function(interval) {
  6834.                     if (!interval) interval = self._interval;
  6835.                     if (self._interval) clearInterval(self._interval);
  6836.                     self._interval = setInterval(self._callback, interval, self._args)
  6837.                 };
  6838.                 this.clear = function() {
  6839.                     if (self._interval) {
  6840.                         clearInterval(self._interval);
  6841.                         self._interval = undefined
  6842.                     }
  6843.                 };
  6844.                 this.destroy = function() {
  6845.                     if (self._interval) {
  6846.                         clearInterval(self._interval)
  6847.                     }
  6848.                     self._callback = undefined;
  6849.                     self._interval = undefined;
  6850.                     self._args = undefined
  6851.                 }
  6852.             }
  6853.  
  6854.             function reInterval() {
  6855.                 if (typeof arguments[0] !== "function") throw new Error("callback needed");
  6856.                 if (typeof arguments[1] !== "number") throw new Error("interval needed");
  6857.                 var args;
  6858.                 if (arguments.length > 0) {
  6859.                     args = new Array(arguments.length - 2);
  6860.                     for (var i = 0; i < args.length; i++) {
  6861.                         args[i] = arguments[i + 2]
  6862.                     }
  6863.                 }
  6864.                 return new ReInterval(arguments[0], arguments[1], args)
  6865.             }
  6866.             module.exports = reInterval
  6867.         }, {}],
  6868.         47: [function(require, module, exports) {
  6869.             var buffer = require("buffer");
  6870.             var Buffer = buffer.Buffer;
  6871.  
  6872.             function copyProps(src, dst) {
  6873.                 for (var key in src) {
  6874.                     dst[key] = src[key]
  6875.                 }
  6876.             }
  6877.             if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
  6878.                 module.exports = buffer
  6879.             } else {
  6880.                 copyProps(buffer, exports);
  6881.                 exports.Buffer = SafeBuffer
  6882.             }
  6883.  
  6884.             function SafeBuffer(arg, encodingOrOffset, length) {
  6885.                 return Buffer(arg, encodingOrOffset, length)
  6886.             }
  6887.             copyProps(Buffer, SafeBuffer);
  6888.             SafeBuffer.from = function(arg, encodingOrOffset, length) {
  6889.                 if (typeof arg === "number") {
  6890.                     throw new TypeError("Argument must not be a number")
  6891.                 }
  6892.                 return Buffer(arg, encodingOrOffset, length)
  6893.             };
  6894.             SafeBuffer.alloc = function(size, fill, encoding) {
  6895.                 if (typeof size !== "number") {
  6896.                     throw new TypeError("Argument must be a number")
  6897.                 }
  6898.                 var buf = Buffer(size);
  6899.                 if (fill !== undefined) {
  6900.                     if (typeof encoding === "string") {
  6901.                         buf.fill(fill, encoding)
  6902.                     } else {
  6903.                         buf.fill(fill)
  6904.                     }
  6905.                 } else {
  6906.                     buf.fill(0)
  6907.                 }
  6908.                 return buf
  6909.             };
  6910.             SafeBuffer.allocUnsafe = function(size) {
  6911.                 if (typeof size !== "number") {
  6912.                     throw new TypeError("Argument must be a number")
  6913.                 }
  6914.                 return Buffer(size)
  6915.             };
  6916.             SafeBuffer.allocUnsafeSlow = function(size) {
  6917.                 if (typeof size !== "number") {
  6918.                     throw new TypeError("Argument must be a number")
  6919.                 }
  6920.                 return buffer.SlowBuffer(size)
  6921.             }
  6922.         }, {
  6923.             buffer: 13
  6924.         }],
  6925.         48: [function(require, module, exports) {
  6926.             module.exports = shift;
  6927.  
  6928.             function shift(stream) {
  6929.                 var rs = stream._readableState;
  6930.                 if (!rs) return null;
  6931.                 return rs.objectMode ? stream.read() : stream.read(getStateLength(rs))
  6932.             }
  6933.  
  6934.             function getStateLength(state) {
  6935.                 if (state.buffer.length) {
  6936.                     if (state.buffer.head) {
  6937.                         return state.buffer.head.data.length
  6938.                     }
  6939.                     return state.buffer[0].length
  6940.                 }
  6941.                 return state.length
  6942.             }
  6943.         }, {}],
  6944.         49: [function(require, module, exports) {
  6945.             "use strict";
  6946.             var Buffer = require("safe-buffer").Buffer;
  6947.             var isEncoding = Buffer.isEncoding || function(encoding) {
  6948.                 encoding = "" + encoding;
  6949.                 switch (encoding && encoding.toLowerCase()) {
  6950.                     case "hex":
  6951.                     case "utf8":
  6952.                     case "utf-8":
  6953.                     case "ascii":
  6954.                     case "binary":
  6955.                     case "base64":
  6956.                     case "ucs2":
  6957.                     case "ucs-2":
  6958.                     case "utf16le":
  6959.                     case "utf-16le":
  6960.                     case "raw":
  6961.                         return true;
  6962.                     default:
  6963.                         return false
  6964.                 }
  6965.             };
  6966.  
  6967.             function _normalizeEncoding(enc) {
  6968.                 if (!enc) return "utf8";
  6969.                 var retried;
  6970.                 while (true) {
  6971.                     switch (enc) {
  6972.                         case "utf8":
  6973.                         case "utf-8":
  6974.                             return "utf8";
  6975.                         case "ucs2":
  6976.                         case "ucs-2":
  6977.                         case "utf16le":
  6978.                         case "utf-16le":
  6979.                             return "utf16le";
  6980.                         case "latin1":
  6981.                         case "binary":
  6982.                             return "latin1";
  6983.                         case "base64":
  6984.                         case "ascii":
  6985.                         case "hex":
  6986.                             return enc;
  6987.                         default:
  6988.                             if (retried) return;
  6989.                             enc = ("" + enc).toLowerCase();
  6990.                             retried = true
  6991.                     }
  6992.                 }
  6993.             }
  6994.  
  6995.             function normalizeEncoding(enc) {
  6996.                 var nenc = _normalizeEncoding(enc);
  6997.                 if (typeof nenc !== "string" && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error("Unknown encoding: " + enc);
  6998.                 return nenc || enc
  6999.             }
  7000.             exports.StringDecoder = StringDecoder;
  7001.  
  7002.             function StringDecoder(encoding) {
  7003.                 this.encoding = normalizeEncoding(encoding);
  7004.                 var nb;
  7005.                 switch (this.encoding) {
  7006.                     case "utf16le":
  7007.                         this.text = utf16Text;
  7008.                         this.end = utf16End;
  7009.                         nb = 4;
  7010.                         break;
  7011.                     case "utf8":
  7012.                         this.fillLast = utf8FillLast;
  7013.                         nb = 4;
  7014.                         break;
  7015.                     case "base64":
  7016.                         this.text = base64Text;
  7017.                         this.end = base64End;
  7018.                         nb = 3;
  7019.                         break;
  7020.                     default:
  7021.                         this.write = simpleWrite;
  7022.                         this.end = simpleEnd;
  7023.                         return
  7024.                 }
  7025.                 this.lastNeed = 0;
  7026.                 this.lastTotal = 0;
  7027.                 this.lastChar = Buffer.allocUnsafe(nb)
  7028.             }
  7029.             StringDecoder.prototype.write = function(buf) {
  7030.                 if (buf.length === 0) return "";
  7031.                 var r;
  7032.                 var i;
  7033.                 if (this.lastNeed) {
  7034.                     r = this.fillLast(buf);
  7035.                     if (r === undefined) return "";
  7036.                     i = this.lastNeed;
  7037.                     this.lastNeed = 0
  7038.                 } else {
  7039.                     i = 0
  7040.                 }
  7041.                 if (i < buf.length) return r ? r + this.text(buf, i) : this.text(buf, i);
  7042.                 return r || ""
  7043.             };
  7044.             StringDecoder.prototype.end = utf8End;
  7045.             StringDecoder.prototype.text = utf8Text;
  7046.             StringDecoder.prototype.fillLast = function(buf) {
  7047.                 if (this.lastNeed <= buf.length) {
  7048.                     buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed);
  7049.                     return this.lastChar.toString(this.encoding, 0, this.lastTotal)
  7050.                 }
  7051.                 buf.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, buf.length);
  7052.                 this.lastNeed -= buf.length
  7053.             };
  7054.  
  7055.             function utf8CheckByte(byte) {
  7056.                 if (byte <= 127) return 0;
  7057.                 else if (byte >> 5 === 6) return 2;
  7058.                 else if (byte >> 4 === 14) return 3;
  7059.                 else if (byte >> 3 === 30) return 4;
  7060.                 return -1
  7061.             }
  7062.  
  7063.             function utf8CheckIncomplete(self, buf, i) {
  7064.                 var j = buf.length - 1;
  7065.                 if (j < i) return 0;
  7066.                 var nb = utf8CheckByte(buf[j]);
  7067.                 if (nb >= 0) {
  7068.                     if (nb > 0) self.lastNeed = nb - 1;
  7069.                     return nb
  7070.                 }
  7071.                 if (--j < i) return 0;
  7072.                 nb = utf8CheckByte(buf[j]);
  7073.                 if (nb >= 0) {
  7074.                     if (nb > 0) self.lastNeed = nb - 2;
  7075.                     return nb
  7076.                 }
  7077.                 if (--j < i) return 0;
  7078.                 nb = utf8CheckByte(buf[j]);
  7079.                 if (nb >= 0) {
  7080.                     if (nb > 0) {
  7081.                         if (nb === 2) nb = 0;
  7082.                         else self.lastNeed = nb - 3
  7083.                     }
  7084.                     return nb
  7085.                 }
  7086.                 return 0
  7087.             }
  7088.  
  7089.             function utf8CheckExtraBytes(self, buf, p) {
  7090.                 if ((buf[0] & 192) !== 128) {
  7091.                     self.lastNeed = 0;
  7092.                     return "�".repeat(p)
  7093.                 }
  7094.                 if (self.lastNeed > 1 && buf.length > 1) {
  7095.                     if ((buf[1] & 192) !== 128) {
  7096.                         self.lastNeed = 1;
  7097.                         return "�".repeat(p + 1)
  7098.                     }
  7099.                     if (self.lastNeed > 2 && buf.length > 2) {
  7100.                         if ((buf[2] & 192) !== 128) {
  7101.                             self.lastNeed = 2;
  7102.                             return "�".repeat(p + 2)
  7103.                         }
  7104.                     }
  7105.                 }
  7106.             }
  7107.  
  7108.             function utf8FillLast(buf) {
  7109.                 var p = this.lastTotal - this.lastNeed;
  7110.                 var r = utf8CheckExtraBytes(this, buf, p);
  7111.                 if (r !== undefined) return r;
  7112.                 if (this.lastNeed <= buf.length) {
  7113.                     buf.copy(this.lastChar, p, 0, this.lastNeed);
  7114.                     return this.lastChar.toString(this.encoding, 0, this.lastTotal)
  7115.                 }
  7116.                 buf.copy(this.lastChar, p, 0, buf.length);
  7117.                 this.lastNeed -= buf.length
  7118.             }
  7119.  
  7120.             function utf8Text(buf, i) {
  7121.                 var total = utf8CheckIncomplete(this, buf, i);
  7122.                 if (!this.lastNeed) return buf.toString("utf8", i);
  7123.                 this.lastTotal = total;
  7124.                 var end = buf.length - (total - this.lastNeed);
  7125.                 buf.copy(this.lastChar, 0, end);
  7126.                 return buf.toString("utf8", i, end)
  7127.             }
  7128.  
  7129.             function utf8End(buf) {
  7130.                 var r = buf && buf.length ? this.write(buf) : "";
  7131.                 if (this.lastNeed) return r + "�".repeat(this.lastTotal - this.lastNeed);
  7132.                 return r
  7133.             }
  7134.  
  7135.             function utf16Text(buf, i) {
  7136.                 if ((buf.length - i) % 2 === 0) {
  7137.                     var r = buf.toString("utf16le", i);
  7138.                     if (r) {
  7139.                         var c = r.charCodeAt(r.length - 1);
  7140.                         if (c >= 55296 && c <= 56319) {
  7141.                             this.lastNeed = 2;
  7142.                             this.lastTotal = 4;
  7143.                             this.lastChar[0] = buf[buf.length - 2];
  7144.                             this.lastChar[1] = buf[buf.length - 1];
  7145.                             return r.slice(0, -1)
  7146.                         }
  7147.                     }
  7148.                     return r
  7149.                 }
  7150.                 this.lastNeed = 1;
  7151.                 this.lastTotal = 2;
  7152.                 this.lastChar[0] = buf[buf.length - 1];
  7153.                 return buf.toString("utf16le", i, buf.length - 1)
  7154.             }
  7155.  
  7156.             function utf16End(buf) {
  7157.                 var r = buf && buf.length ? this.write(buf) : "";
  7158.                 if (this.lastNeed) {
  7159.                     var end = this.lastTotal - this.lastNeed;
  7160.                     return r + this.lastChar.toString("utf16le", 0, end)
  7161.                 }
  7162.                 return r
  7163.             }
  7164.  
  7165.             function base64Text(buf, i) {
  7166.                 var n = (buf.length - i) % 3;
  7167.                 if (n === 0) return buf.toString("base64", i);
  7168.                 this.lastNeed = 3 - n;
  7169.                 this.lastTotal = 3;
  7170.                 if (n === 1) {
  7171.                     this.lastChar[0] = buf[buf.length - 1]
  7172.                 } else {
  7173.                     this.lastChar[0] = buf[buf.length - 2];
  7174.                     this.lastChar[1] = buf[buf.length - 1]
  7175.                 }
  7176.                 return buf.toString("base64", i, buf.length - n)
  7177.             }
  7178.  
  7179.             function base64End(buf) {
  7180.                 var r = buf && buf.length ? this.write(buf) : "";
  7181.                 if (this.lastNeed) return r + this.lastChar.toString("base64", 0, 3 - this.lastNeed);
  7182.                 return r
  7183.             }
  7184.  
  7185.             function simpleWrite(buf) {
  7186.                 return buf.toString(this.encoding)
  7187.             }
  7188.  
  7189.             function simpleEnd(buf) {
  7190.                 return buf && buf.length ? this.write(buf) : ""
  7191.             }
  7192.         }, {
  7193.             "safe-buffer": 47
  7194.         }],
  7195.         50: [function(require, module, exports) {
  7196.             "use strict";
  7197.             var punycode = require("punycode");
  7198.             var util = require("./util");
  7199.             exports.parse = urlParse;
  7200.             exports.resolve = urlResolve;
  7201.             exports.resolveObject = urlResolveObject;
  7202.             exports.format = urlFormat;
  7203.             exports.Url = Url;
  7204.  
  7205.             function Url() {
  7206.                 this.protocol = null;
  7207.                 this.slashes = null;
  7208.                 this.auth = null;
  7209.                 this.host = null;
  7210.                 this.port = null;
  7211.                 this.hostname = null;
  7212.                 this.hash = null;
  7213.                 this.search = null;
  7214.                 this.query = null;
  7215.                 this.pathname = null;
  7216.                 this.path = null;
  7217.                 this.href = null
  7218.             }
  7219.             var protocolPattern = /^([a-z0-9.+-]+:)/i,
  7220.                 portPattern = /:[0-9]*$/,
  7221.                 simplePathPattern = /^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,
  7222.                 delims = ["<", ">", '"', "`", " ", "\r", "\n", "\t"],
  7223.                 unwise = ["{", "}", "|", "\\", "^", "`"].concat(delims),
  7224.                 autoEscape = ["'"].concat(unwise),
  7225.                 nonHostChars = ["%", "/", "?", ";", "#"].concat(autoEscape),
  7226.                 hostEndingChars = ["/", "?", "#"],
  7227.                 hostnameMaxLen = 255,
  7228.                 hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,
  7229.                 hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,
  7230.                 unsafeProtocol = {
  7231.                     javascript: true,
  7232.                     "javascript:": true
  7233.                 },
  7234.                 hostlessProtocol = {
  7235.                     javascript: true,
  7236.                     "javascript:": true
  7237.                 },
  7238.                 slashedProtocol = {
  7239.                     http: true,
  7240.                     https: true,
  7241.                     ftp: true,
  7242.                     gopher: true,
  7243.                     file: true,
  7244.                     "http:": true,
  7245.                     "https:": true,
  7246.                     "ftp:": true,
  7247.                     "gopher:": true,
  7248.                     "file:": true
  7249.                 },
  7250.                 querystring = require("querystring");
  7251.  
  7252.             function urlParse(url, parseQueryString, slashesDenoteHost) {
  7253.                 if (url && util.isObject(url) && url instanceof Url) return url;
  7254.                 var u = new Url;
  7255.                 u.parse(url, parseQueryString, slashesDenoteHost);
  7256.                 return u
  7257.             }
  7258.             Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) {
  7259.                 if (!util.isString(url)) {
  7260.                     throw new TypeError("Parameter 'url' must be a string, not " + typeof url)
  7261.                 }
  7262.                 var queryIndex = url.indexOf("?"),
  7263.                     splitter = queryIndex !== -1 && queryIndex < url.indexOf("#") ? "?" : "#",
  7264.                     uSplit = url.split(splitter),
  7265.                     slashRegex = /\\/g;
  7266.                 uSplit[0] = uSplit[0].replace(slashRegex, "/");
  7267.                 url = uSplit.join(splitter);
  7268.                 var rest = url;
  7269.                 rest = rest.trim();
  7270.                 if (!slashesDenoteHost && url.split("#").length === 1) {
  7271.                     var simplePath = simplePathPattern.exec(rest);
  7272.                     if (simplePath) {
  7273.                         this.path = rest;
  7274.                         this.href = rest;
  7275.                         this.pathname = simplePath[1];
  7276.                         if (simplePath[2]) {
  7277.                             this.search = simplePath[2];
  7278.                             if (parseQueryString) {
  7279.                                 this.query = querystring.parse(this.search.substr(1))
  7280.                             } else {
  7281.                                 this.query = this.search.substr(1)
  7282.                             }
  7283.                         } else if (parseQueryString) {
  7284.                             this.search = "";
  7285.                             this.query = {}
  7286.                         }
  7287.                         return this
  7288.                     }
  7289.                 }
  7290.                 var proto = protocolPattern.exec(rest);
  7291.                 if (proto) {
  7292.                     proto = proto[0];
  7293.                     var lowerProto = proto.toLowerCase();
  7294.                     this.protocol = lowerProto;
  7295.                     rest = rest.substr(proto.length)
  7296.                 }
  7297.                 if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) {
  7298.                     var slashes = rest.substr(0, 2) === "//";
  7299.                     if (slashes && !(proto && hostlessProtocol[proto])) {
  7300.                         rest = rest.substr(2);
  7301.                         this.slashes = true
  7302.                     }
  7303.                 }
  7304.                 if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {
  7305.                     var hostEnd = -1;
  7306.                     for (var i = 0; i < hostEndingChars.length; i++) {
  7307.                         var hec = rest.indexOf(hostEndingChars[i]);
  7308.                         if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec
  7309.                     }
  7310.                     var auth, atSign;
  7311.                     if (hostEnd === -1) {
  7312.                         atSign = rest.lastIndexOf("@")
  7313.                     } else {
  7314.                         atSign = rest.lastIndexOf("@", hostEnd)
  7315.                     }
  7316.                     if (atSign !== -1) {
  7317.                         auth = rest.slice(0, atSign);
  7318.                         rest = rest.slice(atSign + 1);
  7319.                         this.auth = decodeURIComponent(auth)
  7320.                     }
  7321.                     hostEnd = -1;
  7322.                     for (var i = 0; i < nonHostChars.length; i++) {
  7323.                         var hec = rest.indexOf(nonHostChars[i]);
  7324.                         if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) hostEnd = hec
  7325.                     }
  7326.                     if (hostEnd === -1) hostEnd = rest.length;
  7327.                     this.host = rest.slice(0, hostEnd);
  7328.                     rest = rest.slice(hostEnd);
  7329.                     this.parseHost();
  7330.                     this.hostname = this.hostname || "";
  7331.                     var ipv6Hostname = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
  7332.                     if (!ipv6Hostname) {
  7333.                         var hostparts = this.hostname.split(/\./);
  7334.                         for (var i = 0, l = hostparts.length; i < l; i++) {
  7335.                             var part = hostparts[i];
  7336.                             if (!part) continue;
  7337.                             if (!part.match(hostnamePartPattern)) {
  7338.                                 var newpart = "";
  7339.                                 for (var j = 0, k = part.length; j < k; j++) {
  7340.                                     if (part.charCodeAt(j) > 127) {
  7341.                                         newpart += "x"
  7342.                                     } else {
  7343.                                         newpart += part[j]
  7344.                                     }
  7345.                                 }
  7346.                                 if (!newpart.match(hostnamePartPattern)) {
  7347.                                     var validParts = hostparts.slice(0, i);
  7348.                                     var notHost = hostparts.slice(i + 1);
  7349.                                     var bit = part.match(hostnamePartStart);
  7350.                                     if (bit) {
  7351.                                         validParts.push(bit[1]);
  7352.                                         notHost.unshift(bit[2])
  7353.                                     }
  7354.                                     if (notHost.length) {
  7355.                                         rest = "/" + notHost.join(".") + rest
  7356.                                     }
  7357.                                     this.hostname = validParts.join(".");
  7358.                                     break
  7359.                                 }
  7360.                             }
  7361.                         }
  7362.                     }
  7363.                     if (this.hostname.length > hostnameMaxLen) {
  7364.                         this.hostname = ""
  7365.                     } else {
  7366.                         this.hostname = this.hostname.toLowerCase()
  7367.                     }
  7368.                     if (!ipv6Hostname) {
  7369.                         this.hostname = punycode.toASCII(this.hostname)
  7370.                     }
  7371.                     var p = this.port ? ":" + this.port : "";
  7372.                     var h = this.hostname || "";
  7373.                     this.host = h + p;
  7374.                     this.href += this.host;
  7375.                     if (ipv6Hostname) {
  7376.                         this.hostname = this.hostname.substr(1, this.hostname.length - 2);
  7377.                         if (rest[0] !== "/") {
  7378.                             rest = "/" + rest
  7379.                         }
  7380.                     }
  7381.                 }
  7382.                 if (!unsafeProtocol[lowerProto]) {
  7383.                     for (var i = 0, l = autoEscape.length; i < l; i++) {
  7384.                         var ae = autoEscape[i];
  7385.                         if (rest.indexOf(ae) === -1) continue;
  7386.                         var esc = encodeURIComponent(ae);
  7387.                         if (esc === ae) {
  7388.                             esc = escape(ae)
  7389.                         }
  7390.                         rest = rest.split(ae).join(esc)
  7391.                     }
  7392.                 }
  7393.                 var hash = rest.indexOf("#");
  7394.                 if (hash !== -1) {
  7395.                     this.hash = rest.substr(hash);
  7396.                     rest = rest.slice(0, hash)
  7397.                 }
  7398.                 var qm = rest.indexOf("?");
  7399.                 if (qm !== -1) {
  7400.                     this.search = rest.substr(qm);
  7401.                     this.query = rest.substr(qm + 1);
  7402.                     if (parseQueryString) {
  7403.                         this.query = querystring.parse(this.query)
  7404.                     }
  7405.                     rest = rest.slice(0, qm)
  7406.                 } else if (parseQueryString) {
  7407.                     this.search = "";
  7408.                     this.query = {}
  7409.                 }
  7410.                 if (rest) this.pathname = rest;
  7411.                 if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {
  7412.                     this.pathname = "/"
  7413.                 }
  7414.                 if (this.pathname || this.search) {
  7415.                     var p = this.pathname || "";
  7416.                     var s = this.search || "";
  7417.                     this.path = p + s
  7418.                 }
  7419.                 this.href = this.format();
  7420.                 return this
  7421.             };
  7422.  
  7423.             function urlFormat(obj) {
  7424.                 if (util.isString(obj)) obj = urlParse(obj);
  7425.                 if (!(obj instanceof Url)) return Url.prototype.format.call(obj);
  7426.                 return obj.format()
  7427.             }
  7428.             Url.prototype.format = function() {
  7429.                 var auth = this.auth || "";
  7430.                 if (auth) {
  7431.                     auth = encodeURIComponent(auth);
  7432.                     auth = auth.replace(/%3A/i, ":");
  7433.                     auth += "@"
  7434.                 }
  7435.                 var protocol = this.protocol || "",
  7436.                     pathname = this.pathname || "",
  7437.                     hash = this.hash || "",
  7438.                     host = false,
  7439.                     query = "";
  7440.                 if (this.host) {
  7441.                     host = auth + this.host
  7442.                 } else if (this.hostname) {
  7443.                     host = auth + (this.hostname.indexOf(":") === -1 ? this.hostname : "[" + this.hostname + "]");
  7444.                     if (this.port) {
  7445.                         host += ":" + this.port
  7446.                     }
  7447.                 }
  7448.                 if (this.query && util.isObject(this.query) && Object.keys(this.query).length) {
  7449.                     query = querystring.stringify(this.query)
  7450.                 }
  7451.                 var search = this.search || query && "?" + query || "";
  7452.                 if (protocol && protocol.substr(-1) !== ":") protocol += ":";
  7453.                 if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {
  7454.                     host = "//" + (host || "");
  7455.                     if (pathname && pathname.charAt(0) !== "/") pathname = "/" + pathname
  7456.                 } else if (!host) {
  7457.                     host = ""
  7458.                 }
  7459.                 if (hash && hash.charAt(0) !== "#") hash = "#" + hash;
  7460.                 if (search && search.charAt(0) !== "?") search = "?" + search;
  7461.                 pathname = pathname.replace(/[?#]/g, function(match) {
  7462.                     return encodeURIComponent(match)
  7463.                 });
  7464.                 search = search.replace("#", "%23");
  7465.                 return protocol + host + pathname + search + hash
  7466.             };
  7467.  
  7468.             function urlResolve(source, relative) {
  7469.                 return urlParse(source, false, true).resolve(relative)
  7470.             }
  7471.             Url.prototype.resolve = function(relative) {
  7472.                 return this.resolveObject(urlParse(relative, false, true)).format()
  7473.             };
  7474.  
  7475.             function urlResolveObject(source, relative) {
  7476.                 if (!source) return relative;
  7477.                 return urlParse(source, false, true).resolveObject(relative)
  7478.             }
  7479.             Url.prototype.resolveObject = function(relative) {
  7480.                 if (util.isString(relative)) {
  7481.                     var rel = new Url;
  7482.                     rel.parse(relative, false, true);
  7483.                     relative = rel
  7484.                 }
  7485.                 var result = new Url;
  7486.                 var tkeys = Object.keys(this);
  7487.                 for (var tk = 0; tk < tkeys.length; tk++) {
  7488.                     var tkey = tkeys[tk];
  7489.                     result[tkey] = this[tkey]
  7490.                 }
  7491.                 result.hash = relative.hash;
  7492.                 if (relative.href === "") {
  7493.                     result.href = result.format();
  7494.                     return result
  7495.                 }
  7496.                 if (relative.slashes && !relative.protocol) {
  7497.                     var rkeys = Object.keys(relative);
  7498.                     for (var rk = 0; rk < rkeys.length; rk++) {
  7499.                         var rkey = rkeys[rk];
  7500.                         if (rkey !== "protocol") result[rkey] = relative[rkey]
  7501.                     }
  7502.                     if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {
  7503.                         result.path = result.pathname = "/"
  7504.                     }
  7505.                     result.href = result.format();
  7506.                     return result
  7507.                 }
  7508.                 if (relative.protocol && relative.protocol !== result.protocol) {
  7509.                     if (!slashedProtocol[relative.protocol]) {
  7510.                         var keys = Object.keys(relative);
  7511.                         for (var v = 0; v < keys.length; v++) {
  7512.                             var k = keys[v];
  7513.                             result[k] = relative[k]
  7514.                         }
  7515.                         result.href = result.format();
  7516.                         return result
  7517.                     }
  7518.                     result.protocol = relative.protocol;
  7519.                     if (!relative.host && !hostlessProtocol[relative.protocol]) {
  7520.                         var relPath = (relative.pathname || "").split("/");
  7521.                         while (relPath.length && !(relative.host = relPath.shift()));
  7522.                         if (!relative.host) relative.host = "";
  7523.                         if (!relative.hostname) relative.hostname = "";
  7524.                         if (relPath[0] !== "") relPath.unshift("");
  7525.                         if (relPath.length < 2) relPath.unshift("");
  7526.                         result.pathname = relPath.join("/")
  7527.                     } else {
  7528.                         result.pathname = relative.pathname
  7529.                     }
  7530.                     result.search = relative.search;
  7531.                     result.query = relative.query;
  7532.                     result.host = relative.host || "";
  7533.                     result.auth = relative.auth;
  7534.                     result.hostname = relative.hostname || relative.host;
  7535.                     result.port = relative.port;
  7536.                     if (result.pathname || result.search) {
  7537.                         var p = result.pathname || "";
  7538.                         var s = result.search || "";
  7539.                         result.path = p + s
  7540.                     }
  7541.                     result.slashes = result.slashes || relative.slashes;
  7542.                     result.href = result.format();
  7543.                     return result
  7544.                 }
  7545.                 var isSourceAbs = result.pathname && result.pathname.charAt(0) === "/",
  7546.                     isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === "/",
  7547.                     mustEndAbs = isRelAbs || isSourceAbs || result.host && relative.pathname,
  7548.                     removeAllDots = mustEndAbs,
  7549.                     srcPath = result.pathname && result.pathname.split("/") || [],
  7550.                     relPath = relative.pathname && relative.pathname.split("/") || [],
  7551.                     psychotic = result.protocol && !slashedProtocol[result.protocol];
  7552.                 if (psychotic) {
  7553.                     result.hostname = "";
  7554.                     result.port = null;
  7555.                     if (result.host) {
  7556.                         if (srcPath[0] === "") srcPath[0] = result.host;
  7557.                         else srcPath.unshift(result.host)
  7558.                     }
  7559.                     result.host = "";
  7560.                     if (relative.protocol) {
  7561.                         relative.hostname = null;
  7562.                         relative.port = null;
  7563.                         if (relative.host) {
  7564.                             if (relPath[0] === "") relPath[0] = relative.host;
  7565.                             else relPath.unshift(relative.host)
  7566.                         }
  7567.                         relative.host = null
  7568.                     }
  7569.                     mustEndAbs = mustEndAbs && (relPath[0] === "" || srcPath[0] === "")
  7570.                 }
  7571.                 if (isRelAbs) {
  7572.                     result.host = relative.host || relative.host === "" ? relative.host : result.host;
  7573.                     result.hostname = relative.hostname || relative.hostname === "" ? relative.hostname : result.hostname;
  7574.                     result.search = relative.search;
  7575.                     result.query = relative.query;
  7576.                     srcPath = relPath
  7577.                 } else if (relPath.length) {
  7578.                     if (!srcPath) srcPath = [];
  7579.                     srcPath.pop();
  7580.                     srcPath = srcPath.concat(relPath);
  7581.                     result.search = relative.search;
  7582.                     result.query = relative.query
  7583.                 } else if (!util.isNullOrUndefined(relative.search)) {
  7584.                     if (psychotic) {
  7585.                         result.hostname = result.host = srcPath.shift();
  7586.                         var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
  7587.                         if (authInHost) {
  7588.                             result.auth = authInHost.shift();
  7589.                             result.host = result.hostname = authInHost.shift()
  7590.                         }
  7591.                     }
  7592.                     result.search = relative.search;
  7593.                     result.query = relative.query;
  7594.                     if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  7595.                         result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "")
  7596.                     }
  7597.                     result.href = result.format();
  7598.                     return result
  7599.                 }
  7600.                 if (!srcPath.length) {
  7601.                     result.pathname = null;
  7602.                     if (result.search) {
  7603.                         result.path = "/" + result.search
  7604.                     } else {
  7605.                         result.path = null
  7606.                     }
  7607.                     result.href = result.format();
  7608.                     return result
  7609.                 }
  7610.                 var last = srcPath.slice(-1)[0];
  7611.                 var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === "." || last === "..") || last === "";
  7612.                 var up = 0;
  7613.                 for (var i = srcPath.length; i >= 0; i--) {
  7614.                     last = srcPath[i];
  7615.                     if (last === ".") {
  7616.                         srcPath.splice(i, 1)
  7617.                     } else if (last === "..") {
  7618.                         srcPath.splice(i, 1);
  7619.                         up++
  7620.                     } else if (up) {
  7621.                         srcPath.splice(i, 1);
  7622.                         up--
  7623.                     }
  7624.                 }
  7625.                 if (!mustEndAbs && !removeAllDots) {
  7626.                     for (; up--; up) {
  7627.                         srcPath.unshift("..")
  7628.                     }
  7629.                 }
  7630.                 if (mustEndAbs && srcPath[0] !== "" && (!srcPath[0] || srcPath[0].charAt(0) !== "/")) {
  7631.                     srcPath.unshift("")
  7632.                 }
  7633.                 if (hasTrailingSlash && srcPath.join("/").substr(-1) !== "/") {
  7634.                     srcPath.push("")
  7635.                 }
  7636.                 var isAbsolute = srcPath[0] === "" || srcPath[0] && srcPath[0].charAt(0) === "/";
  7637.                 if (psychotic) {
  7638.                     result.hostname = result.host = isAbsolute ? "" : srcPath.length ? srcPath.shift() : "";
  7639.                     var authInHost = result.host && result.host.indexOf("@") > 0 ? result.host.split("@") : false;
  7640.                     if (authInHost) {
  7641.                         result.auth = authInHost.shift();
  7642.                         result.host = result.hostname = authInHost.shift()
  7643.                     }
  7644.                 }
  7645.                 mustEndAbs = mustEndAbs || result.host && srcPath.length;
  7646.                 if (mustEndAbs && !isAbsolute) {
  7647.                     srcPath.unshift("")
  7648.                 }
  7649.                 if (!srcPath.length) {
  7650.                     result.pathname = null;
  7651.                     result.path = null
  7652.                 } else {
  7653.                     result.pathname = srcPath.join("/")
  7654.                 }
  7655.                 if (!util.isNull(result.pathname) || !util.isNull(result.search)) {
  7656.                     result.path = (result.pathname ? result.pathname : "") + (result.search ? result.search : "")
  7657.                 }
  7658.                 result.auth = relative.auth || result.auth;
  7659.                 result.slashes = result.slashes || relative.slashes;
  7660.                 result.href = result.format();
  7661.                 return result
  7662.             };
  7663.             Url.prototype.parseHost = function() {
  7664.                 var host = this.host;
  7665.                 var port = portPattern.exec(host);
  7666.                 if (port) {
  7667.                     port = port[0];
  7668.                     if (port !== ":") {
  7669.                         this.port = port.substr(1)
  7670.                     }
  7671.                     host = host.substr(0, host.length - port.length)
  7672.                 }
  7673.                 if (host) this.hostname = host
  7674.             }
  7675.         }, {
  7676.             "./util": 51,
  7677.             punycode: 31,
  7678.             querystring: 34
  7679.         }],
  7680.         51: [function(require, module, exports) {
  7681.             "use strict";
  7682.             module.exports = {
  7683.                 isString: function(arg) {
  7684.                     return typeof arg === "string"
  7685.                 },
  7686.                 isObject: function(arg) {
  7687.                     return typeof arg === "object" && arg !== null
  7688.                 },
  7689.                 isNull: function(arg) {
  7690.                     return arg === null
  7691.                 },
  7692.                 isNullOrUndefined: function(arg) {
  7693.                     return arg == null
  7694.                 }
  7695.             }
  7696.         }, {}],
  7697.         52: [function(require, module, exports) {
  7698.             (function(global) {
  7699.                 module.exports = deprecate;
  7700.  
  7701.                 function deprecate(fn, msg) {
  7702.                     if (config("noDeprecation")) {
  7703.                         return fn
  7704.                     }
  7705.                     var warned = false;
  7706.  
  7707.                     function deprecated() {
  7708.                         if (!warned) {
  7709.                             if (config("throwDeprecation")) {
  7710.                                 throw new Error(msg)
  7711.                             } else if (config("traceDeprecation")) {
  7712.                                 console.trace(msg)
  7713.                             } else {
  7714.                                 console.warn(msg)
  7715.                             }
  7716.                             warned = true
  7717.                         }
  7718.                         return fn.apply(this, arguments)
  7719.                     }
  7720.                     return deprecated
  7721.                 }
  7722.  
  7723.                 function config(name) {
  7724.                     try {
  7725.                         if (!global.localStorage) return false
  7726.                     } catch (_) {
  7727.                         return false
  7728.                     }
  7729.                     var val = global.localStorage[name];
  7730.                     if (null == val) return false;
  7731.                     return String(val).toLowerCase() === "true"
  7732.                 }
  7733.             }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  7734.         }, {}],
  7735.         53: [function(require, module, exports) {
  7736.             arguments[4][18][0].apply(exports, arguments)
  7737.         }, {
  7738.             dup: 18
  7739.         }],
  7740.         54: [function(require, module, exports) {
  7741.             module.exports = function isBuffer(arg) {
  7742.                 return arg && typeof arg === "object" && typeof arg.copy === "function" && typeof arg.fill === "function" && typeof arg.readUInt8 === "function"
  7743.             }
  7744.         }, {}],
  7745.         55: [function(require, module, exports) {
  7746.             (function(process, global) {
  7747.                 var formatRegExp = /%[sdj%]/g;
  7748.                 exports.format = function(f) {
  7749.                     if (!isString(f)) {
  7750.                         var objects = [];
  7751.                         for (var i = 0; i < arguments.length; i++) {
  7752.                             objects.push(inspect(arguments[i]))
  7753.                         }
  7754.                         return objects.join(" ")
  7755.                     }
  7756.                     var i = 1;
  7757.                     var args = arguments;
  7758.                     var len = args.length;
  7759.                     var str = String(f).replace(formatRegExp, function(x) {
  7760.                         if (x === "%%") return "%";
  7761.                         if (i >= len) return x;
  7762.                         switch (x) {
  7763.                             case "%s":
  7764.                                 return String(args[i++]);
  7765.                             case "%d":
  7766.                                 return Number(args[i++]);
  7767.                             case "%j":
  7768.                                 try {
  7769.                                     return JSON.stringify(args[i++])
  7770.                                 } catch (_) {
  7771.                                     return "[Circular]"
  7772.                                 }
  7773.                             default:
  7774.                                 return x
  7775.                         }
  7776.                     });
  7777.                     for (var x = args[i]; i < len; x = args[++i]) {
  7778.                         if (isNull(x) || !isObject(x)) {
  7779.                             str += " " + x
  7780.                         } else {
  7781.                             str += " " + inspect(x)
  7782.                         }
  7783.                     }
  7784.                     return str
  7785.                 };
  7786.                 exports.deprecate = function(fn, msg) {
  7787.                     if (isUndefined(global.process)) {
  7788.                         return function() {
  7789.                             return exports.deprecate(fn, msg).apply(this, arguments)
  7790.                         }
  7791.                     }
  7792.                     if (process.noDeprecation === true) {
  7793.                         return fn
  7794.                     }
  7795.                     var warned = false;
  7796.  
  7797.                     function deprecated() {
  7798.                         if (!warned) {
  7799.                             if (process.throwDeprecation) {
  7800.                                 throw new Error(msg)
  7801.                             } else if (process.traceDeprecation) {
  7802.                                 console.trace(msg)
  7803.                             } else {
  7804.                                 console.error(msg)
  7805.                             }
  7806.                             warned = true
  7807.                         }
  7808.                         return fn.apply(this, arguments)
  7809.                     }
  7810.                     return deprecated
  7811.                 };
  7812.                 var debugs = {};
  7813.                 var debugEnviron;
  7814.                 exports.debuglog = function(set) {
  7815.                     if (isUndefined(debugEnviron)) debugEnviron = process.env.NODE_DEBUG || "";
  7816.                     set = set.toUpperCase();
  7817.                     if (!debugs[set]) {
  7818.                         if (new RegExp("\\b" + set + "\\b", "i").test(debugEnviron)) {
  7819.                             var pid = process.pid;
  7820.                             debugs[set] = function() {
  7821.                                 var msg = exports.format.apply(exports, arguments);
  7822.                                 console.error("%s %d: %s", set, pid, msg)
  7823.                             }
  7824.                         } else {
  7825.                             debugs[set] = function() {}
  7826.                         }
  7827.                     }
  7828.                     return debugs[set]
  7829.                 };
  7830.  
  7831.                 function inspect(obj, opts) {
  7832.                     var ctx = {
  7833.                         seen: [],
  7834.                         stylize: stylizeNoColor
  7835.                     };
  7836.                     if (arguments.length >= 3) ctx.depth = arguments[2];
  7837.                     if (arguments.length >= 4) ctx.colors = arguments[3];
  7838.                     if (isBoolean(opts)) {
  7839.                         ctx.showHidden = opts
  7840.                     } else if (opts) {
  7841.                         exports._extend(ctx, opts)
  7842.                     }
  7843.                     if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
  7844.                     if (isUndefined(ctx.depth)) ctx.depth = 2;
  7845.                     if (isUndefined(ctx.colors)) ctx.colors = false;
  7846.                     if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
  7847.                     if (ctx.colors) ctx.stylize = stylizeWithColor;
  7848.                     return formatValue(ctx, obj, ctx.depth)
  7849.                 }
  7850.                 exports.inspect = inspect;
  7851.                 inspect.colors = {
  7852.                     bold: [1, 22],
  7853.                     italic: [3, 23],
  7854.                     underline: [4, 24],
  7855.                     inverse: [7, 27],
  7856.                     white: [37, 39],
  7857.                     grey: [90, 39],
  7858.                     black: [30, 39],
  7859.                     blue: [34, 39],
  7860.                     cyan: [36, 39],
  7861.                     green: [32, 39],
  7862.                     magenta: [35, 39],
  7863.                     red: [31, 39],
  7864.                     yellow: [33, 39]
  7865.                 };
  7866.                 inspect.styles = {
  7867.                     special: "cyan",
  7868.                     number: "yellow",
  7869.                     boolean: "yellow",
  7870.                     undefined: "grey",
  7871.                     null: "bold",
  7872.                     string: "green",
  7873.                     date: "magenta",
  7874.                     regexp: "red"
  7875.                 };
  7876.  
  7877.                 function stylizeWithColor(str, styleType) {
  7878.                     var style = inspect.styles[styleType];
  7879.                     if (style) {
  7880.                         return "[" + inspect.colors[style][0] + "m" + str + "[" + inspect.colors[style][1] + "m"
  7881.                     } else {
  7882.                         return str
  7883.                     }
  7884.                 }
  7885.  
  7886.                 function stylizeNoColor(str, styleType) {
  7887.                     return str
  7888.                 }
  7889.  
  7890.                 function arrayToHash(array) {
  7891.                     var hash = {};
  7892.                     array.forEach(function(val, idx) {
  7893.                         hash[val] = true
  7894.                     });
  7895.                     return hash
  7896.                 }
  7897.  
  7898.                 function formatValue(ctx, value, recurseTimes) {
  7899.                     if (ctx.customInspect && value && isFunction(value.inspect) && value.inspect !== exports.inspect && !(value.constructor && value.constructor.prototype === value)) {
  7900.                         var ret = value.inspect(recurseTimes, ctx);
  7901.                         if (!isString(ret)) {
  7902.                             ret = formatValue(ctx, ret, recurseTimes)
  7903.                         }
  7904.                         return ret
  7905.                     }
  7906.                     var primitive = formatPrimitive(ctx, value);
  7907.                     if (primitive) {
  7908.                         return primitive
  7909.                     }
  7910.                     var keys = Object.keys(value);
  7911.                     var visibleKeys = arrayToHash(keys);
  7912.                     if (ctx.showHidden) {
  7913.                         keys = Object.getOwnPropertyNames(value)
  7914.                     }
  7915.                     if (isError(value) && (keys.indexOf("message") >= 0 || keys.indexOf("description") >= 0)) {
  7916.                         return formatError(value)
  7917.                     }
  7918.                     if (keys.length === 0) {
  7919.                         if (isFunction(value)) {
  7920.                             var name = value.name ? ": " + value.name : "";
  7921.                             return ctx.stylize("[Function" + name + "]", "special")
  7922.                         }
  7923.                         if (isRegExp(value)) {
  7924.                             return ctx.stylize(RegExp.prototype.toString.call(value), "regexp")
  7925.                         }
  7926.                         if (isDate(value)) {
  7927.                             return ctx.stylize(Date.prototype.toString.call(value), "date")
  7928.                         }
  7929.                         if (isError(value)) {
  7930.                             return formatError(value)
  7931.                         }
  7932.                     }
  7933.                     var base = "",
  7934.                         array = false,
  7935.                         braces = ["{", "}"];
  7936.                     if (isArray(value)) {
  7937.                         array = true;
  7938.                         braces = ["[", "]"]
  7939.                     }
  7940.                     if (isFunction(value)) {
  7941.                         var n = value.name ? ": " + value.name : "";
  7942.                         base = " [Function" + n + "]"
  7943.                     }
  7944.                     if (isRegExp(value)) {
  7945.                         base = " " + RegExp.prototype.toString.call(value)
  7946.                     }
  7947.                     if (isDate(value)) {
  7948.                         base = " " + Date.prototype.toUTCString.call(value)
  7949.                     }
  7950.                     if (isError(value)) {
  7951.                         base = " " + formatError(value)
  7952.                     }
  7953.                     if (keys.length === 0 && (!array || value.length == 0)) {
  7954.                         return braces[0] + base + braces[1]
  7955.                     }
  7956.                     if (recurseTimes < 0) {
  7957.                         if (isRegExp(value)) {
  7958.                             return ctx.stylize(RegExp.prototype.toString.call(value), "regexp")
  7959.                         } else {
  7960.                             return ctx.stylize("[Object]", "special")
  7961.                         }
  7962.                     }
  7963.                     ctx.seen.push(value);
  7964.                     var output;
  7965.                     if (array) {
  7966.                         output = formatArray(ctx, value, recurseTimes, visibleKeys, keys)
  7967.                     } else {
  7968.                         output = keys.map(function(key) {
  7969.                             return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array)
  7970.                         })
  7971.                     }
  7972.                     ctx.seen.pop();
  7973.                     return reduceToSingleString(output, base, braces)
  7974.                 }
  7975.  
  7976.                 function formatPrimitive(ctx, value) {
  7977.                     if (isUndefined(value)) return ctx.stylize("undefined", "undefined");
  7978.                     if (isString(value)) {
  7979.                         var simple = "'" + JSON.stringify(value).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
  7980.                         return ctx.stylize(simple, "string")
  7981.                     }
  7982.                     if (isNumber(value)) return ctx.stylize("" + value, "number");
  7983.                     if (isBoolean(value)) return ctx.stylize("" + value, "boolean");
  7984.                     if (isNull(value)) return ctx.stylize("null", "null")
  7985.                 }
  7986.  
  7987.                 function formatError(value) {
  7988.                     return "[" + Error.prototype.toString.call(value) + "]"
  7989.                 }
  7990.  
  7991.                 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
  7992.                     var output = [];
  7993.                     for (var i = 0, l = value.length; i < l; ++i) {
  7994.                         if (hasOwnProperty(value, String(i))) {
  7995.                             output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, String(i), true))
  7996.                         } else {
  7997.                             output.push("")
  7998.                         }
  7999.                     }
  8000.                     keys.forEach(function(key) {
  8001.                         if (!key.match(/^\d+$/)) {
  8002.                             output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, key, true))
  8003.                         }
  8004.                     });
  8005.                     return output
  8006.                 }
  8007.  
  8008.                 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
  8009.                     var name, str, desc;
  8010.                     desc = Object.getOwnPropertyDescriptor(value, key) || {
  8011.                         value: value[key]
  8012.                     };
  8013.                     if (desc.get) {
  8014.                         if (desc.set) {
  8015.                             str = ctx.stylize("[Getter/Setter]", "special")
  8016.                         } else {
  8017.                             str = ctx.stylize("[Getter]", "special")
  8018.                         }
  8019.                     } else {
  8020.                         if (desc.set) {
  8021.                             str = ctx.stylize("[Setter]", "special")
  8022.                         }
  8023.                     }
  8024.                     if (!hasOwnProperty(visibleKeys, key)) {
  8025.                         name = "[" + key + "]"
  8026.                     }
  8027.                     if (!str) {
  8028.                         if (ctx.seen.indexOf(desc.value) < 0) {
  8029.                             if (isNull(recurseTimes)) {
  8030.                                 str = formatValue(ctx, desc.value, null)
  8031.                             } else {
  8032.                                 str = formatValue(ctx, desc.value, recurseTimes - 1)
  8033.                             }
  8034.                             if (str.indexOf("\n") > -1) {
  8035.                                 if (array) {
  8036.                                     str = str.split("\n").map(function(line) {
  8037.                                         return "  " + line
  8038.                                     }).join("\n").substr(2)
  8039.                                 } else {
  8040.                                     str = "\n" + str.split("\n").map(function(line) {
  8041.                                         return "   " + line
  8042.                                     }).join("\n")
  8043.                                 }
  8044.                             }
  8045.                         } else {
  8046.                             str = ctx.stylize("[Circular]", "special")
  8047.                         }
  8048.                     }
  8049.                     if (isUndefined(name)) {
  8050.                         if (array && key.match(/^\d+$/)) {
  8051.                             return str
  8052.                         }
  8053.                         name = JSON.stringify("" + key);
  8054.                         if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
  8055.                             name = name.substr(1, name.length - 2);
  8056.                             name = ctx.stylize(name, "name")
  8057.                         } else {
  8058.                             name = name.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'");
  8059.                             name = ctx.stylize(name, "string")
  8060.                         }
  8061.                     }
  8062.                     return name + ": " + str
  8063.                 }
  8064.  
  8065.                 function reduceToSingleString(output, base, braces) {
  8066.                     var numLinesEst = 0;
  8067.                     var length = output.reduce(function(prev, cur) {
  8068.                         numLinesEst++;
  8069.                         if (cur.indexOf("\n") >= 0) numLinesEst++;
  8070.                         return prev + cur.replace(/\u001b\[\d\d?m/g, "").length + 1
  8071.                     }, 0);
  8072.                     if (length > 60) {
  8073.                         return braces[0] + (base === "" ? "" : base + "\n ") + " " + output.join(",\n  ") + " " + braces[1]
  8074.                     }
  8075.                     return braces[0] + base + " " + output.join(", ") + " " + braces[1]
  8076.                 }
  8077.  
  8078.                 function isArray(ar) {
  8079.                     return Array.isArray(ar)
  8080.                 }
  8081.                 exports.isArray = isArray;
  8082.  
  8083.                 function isBoolean(arg) {
  8084.                     return typeof arg === "boolean"
  8085.                 }
  8086.                 exports.isBoolean = isBoolean;
  8087.  
  8088.                 function isNull(arg) {
  8089.                     return arg === null
  8090.                 }
  8091.                 exports.isNull = isNull;
  8092.  
  8093.                 function isNullOrUndefined(arg) {
  8094.                     return arg == null
  8095.                 }
  8096.                 exports.isNullOrUndefined = isNullOrUndefined;
  8097.  
  8098.                 function isNumber(arg) {
  8099.                     return typeof arg === "number"
  8100.                 }
  8101.                 exports.isNumber = isNumber;
  8102.  
  8103.                 function isString(arg) {
  8104.                     return typeof arg === "string"
  8105.                 }
  8106.                 exports.isString = isString;
  8107.  
  8108.                 function isSymbol(arg) {
  8109.                     return typeof arg === "symbol"
  8110.                 }
  8111.                 exports.isSymbol = isSymbol;
  8112.  
  8113.                 function isUndefined(arg) {
  8114.                     return arg === void 0
  8115.                 }
  8116.                 exports.isUndefined = isUndefined;
  8117.  
  8118.                 function isRegExp(re) {
  8119.                     return isObject(re) && objectToString(re) === "[object RegExp]"
  8120.                 }
  8121.                 exports.isRegExp = isRegExp;
  8122.  
  8123.                 function isObject(arg) {
  8124.                     return typeof arg === "object" && arg !== null
  8125.                 }
  8126.                 exports.isObject = isObject;
  8127.  
  8128.                 function isDate(d) {
  8129.                     return isObject(d) && objectToString(d) === "[object Date]"
  8130.                 }
  8131.                 exports.isDate = isDate;
  8132.  
  8133.                 function isError(e) {
  8134.                     return isObject(e) && (objectToString(e) === "[object Error]" || e instanceof Error)
  8135.                 }
  8136.                 exports.isError = isError;
  8137.  
  8138.                 function isFunction(arg) {
  8139.                     return typeof arg === "function"
  8140.                 }
  8141.                 exports.isFunction = isFunction;
  8142.  
  8143.                 function isPrimitive(arg) {
  8144.                     return arg === null || typeof arg === "boolean" || typeof arg === "number" || typeof arg === "string" || typeof arg === "symbol" || typeof arg === "undefined"
  8145.                 }
  8146.                 exports.isPrimitive = isPrimitive;
  8147.                 exports.isBuffer = require("./support/isBuffer");
  8148.  
  8149.                 function objectToString(o) {
  8150.                     return Object.prototype.toString.call(o)
  8151.                 }
  8152.  
  8153.                 function pad(n) {
  8154.                     return n < 10 ? "0" + n.toString(10) : n.toString(10)
  8155.                 }
  8156.                 var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
  8157.  
  8158.                 function timestamp() {
  8159.                     var d = new Date;
  8160.                     var time = [pad(d.getHours()), pad(d.getMinutes()), pad(d.getSeconds())].join(":");
  8161.                     return [d.getDate(), months[d.getMonth()], time].join(" ")
  8162.                 }
  8163.                 exports.log = function() {
  8164.                     console.log("%s - %s", timestamp(), exports.format.apply(exports, arguments))
  8165.                 };
  8166.                 exports.inherits = require("inherits");
  8167.                 exports._extend = function(origin, add) {
  8168.                     if (!add || !isObject(add)) return origin;
  8169.                     var keys = Object.keys(add);
  8170.                     var i = keys.length;
  8171.                     while (i--) {
  8172.                         origin[keys[i]] = add[keys[i]]
  8173.                     }
  8174.                     return origin
  8175.                 };
  8176.  
  8177.                 function hasOwnProperty(obj, prop) {
  8178.                     return Object.prototype.hasOwnProperty.call(obj, prop)
  8179.                 }
  8180.             }).call(this, require("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  8181.         }, {
  8182.             "./support/isBuffer": 54,
  8183.             _process: 30,
  8184.             inherits: 53
  8185.         }],
  8186.         56: [function(require, module, exports) {
  8187.             (function(process, global) {
  8188.                 "use strict";
  8189.                 var Transform = require("readable-stream").Transform;
  8190.                 var duplexify = require("duplexify");
  8191.                 var WS = require("ws");
  8192.                 var Buffer = require("safe-buffer").Buffer;
  8193.                 module.exports = WebSocketStream;
  8194.  
  8195.                 function buildProxy(options, socketWrite, socketEnd) {
  8196.                     var proxy = new Transform({
  8197.                         objectMode: options.objectMode
  8198.                     });
  8199.                     proxy._write = socketWrite;
  8200.                     proxy._flush = socketEnd;
  8201.                     return proxy
  8202.                 }
  8203.  
  8204.                 function WebSocketStream(target, protocols, options) {
  8205.                     var stream, socket;
  8206.                     var isBrowser = process.title === "browser";
  8207.                     var isNative = !!global.WebSocket;
  8208.                     var socketWrite = isBrowser ? socketWriteBrowser : socketWriteNode;
  8209.                     if (protocols && !Array.isArray(protocols) && "object" === typeof protocols) {
  8210.                         options = protocols;
  8211.                         protocols = null;
  8212.                         if (typeof options.protocol === "string" || Array.isArray(options.protocol)) {
  8213.                             protocols = options.protocol
  8214.                         }
  8215.                     }
  8216.                     if (!options) options = {};
  8217.                     if (options.objectMode === undefined) {
  8218.                         options.objectMode = !(options.binary === true || options.binary === undefined)
  8219.                     }
  8220.                     var proxy = buildProxy(options, socketWrite, socketEnd);
  8221.                     if (!options.objectMode) {
  8222.                         proxy._writev = writev
  8223.                     }
  8224.                     var bufferSize = options.browserBufferSize || 1024 * 512;
  8225.                     var bufferTimeout = options.browserBufferTimeout || 1e3;
  8226.                     if (typeof target === "object") {
  8227.                         socket = target
  8228.                     } else {
  8229.                         if (isNative && isBrowser) {
  8230.                             socket = new WS(target, protocols)
  8231.                         } else {
  8232.                             socket = new WS(target, protocols, options)
  8233.                         }
  8234.                         socket.binaryType = "arraybuffer"
  8235.                     }
  8236.                     if (socket.readyState === socket.OPEN) {
  8237.                         stream = proxy
  8238.                     } else {
  8239.                         stream = duplexify.obj();
  8240.                         socket.onopen = onopen
  8241.                     }
  8242.                     stream.socket = socket;
  8243.                     socket.onclose = onclose;
  8244.                     socket.onerror = onerror;
  8245.                     socket.onmessage = onmessage;
  8246.                     proxy.on("close", destroy);
  8247.                     var coerceToBuffer = !options.objectMode;
  8248.  
  8249.                     function socketWriteNode(chunk, enc, next) {
  8250.                         if (socket.readyState !== socket.OPEN) {
  8251.                             next();
  8252.                             return
  8253.                         }
  8254.                         if (coerceToBuffer && typeof chunk === "string") {
  8255.                             chunk = Buffer.from(chunk, "utf8")
  8256.                         }
  8257.                         socket.send(chunk, next)
  8258.                     }
  8259.  
  8260.                     function socketWriteBrowser(chunk, enc, next) {
  8261.                         if (socket.bufferedAmount > bufferSize) {
  8262.                             setTimeout(socketWriteBrowser, bufferTimeout, chunk, enc, next);
  8263.                             return
  8264.                         }
  8265.                         if (coerceToBuffer && typeof chunk === "string") {
  8266.                             chunk = Buffer.from(chunk, "utf8")
  8267.                         }
  8268.                         try {
  8269.                             socket.send(chunk)
  8270.                         } catch (err) {
  8271.                             return next(err)
  8272.                         }
  8273.                         next()
  8274.                     }
  8275.  
  8276.                     function socketEnd(done) {
  8277.                         socket.close();
  8278.                         done()
  8279.                     }
  8280.  
  8281.                     function onopen() {
  8282.                         stream.setReadable(proxy);
  8283.                         stream.setWritable(proxy);
  8284.                         stream.emit("connect")
  8285.                     }
  8286.  
  8287.                     function onclose() {
  8288.                         stream.end();
  8289.                         stream.destroy()
  8290.                     }
  8291.  
  8292.                     function onerror(err) {
  8293.                         stream.destroy(err)
  8294.                     }
  8295.  
  8296.                     function onmessage(event) {
  8297.                         var data = event.data;
  8298.                         if (data instanceof ArrayBuffer) data = Buffer.from(data);
  8299.                         else data = Buffer.from(data, "utf8");
  8300.                         proxy.push(data)
  8301.                     }
  8302.  
  8303.                     function destroy() {
  8304.                         socket.close()
  8305.                     }
  8306.  
  8307.                     function writev(chunks, cb) {
  8308.                         var buffers = new Array(chunks.length);
  8309.                         for (var i = 0; i < chunks.length; i++) {
  8310.                             if (typeof chunks[i].chunk === "string") {
  8311.                                 buffers[i] = Buffer.from(chunks[i], "utf8")
  8312.                             } else {
  8313.                                 buffers[i] = chunks[i].chunk
  8314.                             }
  8315.                         }
  8316.                         this._write(Buffer.concat(buffers), "binary", cb)
  8317.                     }
  8318.                     return stream
  8319.                 }
  8320.             }).call(this, require("_process"), typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
  8321.         }, {
  8322.             _process: 30,
  8323.             duplexify: 15,
  8324.             "readable-stream": 45,
  8325.             "safe-buffer": 47,
  8326.             ws: 57
  8327.         }],
  8328.         57: [function(require, module, exports) {
  8329.             var ws = null;
  8330.             if (typeof WebSocket !== "undefined") {
  8331.                 ws = WebSocket
  8332.             } else if (typeof MozWebSocket !== "undefined") {
  8333.                 ws = MozWebSocket
  8334.             } else if (typeof window !== "undefined") {
  8335.                 ws = window.WebSocket || window.MozWebSocket
  8336.             }
  8337.             module.exports = ws
  8338.         }, {}],
  8339.         58: [function(require, module, exports) {
  8340.             module.exports = wrappy;
  8341.  
  8342.             function wrappy(fn, cb) {
  8343.                 if (fn && cb) return wrappy(fn)(cb);
  8344.                 if (typeof fn !== "function") throw new TypeError("need wrapper function");
  8345.                 Object.keys(fn).forEach(function(k) {
  8346.                     wrapper[k] = fn[k]
  8347.                 });
  8348.                 return wrapper;
  8349.  
  8350.                 function wrapper() {
  8351.                     var args = new Array(arguments.length);
  8352.                     for (var i = 0; i < args.length; i++) {
  8353.                         args[i] = arguments[i]
  8354.                     }
  8355.                     var ret = fn.apply(this, args);
  8356.                     var cb = args[args.length - 1];
  8357.                     if (typeof ret === "function" && ret !== cb) {
  8358.                         Object.keys(cb).forEach(function(k) {
  8359.                             ret[k] = cb[k]
  8360.                         })
  8361.                     }
  8362.                     return ret
  8363.                 }
  8364.             }
  8365.         }, {}],
  8366.         59: [function(require, module, exports) {
  8367.             module.exports = extend;
  8368.             var hasOwnProperty = Object.prototype.hasOwnProperty;
  8369.  
  8370.             function extend() {
  8371.                 var target = {};
  8372.                 for (var i = 0; i < arguments.length; i++) {
  8373.                     var source = arguments[i];
  8374.                     for (var key in source) {
  8375.                         if (hasOwnProperty.call(source, key)) {
  8376.                             target[key] = source[key]
  8377.                         }
  8378.                     }
  8379.                 }
  8380.                 return target
  8381.             }
  8382.         }, {}]
  8383.     }, {}, [8])(8)
  8384. });
Add Comment
Please, Sign In to add comment