(self["webpackChunkset_vue"]=self["webpackChunkset_vue"]||[]).push([[149],{5149:function(t,e,r){r(4114),r(6573),r(8100),r(7936),r(7467),r(4732),r(9577),r(9848),function(e){t.exports=e()}((function(){var t;return function(){function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){var u=void 0;if(!a&&u)return require(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};e[s][0].call(l.exports,(function(t){var r=e[s][1][t];return i(r||t)}),l,l.exports,t,e,r,n)}return r[s].exports}for(var o=void 0,s=0;s0&&(this.options.resubscribe?(this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics)):this._resubscribeTopics={}),s=!1})),this.on("close",(function(){null!==n.pingTimer&&(n.pingTimer.clear(),n.pingTimer=null)})),this.on("close",this._setupReconnect),i.EventEmitter.call(this),this._setupStream()}c(v,i.EventEmitter),v.prototype._setupStream=function(){var t,e=this,n=new u,i=a.parser(this.options),o=null,c=[];function l(){r.nextTick(f)}function f(){var t=c.shift(),r=o;t?e._handlePacket(t,l):(o=null,r())}this._clearReconnect(),this.stream=this.streamBuilder(this),i.on("packet",(function(t){c.push(t)})),n._write=function(t,e,r){o=r,i.parse(t),f()},this.stream.pipe(n),this.stream.on("error",m),s(this.stream,this.emit.bind(this,"close")),t=Object.create(this.options),t.cmd="connect",y(this,t),i.on("error",this.emit.bind(this,"error")),this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){e._cleanUp(!0)}),this.options.connectTimeout)},v.prototype._handlePacket=function(t,e){switch(this.emit("packetreceive",t),t.cmd){case"publish":this._handlePublish(t,e);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":this._handleAck(t),e();break;case"pubrel":this._handlePubrel(t,e);break;case"connack":this._handleConnack(t),e();break;case"pingresp":this._handlePingresp(t),e();break;default:break}},v.prototype._checkDisconnecting=function(t){return this.disconnecting&&(t?t(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting},v.prototype.publish=function(t,e,r,n){var i;"function"===typeof r&&(n=r,r=null);var o={qos:0,retain:!1,dup:!1};if(r=h(o,r),this._checkDisconnecting(n))return this;switch(i={cmd:"publish",topic:t,payload:e,qos:r.qos,retain:r.retain,messageId:this._nextId(),dup:r.dup},r.qos){case 1:case 2:this.outgoing[i.messageId]=n||m,this._sendPacket(i);break;default:this._sendPacket(i,n);break}return this},v.prototype.subscribe=function(){var t,e,r=Array.prototype.slice.call(arguments),n=[],i=r.shift(),o=i.resubscribe,s=r.pop()||m,a=r.pop(),u=this;if(delete i.resubscribe,"string"===typeof i&&(i=[i]),"function"!==typeof s&&(a=s,s=m),e=f.validateTopics(i),null!==e)return p(s,new Error("Invalid topic "+e)),this;if(this._checkDisconnecting(s))return this;var c={qos:0};if(a=h(c,a),Array.isArray(i)?i.forEach((function(t){(u._resubscribeTopics[t]0&&(u._resubscribeTopics[t.topic]=t.qos,l.push(t.topic))})),u.messageIdToTopic[t.messageId]=l}return this.outgoing[t.messageId]=function(t,e){if(!t)for(var r=e.granted,i=0;i0?this.once("outgoingEmpty",setTimeout.bind(null,i,10)):i()),this},v.prototype.removeOutgoingMessage=function(t){var e=this.outgoing[t];return delete this.outgoing[t],this.outgoingStore.del({messageId:t},(function(){e(new Error("Message removed"))})),this},v.prototype.reconnect=function(t){var e=this,r=function(){t?(e.options.incomingStore=t.incomingStore,e.options.outgoingStore=t.outgoingStore):(e.options.incomingStore=null,e.options.outgoingStore=null),e.incomingStore=e.options.incomingStore||new o,e.outgoingStore=e.options.outgoingStore||new o,e.disconnecting=!1,e.disconnected=!1,e._deferredReconnect=null,e._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},v.prototype._reconnect=function(){this.emit("reconnect"),this._setupStream()},v.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0&&(this.reconnecting||(this.emit("offline"),this.reconnecting=!0),t.reconnectTimer=setInterval((function(){t._reconnect()}),t.options.reconnectPeriod))},v.prototype._clearReconnect=function(){this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},v.prototype._cleanUp=function(t,e){e&&this.stream.on("close",e),t?(0===this.options.reconnectPeriod&&this.options.clean&&b(this.outgoing),this.stream.destroy()):this._sendPacket({cmd:"disconnect"},p.bind(null,this.stream.end.bind(this.stream))),this.disconnecting||(this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(this.stream.removeListener("close",e),e())},v.prototype._sendPacket=function(t,e){if(this.connected){switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void _(this,t,e);default:return void y(this,t,e)}switch(t.qos){case 2:case 1:_(this,t,e);break;case 0:default:y(this,t,e);break}}else 0===(t.qos||0)&&this.queueQoSZero||"publish"!==t.cmd?this.queue.push({packet:t,cb:e}):t.qos>0?(e=this.outgoing[t.messageId],this.outgoingStore.put(t,(function(t){if(t)return e&&e(t)}))):e&&e(new Error("No connection to broker"))},v.prototype._setupPingTimer=function(){var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=l((function(){t._checkPing()}),1e3*this.options.keepalive))},v.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},v.prototype._checkPing=function(){this.pingResp?(this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):this._cleanUp(!0)},v.prototype._handlePingresp=function(){this.pingResp=!0},v.prototype._handleConnack=function(t){var e=t.returnCode,r=["","Unacceptable protocol version","Identifier rejected","Server unavailable","Bad username or password","Not authorized"];if(clearTimeout(this.connackTimer),0===e)this.reconnecting=!1,this.emit("connect",t);else if(e>0){var n=new Error("Connection refused: "+r[e]);n.code=e,this.emit("error",n)}},v.prototype._handlePublish=function(t,e){e="undefined"!==typeof e?e:m;var r=t.topic.toString(),n=t.payload,i=t.qos,o=t.messageId,s=this;switch(i){case 2:this.incomingStore.put(t,(function(t){if(t)return e(t);s._sendPacket({cmd:"pubrec",messageId:o},e)}));break;case 1:this.emit("message",r,n,t),this.handleMessage(t,(function(t){if(t)return e(t);s._sendPacket({cmd:"puback",messageId:o},e)}));break;case 0:this.emit("message",r,n,t),this.handleMessage(t,e);break;default:break}},v.prototype.handleMessage=function(t,e){e()},v.prototype._handleAck=function(t){var e=t.messageId,r=t.cmd,n=null,i=this.outgoing[e],o=this;if(i){switch(r){case"pubcomp":case"puback":delete this.outgoing[e],this.outgoingStore.del(t,i);break;case"pubrec":n={cmd:"pubrel",qos:2,messageId:e},this._sendPacket(n);break;case"suback":if(delete this.outgoing[e],1===t.granted.length&&0!==(128&t.granted[0])){var s=this.messageIdToTopic[e];s&&s.forEach((function(t){delete o._resubscribeTopics[t]}))}i(null,t);break;case"unsuback":delete this.outgoing[e],i(null);break;default:o.emit("error",new Error("unrecognized packet type"))}this.disconnecting&&0===Object.keys(this.outgoing).length&&this.emit("outgoingEmpty")}},v.prototype._handlePubrel=function(t,e){e="undefined"!==typeof e?e:m;var r=t.messageId,n=this,i={cmd:"pubcomp",messageId:r};n.incomingStore.get(t,(function(r,o){r||"pubrel"===o.cmd?n._sendPacket(i,e):(n.emit("message",o.topic,o.payload,o),n.incomingStore.put(t,(function(t){if(t)return e(t);n.handleMessage(o,(function(t){if(t)return e(t);n._sendPacket(i,e)}))})))}))},v.prototype._nextId=function(){var t=this.nextId++;return 65536===this.nextId&&(this.nextId=1),t},v.prototype.getLastMessageId=function(){return 1===this.nextId?65535:this.nextId-1},e.exports=v}).call(this,t("_process"),"undefined"!==typeof r.g?r.g:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./store":6,"./validations":7,_process:92,"end-of-stream":17,events:78,inherits:80,"mqtt-packet":85,"readable-stream":106,reinterval:107,xtend:120}],2:[function(t,e,r){"use strict";var n=t("net");function i(t,e){var r,i;return e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",r=e.port,i=e.hostname,n.createConnection(r,i)}e.exports=i},{net:11}],3:[function(t,e,r){"use strict";var n=t("tls");function i(t,e){var r;function i(n){e.rejectUnauthorized&&t.emit("error",n),r.end()}return e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=!1!==e.rejectUnauthorized,delete e.path,r=n.connect(e),r.on("secureConnect",(function(){e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",i)})),r.on("error",i),r}e.exports=i},{tls:11}],4:[function(t,e,r){(function(r){"use strict";var n=t("websocket-stream"),i=t("url"),o=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],s="browser"===r.title;function a(t,e){var r=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"===typeof t.transformWsUrl&&(r=t.transformWsUrl(r,t,e)),r}function u(t){t.hostname||(t.hostname="localhost"),t.port||("wss"===t.protocol?t.port=443:t.port=80),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={}),s||"wss"!==t.protocol||o.forEach((function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])}))}function c(t,e){var r="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";u(e);var i=a(e,t);return n(i,[r],e.wsOptions)}function l(t,e){return c(t,e)}function f(t,e){if(e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"===typeof document)throw new Error("Could not determine host. Specify host manually.");var r=i.parse(document.URL);e.hostname=r.hostname,e.port||(e.port=r.port)}return c(t,e)}e.exports=s?f:l}).call(this,t("_process"))},{_process:92,url:112,"websocket-stream":117}],5:[function(t,e,r){"use strict";var n=!1,i=[];function o(t){n?wx.sendSocketMessage({data:t.buffer||t}):i.push(t)}function s(t,e){var r={OPEN:1,CLOSING:2,CLOSED:3,readyState:n?1:0,send:o,close:wx.closeSocket,onopen:null,onmessage:null,onclose:null,onerror:null};return wx.connectSocket({url:t,protocols:e}),wx.onSocketOpen((function(t){r.readyState=r.OPEN,n=!0;for(var e=0;e0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");-1===r&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function l(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function f(t,e,r){return 3*(e+r)/4-r}function h(t){for(var e,r=c(t),n=r[0],s=r[1],a=new o(f(t,n,s)),u=0,l=s>0?n-4:n,h=0;h>16&255,a[u++]=e>>8&255,a[u++]=255&e;return 2===s&&(e=i[t.charCodeAt(h)]<<2|i[t.charCodeAt(h+1)]>>4,a[u++]=255&e),1===s&&(e=i[t.charCodeAt(h)]<<10|i[t.charCodeAt(h+1)]<<4|i[t.charCodeAt(h+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e),a}function p(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function d(t,e,r){for(var n,i=[],o=e;ou?u:a+s));return 1===i?(e=t[r-1],o.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},{}],10:[function(t,e,r){var n=t("readable-stream/duplex"),i=t("util"),o=t("safe-buffer").Buffer;function s(t){if(!(this instanceof s))return new s(t);if(this._bufs=[],this.length=0,"function"==typeof t){this._callback=t;var e=function(t){this._callback&&(this._callback(t),this._callback=null)}.bind(this);this.on("pipe",(function(t){t.on("error",e)})),this.on("unpipe",(function(t){t.removeListener("error",e)}))}else this.append(t);n.call(this)}i.inherits(s,n),s.prototype._offset=function(t){var e,r=0,n=0;if(0===t)return[0,0];for(;nthis.length)&&(n=this.length),r>=this.length)return t||o.alloc(0);if(n<=0)return t||o.alloc(0);var i,s,a=!!t,u=this._offset(r),c=n-r,l=c,f=a&&e||0,h=u[1];if(0===r&&n==this.length){if(!a)return 1===this._bufs.length?this._bufs[0]:o.concat(this._bufs,this.length);for(s=0;si)){this._bufs[s].copy(t,f,h,h+l);break}this._bufs[s].copy(t,f,h),f+=i,l-=i,h&&(h=0)}return t},s.prototype.shallowSlice=function(t,e){t=t||0,e=e||this.length,t<0&&(t+=this.length),e<0&&(e+=this.length);var r=this._offset(t),n=this._offset(e),i=this._bufs.slice(r[0],n[0]+1);return 0==n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!=r[1]&&(i[0]=i[0].slice(r[1])),new s(i)},s.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)},s.prototype.consume=function(t){while(this._bufs.length){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){for(var t=0,e=new s;to)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=u.prototype,e}function u(t,e,r){if("number"===typeof t){if("string"===typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return h(t)}return c(t,e,r)}function c(t,e,r){if("string"===typeof t)return p(t,e);if(ArrayBuffer.isView(t))return d(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Y(t,ArrayBuffer)||t&&Y(t.buffer,ArrayBuffer))return g(t,e,r);if("number"===typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return u.from(n,e,r);var i=y(t);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof t[Symbol.toPrimitive])return u.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function l(t){if("number"!==typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t,e,r){return l(t),t<=0?a(t):void 0!==e?"string"===typeof r?a(t).fill(e,r):a(t).fill(e):a(t)}function h(t){return l(t),a(t<0?0:0|b(t))}function p(t,e){if("string"===typeof e&&""!==e||(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),n=a(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function d(t){for(var e=t.length<0?0:0|b(t.length),r=a(e),n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function _(t){return+t!=t&&(t=0),u.alloc(+t)}function m(t,e){if(u.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Y(t,ArrayBuffer))return t.byteLength;if("string"!==typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return $(t).length;default:if(i)return n?-1:Q(t).length;e=(""+e).toLowerCase(),i=!0}}function v(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,e>>>=0,r<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return B(this,e,r);case"utf8":case"utf-8":return M(this,e,r);case"ascii":return P(this,e,r);case"latin1":case"binary":return R(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function x(t,e,r,n,i){if(0===t.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,J(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof e&&(e=u.from(e,n)),u.isBuffer(e))return 0===e.length?-1:S(t,e,r,n,i);if("number"===typeof e)return e&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):S(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function S(t,e,r,n,i){var o,s=1,a=t.length,u=e.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var l=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var f=!0,h=0;hi&&(n=i)):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(l=c);break;case 2:o=t[i+1],128===(192&o)&&(u=(31&c)<<6|63&o,u>127&&(l=u));break;case 3:o=t[i+1],s=t[i+2],128===(192&o)&&128===(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s,u>2047&&(u<55296||u>57343)&&(l=u));break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a,u>65535&&u<1114112&&(l=u))}null===l?(l=65533,f=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=f}return L(n)}r.kMaxLength=o,u.TYPED_ARRAY_SUPPORT=s(),u.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||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."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),"undefined"!==typeof Symbol&&null!=Symbol.species&&u[Symbol.species]===u&&Object.defineProperty(u,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),u.poolSize=8192,u.from=function(t,e,r){return c(t,e,r)},u.prototype.__proto__=Uint8Array.prototype,u.__proto__=Uint8Array,u.alloc=function(t,e,r){return f(t,e,r)},u.allocUnsafe=function(t){return h(t)},u.allocUnsafeSlow=function(t){return h(t)},u.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==u.prototype},u.compare=function(t,e){if(Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),Y(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(t)||!u.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,o=Math.min(r,n);ie&&(t+=" ... "),""},u.prototype.compare=function(t,e,r,n,i){if(Y(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(e>>>=0,r>>>=0,n>>>=0,i>>>=0,this===t)return 0;for(var o=i-n,s=r-e,a=Math.min(o,s),c=this.slice(n,i),l=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return E(this,t,e,r);case"utf8":case"utf-8":return k(this,t,e,r);case"ascii":return j(this,t,e,r);case"latin1":case"binary":return I(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function L(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;while(nn)&&(r=n);for(var i="",o=e;or)throw new RangeError("Trying to access beyond buffer length")}function q(t,e,r,n,i,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function D(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,e,r,4,34028234663852886e22,-34028234663852886e22),i.write(t,e,r,n,23,4),r+4}function W(t,e,r,n,o){return e=+e,r>>>=0,o||D(t,e,r,8,17976931348623157e292,-17976931348623157e292),i.write(t,e,r,n,52,8),r+8}u.prototype.slice=function(t,e){var r=this.length;t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e>>=0,e>>>=0,r||N(t,e,this.length);var n=this[t],i=1,o=0;while(++o>>=0,e>>>=0,r||N(t,e,this.length);var n=this[t+--e],i=1;while(e>0&&(i*=256))n+=this[t+--e]*i;return n},u.prototype.readUInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return t>>>=0,e||N(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);var n=this[t],i=1,o=0;while(++o=i&&(n-=Math.pow(2,8*e)),n},u.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||N(t,e,this.length);var n=e,i=1,o=this[t+--n];while(n>0&&(i*=256))o+=this[t+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return t>>>=0,e||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(t,e){t>>>=0,e||N(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return t>>>=0,e||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return t>>>=0,e||N(t,4,this.length),i.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return t>>>=0,e||N(t,4,this.length),i.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return t>>>=0,e||N(t,8,this.length),i.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return t>>>=0,e||N(t,8,this.length),i.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;q(this,t,e,r,i,0)}var o=1,s=0;this[e]=255&t;while(++s>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;q(this,t,e,r,i,0)}var o=r-1,s=1;this[e+o]=255&t;while(--o>=0&&(s*=256))this[e+o]=t/s&255;return e+r},u.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,1,255,0),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},u.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;this[e]=255&t;while(++o>>=0,!n){var i=Math.pow(2,8*r-1);q(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;this[e+o]=255&t;while(--o>=0&&(s*=256))t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s|0)-a&255;return e+r},u.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},u.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},u.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},u.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||q(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},u.prototype.writeFloatLE=function(t,e,r){return F(this,t,e,!0,r)},u.prototype.writeFloatBE=function(t,e,r){return F(this,t,e,!1,r)},u.prototype.writeDoubleLE=function(t,e,r){return W(this,t,e,!0,r)},u.prototype.writeDoubleBE=function(t,e,r){return W(this,t,e,!1,r)},u.prototype.copy=function(t,e,r,n){if(!u.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},u.prototype.fill=function(t,e,r,n){if("string"===typeof t){if("string"===typeof e?(n=e,e=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!u.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"===typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"===typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(t){for(var e=[],r=0;r>8,i=r%256,o.push(i),o.push(n)}return o}function $(t){return n.toByteArray(K(t))}function Z(t,e,r,n){for(var i=0;i=e.length||i>=t.length)break;e[i+r]=t[i]}return i}function Y(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!==t}},{"base64-js":9,ieee754:79}],13:[function(t,e,r){(function(t){function e(t){return Array.isArray?Array.isArray(t):"[object Array]"===y(t)}function n(t){return"boolean"===typeof t}function i(t){return null===t}function o(t){return null==t}function s(t){return"number"===typeof t}function a(t){return"string"===typeof t}function u(t){return"symbol"===typeof t}function c(t){return void 0===t}function l(t){return"[object RegExp]"===y(t)}function f(t){return"object"===typeof t&&null!==t}function h(t){return"[object Date]"===y(t)}function p(t){return"[object Error]"===y(t)||t instanceof Error}function d(t){return"function"===typeof t}function g(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t}function y(t){return Object.prototype.toString.call(t)}r.isArray=e,r.isBoolean=n,r.isNull=i,r.isNullOrUndefined=o,r.isNumber=s,r.isString=a,r.isSymbol=u,r.isUndefined=c,r.isRegExp=l,r.isObject=f,r.isDate=h,r.isError=p,r.isFunction=d,r.isPrimitive=g,r.isBuffer=t.isBuffer}).call(this,{isBuffer:t("../../is-buffer/index.js")})},{"../../is-buffer/index.js":81}],14:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/copy"),o=t("es5-ext/object/normalize-options"),s=t("es5-ext/object/valid-callable"),a=t("es5-ext/object/map"),u=t("es5-ext/object/valid-callable"),c=t("es5-ext/object/valid-value"),l=Function.prototype.bind,f=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,o=c(e)&&u(e.value);return n=i(e),delete n.writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?o:(e.value=l.call(o,r.resolveContext?r.resolveContext(this):this),f(this,t,e),this[t])},n},e.exports=function(t){var e=o(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,(function(t,r){return n(r,t,e)}))}},{"es5-ext/object/copy":38,"es5-ext/object/map":47,"es5-ext/object/normalize-options":48,"es5-ext/object/valid-callable":53,"es5-ext/object/valid-value":54}],15:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/assign"),o=t("es5-ext/object/normalize-options"),s=t("es5-ext/object/is-callable"),a=t("es5-ext/string/#/contains");n=e.exports=function(t,e){var r,n,s,u,c;return arguments.length<2||"string"!==typeof t?(u=e,e=t,t=null):u=arguments[2],null==t?(r=s=!0,n=!1):(r=a.call(t,"c"),n=a.call(t,"e"),s=a.call(t,"w")),c={value:e,configurable:r,enumerable:n,writable:s},u?i(o(u),c):c},n.gs=function(t,e,r){var n,u,c,l;return"string"!==typeof t?(c=r,r=e,e=t,t=null):c=arguments[3],null==e?e=void 0:s(e)?null==r?r=void 0:s(r)||(c=r,r=void 0):(c=e,e=r=void 0),null==t?(n=!0,u=!1):(n=a.call(t,"c"),u=a.call(t,"e")),l={get:e,set:r,configurable:n,enumerable:u},c?i(o(c),l):l}},{"es5-ext/object/assign":35,"es5-ext/object/is-callable":41,"es5-ext/object/normalize-options":48,"es5-ext/string/#/contains":55}],16:[function(t,e,r){(function(r,n){var i=t("readable-stream"),o=t("end-of-stream"),s=t("inherits"),a=t("stream-shift"),u=n.from&&n.from!==Uint8Array.from?n.from([0]):new n([0]),c=function(t,e){t._corked?t.once("uncork",e):e()},l=function(t,e){t._autoDestroy&&t.destroy(e)},f=function(t,e){return function(r){r?l(t,"premature close"===r.message?null:r):e&&!t._ended&&t.end()}},h=function(t,e){return t?t._writableState&&t._writableState.finished?e():t._writableState?t.end(e):(t.end(),void e()):e()},p=function(t){return new i.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},d=function(t,e,r){if(!(this instanceof d))return new d(t,e,r);i.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};s(d,i.Duplex),d.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new d(t,e,r)},d.prototype.cork=function(){1===++this._corked&&this.emit("cork")},d.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},d.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed)t&&t.destroy&&t.destroy();else if(null!==t&&!1!==t){var e=this,n=o(t,{writable:!0,readable:!1},f(this,this._forwardEnd)),i=function(){var t=e._ondrain;e._ondrain=null,t&&t()},s=function(){e._writable.removeListener("drain",i),n()};this._unwrite&&r.nextTick(i),this._writable=t,this._writable.on("drain",i),this._unwrite=s,this.uncork()}else this.end()},d.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed)t&&t.destroy&&t.destroy();else{if(null===t||!1===t)return this.push(null),void this.resume();var e=this,r=o(t,{writable:!1,readable:!0},f(this)),n=function(){e._forward()},i=function(){e.push(null)},s=function(){e._readable2.removeListener("readable",n),e._readable2.removeListener("end",i),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:p(t),this._readable2.on("readable",n),this._readable2.on("end",i),this._unread=s,this._forward()}},d.prototype._read=function(){this._drained=!0,this._forward()},d.prototype._forward=function(){if(!this._forwarding&&this._readable2&&this._drained){var t;this._forwarding=!0;while(this._drained&&null!==(t=a(this._readable2)))this.destroyed||(this._drained=this.push(t));this._forwarding=!1}},d.prototype.destroy=function(t){if(!this.destroyed){this.destroyed=!0;var e=this;r.nextTick((function(){e._destroy(t)}))}},d.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},d.prototype._write=function(t,e,r){return this.destroyed?r():this._corked?c(this,this._write.bind(this,t,e,r)):t===u?this._finish(r):this._writable?void(!1===this._writable.write(t)?this._ondrain=r:r()):r()},d.prototype._finish=function(t){var e=this;this.emit("preend"),c(this,(function(){h(e._forwardEnd&&e._writable,(function(){!1===e._writableState.prefinished&&(e._writableState.prefinished=!0),e.emit("prefinish"),c(e,t)}))}))},d.prototype.end=function(t,e,r){return"function"===typeof t?this.end(null,null,t):"function"===typeof e?this.end(t,null,e):(this._ended=!0,t&&this.write(t),this._writableState.ending||this.write(u),i.Writable.prototype.end.call(this,r))},e.exports=d}).call(this,t("_process"),t("buffer").Buffer)},{_process:92,buffer:12,"end-of-stream":17,inherits:80,"readable-stream":106,"stream-shift":109}],17:[function(t,e,r){var n=t("once"),i=function(){},o=function(t){return t.setHeader&&"function"===typeof t.abort},s=function(t){return t.stdio&&Array.isArray(t.stdio)&&3===t.stdio.length},a=function(t,e,r){if("function"===typeof e)return a(t,null,e);e||(e={}),r=n(r||i);var u=t._writableState,c=t._readableState,l=e.readable||!1!==e.readable&&t.readable,f=e.writable||!1!==e.writable&&t.writable,h=function(){t.writable||p()},p=function(){f=!1,l||r.call(t)},d=function(){l=!1,f||r.call(t)},g=function(e){r.call(t,e?new Error("exited with error code: "+e):null)},y=function(e){r.call(t,e)},b=function(){return(!l||c&&c.ended)&&(!f||u&&u.ended)?void 0:r.call(t,new Error("premature close"))},_=function(){t.req.on("finish",p)};return o(t)?(t.on("complete",p),t.on("abort",b),t.req?_():t.on("request",_)):f&&!u&&(t.on("end",h),t.on("close",h)),s(t)&&t.on("exit",g),t.on("end",d),t.on("finish",p),!1!==e.error&&t.on("error",y),t.on("close",b),function(){t.removeListener("complete",p),t.removeListener("abort",b),t.removeListener("request",_),t.req&&t.req.removeListener("finish",p),t.removeListener("end",h),t.removeListener("close",h),t.removeListener("finish",p),t.removeListener("exit",g),t.removeListener("end",d),t.removeListener("error",y),t.removeListener("close",b)}};e.exports=a},{once:90}],18:[function(t,e,r){"use strict";var n=t("../../object/valid-value");e.exports=function(){return n(this).length=0,this}},{"../../object/valid-value":54}],19:[function(t,e,r){"use strict";var n=t("../../number/is-nan"),i=t("../../number/to-pos-integer"),o=t("../../object/valid-value"),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;e.exports=function(t){var e,r,l,f;if(!n(t))return s.apply(this,arguments);for(r=i(o(this).length),l=arguments[1],l=isNaN(l)?0:l>=0?c(l):i(this.length)-c(u(l)),e=l;e=55296&&_<=56319&&(x+=t[++r])),x=S?h.call(S,E,x,g):x,e?(p.value=x,d(y,g,p)):y[g]=x,++g;b=g}if(void 0===b)for(b=s(t.length),e&&(y=new e(b)),r=0;r0?1:-1}},{}],29:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Number.isNaN:t("./shim")},{"./is-implemented":30,"./shim":31}],30:[function(t,e,r){"use strict";e.exports=function(){var t=Number.isNaN;return"function"===typeof t&&(!t({})&&t(NaN)&&!t(34))}},{}],31:[function(t,e,r){"use strict";e.exports=function(t){return t!==t}},{}],32:[function(t,e,r){"use strict";var n=t("../math/sign"),i=Math.abs,o=Math.floor;e.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?n(t)*o(i(t)):t)}},{"../math/sign":26}],33:[function(t,e,r){"use strict";var n=t("./to-integer"),i=Math.max;e.exports=function(t){return i(0,n(t))}},{"./to-integer":32}],34:[function(t,e,r){"use strict";var n=t("./valid-callable"),i=t("./valid-value"),o=Function.prototype.bind,s=Function.prototype.call,a=Object.keys,u=Object.prototype.propertyIsEnumerable;e.exports=function(t,e){return function(r,c){var l,f=arguments[2],h=arguments[3];return r=Object(i(r)),n(c),l=a(r),h&&l.sort("function"===typeof h?o.call(h,r):void 0),"function"!==typeof t&&(t=l[t]),s.call(t,l,(function(t,n){return u.call(r,t)?s.call(c,f,r[t],t,r,n):e}))}}},{"./valid-callable":53,"./valid-value":54}],35:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Object.assign:t("./shim")},{"./is-implemented":36,"./shim":37}],36:[function(t,e,r){"use strict";e.exports=function(){var t,e=Object.assign;return"function"===typeof e&&(t={foo:"raz"},e(t,{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},{}],37:[function(t,e,r){"use strict";var n=t("../keys"),i=t("../valid-value"),o=Math.max;e.exports=function(t,e){var r,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(n){try{t[n]=e[n]}catch(i){r||(r=i)}},s=1;s-1}},{}],58:[function(t,e,r){"use strict";var n=Object.prototype.toString,i=n.call("");e.exports=function(t){return"string"===typeof t||t&&"object"===typeof t&&(t instanceof String||n.call(t)===i)||!1}},{}],59:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),o=t("es5-ext/string/#/contains"),s=t("d"),a=t("es6-symbol"),u=t("./"),c=Object.defineProperty;n=e.exports=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");u.call(this,t),e=e?o.call(e,"key+value")?"key+value":o.call(e,"key")?"key":"value":"value",c(this,"__kind__",s("",e))},i&&i(n,u),delete n.prototype.constructor,n.prototype=Object.create(u.prototype,{_resolve:s((function(t){return"value"===this.__kind__?this.__list__[t]:"key+value"===this.__kind__?[t,this.__list__[t]]:t}))}),c(n.prototype,a.toStringTag,s("c","Array Iterator"))},{"./":62,d:15,"es5-ext/object/set-prototype-of":50,"es5-ext/string/#/contains":55,"es6-symbol":72}],60:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/valid-callable"),o=t("es5-ext/string/is-string"),s=t("./get"),a=Array.isArray,u=Function.prototype.call,c=Array.prototype.some;e.exports=function(t,e){var r,l,f,h,p,d,g,y,b=arguments[2];if(a(t)||n(t)?r="array":o(t)?r="string":t=s(t),i(e),f=function(){h=!0},"array"!==r){if("string"!==r){l=t.next();while(!l.done){if(u.call(e,b,l.value,f),h)return;l=t.next()}}else for(d=t.length,p=0;p=55296&&y<=56319&&(g+=t[++p])),u.call(e,b,g,f),h)break}else c.call(t,(function(t){return u.call(e,b,t,f),h}))}},{"./get":61,"es5-ext/function/is-arguments":23,"es5-ext/object/valid-callable":53,"es5-ext/string/is-string":58}],61:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/string/is-string"),o=t("./array"),s=t("./string"),a=t("./valid-iterable"),u=t("es6-symbol").iterator;e.exports=function(t){return"function"===typeof a(t)[u]?t[u]():n(t)?new o(t):i(t)?new s(t):new o(t)}},{"./array":59,"./string":64,"./valid-iterable":65,"es5-ext/function/is-arguments":23,"es5-ext/string/is-string":58,"es6-symbol":72}],62:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),o=t("es5-ext/object/assign"),s=t("es5-ext/object/valid-callable"),a=t("es5-ext/object/valid-value"),u=t("d"),c=t("d/auto-bind"),l=t("es6-symbol"),f=Object.defineProperty,h=Object.defineProperties;e.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:u("w",a(t)),__context__:u("w",e),__nextIndex__:u("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,o({_next:u((function(){var t;if(this.__list__)return this.__redo__&&(t=this.__redo__.shift(),void 0!==t)?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach((function(e,r){e>=t&&(this.__redo__[r]=++e)}),this),this.__redo__.push(t)):f(this,"__redo__",u("c",[t])))})),_onDelete:u((function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(e=this.__redo__.indexOf(t),-1!==e&&this.__redo__.splice(e,1),this.__redo__.forEach((function(e,r){e>t&&(this.__redo__[r]=--e)}),this)))})),_onClear:u((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(n.prototype,l.iterator,u((function(){return this})))},{d:15,"d/auto-bind":14,"es5-ext/array/#/clear":18,"es5-ext/object/assign":35,"es5-ext/object/valid-callable":53,"es5-ext/object/valid-value":54,"es6-symbol":72}],63:[function(t,e,r){"use strict";var n=t("es5-ext/function/is-arguments"),i=t("es5-ext/object/is-value"),o=t("es5-ext/string/is-string"),s=t("es6-symbol").iterator,a=Array.isArray;e.exports=function(t){return!!i(t)&&(!!a(t)||(!!o(t)||(!!n(t)||"function"===typeof t[s])))}},{"es5-ext/function/is-arguments":23,"es5-ext/object/is-value":43,"es5-ext/string/is-string":58,"es6-symbol":72}],64:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),o=t("d"),s=t("es6-symbol"),a=t("./"),u=Object.defineProperty;n=e.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:o((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)}))}),u(n.prototype,s.toStringTag,o("c","String Iterator"))},{"./":62,d:15,"es5-ext/object/set-prototype-of":50,"es6-symbol":72}],65:[function(t,e,r){"use strict";var n=t("./is-iterable");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not iterable");return t}},{"./is-iterable":63}],66:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Map:t("./polyfill")},{"./is-implemented":67,"./polyfill":71}],67:[function(t,e,r){"use strict";e.exports=function(){var t,e,r;if("function"!==typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(n){return!1}return"[object Map]"===String(t)&&(3===t.size&&("function"===typeof t.clear&&("function"===typeof t.delete&&("function"===typeof t.entries&&("function"===typeof t.forEach&&("function"===typeof t.get&&("function"===typeof t.has&&("function"===typeof t.keys&&("function"===typeof t.set&&("function"===typeof t.values&&(e=t.entries(),r=e.next(),!1===r.done&&(!!r.value&&("raz"===r.value[0]&&"one"===r.value[1])))))))))))))}},{}],68:[function(t,e,r){"use strict";e.exports=function(){return"undefined"!==typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)}()},{}],69:[function(t,e,r){"use strict";e.exports=t("es5-ext/object/primitive-set")("key","value","key+value")},{"es5-ext/object/primitive-set":49}],70:[function(t,e,r){"use strict";var n,i=t("es5-ext/object/set-prototype-of"),o=t("d"),s=t("es6-iterator"),a=t("es6-symbol").toStringTag,u=t("./iterator-kinds"),c=Object.defineProperties,l=s.prototype._unBind;n=e.exports=function(t,e){if(!(this instanceof n))return new n(t,e);s.call(this,t.__mapKeysData__,t),e&&u[e]||(e="key+value"),c(this,{__kind__:o("",e),__values__:o("w",t.__mapValuesData__)})},i&&i(n,s),n.prototype=Object.create(s.prototype,{constructor:o(n),_resolve:o((function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]})),_unBind:o((function(){this.__values__=null,l.call(this)})),toString:o((function(){return"[object Map Iterator]"}))}),Object.defineProperty(n.prototype,a,o("c","Map Iterator"))},{"./iterator-kinds":69,d:15,"es5-ext/object/set-prototype-of":50,"es6-iterator":62,"es6-symbol":72}],71:[function(t,e,r){"use strict";var n,i=t("es5-ext/array/#/clear"),o=t("es5-ext/array/#/e-index-of"),s=t("es5-ext/object/set-prototype-of"),a=t("es5-ext/object/valid-callable"),u=t("es5-ext/object/valid-value"),c=t("d"),l=t("event-emitter"),f=t("es6-symbol"),h=t("es6-iterator/valid-iterable"),p=t("es6-iterator/for-of"),d=t("./lib/iterator"),g=t("./is-native-implemented"),y=Function.prototype.call,b=Object.defineProperties,_=Object.getPrototypeOf;e.exports=n=function(){var t,e,r,i=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return r=g&&s&&Map!==n?s(new Map,_(this)):this,null!=i&&h(i),b(r,{__mapKeysData__:c("c",t=[]),__mapValuesData__:c("c",e=[])}),i?(p(i,(function(r){var n=u(r)[0];r=r[1],-1===o.call(t,n)&&(t.push(n),e.push(r))}),r),r):r},g&&(s&&s(n,Map),n.prototype=Object.create(Map.prototype,{constructor:c(n)})),l(b(n.prototype,{clear:c((function(){this.__mapKeysData__.length&&(i.call(this.__mapKeysData__),i.call(this.__mapValuesData__),this.emit("_clear"))})),delete:c((function(t){var e=o.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)})),entries:c((function(){return new d(this,"key+value")})),forEach:c((function(t){var e,r,n=arguments[1];a(t),e=this.entries(),r=e._next();while(void 0!==r)y.call(t,n,this.__mapValuesData__[r],this.__mapKeysData__[r],this),r=e._next()})),get:c((function(t){var e=o.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]})),has:c((function(t){return-1!==o.call(this.__mapKeysData__,t)})),keys:c((function(){return new d(this,"key")})),set:c((function(t,e){var r,n=o.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,r=!0),this.__mapValuesData__[n]=e,r&&this.emit("_add",n,t),this})),size:c.gs((function(){return this.__mapKeysData__.length})),values:c((function(){return new d(this,"value")})),toString:c((function(){return"[object Map]"}))})),Object.defineProperty(n.prototype,f.iterator,c((function(){return this.entries()}))),Object.defineProperty(n.prototype,f.toStringTag,c("c","Map"))},{"./is-native-implemented":68,"./lib/iterator":70,d:15,"es5-ext/array/#/clear":18,"es5-ext/array/#/e-index-of":19,"es5-ext/object/set-prototype-of":50,"es5-ext/object/valid-callable":53,"es5-ext/object/valid-value":54,"es6-iterator/for-of":60,"es6-iterator/valid-iterable":65,"es6-symbol":72,"event-emitter":77}],72:[function(t,e,r){"use strict";e.exports=t("./is-implemented")()?Symbol:t("./polyfill")},{"./is-implemented":73,"./polyfill":75}],73:[function(t,e,r){"use strict";var n={object:!0,symbol:!0};e.exports=function(){var t;if("function"!==typeof Symbol)return!1;t=Symbol("test symbol");try{String(t)}catch(e){return!1}return!!n[typeof Symbol.iterator]&&(!!n[typeof Symbol.toPrimitive]&&!!n[typeof Symbol.toStringTag])}},{}],74:[function(t,e,r){"use strict";e.exports=function(t){return!!t&&("symbol"===typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},{}],75:[function(t,e,r){"use strict";var n,i,o,s,a=t("d"),u=t("./validate-symbol"),c=Object.create,l=Object.defineProperties,f=Object.defineProperty,h=Object.prototype,p=c(null);if("function"===typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(g){}}var d=function(){var t=c(null);return function(e){var r,n,i=0;while(t[e+(i||"")])++i;return e+=i||"",t[e]=!0,r="@@"+e,f(h,r,a.gs(null,(function(t){n||(n=!0,f(this,r,a(t)),n=!1)}))),r}}();o=function(t){if(this instanceof o)throw new TypeError("Symbol is not a constructor");return i(t)},e.exports=i=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=c(o.prototype),e=void 0===e?"":String(e),l(r,{__description__:a("",e),__name__:a("",d(e))}))},l(i,{for:a((function(t){return p[t]?p[t]:p[t]=i(String(t))})),keyFor:a((function(t){var e;for(e in u(t),p)if(p[e]===t)return e})),hasInstance:a("",n&&n.hasInstance||i("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||i("isConcatSpreadable")),iterator:a("",n&&n.iterator||i("iterator")),match:a("",n&&n.match||i("match")),replace:a("",n&&n.replace||i("replace")),search:a("",n&&n.search||i("search")),species:a("",n&&n.species||i("species")),split:a("",n&&n.split||i("split")),toPrimitive:a("",n&&n.toPrimitive||i("toPrimitive")),toStringTag:a("",n&&n.toStringTag||i("toStringTag")),unscopables:a("",n&&n.unscopables||i("unscopables"))}),l(o.prototype,{constructor:a(i),toString:a("",(function(){return this.__name__}))}),l(i.prototype,{toString:a((function(){return"Symbol ("+u(this).__description__+")"})),valueOf:a((function(){return u(this)}))}),f(i.prototype,i.toPrimitive,a("",(function(){var t=u(this);return"symbol"===typeof t?t:t.toString()}))),f(i.prototype,i.toStringTag,a("c","Symbol")),f(o.prototype,i.toStringTag,a("c",i.prototype[i.toStringTag])),f(o.prototype,i.toPrimitive,a("c",i.prototype[i.toPrimitive]))},{"./validate-symbol":76,d:15}],76:[function(t,e,r){"use strict";var n=t("./is-symbol");e.exports=function(t){if(!n(t))throw new TypeError(t+" is not a symbol");return t}},{"./is-symbol":74}],77:[function(t,e,r){"use strict";var n,i,o,s,a,u,c,l=t("d"),f=t("es5-ext/object/valid-callable"),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,g=Object.defineProperty,y=Object.defineProperties,b=Object.prototype.hasOwnProperty,_={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var r;return f(e),b.call(this,"__ee__")?r=this.__ee__:(r=_.value=d(null),g(this,"__ee__",_),_.value=null),r[t]?"object"===typeof r[t]?r[t].push(e):r[t]=[r[t],e]:r[t]=e,this},i=function(t,e){var r,i;return f(e),i=this,n.call(this,t,r=function(){o.call(i,t,r),h.call(e,this,arguments)}),r.__eeOnceListener__=e,this},o=function(t,e){var r,n,i,o;if(f(e),!b.call(this,"__ee__"))return this;if(r=this.__ee__,!r[t])return this;if(n=r[t],"object"===typeof n)for(o=0;i=n[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===n.length?r[t]=n[o?0:1]:n.splice(o,1));else n!==e&&n.__eeOnceListener__!==e||delete r[t];return this},s=function(t){var e,r,n,i,o;if(b.call(this,"__ee__")&&(i=this.__ee__[t],i))if("object"===typeof i){for(r=arguments.length,o=new Array(r-1),e=1;e0&&a.length>o)){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(e)+'" listeners added. Use emitter.setMaxListeners() to increase limit.');u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,"object"===typeof console&&console.warn&&console.warn("%s: %s",u.name,u.message)}}else a=s[e]=r,++t._eventsCount;return t}function b(){if(!this.fired)switch(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length){case 0:return this.listener.call(this.target);case 1:return this.listener.call(this.target,arguments[0]);case 2:return this.listener.call(this.target,arguments[0],arguments[1]);case 3:return this.listener.call(this.target,arguments[0],arguments[1],arguments[2]);default:for(var t=new Array(arguments.length),e=0;e1&&(e=arguments[1]),e instanceof Error)throw e;var u=new Error('Unhandled "error" event. ('+e+")");throw u.context=e,u}if(r=s[t],!r)return!1;var c="function"===typeof r;switch(n=arguments.length,n){case 1:f(r,c,this);break;case 2:h(r,c,this,arguments[1]);break;case 3:p(r,c,this,arguments[1],arguments[2]);break;case 4:d(r,c,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o=0;s--)if(r[s]===e||r[s].listener===e){a=r[s].listener,o=s;break}if(o<0)return this;0===o?r.shift():w(r,o),1===r.length&&(i[t]=r[0]),i.removeListener&&this.emit("removeListener",t,a||e)}return this},s.prototype.removeAllListeners=function(t){var e,r,o;if(r=this._events,!r)return this;if(!r.removeListener)return 0===arguments.length?(this._events=n(null),this._eventsCount=0):r[t]&&(0===--this._eventsCount?this._events=n(null):delete r[t]),this;if(0===arguments.length){var s,a=i(r);for(o=0;o=0;o--)this.removeListener(t,e[o]);return this},s.prototype.listeners=function(t){return m(this,t,!0)},s.prototype.rawListeners=function(t){return m(this,t,!1)},s.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):v.call(t,e)},s.prototype.listenerCount=v,s.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]}},{}],79:[function(t,e,r){r.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,l=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+t[e+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+t[e+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},r.write=function(t,e,r,n,i,o){var s,a,u,c=8*o-i-1,l=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=l):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),e+=s+f>=1?h/u:h*Math.pow(2,1-f),e*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(e*u-1)*Math.pow(2,i),s+=f):(a=e*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*g}},{}],80:[function(t,e,r){"function"===typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],81:[function(t,e,r){function n(t){return!!t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function i(t){return"function"===typeof t.readFloatLE&&"function"===typeof t.slice&&n(t.slice(0,0))}e.exports=function(t){return null!=t&&(n(t)||i(t)||!!t._isBuffer)}},{}],82:[function(t,e,r){var n={}.toString;e.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},{}],83:[function(t,e,r){"use strict";var n=t("safe-buffer").Buffer,i=e.exports;for(var o in i.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"reserved"},i.codes={},i.types){var s=i.types[o];i.codes[s]=o}function a(t){return[0,1,2].map((function(e){return[0,1].map((function(r){return[0,1].map((function(o){var s=new n(1);return s.writeUInt8(i.codes[t]<>8,0),e.writeUInt8(255&t,1),e}function a(){for(var t=0;t0)&&this[this._states[this._stateCounter]]()&&!this.error)this._stateCounter++,this._stateCounter>=this._states.length&&(this._stateCounter=0);return this._list.length},u.prototype._parseHeader=function(){var t=this._list.readUInt8(0);return this.packet.cmd=a.types[t>>a.CMD_SHIFT],this.packet.retain=0!==(t&a.RETAIN_MASK),this.packet.qos=t>>a.QOS_SHIFT&a.QOS_MASK,this.packet.dup=0!==(t&a.DUP_MASK),this._list.consume(1),!0},u.prototype._parseLength=function(){var t,e=0,r=1,n=0,i=!0;while(e<5){if(t=this._list.readUInt8(e++),n+=r*(t&a.LENGTH_MASK),r*=128,0===(t&a.LENGTH_FIN_MASK))break;if(this._list.length<=e){i=!1;break}}return i&&(this.packet.length=n,this._list.consume(e)),i},u.prototype._parsePayload=function(){var t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseMessageId();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":case"disconnect":break;default:this._emitError(new Error("Not supported"))}t=!0}return t},u.prototype._parseConnect=function(){var t,e,r,n,i,o,s={},u=this.packet;if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==t&&"MQIsdp"!==t)return this._emitError(new Error("Invalid protocolId"));if(u.protocolId=t,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(u.protocolVersion=this._list.readUInt8(this._pos),3!==u.protocolVersion&&4!==u.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK,s.will&&(u.will={},u.will.retain=0!==(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),u.will.qos=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT),u.clean=0!==(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK),this._pos++,u.keepalive=this._parseNum(),-1===u.keepalive)return this._emitError(new Error("Packet too short"));if(e=this._parseString(),null===e)return this._emitError(new Error("Packet too short"));if(u.clientId=e,s.will){if(r=this._parseString(),null===r)return this._emitError(new Error("Cannot parse will topic"));if(u.will.topic=r,n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse will payload"));u.will.payload=n}if(s.username){if(o=this._parseString(),null===o)return this._emitError(new Error("Cannot parse username"));u.username=o}if(s.password){if(i=this._parseBuffer(),null===i)return this._emitError(new Error("Cannot parse password"));u.password=i}return u},u.prototype._parseConnack=function(){var t=this.packet;return this._list.length<2?null:(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&a.SESSIONPRESENT_MASK),t.returnCode=this._list.readUInt8(this._pos),-1===t.returnCode?this._emitError(new Error("Cannot parse return code")):void 0)},u.prototype._parsePublish=function(){var t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(new Error("Cannot parse topic"));t.qos>0&&!this._parseMessageId()||(t.payload=this._list.slice(this._pos,t.length))},u.prototype._parseSubscribe=function(){var t,e,r=this.packet;if(1!==r.qos)return this._emitError(new Error("Wrong subscribe header"));if(r.subscriptions=[],this._parseMessageId())while(this._posthis._list.length||n>this.packet.length?null:(e=this._list.toString("utf8",this._pos,n),this._pos+=r,e)},u.prototype._parseBuffer=function(){var t,e=this._parseNum(),r=e+this._pos;return-1===e||r>this._list.length||r>this.packet.length?null:(t=this._list.slice(this._pos,r),this._pos+=e,t)},u.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var t=this._list.readUInt16BE(this._pos);return this._pos+=2,t},u.prototype._newPacket=function(){return this.packet&&(this._list.consume(this.packet.length),this.emit("packet",this.packet)),this.packet=new s,!0},u.prototype._emitError=function(t){this.error=t,this.emit("error",t)},e.exports=u},{"./constants":83,"./packet":87,bl:10,events:78,inherits:80}],89:[function(t,e,r){"use strict";var n=t("./constants"),i=t("safe-buffer").Buffer,o=i.allocUnsafe(0),s=i.from([0]),a=t("./numbers"),u=t("process-nextick-args").nextTick,c=a.cache,l=a.generateNumber,f=a.generateCache,h=T,p=!0;function d(t,e){switch(e.cork&&(e.cork(),u(g,e)),p&&(p=!1,f()),t.cmd){case"connect":return y(t,e);case"connack":return b(t,e);case"publish":return _(t,e);case"puback":case"pubrec":case"pubrel":case"pubcomp":case"unsuback":return m(t,e);case"subscribe":return v(t,e);case"suback":return w(t,e);case"unsubscribe":return x(t,e);case"pingreq":case"pingresp":case"disconnect":return S(t,e);default:return e.emit("error",new Error("Unknown command")),!1}}function g(t){t.uncork()}function y(t,e){var r=t||{},o=r.protocolId||"MQTT",s=r.protocolVersion||4,a=r.will,u=r.clean,c=r.keepalive||0,l=r.clientId||"",f=r.username,p=r.password;void 0===u&&(u=!0);var d=0;if(!o||"string"!==typeof o&&!i.isBuffer(o))return e.emit("error",new Error("Invalid protocolId")),!1;if(d+=o.length+2,3!==s&&4!==s)return e.emit("error",new Error("Invalid protocol version")),!1;if(d+=1,"string"!==typeof l&&!i.isBuffer(l)||!l&&4!==s||!l&&!u){if(s<4)return e.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*u===0)return e.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}else d+=l.length+2;if("number"!==typeof c||c<0||c>65535||c%1!==0)return e.emit("error",new Error("Invalid keepalive")),!1;if(d+=2,d+=1,a){if("object"!==typeof a)return e.emit("error",new Error("Invalid will")),!1;if(!a.topic||"string"!==typeof a.topic)return e.emit("error",new Error("Invalid will topic")),!1;if(d+=i.byteLength(a.topic)+2,a.payload&&a.payload){if(!(a.payload.length>=0))return e.emit("error",new Error("Invalid will payload")),!1;"string"===typeof a.payload?d+=i.byteLength(a.payload)+2:d+=a.payload.length+2}else d+=2}var g=!1;if(null!=f){if(!L(f))return e.emit("error",new Error("Invalid username")),!1;g=!0,d+=i.byteLength(f)+2}if(null!=p){if(!g)return e.emit("error",new Error("Username is required to use password")),!1;if(!L(p))return e.emit("error",new Error("Invalid password")),!1;d+=C(p)+2}e.write(n.CONNECT_HEADER),I(e,d),M(e,o),e.write(4===s?n.VERSION4:n.VERSION3);var y=0;return y|=null!=f?n.USERNAME_MASK:0,y|=null!=p?n.PASSWORD_MASK:0,y|=a&&a.retain?n.WILL_RETAIN_MASK:0,y|=a&&a.qos?a.qos<0&&h(e,l),e.write(c))}function m(t,e){var r=t||{},i=r.cmd||"puback",o=r.messageId,s=r.dup&&"pubrel"===i?n.DUP_MASK:0,a=0;return"pubrel"===i&&(a=1),"number"!==typeof o?(e.emit("error",new Error("Invalid messageId")),!1):(e.write(n.ACKS[i][a][s][0]),I(e,2),h(e,o))}function v(t,e){var r=t||{},o=r.dup?n.DUP_MASK:0,s=r.messageId,a=r.subscriptions,u=0;if("number"!==typeof s)return e.emit("error",new Error("Invalid messageId")),!1;if(u+=2,"object"!==typeof a||!a.length)return e.emit("error",new Error("Invalid subscriptions")),!1;for(var c=0;c=0&&t<128?1:t>=128&&t<16384?2:t>=16384&&t<2097152?3:t>=2097152&&t<268435456?4:0}function k(t){var e=0,r=0,n=i.allocUnsafe(E(t));do{e=t%128|0,t=t/128|0,t>0&&(e|=128),n.writeUInt8(e,r++)}while(t>0);return n}Object.defineProperty(d,"cacheNumbers",{get:function(){return h===T},set:function(t){t?(c&&0!==Object.keys(c).length||(p=!0),h=T):(p=!1,h=A)}});var j={};function I(t,e){var r=j[e];r||(r=k(e),e<16384&&(j[e]=r)),t.write(r)}function O(t,e){var r=i.byteLength(e);h(t,r),t.write(e,"utf8")}function T(t,e){return t.write(c[e])}function A(t,e){return t.write(l(e))}function M(t,e){"string"===typeof e?O(t,e):e?(h(t,e.length),t.write(e)):h(t,0)}function C(t){return t?t instanceof i?t.length:i.byteLength(t):0}function L(t){return"string"===typeof t||t instanceof i}e.exports=d},{"./constants":83,"./numbers":86,"process-nextick-args":91,"safe-buffer":108}],90:[function(t,e,r){var n=t("wrappy");function i(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function o(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}e.exports=n(i),e.exports.strict=n(o),i.proto=i((function(){Object.defineProperty(Function.prototype,"once",{value:function(){return i(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return o(this)},configurable:!0})}))},{wrappy:119}],91:[function(t,e,r){(function(t){"use strict";function r(e,r,n,i){if("function"!==typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return t.nextTick(e);case 2:return t.nextTick((function(){e.call(null,r)}));case 3:return t.nextTick((function(){e.call(null,r,n)}));case 4:return t.nextTick((function(){e.call(null,r,n,i)}));default:o=new Array(a-1),s=0;while(s1)for(var r=1;r= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=f-h,E=Math.floor,k=String.fromCharCode;function j(t){throw new RangeError(x[t])}function I(t,e){var r=t.length,n=[];while(r--)n[r]=e(t[r]);return n}function O(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(w,".");var i=t.split("."),o=I(i,e).join(".");return n+o}function T(t){var e,r,n=[],i=0,o=t.length;while(i=55296&&e<=56319&&i65535&&(t-=65536,e+=k(t>>>10&1023|55296),t=56320|1023&t),e+=k(t),e})).join("")}function M(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:f}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function L(t,e,r){var n=0;for(t=r?E(t/g):t>>1,t+=E(t/e);t>S*p>>1;n+=f)t=E(t/S);return E(n+(S+1)*t/(t+d))}function P(t){var e,r,n,i,o,s,a,u,c,d,g=[],m=t.length,v=0,w=b,x=y;for(r=t.lastIndexOf(_),r<0&&(r=0),n=0;n=128&&j("not-basic"),g.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=m&&j("invalid-input"),u=M(t.charCodeAt(i++)),(u>=f||u>E((l-v)/s))&&j("overflow"),v+=u*s,c=a<=x?h:a>=x+p?p:a-x,uE(l/d)&&j("overflow"),s*=d}e=g.length+1,x=L(v-o,e,0==o),E(v/e)>l-w&&j("overflow"),w+=E(v/e),v%=e,g.splice(v++,0,w)}return A(g)}function R(t){var e,r,n,i,o,s,a,u,c,d,g,m,v,w,x,S=[];for(t=T(t),m=t.length,e=b,r=0,o=y,s=0;s=e&&gE((l-r)/v)&&j("overflow"),r+=(a-e)*v,e=a,s=0;sl&&j("overflow"),g==e){for(u=r,c=f;;c+=f){if(d=c<=o?h:c>=o+p?p:c-o,u0&&c>u&&(c=u);for(var l=0;l=0?(f=g.substr(0,y),h=g.substr(y+1)):(f=g,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],95:[function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};e.exports=function(t,e,r,a){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"===typeof t?o(s(t),(function(s){var a=encodeURIComponent(n(s))+r;return i(t[s])?o(t[s],(function(t){return a+encodeURIComponent(n(t))})).join(e):a+encodeURIComponent(n(t[s]))})).join(e):a?encodeURIComponent(n(a))+r+encodeURIComponent(n(t)):""};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function o(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n0?("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=f(e)),n?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):E(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?E(t,s,e,!1):L(t,s)):E(t,s,e,!1))):n||(s.reading=!1));return j(s)}function E(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(t.emit("data",r),t.read(0)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&M(t)),L(t,e)}function k(t,e){var r;return h(e)||"string"===typeof e||void 0===e||t.objectMode||(r=new TypeError("Invalid non-string/buffer chunk")),r}function j(t){return!t.ended&&(t.needReadable||t.length=I?t=I:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function T(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=O(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function A(t,e){if(!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,M(t)}}function M(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(g("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(C,t):C(t))}function C(t){g("emit readable"),t.emit("readable"),q(t)}function L(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(P,t,e))}function P(t,e){var r=e.length;while(!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):r=F(t,e.buffer,e.decoder),r);var r}function F(t,e,r){var n;return to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),t-=s,0===t){s===o.length?(++n,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++n}return e.length-=n,i}function z(t,e){var r=c.allocUnsafe(t),n=e.head,i=1;n.data.copy(r),t-=n.data.length;while(n=n.next){var o=n.data,s=t>o.length?o.length:t;if(o.copy(r,r.length-t,0,s),t-=s,0===t){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}function K(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,i.nextTick(H,e,t))}function H(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function Q(t,e){for(var r=0,n=t.length;r=e.highWaterMark||e.ended))return g("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?K(this):M(this),null;if(t=T(t,e),0===t&&e.ended)return 0===e.length&&K(this),null;var n,i=e.needReadable;return g("need readable",i),(0===e.length||e.length-t0?D(t,e):null,null===n?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&K(this)),null!==n&&this.emit("data",n),n},x.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},x.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t);break}o.pipesCount+=1,g("pipe count=%d opts=%j",o.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,u=s?l:w;function c(t,e){g("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,p())}function l(){g("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",c);var f=R(n);t.on("drain",f);var h=!1;function p(){g("cleanup"),t.removeListener("close",_),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",w),n.removeListener("data",y),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}var d=!1;function y(e){g("ondata"),d=!1;var r=t.write(e);!1!==r||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==Q(o.pipes,t))&&!h&&(g("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function b(e){g("onerror",e),w(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",m),w()}function m(){g("onfinish"),t.removeListener("close",_),w()}function w(){g("unpipe"),n.unpipe(t)}return n.on("data",y),v(t,"error",b),t.once("close",_),t.once("finish",m),t.emit("pipe",n),o.flowing||(g("pipe resume"),n.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o-1?i:o.nextTick;v.WritableState=m;var c=t("core-util-is");c.inherits=t("inherits");var l={deprecate:t("util-deprecate")},f=t("./internal/streams/stream"),h=t("safe-buffer").Buffer,p=n.Uint8Array||function(){};function d(t){return h.from(t)}function g(t){return h.isBuffer(t)||t instanceof p}var y,b=t("./internal/streams/destroy");function _(){}function m(e,r){a=a||t("./_stream_duplex"),e=e||{};var n=r instanceof a;this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode);var i=e.highWaterMark,o=e.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:n&&(o||0===o)?o:u,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var c=!1===e.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){O(r,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(e){if(a=a||t("./_stream_duplex"),!y.call(v,this)&&!(this instanceof a))return new v(e);this._writableState=new m(e,this),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),f.call(this)}function w(t,e){var r=new Error("write after end");t.emit("error",r),o.nextTick(e,r)}function x(t,e,r,n){var i=!0,s=!1;return null===r?s=new TypeError("May not write null values to stream"):"string"===typeof r||void 0===r||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(n,s),i=!1),i}function S(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=h.from(e,r)),e}function E(t,e,r,n,i,o){if(!r){var s=S(e,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,r){var n=this._writableState;"function"===typeof t?(r=t,t=null,e=null):"function"===typeof e&&(r=e,e=null),null!==t&&void 0!==t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||B(this,n,r)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=b.destroy,v.prototype._undestroy=b.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,t("_process"),"undefined"!==typeof r.g?r.g:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{},t("timers").setImmediate)},{"./_stream_duplex":98,"./internal/streams/destroy":104,"./internal/streams/stream":105,_process:92,"core-util-is":13,inherits:80,"process-nextick-args":91,"safe-buffer":108,timers:111,"util-deprecate":114}],103:[function(t,e,r){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i=t("safe-buffer").Buffer,o=t("util");function s(t,e,r){t.copy(e,r)}e.exports=function(){function t(){n(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";var e=this.head,r=""+e.data;while(e=e.next)r+=t+e.data;return r},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;var e=i.allocUnsafe(t>>>0),r=this.head,n=0;while(r)s(r.data,e,n),n+=r.data.length,r=r.next;return e},t}(),o&&o.inspect&&o.inspect.custom&&(e.exports.prototype[o.inspect.custom]=function(){var t=o.inspect({length:this.length});return this.constructor.name+" "+t})},{"safe-buffer":108,util:11}],104:[function(t,e,r){"use strict";var n=t("process-nextick-args");function i(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return i||o?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||n.nextTick(s,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!e&&t?(n.nextTick(s,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)})),this)}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(t,e){t.emit("error",e)}e.exports={destroy:i,undestroy:o}},{"process-nextick-args":91}],105:[function(t,e,r){e.exports=t("events").EventEmitter},{events:78}],106:[function(t,e,r){r=e.exports=t("./lib/_stream_readable.js"),r.Stream=r,r.Readable=r,r.Writable=t("./lib/_stream_writable.js"),r.Duplex=t("./lib/_stream_duplex.js"),r.Transform=t("./lib/_stream_transform.js"),r.PassThrough=t("./lib/_stream_passthrough.js")},{"./lib/_stream_duplex.js":98,"./lib/_stream_passthrough.js":99,"./lib/_stream_readable.js":100,"./lib/_stream_transform.js":101,"./lib/_stream_writable.js":102}],107:[function(t,e,r){"use strict";function n(t,e,r){var n=this;this._callback=t,this._args=r,this._interval=setInterval(t,e,this._args),this.reschedule=function(t){t||(t=n._interval),n._interval&&clearInterval(n._interval),n._interval=setInterval(n._callback,t,n._args)},this.clear=function(){n._interval&&(clearInterval(n._interval),n._interval=void 0)},this.destroy=function(){n._interval&&clearInterval(n._interval),n._callback=void 0,n._interval=void 0,n._args=void 0}}function i(){if("function"!==typeof arguments[0])throw new Error("callback needed");if("number"!==typeof arguments[1])throw new Error("interval needed");var t;if(arguments.length>0){t=new Array(arguments.length-2);for(var e=0;e>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function c(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0))}function l(t,e,r){if(128!==(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!==(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!==(192&e[2]))return t.lastNeed=2,"�"}}function f(t){var e=this.lastTotal-this.lastNeed,r=l(this,t,e);return void 0!==r?r:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function h(t,e){var r=c(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function d(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function g(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function y(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function b(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function _(t){return t.toString(this.encoding)}function m(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},r.setImmediate="function"===typeof e?e:function(t){var e=u++,n=!(arguments.length<2)&&s.call(arguments,1);return a[e]=!0,i((function(){a[e]&&(n?t.apply(null,n):t.call(null),r.clearImmediate(e))})),e},r.clearImmediate="function"===typeof n?n:function(t){delete a[t]}}).call(this,t("timers").setImmediate,t("timers").clearImmediate)},{"process/browser.js":92,timers:111}],112:[function(t,e,r){"use strict";var n=t("punycode"),i=t("./util");function o(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}r.parse=w,r.resolve=S,r.resolveObject=E,r.format=x,r.Url=o;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,u=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,c=["<",">",'"',"`"," ","\r","\n","\t"],l=["{","}","|","\\","^","`"].concat(c),f=["'"].concat(l),h=["%","/","?",";","#"].concat(f),p=["/","?","#"],d=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,y=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},_={javascript:!0,"javascript:":!0},m={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},v=t("querystring");function w(t,e,r){if(t&&i.isObject(t)&&t instanceof o)return t;var n=new o;return n.parse(t,e,r),n}function x(t){return i.isString(t)&&(t=w(t)),t instanceof o?t.format():o.prototype.format.call(t)}function S(t,e){return w(t,!1,!0).resolve(e)}function E(t,e){return t?w(t,!1,!0).resolveObject(e):e}o.prototype.parse=function(t,e,r){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?R+="x":R+=P[B];if(!R.match(g)){var N=C.slice(0,T),q=C.slice(T+1),D=P.match(y);D&&(N.push(D[1]),q.unshift(D[2])),q.length&&(w="/"+q.join(".")+w),this.hostname=N.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),M||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+F,this.href+=this.host,M&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!b[E])for(T=0,L=f.length;T0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return r.search=t.search,r.query=t.query,i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var j=S.slice(-1)[0],I=(r.host||t.host||S.length>1)&&("."===j||".."===j)||""===j,O=0,T=S.length;T>=0;T--)j=S[T],"."===j?S.splice(T,1):".."===j?(S.splice(T,1),O++):O&&(S.splice(T,1),O--);if(!w&&!x)for(;O--;O)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),I&&"/"!==S.join("/").substr(-1)&&S.push("");var A=""===S[0]||S[0]&&"/"===S[0].charAt(0);if(E){r.hostname=r.host=A?"":S.length?S.shift():"";k=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");k&&(r.auth=k.shift(),r.host=r.hostname=k.shift())}return w=w||r.host&&S.length,w&&!A&&S.unshift(""),S.length?r.pathname=S.join("/"):(r.pathname=null,r.path=null),i.isNull(r.pathname)&&i.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},o.prototype.parseHost=function(){var t=this.host,e=a.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":113,punycode:93,querystring:96}],113:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"===typeof t},isObject:function(t){return"object"===typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],114:[function(t,e,n){(function(t){function r(t,e){if(n("noDeprecation"))return t;var r=!1;function i(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return i}function n(e){try{if(!t.localStorage)return!1}catch(n){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}e.exports=r}).call(this,"undefined"!==typeof r.g?r.g:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{}],115:[function(t,e,r){e.exports=function(t){return t&&"object"===typeof t&&"function"===typeof t.copy&&"function"===typeof t.fill&&"function"===typeof t.readUInt8}},{}],116:[function(t,e,n){(function(e,r){var i=/%[sdj%]/g;n.format=function(t){if(!x(t)){for(var e=[],r=0;r=o)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return t}})),u=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),_(e)?r.showHidden=e:e&&n._extend(r,e),E(r.showHidden)&&(r.showHidden=!1),E(r.depth)&&(r.depth=2),E(r.colors)&&(r.colors=!1),E(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=u),f(r,t,r.depth)}function u(t,e){var r=a.styles[e];return r?"["+a.colors[r][0]+"m"+t+"["+a.colors[r][1]+"m":t}function c(t,e){return t}function l(t){var e={};return t.forEach((function(t,r){e[t]=!0})),e}function f(t,e,r){if(t.customInspect&&e&&T(e.inspect)&&e.inspect!==n.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(r,t);return x(i)||(i=f(t,i,r)),i}var o=h(t,e);if(o)return o;var s=Object.keys(e),a=l(s);if(t.showHidden&&(s=Object.getOwnPropertyNames(e)),O(e)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return p(e);if(0===s.length){if(T(e)){var u=e.name?": "+e.name:"";return t.stylize("[Function"+u+"]","special")}if(k(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(I(e))return t.stylize(Date.prototype.toString.call(e),"date");if(O(e))return p(e)}var c,_="",m=!1,v=["{","}"];if(b(e)&&(m=!0,v=["[","]"]),T(e)){var w=e.name?": "+e.name:"";_=" [Function"+w+"]"}return k(e)&&(_=" "+RegExp.prototype.toString.call(e)),I(e)&&(_=" "+Date.prototype.toUTCString.call(e)),O(e)&&(_=" "+p(e)),0!==s.length||m&&0!=e.length?r<0?k(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),c=m?d(t,e,r,a,s):s.map((function(n){return g(t,e,r,a,n,m)})),t.seen.pop(),y(c,_,v)):v[0]+_+v[1]}function h(t,e){if(E(e))return t.stylize("undefined","undefined");if(x(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return w(e)?t.stylize(""+e,"number"):_(e)?t.stylize(""+e,"boolean"):m(e)?t.stylize("null","null"):void 0}function p(t){return"["+Error.prototype.toString.call(t)+"]"}function d(t,e,r,n,i){for(var o=[],s=0,a=e.length;s-1&&(a=o?a.split("\n").map((function(t){return" "+t})).join("\n").substr(2):"\n"+a.split("\n").map((function(t){return" "+t})).join("\n"))):a=t.stylize("[Circular]","special")),E(s)){if(o&&i.match(/^\d+$/))return a;s=JSON.stringify(""+i),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=t.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=t.stylize(s,"string"))}return s+": "+a}function y(t,e,r){var n=t.reduce((function(t,e){return e.indexOf("\n")>=0&&0,t+e.replace(/\u001b\[\d\d?m/g,"").length+1}),0);return n>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function b(t){return Array.isArray(t)}function _(t){return"boolean"===typeof t}function m(t){return null===t}function v(t){return null==t}function w(t){return"number"===typeof t}function x(t){return"string"===typeof t}function S(t){return"symbol"===typeof t}function E(t){return void 0===t}function k(t){return j(t)&&"[object RegExp]"===M(t)}function j(t){return"object"===typeof t&&null!==t}function I(t){return j(t)&&"[object Date]"===M(t)}function O(t){return j(t)&&("[object Error]"===M(t)||t instanceof Error)}function T(t){return"function"===typeof t}function A(t){return null===t||"boolean"===typeof t||"number"===typeof t||"string"===typeof t||"symbol"===typeof t||"undefined"===typeof t}function M(t){return Object.prototype.toString.call(t)}function C(t){return t<10?"0"+t.toString(10):t.toString(10)}n.debuglog=function(t){if(E(o)&&(o=e.env.NODE_DEBUG||""),t=t.toUpperCase(),!s[t])if(new RegExp("\\b"+t+"\\b","i").test(o)){var r=e.pid;s[t]=function(){var e=n.format.apply(n,arguments);console.error("%s %d: %s",t,r,e)}}else s[t]=function(){};return s[t]},n.inspect=a,a.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=b,n.isBoolean=_,n.isNull=m,n.isNullOrUndefined=v,n.isNumber=w,n.isString=x,n.isSymbol=S,n.isUndefined=E,n.isRegExp=k,n.isObject=j,n.isDate=I,n.isError=O,n.isFunction=T,n.isPrimitive=A,n.isBuffer=t("./support/isBuffer");var L=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var t=new Date,e=[C(t.getHours()),C(t.getMinutes()),C(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function R(t,e){return Object.prototype.hasOwnProperty.call(t,e)}n.log=function(){console.log("%s - %s",P(),n.format.apply(n,arguments))},n.inherits=t("inherits"),n._extend=function(t,e){if(!e||!j(e))return t;var r=Object.keys(e),n=r.length;while(n--)t[r[n]]=e[r[n]];return t}}).call(this,t("_process"),"undefined"!==typeof r.g?r.g:"undefined"!==typeof self?self:"undefined"!==typeof window?window:{})},{"./support/isBuffer":115,_process:92,inherits:80}],117:[function(t,e,n){(function(r,n){"use strict";var i=t("readable-stream").Transform,o=t("duplexify"),s=t("ws"),a=t("safe-buffer").Buffer;function u(t,e,r){var n=new i({objectMode:t.objectMode});return n._write=e,n._flush=r,n}function c(t,e,i){var c,l,f="browser"===r.title,h=!!n.WebSocket,p=f?m:_;e&&!Array.isArray(e)&&"object"===typeof e&&(i=e,e=null,("string"===typeof i.protocol||Array.isArray(i.protocol))&&(e=i.protocol)),i||(i={}),void 0===i.objectMode&&(i.objectMode=!(!0===i.binary||void 0===i.binary));var d=u(i,p,v);i.objectMode||(d._writev=j);var g=i.browserBufferSize||524288,y=i.browserBufferTimeout||1e3;"object"===typeof t?l=t:(l=h&&f?new s(t,e):new s(t,e,i),l.binaryType="arraybuffer"),l.readyState===l.OPEN?c=d:(c=o.obj(),l.onopen=w),c.socket=l,l.onclose=x,l.onerror=S,l.onmessage=E,d.on("close",k);var b=!i.objectMode;function _(t,e,r){l.readyState===l.OPEN?(b&&"string"===typeof t&&(t=a.from(t,"utf8")),l.send(t,r)):r()}function m(t,e,r){if(l.bufferedAmount>g)setTimeout(m,y,t,e,r);else{b&&"string"===typeof t&&(t=a.from(t,"utf8"));try{l.send(t)}catch(n){return r(n)}r()}}function v(t){l.close(),t()}function w(){c.setReadable(d),c.setWritable(d),c.emit("connect")}function x(){c.end(),c.destroy()}function S(t){c.destroy(t)}function E(t){var e=t.data;e=e instanceof ArrayBuffer?a.from(e):a.from(e,"utf8"),d.push(e)}function k(){l.close()}function j(t,e){for(var r=new Array(t.length),n=0;nr,f=o(n)?n:l(n),h=a?u(arguments,r):[],p=a?function(){i(f,this,h)}:f;return e?t(p,s):t(p)}:t}},1606:function(t,e,r){"use strict";var n,i,o,s,a=r(4475),u=r(8745),c=r(6080),l=r(4901),f=r(9297),h=r(9039),p=r(397),d=r(7680),g=r(4055),y=r(2812),b=r(8119),_=r(9088),m=a.setImmediate,v=a.clearImmediate,w=a.process,x=a.Dispatch,S=a.Function,E=a.MessageChannel,k=a.String,j=0,I={},O="onreadystatechange";h((function(){n=a.location}));var T=function(t){if(f(I,t)){var e=I[t];delete I[t],e()}},A=function(t){return function(){T(t)}},M=function(t){T(t.data)},C=function(t){a.postMessage(k(t),n.protocol+"//"+n.host)};m&&v||(m=function(t){y(arguments.length,1);var e=l(t)?t:S(t),r=d(arguments,1);return I[++j]=function(){u(e,void 0,r)},i(j),j},v=function(t){delete I[t]},_?i=function(t){w.nextTick(A(t))}:x&&x.now?i=function(t){x.now(A(t))}:E&&!b?(o=new E,s=o.port2,o.port1.onmessage=M,i=c(s.postMessage,s)):a.addEventListener&&l(a.postMessage)&&!a.importScripts&&n&&"file:"!==n.protocol&&!h(C)?(i=C,a.addEventListener("message",M,!1)):i=O in g("script")?function(t){p.appendChild(g("script"))[O]=function(){p.removeChild(this),T(t)}}:function(t){setTimeout(A(t),0)}),t.exports={set:m,clear:v}},6368:function(t,e,r){"use strict";var n=r(6518),i=r(4475),o=r(1606).clear;n({global:!0,bind:!0,enumerable:!0,forced:i.clearImmediate!==o},{clearImmediate:o})},9848:function(t,e,r){"use strict";r(6368),r(9309)},9309:function(t,e,r){"use strict";var n=r(6518),i=r(4475),o=r(1606).set,s=r(9472),a=i.setImmediate?s(o,!1):o;n({global:!0,bind:!0,enumerable:!0,forced:i.setImmediate!==a},{setImmediate:a})}}]);