(window["webpackJsonp_security-control"]=window["webpackJsonp_security-control"]||[]).push([["chunk-92af1348"],{"05ee":function(t,e,n){"use strict";var r=n(8),i=n("34eb")("mqttjs:tcp");function o(t,e){var n,o;return e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",n=e.port,o=e.hostname,i("port %d and host %s",n,o),r.createConnection(n,o)}t.exports=o},"06a2":function(t,e,n){"use strict";var r,i=n("a671"),o=n("2031"),s=n("1a94"),a=n("96ae"),u=n("f508"),c=n("986b"),l=n("1c4a"),f=Object.defineProperty,h=Object.defineProperties;t.exports=r=function(t,e){if(!(this instanceof r))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 r.prototype.constructor,h(r.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,n){e>=t&&(this.__redo__[n]=++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,n){e>t&&(this.__redo__[n]=--e)}),this)))})),_onClear:u((function(){this.__redo__&&i.call(this.__redo__),this.__nextIndex__=0}))}))),f(r.prototype,l.iterator,u((function(){return this})))},"09d9":function(t,e,n){"use strict";var r,i=n("e0f6"),o=n("f508"),s=n("1c4a"),a=n("06a2"),u=Object.defineProperty;r=t.exports=function(t){if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),u(this,"__length__",o("",t.length))},i&&i(r,a),delete r.prototype.constructor,r.prototype=Object.create(a.prototype,{_next:o((function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?n+this.__list__[this.__nextIndex__++]:n)}))}),u(r.prototype,s.toStringTag,o("c","String Iterator"))},"0b16":function(t,e,n){"use strict";var r=n("1985"),i=n("35e8");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}e.parse=w,e.resolve=k,e.resolveObject=E,e.format=S,e.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,_=/^[+a-z0-9A-Z_-]{0,63}$/,g=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},v={javascript:!0,"javascript:":!0},y={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},m=n("b383");function w(t,e,n){if(t&&i.isObject(t)&&t instanceof o)return t;var r=new o;return r.parse(t,e,n),r}function S(t){return i.isString(t)&&(t=w(t)),t instanceof o?t.format():o.prototype.format.call(t)}function k(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,n){if(!i.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var o=t.indexOf("?"),a=-1!==o&&o127?L+="x":L+=M[N];if(!L.match(_)){var U=T.slice(0,R),D=T.slice(R+1),q=M.match(g);q&&(U.push(q[1]),D.unshift(q[2])),D.length&&(w="/"+D.join(".")+w),this.hostname=U.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=r.toASCII(this.hostname));var F=this.port?":"+this.port:"",W=this.hostname||"";this.host=W+F,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!b[E])for(R=0,P=f.length;R0)&&n.host.split("@");x&&(n.auth=x.shift(),n.host=n.hostname=x.shift())}return n.search=t.search,n.query=t.query,i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!k.length)return n.pathname=null,n.search?n.path="/"+n.search:n.path=null,n.href=n.format(),n;for(var O=k.slice(-1)[0],I=(n.host||t.host||k.length>1)&&("."===O||".."===O)||""===O,C=0,R=k.length;R>=0;R--)O=k[R],"."===O?k.splice(R,1):".."===O?(k.splice(R,1),C++):C&&(k.splice(R,1),C--);if(!w&&!S)for(;C--;C)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),I&&"/"!==k.join("/").substr(-1)&&k.push("");var j=""===k[0]||k[0]&&"/"===k[0].charAt(0);if(E){n.hostname=n.host=j?"":k.length?k.shift():"";x=!!(n.host&&n.host.indexOf("@")>0)&&n.host.split("@");x&&(n.auth=x.shift(),n.host=n.hostname=x.shift())}return w=w||n.host&&k.length,w&&!j&&k.unshift(""),k.length?n.pathname=k.join("/"):(n.pathname=null,n.path=null),i.isNull(n.pathname)&&i.isNull(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=t.auth||n.auth,n.slashes=n.slashes||t.slashes,n.href=n.format(),n},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)}},"0b24":function(t,e,n){"use strict";var r,i=n("a671"),o=n("3527"),s=n("e0f6"),a=n("1a94"),u=n("96ae"),c=n("f508"),l=n("c9fc"),f=n("1c4a"),h=n("3473"),p=n("c351"),d=n("1195"),_=n("b779"),g=Function.prototype.call,b=Object.defineProperties,v=Object.getPrototypeOf;t.exports=r=function(){var t,e,n,i=arguments[0];if(!(this instanceof r))throw new TypeError("Constructor requires 'new'");return n=_&&s&&Map!==r?s(new Map,v(this)):this,null!=i&&h(i),b(n,{__mapKeysData__:c("c",t=[]),__mapValuesData__:c("c",e=[])}),i?(p(i,(function(n){var r=u(n)[0];n=n[1],-1===o.call(t,r)&&(t.push(r),e.push(n))}),n),n):n},_&&(s&&s(r,Map),r.prototype=Object.create(Map.prototype,{constructor:c(r)})),l(b(r.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,n,r=arguments[1];a(t),e=this.entries(),n=e._next();while(void 0!==n)g.call(t,r,this.__mapValuesData__[n],this.__mapKeysData__[n],this),n=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 n,r=o.call(this.__mapKeysData__,t);return-1===r&&(r=this.__mapKeysData__.push(t)-1,n=!0),this.__mapValuesData__[r]=e,n&&this.emit("_add",r,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(r.prototype,f.iterator,c((function(){return this.entries()}))),Object.defineProperty(r.prototype,f.toStringTag,c("c","Map"))},"0e8b":function(t,e,n){"use strict";(function(e,r){var i;t.exports=R,R.ReadableState=C;n("faa1").EventEmitter;var o=function(t,e){return t.listeners(e).length},s=n("b98b"),a=n("1c35").Buffer,u=e.Uint8Array||function(){};function c(t){return a.from(t)}function l(t){return a.isBuffer(t)||t instanceof u}var f,h=n(6);f=h&&h.debuglog?h.debuglog("stream"):function(){};var p,d,_,g=n("e937"),b=n("f482"),v=n("86c6"),y=v.getHighWaterMark,m=n("9bfc").codes,w=m.ERR_INVALID_ARG_TYPE,S=m.ERR_STREAM_PUSH_AFTER_EOF,k=m.ERR_METHOD_NOT_IMPLEMENTED,E=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n("3fb5")(R,s);var x=b.errorOrDestroy,O=["error","close","destroy","pause","resume"];function I(t,e,n){if("function"===typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}function C(t,e,r){i=i||n("a493"),t=t||{},"boolean"!==typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=y(this,t,"readableHighWaterMark",r),this.buffer=new g,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(p||(p=n("7d72").StringDecoder),this.decoder=new p(t.encoding),this.encoding=t.encoding)}function R(t){if(i=i||n("a493"),!(this instanceof R))return new R(t);var e=this instanceof i;this._readableState=new C(t,this,e),this.readable=!0,t&&("function"===typeof t.read&&(this._read=t.read),"function"===typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function j(t,e,n,r,i){f("readableAddChunk",e);var o,s=t._readableState;if(null===e)s.reading=!1,N(t,s);else if(i||(o=T(s,e)),o)x(t,o);else if(s.objectMode||e&&e.length>0)if("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=c(e)),r)s.endEmitted?x(t,new E):A(t,s,e,!0);else if(s.ended)x(t,new S);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?A(t,s,e,!1):D(t,s)):A(t,s,e,!1)}else r||(s.reading=!1,D(t,s));return!s.ended&&(s.length=P?t=P:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function L(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=M(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function N(t,e){if(f("onEofChunk"),!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?B(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,U(t)))}}function B(t){var e=t._readableState;f("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(U,t))}function U(t){var e=t._readableState;f("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,K(t)}function D(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(q,t,e))}function q(t,e){while(!e.reading&&!e.ended&&(e.length0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function V(t){f("readable nexttick read 0"),t.read(0)}function z(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(H,t,e))}function H(t,e){f("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),K(t),e.flowing&&!e.reading&&t.read(0)}function K(t){var e=t._readableState;f("flow",e.flowing);while(e.flowing&&null!==t.read());}function $(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function Q(t){var e=t._readableState;f("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(G,e,t))}function G(t,e){if(f("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function Z(t,e){for(var n=0,r=t.length;n=e.highWaterMark:e.length>0)||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?Q(this):B(this),null;if(t=L(t,e),0===t&&e.ended)return 0===e.length&&Q(this),null;var r,i=e.needReadable;return f("need readable",i),(0===e.length||e.length-t0?$(t,e):null,null===r?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&Q(this)),null!==r&&this.emit("data",r),r},R.prototype._read=function(t){x(this,new k("_read()"))},R.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,f("pipe count=%d opts=%j",i.pipesCount,e);var s=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr,a=s?c:v;function u(t,e){f("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,p())}function c(){f("onend"),t.end()}i.endEmitted?r.nextTick(a):n.once("end",a),t.on("unpipe",u);var l=F(n);t.on("drain",l);var h=!1;function p(){f("cleanup"),t.removeListener("close",g),t.removeListener("finish",b),t.removeListener("drain",l),t.removeListener("error",_),t.removeListener("unpipe",u),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",d),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||l()}function d(e){f("ondata");var r=t.write(e);f("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==Z(i.pipes,t))&&!h&&(f("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function _(e){f("onerror",e),v(),t.removeListener("error",_),0===o(t,"error")&&x(t,e)}function g(){t.removeListener("finish",b),v()}function b(){f("onfinish"),t.removeListener("close",g),v()}function v(){f("unpipe"),n.unpipe(t)}return n.on("data",d),I(t,"error",_),t.once("close",g),t.once("finish",b),t.emit("pipe",n),i.flowing||(f("pipe resume"),n.resume()),t},R.prototype.unpipe=function(t){var e=this._readableState,n={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,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,f("on readable",i.length,i.reading),i.length?B(this):i.reading||r.nextTick(V,this))),n},R.prototype.addListener=R.prototype.on,R.prototype.removeListener=function(t,e){var n=s.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(W,this),n},R.prototype.removeAllListeners=function(t){var e=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(W,this),e},R.prototype.resume=function(){var t=this._readableState;return t.flowing||(f("resume"),t.flowing=!t.readableListening,z(this,t)),t.paused=!1,this},R.prototype.pause=function(){return f("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(f("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},R.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",(function(){if(f("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)})),t.on("data",(function(i){if(f("wrapped data"),n.decoder&&(i=n.decoder.write(i)),(!n.objectMode||null!==i&&void 0!==i)&&(n.objectMode||i&&i.length)){var o=e.push(i);o||(r=!0,t.pause())}})),t)void 0===this[i]&&"function"===typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var o=0;o100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var u=parseFloat(e[1]),c=(e[2]||"ms").toLowerCase();switch(c){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*s;case"days":case"day":case"d":return u*o;case"hours":case"hour":case"hrs":case"hr":case"h":return u*i;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}}}function c(t){var e=Math.abs(t);return e>=o?Math.round(t/o)+"d":e>=i?Math.round(t/i)+"h":e>=r?Math.round(t/r)+"m":e>=n?Math.round(t/n)+"s":t+"ms"}function l(t){var e=Math.abs(t);return e>=o?f(t,e,o,"day"):e>=i?f(t,e,i,"hour"):e>=r?f(t,e,r,"minute"):e>=n?f(t,e,n,"second"):t+" ms"}function f(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,e){e=e||{};var n=typeof t;if("string"===n&&t.length>0)return u(t);if("number"===n&&isFinite(t))return e.long?l(t):c(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},"14ab":function(t,e,n){"use strict";t.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")}},"14cf":function(t,e,n){"use strict";t.exports=function(){var t,e,n=Array.from;return"function"===typeof n&&(t=["raz","dwa"],e=n(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},1793:function(t,e,n){"use strict";var r=n("6321"),i=/^\s*class[\s{/}]/,o=Function.prototype.toString;t.exports=function(t){return!!r(t)&&!i.test(o.call(t))}},"18ec":function(t,e,n){"use strict";var r="razdwatrzy";t.exports=function(){return"function"===typeof r.contains&&(!0===r.contains("dwa")&&!1===r.contains("foo"))}},1985:function(t,e,n){(function(t,r){var i;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(o){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof r&&r;s.global!==s&&s.window!==s&&s.self;var a,u=2147483647,c=36,l=1,f=26,h=38,p=700,d=72,_=128,g="-",b=/^xn--/,v=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=c-l,S=Math.floor,k=String.fromCharCode;function E(t){throw new RangeError(m[t])}function x(t,e){var n=t.length,r=[];while(n--)r[n]=e(t[n]);return r}function O(t,e){var n=t.split("@"),r="";n.length>1&&(r=n[0]+"@",t=n[1]),t=t.replace(y,".");var i=t.split("."),o=x(i,e).join(".");return r+o}function I(t){var e,n,r=[],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 R(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:c}function j(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,n){var r=0;for(t=n?S(t/p):t>>1,t+=S(t/e);t>w*f>>1;r+=c)t=S(t/w);return S(r+(w+1)*t/(t+h))}function T(t){var e,n,r,i,o,s,a,h,p,b,v=[],y=t.length,m=0,w=_,k=d;for(n=t.lastIndexOf(g),n<0&&(n=0),r=0;r=128&&E("not-basic"),v.push(t.charCodeAt(r));for(i=n>0?n+1:0;i=y&&E("invalid-input"),h=R(t.charCodeAt(i++)),(h>=c||h>S((u-m)/s))&&E("overflow"),m+=h*s,p=a<=k?l:a>=k+f?f:a-k,hS(u/b)&&E("overflow"),s*=b}e=v.length+1,k=A(m-o,e,0==o),S(m/e)>u-w&&E("overflow"),w+=S(m/e),m%=e,v.splice(m++,0,w)}return C(v)}function P(t){var e,n,r,i,o,s,a,h,p,b,v,y,m,w,x,O=[];for(t=I(t),y=t.length,e=_,n=0,o=d,s=0;s=e&&vS((u-n)/m)&&E("overflow"),n+=(a-e)*m,e=a,s=0;su&&E("overflow"),v==e){for(h=n,p=c;;p+=c){if(b=p<=o?l:p>=o+f?f:p-o,h0)&&this[this._states[this._stateCounter]]()&&!this.error)this._stateCounter++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const t=this._list.readUInt8(0);return this.packet.cmd=s.types[t>>s.CMD_SHIFT],this.packet.retain=0!==(t&s.RETAIN_MASK),this.packet.qos=t>>s.QOS_SHIFT&s.QOS_MASK,this.packet.dup=0!==(t&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){const t=this._parseVarByteNum(!0);return t&&(this.packet.length=t.value,this._list.consume(t.bytes)),a("_parseLength %d",t.value),!!t}_parsePayload(){a("_parsePayload: payload %O",this._list);let 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._parseConfirmation();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":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}t=!0}return a("_parsePayload complete result: %s",t),t}_parseConnect(){let t,e,n,r;a("_parseConnect");const i={},o=this.packet,u=this._parseString();if(null===u)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==u&&"MQIsdp"!==u)return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=u,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.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(i.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK,i.will&&(o.will={},o.will.retain=0!==(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),o.will.qos=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT),o.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error("Packet too short"));if(5===o.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(o.properties=t)}const c=this._parseString();if(null===c)return this._emitError(new Error("Packet too short"));if(o.clientId=c,a("_parseConnect: packet.clientId: %s",o.clientId),i.will){if(5===o.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(o.will.properties=t)}if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=t,a("_parseConnect: packet.will.topic: %s",o.will.topic),e=this._parseBuffer(),null===e)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=e,a("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(i.username){if(r=this._parseString(),null===r)return this._emitError(new Error("Cannot parse username"));o.username=r,a("_parseConnect: packet.username: %s",o.username)}if(i.password){if(n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse password"));o.password=n}return this.settings=o,a("_parseConnect: complete"),o}_parseConnack(){a("_parseConnack");const t=this.packet;if(this._list.length<1)return null;if(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)this._list.length>=2?t.reasonCode=this._list.readUInt8(this._pos++):t.reasonCode=0;else{if(this._list.length<2)return null;t.returnCode=this._list.readUInt8(this._pos++)}if(-1===t.returnCode||-1===t.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const t=this.packet;if(t.topic=this._parseString(),null===t.topic)return this._emitError(new Error("Cannot parse topic"));if(!(t.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}t.payload=this._list.slice(this._pos,t.length),a("_parsePublish: payload from buffer list: %o",t.payload)}}_parseSubscribe(){a("_parseSubscribe");const t=this.packet;let e,n,r,i,o,u,c;if(1!==t.qos)return this._emitError(new Error("Wrong subscribe header"));if(t.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}while(this._pos=t.length)return this._emitError(new Error("Malformed Subscribe Payload"));n=this._parseByte(),r=n&s.SUBSCRIBE_OPTIONS_QOS_MASK,u=0!==(n>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(n>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),i=n>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,c={topic:e,qos:r},5===this.settings.protocolVersion?(c.nl=u,c.rap=o,c.rh=i):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",c),t.subscriptions.push(c)}}}_parseSuback(){a("_parseSuback");const t=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}while(this._pos2?(t.reasonCode=this._parseByte(),a("_parseConfirmation: packet.reasonCode `%d`",t.reasonCode)):t.reasonCode=0,t.length>3)){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}return!0}_parseDisconnect(){const t=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?t.reasonCode=this._parseByte():t.reasonCode=0;const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const t=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));t.reasonCode=this._parseByte();const e=this._parseProperties();return Object.getOwnPropertyNames(e).length&&(t.properties=e),a("_parseAuth: result: true"),!0}_parseMessageId(){const t=this.packet;return t.messageId=this._parseNum(),null===t.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",t.messageId),!0)}_parseString(t){const e=this._parseNum(),n=e+this._pos;if(-1===e||n>this._list.length||n>this.packet.length)return null;const r=this._list.toString("utf8",this._pos,n);return this._pos+=e,a("_parseString: result: %s",r),r}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const t=this._parseNum(),e=t+this._pos;if(-1===t||e>this._list.length||e>this.packet.length)return null;const n=this._list.slice(this._pos,e);return this._pos+=t,a("_parseBuffer: result: %o",n),n}_parseNum(){if(this._list.length-this._pos<2)return-1;const t=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",t),t}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const t=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",t),t}_parseVarByteNum(t){a("_parseVarByteNum");const e=4;let n,r=0,i=1,o=0,u=!1;const c=this._pos?this._pos:0;while(r=r&&this._emitError(new Error("Invalid variable byte integer")),c&&(this._pos+=r),u=!!u&&(t?{bytes:r,value:o}:o),a("_parseVarByteNum: result: %o",u),u}_parseByte(){let t;return this._pos0){t=new Array(arguments.length-2);for(var e=0;e * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var o,s="4.17.19",a=200,u="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",l="__lodash_hash_undefined__",f=500,h="__lodash_placeholder__",p=1,d=2,_=4,g=1,b=2,v=1,y=2,m=4,w=8,S=16,k=32,E=64,x=128,O=256,I=512,C=30,R="...",j=800,A=16,T=1,P=2,M=3,L=1/0,N=9007199254740991,B=17976931348623157e292,U=NaN,D=4294967295,q=D-1,F=D>>>1,W=[["ary",x],["bind",v],["bindKey",y],["curry",w],["curryRight",S],["flip",I],["partial",k],["partialRight",E],["rearg",O]],V="[object Arguments]",z="[object Array]",H="[object AsyncFunction]",K="[object Boolean]",$="[object Date]",Q="[object DOMException]",G="[object Error]",Z="[object Function]",Y="[object GeneratorFunction]",J="[object Map]",X="[object Number]",tt="[object Null]",et="[object Object]",nt="[object Promise]",rt="[object Proxy]",it="[object RegExp]",ot="[object Set]",st="[object String]",at="[object Symbol]",ut="[object Undefined]",ct="[object WeakMap]",lt="[object WeakSet]",ft="[object ArrayBuffer]",ht="[object DataView]",pt="[object Float32Array]",dt="[object Float64Array]",_t="[object Int8Array]",gt="[object Int16Array]",bt="[object Int32Array]",vt="[object Uint8Array]",yt="[object Uint8ClampedArray]",mt="[object Uint16Array]",wt="[object Uint32Array]",St=/\b__p \+= '';/g,kt=/\b(__p \+=) '' \+/g,Et=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xt=/&(?:amp|lt|gt|quot|#39);/g,Ot=/[&<>"']/g,It=RegExp(xt.source),Ct=RegExp(Ot.source),Rt=/<%-([\s\S]+?)%>/g,jt=/<%([\s\S]+?)%>/g,At=/<%=([\s\S]+?)%>/g,Tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pt=/^\w*$/,Mt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Lt=/[\\^$.*+?()[\]{}|]/g,Nt=RegExp(Lt.source),Bt=/^\s+|\s+$/g,Ut=/^\s+/,Dt=/\s+$/,qt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ft=/\{\n\/\* \[wrapped with (.+)\] \*/,Wt=/,? & /,Vt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zt=/\\(\\)?/g,Ht=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Kt=/\w*$/,$t=/^[-+]0x[0-9a-f]+$/i,Qt=/^0b[01]+$/i,Gt=/^\[object .+?Constructor\]$/,Zt=/^0o[0-7]+$/i,Yt=/^(?:0|[1-9]\d*)$/,Jt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,te=/['\n\r\u2028\u2029\\]/g,ee="\\ud800-\\udfff",ne="\\u0300-\\u036f",re="\\ufe20-\\ufe2f",ie="\\u20d0-\\u20ff",oe=ne+re+ie,se="\\u2700-\\u27bf",ae="a-z\\xdf-\\xf6\\xf8-\\xff",ue="\\xac\\xb1\\xd7\\xf7",ce="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",le="\\u2000-\\u206f",fe=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",he="A-Z\\xc0-\\xd6\\xd8-\\xde",pe="\\ufe0e\\ufe0f",de=ue+ce+le+fe,_e="['’]",ge="["+ee+"]",be="["+de+"]",ve="["+oe+"]",ye="\\d+",me="["+se+"]",we="["+ae+"]",Se="[^"+ee+de+ye+se+ae+he+"]",ke="\\ud83c[\\udffb-\\udfff]",Ee="(?:"+ve+"|"+ke+")",xe="[^"+ee+"]",Oe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ie="[\\ud800-\\udbff][\\udc00-\\udfff]",Ce="["+he+"]",Re="\\u200d",je="(?:"+we+"|"+Se+")",Ae="(?:"+Ce+"|"+Se+")",Te="(?:"+_e+"(?:d|ll|m|re|s|t|ve))?",Pe="(?:"+_e+"(?:D|LL|M|RE|S|T|VE))?",Me=Ee+"?",Le="["+pe+"]?",Ne="(?:"+Re+"(?:"+[xe,Oe,Ie].join("|")+")"+Le+Me+")*",Be="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ue="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",De=Le+Me+Ne,qe="(?:"+[me,Oe,Ie].join("|")+")"+De,Fe="(?:"+[xe+ve+"?",ve,Oe,Ie,ge].join("|")+")",We=RegExp(_e,"g"),Ve=RegExp(ve,"g"),ze=RegExp(ke+"(?="+ke+")|"+Fe+De,"g"),He=RegExp([Ce+"?"+we+"+"+Te+"(?="+[be,Ce,"$"].join("|")+")",Ae+"+"+Pe+"(?="+[be,Ce+je,"$"].join("|")+")",Ce+"?"+je+"+"+Te,Ce+"+"+Pe,Ue,Be,ye,qe].join("|"),"g"),Ke=RegExp("["+Re+ee+oe+pe+"]"),$e=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Qe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Ge=-1,Ze={};Ze[pt]=Ze[dt]=Ze[_t]=Ze[gt]=Ze[bt]=Ze[vt]=Ze[yt]=Ze[mt]=Ze[wt]=!0,Ze[V]=Ze[z]=Ze[ft]=Ze[K]=Ze[ht]=Ze[$]=Ze[G]=Ze[Z]=Ze[J]=Ze[X]=Ze[et]=Ze[it]=Ze[ot]=Ze[st]=Ze[ct]=!1;var Ye={};Ye[V]=Ye[z]=Ye[ft]=Ye[ht]=Ye[K]=Ye[$]=Ye[pt]=Ye[dt]=Ye[_t]=Ye[gt]=Ye[bt]=Ye[J]=Ye[X]=Ye[et]=Ye[it]=Ye[ot]=Ye[st]=Ye[at]=Ye[vt]=Ye[yt]=Ye[mt]=Ye[wt]=!0,Ye[G]=Ye[Z]=Ye[ct]=!1;var Je={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Xe={"&":"&","<":"<",">":">",'"':""","'":"'"},tn={"&":"&","<":"<",">":">",""":'"',"'":"'"},en={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nn=parseFloat,rn=parseInt,on="object"==typeof t&&t&&t.Object===Object&&t,sn="object"==typeof self&&self&&self.Object===Object&&self,an=on||sn||Function("return this")(),un=e&&!e.nodeType&&e,cn=un&&"object"==typeof r&&r&&!r.nodeType&&r,ln=cn&&cn.exports===un,fn=ln&&on.process,hn=function(){try{var t=cn&&cn.require&&cn.require("util").types;return t||fn&&fn.binding&&fn.binding("util")}catch(e){}}(),pn=hn&&hn.isArrayBuffer,dn=hn&&hn.isDate,_n=hn&&hn.isMap,gn=hn&&hn.isRegExp,bn=hn&&hn.isSet,vn=hn&&hn.isTypedArray;function yn(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function mn(t,e,n,r){var i=-1,o=null==t?0:t.length;while(++i-1}function On(t,e,n){var r=-1,i=null==t?0:t.length;while(++r-1);return n}function Jn(t,e){var n=t.length;while(n--&&Bn(e,t[n],0)>-1);return n}function Xn(t,e){var n=t.length,r=0;while(n--)t[n]===e&&++r;return r}var tr=Wn(Je),er=Wn(Xe);function nr(t){return"\\"+en[t]}function rr(t,e){return null==t?o:t[e]}function ir(t){return Ke.test(t)}function or(t){return $e.test(t)}function sr(t){var e,n=[];while(!(e=t.next()).done)n.push(e.value);return n}function ar(t){var e=-1,n=Array(t.size);return t.forEach((function(t,r){n[++e]=[r,t]})),n}function ur(t,e){return function(n){return t(e(n))}}function cr(t,e){var n=-1,r=t.length,i=0,o=[];while(++n-1}function qr(t,e){var n=this.__data__,r=ui(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Fr(t){var e=-1,n=null==t?0:t.length;this.clear();while(++e=e?t:e)),t}function _i(t,e,n,r,i,s){var a,u=e&p,c=e&d,l=e&_;if(n&&(a=i?n(t,r,i,s):n(t)),a!==o)return a;if(!Sl(t))return t;var f=sl(t);if(f){if(a=Xs(t),!u)return ns(t,a)}else{var h=Gs(t),g=h==Z||h==Y;if(fl(t))return Ko(t,u);if(h==et||h==V||g&&!i){if(a=c||g?{}:ta(t),!u)return c?os(t,fi(a,t)):is(t,li(a,t))}else{if(!Ye[h])return i?t:{};a=ea(t,h,u)}}s||(s=new Zr);var b=s.get(t);if(b)return b;s.set(t,a),Ll(t)?t.forEach((function(r){a.add(_i(r,e,n,r,t,s))})):El(t)&&t.forEach((function(r,i){a.set(i,_i(r,e,n,i,t,s))}));var v=l?c?Us:Bs:c?Sf:wf,y=f?o:v(t);return wn(y||t,(function(r,i){y&&(i=r,r=t[i]),ai(a,i,_i(r,e,n,i,t,s))})),a}function gi(t){var e=wf(t);return function(n){return bi(n,t,e)}}function bi(t,e,n){var r=n.length;if(null==t)return!r;t=ne(t);while(r--){var i=n[r],s=e[i],a=t[i];if(a===o&&!(i in t)||!s(a))return!1}return!0}function vi(t,e,n){if("function"!=typeof t)throw new oe(c);return ka((function(){t.apply(o,n)}),e)}function yi(t,e,n,r){var i=-1,o=xn,s=!0,u=t.length,c=[],l=e.length;if(!u)return c;n&&(e=In(e,Qn(n))),r?(o=On,s=!1):e.length>=a&&(o=Zn,s=!1,e=new $r(e));t:while(++ii?0:i+n),r=r===o||r>i?i:Kl(r),r<0&&(r+=i),r=n>r?0:$l(r);while(n0&&n(a)?e>1?Oi(a,e-1,n,r,i):Cn(i,a):r||(i[i.length]=a)}return i}var Ii=cs(),Ci=cs(!0);function Ri(t,e){return t&&Ii(t,e,wf)}function ji(t,e){return t&&Ci(t,e,wf)}function Ai(t,e){return En(e,(function(e){return yl(t[e])}))}function Ti(t,e){e=Wo(e,t);var n=0,r=e.length;while(null!=t&&ne}function Ni(t,e){return null!=t&&fe.call(t,e)}function Bi(t,e){return null!=t&&e in ne(t)}function Ui(t,e,n){return t>=Fe(e,n)&&t=120&&h.length>=120)?new $r(u&&h):o}h=t[0];var p=-1,d=c[0];t:while(++p-1)a!==t&&xe.call(a,u,1),xe.call(t,u,1)}return t}function _o(t,e){var n=t?e.length:0,r=n-1;while(n--){var i=e[n];if(n==r||i!==o){var o=i;ia(i)?xe.call(t,i,1):Mo(t,i)}}return t}function go(t,e){return t+Me(Ke()*(e-t+1))}function bo(t,e,r,i){var o=-1,s=qe(Pe((e-t)/(r||1)),0),a=n(s);while(s--)a[i?s:++o]=t,t+=r;return a}function vo(t,e){var n="";if(!t||e<1||e>N)return n;do{e%2&&(n+=t),e=Me(e/2),e&&(t+=t)}while(e);return n}function yo(t,e){return Ea(va(t,e,Rh),t+"")}function mo(t){return ri(qf(t))}function wo(t,e){var n=qf(t);return Ia(n,di(e,0,n.length))}function So(t,e,n,r){if(!Sl(t))return t;e=Wo(e,t);var i=-1,s=e.length,a=s-1,u=t;while(null!=u&&++io?0:o+e),r=r>o?o:r,r<0&&(r+=o),o=e>r?0:r-e>>>0,e>>>=0;var s=n(o);while(++i>>1,s=t[o];null!==s&&!Bl(s)&&(n?s<=e:s=a){var l=e?null:Is(t);if(l)return lr(l);s=!1,i=Zn,c=new $r}else c=e?[]:u;t:while(++r=r?t:Oo(t,e,n)}var Ho=je||function(t){return an.clearTimeout(t)};function Ko(t,e){if(e)return t.slice();var n=t.length,r=we?we(n):new t.constructor(n);return t.copy(r),r}function $o(t){var e=new t.constructor(t.byteLength);return new me(e).set(new me(t)),e}function Qo(t,e){var n=e?$o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}function Go(t){var e=new t.constructor(t.source,Kt.exec(t));return e.lastIndex=t.lastIndex,e}function Zo(t){return br?ne(br.call(t)):{}}function Yo(t,e){var n=e?$o(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Jo(t,e){if(t!==e){var n=t!==o,r=null===t,i=t===t,s=Bl(t),a=e!==o,u=null===e,c=e===e,l=Bl(e);if(!u&&!l&&!s&&t>e||s&&a&&c&&!u&&!l||r&&a&&c||!n&&c||!i)return 1;if(!r&&!s&&!l&&t=a)return u;var c=n[r];return u*("desc"==c?-1:1)}}return t.index-e.index}function ts(t,e,r,i){var o=-1,s=t.length,a=r.length,u=-1,c=e.length,l=qe(s-a,0),f=n(c+l),h=!i;while(++u1?n[i-1]:o,a=i>2?n[2]:o;s=t.length>3&&"function"==typeof s?(i--,s):o,a&&oa(n[0],n[1],a)&&(s=i<3?o:s,i=1),e=ne(e);while(++r-1?i[s?e[a]:a]:o}}function gs(t){return Ns((function(e){var n=e.length,r=n,i=Er.prototype.thru;t&&e.reverse();while(r--){var s=e[r];if("function"!=typeof s)throw new oe(c);if(i&&!a&&"wrapper"==qs(s))var a=new Er([],!0)}r=a?r:n;while(++r1&&v.reverse(),h&&lu))return!1;var l=s.get(t),f=s.get(e);if(l&&f)return l==e&&f==t;var h=-1,p=!0,d=n&b?new $r:o;s.set(t,e),s.set(e,t);while(++h1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(qt,"{\n/* [wrapped with "+e+"] */\n")}function ra(t){return sl(t)||ol(t)||!!(Oe&&t&&t[Oe])}function ia(t,e){var n=typeof t;return e=null==e?N:e,!!e&&("number"==n||"symbol"!=n&&Yt.test(t))&&t>-1&&t%1==0&&t0){if(++e>=j)return arguments[0]}else e=0;return t.apply(o,arguments)}}function Ia(t,e){var n=-1,r=t.length,i=r-1;e=e===o?r:e;while(++n1?t[e-1]:o;return n="function"==typeof n?(t.pop(),n):o,Mu(t,n)}));function Vu(t){var e=mr(t);return e.__chain__=!0,e}function zu(t,e){return e(t),t}function Hu(t,e){return e(t)}var Ku=Ns((function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return pi(e,t)};return!(e>1||this.__actions__.length)&&r instanceof xr&&ia(n)?(r=r.slice(n,+n+(e?1:0)),r.__actions__.push({func:Hu,args:[i],thisArg:o}),new Er(r,this.__chain__).thru((function(t){return e&&!t.length&&t.push(o),t}))):this.thru(i)}));function $u(){return Vu(this)}function Qu(){return new Er(this.value(),this.__chain__)}function Gu(){this.__values__===o&&(this.__values__=zl(this.value()));var t=this.__index__>=this.__values__.length,e=t?o:this.__values__[this.__index__++];return{done:t,value:e}}function Zu(){return this}function Yu(t){var e,n=this;while(n instanceof kr){var r=Ta(n);r.__index__=0,r.__values__=o,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e}function Ju(){var t=this.__wrapped__;if(t instanceof xr){var e=t;return this.__actions__.length&&(e=new xr(this)),e=e.reverse(),e.__actions__.push({func:Hu,args:[hu],thisArg:o}),new Er(e,this.__chain__)}return this.thru(hu)}function Xu(){return Bo(this.__wrapped__,this.__actions__)}var tc=ss((function(t,e,n){fe.call(t,n)?++t[n]:hi(t,n,1)}));function ec(t,e,n){var r=sl(t)?kn:Si;return n&&oa(t,e,n)&&(e=o),r(t,Ws(e,3))}function nc(t,e){var n=sl(t)?En:xi;return n(t,Ws(e,3))}var rc=_s(za),ic=_s(Ha);function oc(t,e){return Oi(dc(t,e),1)}function sc(t,e){return Oi(dc(t,e),L)}function ac(t,e,n){return n=n===o?1:Kl(n),Oi(dc(t,e),n)}function uc(t,e){var n=sl(t)?wn:mi;return n(t,Ws(e,3))}function cc(t,e){var n=sl(t)?Sn:wi;return n(t,Ws(e,3))}var lc=ss((function(t,e,n){fe.call(t,n)?t[n].push(e):hi(t,n,[e])}));function fc(t,e,n,r){t=ul(t)?t:qf(t),n=n&&!r?Kl(n):0;var i=t.length;return n<0&&(n=qe(i+n,0)),Nl(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Bn(t,e,n)>-1}var hc=yo((function(t,e,r){var i=-1,o="function"==typeof e,s=ul(t)?n(t.length):[];return mi(t,(function(t){s[++i]=o?yn(e,t,r):Fi(t,e,r)})),s})),pc=ss((function(t,e,n){hi(t,n,e)}));function dc(t,e){var n=sl(t)?In:ro;return n(t,Ws(e,3))}function _c(t,e,n,r){return null==t?[]:(sl(e)||(e=null==e?[]:[e]),n=r?o:n,sl(n)||(n=null==n?[]:[n]),co(t,e,n))}var gc=ss((function(t,e,n){t[n?0:1].push(e)}),(function(){return[[],[]]}));function bc(t,e,n){var r=sl(t)?Rn:Vn,i=arguments.length<3;return r(t,Ws(e,4),n,i,mi)}function vc(t,e,n){var r=sl(t)?jn:Vn,i=arguments.length<3;return r(t,Ws(e,4),n,i,wi)}function yc(t,e){var n=sl(t)?En:xi;return n(t,Dc(Ws(e,3)))}function mc(t){var e=sl(t)?ri:mo;return e(t)}function wc(t,e,n){e=(n?oa(t,e,n):e===o)?1:Kl(e);var r=sl(t)?ii:wo;return r(t,e)}function Sc(t){var e=sl(t)?oi:xo;return e(t)}function kc(t){if(null==t)return 0;if(ul(t))return Nl(t)?dr(t):t.length;var e=Gs(t);return e==J||e==ot?t.size:to(t).length}function Ec(t,e,n){var r=sl(t)?An:Io;return n&&oa(t,e,n)&&(e=o),r(t,Ws(e,3))}var xc=yo((function(t,e){if(null==t)return[];var n=e.length;return n>1&&oa(t,e[0],e[1])?e=[]:n>2&&oa(e[0],e[1],e[2])&&(e=[e[0]]),co(t,Oi(e,1),[])})),Oc=Ae||function(){return an.Date.now()};function Ic(t,e){if("function"!=typeof e)throw new oe(c);return t=Kl(t),function(){if(--t<1)return e.apply(this,arguments)}}function Cc(t,e,n){return e=n?o:e,e=t&&null==e?t.length:e,Rs(t,x,o,o,o,o,e)}function Rc(t,e){var n;if("function"!=typeof e)throw new oe(c);return t=Kl(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=o),n}}var jc=yo((function(t,e,n){var r=v;if(n.length){var i=cr(n,Fs(jc));r|=k}return Rs(t,r,e,n,i)})),Ac=yo((function(t,e,n){var r=v|y;if(n.length){var i=cr(n,Fs(Ac));r|=k}return Rs(e,r,t,n,i)}));function Tc(t,e,n){e=n?o:e;var r=Rs(t,w,o,o,o,o,o,e);return r.placeholder=Tc.placeholder,r}function Pc(t,e,n){e=n?o:e;var r=Rs(t,S,o,o,o,o,o,e);return r.placeholder=Pc.placeholder,r}function Mc(t,e,n){var r,i,s,a,u,l,f=0,h=!1,p=!1,d=!0;if("function"!=typeof t)throw new oe(c);function _(e){var n=r,s=i;return r=i=o,f=e,a=t.apply(s,n),a}function g(t){return f=t,u=ka(y,e),h?_(t):a}function b(t){var n=t-l,r=t-f,i=e-n;return p?Fe(i,s-r):i}function v(t){var n=t-l,r=t-f;return l===o||n>=e||n<0||p&&r>=s}function y(){var t=Oc();if(v(t))return m(t);u=ka(y,b(t))}function m(t){return u=o,d&&r?_(t):(r=i=o,a)}function w(){u!==o&&Ho(u),f=0,r=l=i=u=o}function S(){return u===o?a:m(Oc())}function k(){var t=Oc(),n=v(t);if(r=arguments,i=this,l=t,n){if(u===o)return g(l);if(p)return Ho(u),u=ka(y,e),_(l)}return u===o&&(u=ka(y,e)),a}return e=Ql(e)||0,Sl(n)&&(h=!!n.leading,p="maxWait"in n,s=p?qe(Ql(n.maxWait)||0,e):s,d="trailing"in n?!!n.trailing:d),k.cancel=w,k.flush=S,k}var Lc=yo((function(t,e){return vi(t,1,e)})),Nc=yo((function(t,e,n){return vi(t,Ql(e)||0,n)}));function Bc(t){return Rs(t,I)}function Uc(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new oe(c);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var s=t.apply(this,r);return n.cache=o.set(i,s)||o,s};return n.cache=new(Uc.Cache||Fr),n}function Dc(t){if("function"!=typeof t)throw new oe(c);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function qc(t){return Rc(2,t)}Uc.Cache=Fr;var Fc=Vo((function(t,e){e=1==e.length&&sl(e[0])?In(e[0],Qn(Ws())):In(Oi(e,1),Qn(Ws()));var n=e.length;return yo((function(r){var i=-1,o=Fe(r.length,n);while(++i=e})),ol=Wi(function(){return arguments}())?Wi:function(t){return kl(t)&&fe.call(t,"callee")&&!Ee.call(t,"callee")},sl=n.isArray,al=pn?Qn(pn):Vi;function ul(t){return null!=t&&wl(t.length)&&!yl(t)}function cl(t){return kl(t)&&ul(t)}function ll(t){return!0===t||!1===t||kl(t)&&Mi(t)==K}var fl=Ne||$h,hl=dn?Qn(dn):zi;function pl(t){return kl(t)&&1===t.nodeType&&!Tl(t)}function dl(t){if(null==t)return!0;if(ul(t)&&(sl(t)||"string"==typeof t||"function"==typeof t.splice||fl(t)||Ul(t)||ol(t)))return!t.length;var e=Gs(t);if(e==J||e==ot)return!t.size;if(fa(t))return!to(t).length;for(var n in t)if(fe.call(t,n))return!1;return!0}function _l(t,e){return Hi(t,e)}function gl(t,e,n){n="function"==typeof n?n:o;var r=n?n(t,e):o;return r===o?Hi(t,e,o,n):!!r}function bl(t){if(!kl(t))return!1;var e=Mi(t);return e==G||e==Q||"string"==typeof t.message&&"string"==typeof t.name&&!Tl(t)}function vl(t){return"number"==typeof t&&Be(t)}function yl(t){if(!Sl(t))return!1;var e=Mi(t);return e==Z||e==Y||e==H||e==rt}function ml(t){return"number"==typeof t&&t==Kl(t)}function wl(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=N}function Sl(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function kl(t){return null!=t&&"object"==typeof t}var El=_n?Qn(_n):$i;function xl(t,e){return t===e||Qi(t,e,zs(e))}function Ol(t,e,n){return n="function"==typeof n?n:o,Qi(t,e,zs(e),n)}function Il(t){return Al(t)&&t!=+t}function Cl(t){if(la(t))throw new i(u);return Gi(t)}function Rl(t){return null===t}function jl(t){return null==t}function Al(t){return"number"==typeof t||kl(t)&&Mi(t)==X}function Tl(t){if(!kl(t)||Mi(t)!=et)return!1;var e=Se(t);if(null===e)return!0;var n=fe.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&le.call(n)==_e}var Pl=gn?Qn(gn):Zi;function Ml(t){return ml(t)&&t>=-N&&t<=N}var Ll=bn?Qn(bn):Yi;function Nl(t){return"string"==typeof t||!sl(t)&&kl(t)&&Mi(t)==st}function Bl(t){return"symbol"==typeof t||kl(t)&&Mi(t)==at}var Ul=vn?Qn(vn):Ji;function Dl(t){return t===o}function ql(t){return kl(t)&&Gs(t)==ct}function Fl(t){return kl(t)&&Mi(t)==lt}var Wl=Es(no),Vl=Es((function(t,e){return t<=e}));function zl(t){if(!t)return[];if(ul(t))return Nl(t)?_r(t):ns(t);if(Ie&&t[Ie])return sr(t[Ie]());var e=Gs(t),n=e==J?ar:e==ot?lr:qf;return n(t)}function Hl(t){if(!t)return 0===t?t:0;if(t=Ql(t),t===L||t===-L){var e=t<0?-1:1;return e*B}return t===t?t:0}function Kl(t){var e=Hl(t),n=e%1;return e===e?n?e-n:e:0}function $l(t){return t?di(Kl(t),0,D):0}function Ql(t){if("number"==typeof t)return t;if(Bl(t))return U;if(Sl(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Sl(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Bt,"");var n=Qt.test(t);return n||Zt.test(t)?rn(t.slice(2),n?2:8):$t.test(t)?U:+t}function Gl(t){return rs(t,Sf(t))}function Zl(t){return t?di(Kl(t),-N,N):0===t?t:0}function Yl(t){return null==t?"":To(t)}var Jl=as((function(t,e){if(fa(e)||ul(e))rs(e,wf(e),t);else for(var n in e)fe.call(e,n)&&ai(t,n,e[n])})),Xl=as((function(t,e){rs(e,Sf(e),t)})),tf=as((function(t,e,n,r){rs(e,Sf(e),t,r)})),ef=as((function(t,e,n,r){rs(e,wf(e),t,r)})),nf=Ns(pi);function rf(t,e){var n=Sr(t);return null==e?n:li(n,e)}var of=yo((function(t,e){t=ne(t);var n=-1,r=e.length,i=r>2?e[2]:o;i&&oa(e[0],e[1],i)&&(r=1);while(++n1),e})),rs(t,Us(t),n),r&&(n=_i(n,p|d|_,Ts));var i=e.length;while(i--)Mo(n,e[i]);return n}));function Cf(t,e){return jf(t,Dc(Ws(e)))}var Rf=Ns((function(t,e){return null==t?{}:lo(t,e)}));function jf(t,e){if(null==t)return{};var n=In(Us(t),(function(t){return[t]}));return e=Ws(e),fo(t,n,(function(t,n){return e(t,n[0])}))}function Af(t,e,n){e=Wo(e,t);var r=-1,i=e.length;i||(i=1,t=o);while(++re){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Ke();return Fe(t+i*(e-t+nn("1e-"+((i+"").length-1))),e)}return go(t,e)}var Hf=hs((function(t,e,n){return e=e.toLowerCase(),t+(n?Kf(e):e)}));function Kf(t){return yh(Yl(t).toLowerCase())}function $f(t){return t=Yl(t),t&&t.replace(Jt,tr).replace(Ve,"")}function Qf(t,e,n){t=Yl(t),e=To(e);var r=t.length;n=n===o?r:di(Kl(n),0,r);var i=n;return n-=e.length,n>=0&&t.slice(n,i)==e}function Gf(t){return t=Yl(t),t&&Ct.test(t)?t.replace(Ot,er):t}function Zf(t){return t=Yl(t),t&&Nt.test(t)?t.replace(Lt,"\\$&"):t}var Yf=hs((function(t,e,n){return t+(n?"-":"")+e.toLowerCase()})),Jf=hs((function(t,e,n){return t+(n?" ":"")+e.toLowerCase()})),Xf=fs("toLowerCase");function th(t,e,n){t=Yl(t),e=Kl(e);var r=e?dr(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return ws(Me(i),n)+t+ws(Pe(i),n)}function eh(t,e,n){t=Yl(t),e=Kl(e);var r=e?dr(t):0;return e&&r>>0,n?(t=Yl(t),t&&("string"==typeof e||null!=e&&!Pl(e))&&(e=To(e),!e&&ir(t))?zo(_r(t),0,n):t.split(e,n)):[]}var uh=hs((function(t,e,n){return t+(n?" ":"")+yh(e)}));function ch(t,e,n){return t=Yl(t),n=null==n?0:di(Kl(n),0,t.length),e=To(e),t.slice(n,n+e.length)==e}function lh(t,e,n){var r=mr.templateSettings;n&&oa(t,e,n)&&(e=o),t=Yl(t),e=tf({},e,r,js);var i,s,a=tf({},e.imports,r.imports,js),u=wf(a),c=Gn(a,u),l=0,f=e.interpolate||Xt,h="__p += '",p=re((e.escape||Xt).source+"|"+f.source+"|"+(f===At?Ht:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),d="//# sourceURL="+(fe.call(e,"sourceURL")?(e.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Ge+"]")+"\n";t.replace(p,(function(e,n,r,o,a,u){return r||(r=o),h+=t.slice(l,u).replace(te,nr),n&&(i=!0,h+="' +\n__e("+n+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),r&&(h+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),l=u+e.length,e})),h+="';\n";var _=fe.call(e,"variable")&&e.variable;_||(h="with (obj) {\n"+h+"\n}\n"),h=(s?h.replace(St,""):h).replace(kt,"$1").replace(Et,"$1;"),h="function("+(_||"obj")+") {\n"+(_?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g=wh((function(){return Vt(u,d+"return "+h).apply(o,c)}));if(g.source=h,bl(g))throw g;return g}function fh(t){return Yl(t).toLowerCase()}function hh(t){return Yl(t).toUpperCase()}function ph(t,e,n){if(t=Yl(t),t&&(n||e===o))return t.replace(Bt,"");if(!t||!(e=To(e)))return t;var r=_r(t),i=_r(e),s=Yn(r,i),a=Jn(r,i)+1;return zo(r,s,a).join("")}function dh(t,e,n){if(t=Yl(t),t&&(n||e===o))return t.replace(Dt,"");if(!t||!(e=To(e)))return t;var r=_r(t),i=Jn(r,_r(e))+1;return zo(r,0,i).join("")}function _h(t,e,n){if(t=Yl(t),t&&(n||e===o))return t.replace(Ut,"");if(!t||!(e=To(e)))return t;var r=_r(t),i=Yn(r,_r(e));return zo(r,i).join("")}function gh(t,e){var n=C,r=R;if(Sl(e)){var i="separator"in e?e.separator:i;n="length"in e?Kl(e.length):n,r="omission"in e?To(e.omission):r}t=Yl(t);var s=t.length;if(ir(t)){var a=_r(t);s=a.length}if(n>=s)return t;var u=n-dr(r);if(u<1)return r;var c=a?zo(a,0,u).join(""):t.slice(0,u);if(i===o)return c+r;if(a&&(u+=c.length-u),Pl(i)){if(t.slice(u).search(i)){var l,f=c;i.global||(i=re(i.source,Yl(Kt.exec(i))+"g")),i.lastIndex=0;while(l=i.exec(f))var h=l.index;c=c.slice(0,h===o?u:h)}}else if(t.indexOf(To(i),u)!=u){var p=c.lastIndexOf(i);p>-1&&(c=c.slice(0,p))}return c+r}function bh(t){return t=Yl(t),t&&It.test(t)?t.replace(xt,gr):t}var vh=hs((function(t,e,n){return t+(n?" ":"")+e.toUpperCase()})),yh=fs("toUpperCase");function mh(t,e,n){return t=Yl(t),e=n?o:e,e===o?or(t)?yr(t):Mn(t):t.match(e)||[]}var wh=yo((function(t,e){try{return yn(t,o,e)}catch(n){return bl(n)?n:new i(n)}})),Sh=Ns((function(t,e){return wn(e,(function(e){e=Ra(e),hi(t,e,jc(t[e],t))})),t}));function kh(t){var e=null==t?0:t.length,n=Ws();return t=e?In(t,(function(t){if("function"!=typeof t[1])throw new oe(c);return[n(t[0]),t[1]]})):[],yo((function(n){var r=-1;while(++rN)return[];var n=D,r=Fe(t,D);e=Ws(e),t-=D;var i=Kn(r,e);while(++n0||e<0)?new xr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==o&&(e=Kl(e),n=e<0?n.dropRight(-e):n.take(e-t)),n)},xr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},xr.prototype.toArray=function(){return this.take(D)},Ri(xr.prototype,(function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=mr[r?"take"+("last"==e?"Right":""):e],s=r||/^find/.test(e);i&&(mr.prototype[e]=function(){var e=this.__wrapped__,a=r?[1]:arguments,u=e instanceof xr,c=a[0],l=u||sl(e),f=function(t){var e=i.apply(mr,Cn([t],a));return r&&h?e[0]:e};l&&n&&"function"==typeof c&&1!=c.length&&(u=l=!1);var h=this.__chain__,p=!!this.__actions__.length,d=s&&!h,_=u&&!p;if(!s&&l){e=_?e:new xr(this);var g=t.apply(e,a);return g.__actions__.push({func:Hu,args:[f],thisArg:o}),new Er(g,h)}return d&&_?t.apply(this,a):(g=this.thru(f),d?r?g.value()[0]:g.value():g)})})),wn(["pop","push","shift","sort","splice","unshift"],(function(t){var e=se[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);mr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(sl(i)?i:[],t)}return this[n]((function(n){return e.apply(sl(n)?n:[],t)}))}})),Ri(xr.prototype,(function(t,e){var n=mr[e];if(n){var r=n.name+"";fe.call(cn,r)||(cn[r]=[]),cn[r].push({name:e,func:n})}})),cn[bs(o,y).name]=[{name:"wrapper",func:o}],xr.prototype.clone=Or,xr.prototype.reverse=Ir,xr.prototype.value=Cr,mr.prototype.at=Ku,mr.prototype.chain=$u,mr.prototype.commit=Qu,mr.prototype.next=Gu,mr.prototype.plant=Yu,mr.prototype.reverse=Ju,mr.prototype.toJSON=mr.prototype.valueOf=mr.prototype.value=Xu,mr.prototype.first=mr.prototype.head,Ie&&(mr.prototype[Ie]=Zu),mr},wr=mr();an._=wr,i=function(){return wr}.call(e,n,e,r),i===o||(r.exports=i)}).call(this)}).call(this,n("c8ba"),n("62e4")(t))},3301:function(t,e,n){"use strict";const{Buffer:r}=n("1c35"),i=Symbol.for("BufferList");function o(t){if(!(this instanceof o))return new o(t);o._init.call(this,t)}o._init=function(t){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,t&&this.append(t)},o.prototype._new=function(t){return new o(t)},o.prototype._offset=function(t){if(0===t)return[0,0];let e=0;for(let n=0;nthis.length||t<0)return;const e=this._offset(t);return this._bufs[e[0]][e[1]]},o.prototype.slice=function(t,e){return"number"===typeof t&&t<0&&(t+=this.length),"number"===typeof e&&e<0&&(e+=this.length),this.copy(null,0,t,e)},o.prototype.copy=function(t,e,n,i){if(("number"!==typeof n||n<0)&&(n=0),("number"!==typeof i||i>this.length)&&(i=this.length),n>=this.length)return t||r.alloc(0);if(i<=0)return t||r.alloc(0);const o=!!t,s=this._offset(n),a=i-n;let u=a,c=o&&e||0,l=s[1];if(0===n&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:r.concat(this._bufs,this.length);for(let e=0;ee)){this._bufs[r].copy(t,c,l,l+u),c+=e;break}this._bufs[r].copy(t,c,l),c+=e,u-=e,l&&(l=0)}return t.length>c?t.slice(0,c):t},o.prototype.shallowSlice=function(t,e){if(t=t||0,e="number"!==typeof e?this.length:e,t<0&&(t+=this.length),e<0&&(e+=this.length),t===e)return this._new();const n=this._offset(t),r=this._offset(e),i=this._bufs.slice(n[0],r[0]+1);return 0===r[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,r[1]),0!==n[1]&&(i[0]=i[0].slice(n[1])),this._new(i)},o.prototype.toString=function(t,e,n){return this.slice(e,n).toString(t)},o.prototype.consume=function(t){if(t=Math.trunc(t),Number.isNaN(t)||t<=0)return this;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},o.prototype.duplicate=function(){const t=this._new();for(let e=0;ethis.length?this.length:e;const i=this._offset(e);let o=i[0],s=i[1];for(;o=t.length){const n=e.indexOf(t,s);if(-1!==n)return this._reverseOffset([o,n]);s=e.length-t.length+1}else{const e=this._reverseOffset([o,s]);if(this._match(e,t))return e;s++}}s=0}return-1},o.prototype._match=function(t,e){if(this.length-t=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))}function o(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,0,n)}function s(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(n){}}function a(){let t;try{t=e.storage.getItem("debug")}catch(n){}return!t&&"undefined"!==typeof r&&"env"in r&&(t=Object({VUE_APP_BASE_API:"",VUE_APP_CWOS_SERVICE:"/cwos-portal",VUE_APP_BASE_SERVICE:"/ninca-qk-alarm-app",VUE_APP_DCS_URL:"./alarm-front/player/DCSPlugin-1.2.0.exe",NODE_ENV:"production",BASE_URL:""}).DEBUG),t}function u(){try{return localStorage}catch(t){}}e.formatArgs=o,e.save=s,e.load=a,e.useColors=i,e.storage=u(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0)}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n("dc90")(e);const{formatters:c}=t.exports;c.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}).call(this,n("4362"))},3527:function(t,e,n){"use strict";var r=n("724e"),i=n("d53b"),o=n("96ae"),s=Array.prototype.indexOf,a=Object.prototype.hasOwnProperty,u=Math.abs,c=Math.floor;t.exports=function(t){var e,n,l,f;if(!r(t))return s.apply(this,arguments);for(n=i(o(this).length),l=arguments[1],l=isNaN(l)?0:l>=0?c(l):i(this.length)-c(u(l)),e=l;e0;return l(t,s,a,(function(t){r||(r=t),t&&o.forEach(f),s||(o.forEach(f),i(r))}))}));return e.reduce(h)}t.exports=d},"3a7c":function(t,e,n){function r(t){return Array.isArray?Array.isArray(t):"[object Array]"===b(t)}function i(t){return"boolean"===typeof t}function o(t){return null===t}function s(t){return null==t}function a(t){return"number"===typeof t}function u(t){return"string"===typeof t}function c(t){return"symbol"===typeof t}function l(t){return void 0===t}function f(t){return"[object RegExp]"===b(t)}function h(t){return"object"===typeof t&&null!==t}function p(t){return"[object Date]"===b(t)}function d(t){return"[object Error]"===b(t)||t instanceof Error}function _(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 b(t){return Object.prototype.toString.call(t)}e.isArray=r,e.isBoolean=i,e.isNull=o,e.isNullOrUndefined=s,e.isNumber=a,e.isString=u,e.isSymbol=c,e.isUndefined=l,e.isRegExp=f,e.isObject=h,e.isDate=p,e.isError=d,e.isFunction=_,e.isPrimitive=g,e.isBuffer=n("1c35").Buffer.isBuffer},"3e15":function(t,e,n){"use strict";t.exports=function(){var t,e,n;if("function"!==typeof Map)return!1;try{t=new Map([["raz","one"],["dwa","two"],["trzy","three"]])}catch(r){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(),n=e.next(),!1===n.done&&(!!n.value&&("raz"===n.value[0]&&"one"===n.value[1])))))))))))))}},"3fb5":function(t,e){"function"===typeof Object.create?t.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(t,e){if(e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}},"429b":function(t,e,n){t.exports=n("faa1").EventEmitter},4665:function(t,e,n){"use strict";var r=n("1a94"),i=n("6858e"),o=Function.prototype.call;t.exports=function(t,e){var n={},s=arguments[2];return r(e),i(t,(function(t,r,i,a){n[r]=o.call(e,s,t,r,i,a)})),n}},4681:function(t,e,n){"use strict";var r=n("966d");function i(t,e){var n=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||r.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?(r.nextTick(s,n,t),n._writableState&&(n._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)}t.exports={destroy:i,undestroy:o}},"51e9":function(t,e,n){"use strict";const r=n("f214").Duplex,i=n("3fb5"),o=n("3301");function s(t){if(!(this instanceof s))return new s(t);if("function"===typeof t){this._callback=t;const 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)})),t=null}o._init.call(this,t),r.call(this)}i(s,r),Object.assign(s.prototype,o.prototype),s.prototype._new=function(t){return new s(t)},s.prototype._write=function(t,e,n){this._appendBuffer(t),"function"===typeof n&&n()},s.prototype._read=function(t){if(!this.length)return this.push(null);t=Math.min(t,this.length),this.push(this.slice(0,t)),this.consume(t)},s.prototype.end=function(t){r.prototype.end.call(this,t),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(t,e){this._bufs.length=0,this.length=0,e(t)},s.prototype._isBufferList=function(t){return t instanceof s||t instanceof o||s.isBufferList(t)},s.isBufferList=o.isBufferList,t.exports=s,t.exports.BufferListStream=s,t.exports.BufferList=o},"53a8":function(t,e){t.exports=r;var n=Object.prototype.hasOwnProperty;function r(){for(var t={},e=0;e_)setTimeout(m,g,t,e,n);else{v&&"string"===typeof t&&(t=a.from(t,"utf8"));try{l.send(t)}catch(r){return n(r)}n()}}function w(t){l.close(),t()}function S(){c.setReadable(d),c.setWritable(d),c.emit("connect")}function k(){c.end(),c.destroy()}function E(t){c.destroy(t)}function x(t){var e=t.data;e=e instanceof ArrayBuffer?a.from(e):a.from(e,"utf8"),d.push(e)}function O(){l.close()}function I(t,e){for(var n=new Array(t.length),r=0;r0?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,n=""+e.data;while(e=e.next)n+=t+e.data;return n},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),n=this.head,r=0;while(n)s(n.data,e,r),r+=n.data.length,n=n.next;return e},t}(),o&&o.inspect&&o.inspect.custom&&(t.exports.prototype[o.inspect.custom]=function(){var t=o.inspect({length:this.length});return this.constructor.name+" "+t})},"5edd":function(t,e,n){"use strict";var r=n("936a"),i={object:!0,function:!0,undefined:!0};t.exports=function(t){return!!r(t)&&hasOwnProperty.call(i,typeof t)}},6024:function(t,e,n){"use strict";var r,i=n("e0f6"),o=n("f973"),s=n("f508"),a=n("1c4a"),u=n("06a2"),c=Object.defineProperty;r=t.exports=function(t,e){if(!(this instanceof r))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(r,u),delete r.prototype.constructor,r.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(r.prototype,a.toStringTag,s("c","Array Iterator"))},"62c4":function(t,e,n){"use strict";var r=n("e76c")();t.exports=function(t){return t!==r&&null!==t}},6321:function(t,e,n){"use strict";var r=n("9013");t.exports=function(t){if("function"!==typeof t)return!1;if(!hasOwnProperty.call(t,"length"))return!1;try{if("number"!==typeof t.length)return!1;if("function"!==typeof t.call)return!1;if("function"!==typeof t.apply)return!1}catch(e){return!1}return!r(t)}},"6858e":function(t,e,n){"use strict";t.exports=n("cecf")("forEach")},"692b":function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call("");t.exports=function(t){return"string"===typeof t||t&&"object"===typeof t&&(t instanceof String||r.call(t)===i)||!1}},7045:function(t,e,n){"use strict";var r=Object.prototype.toString,i=RegExp.prototype.test.bind(/^[object [A-Za-z0-9]*Function]$/);t.exports=function(t){return"function"===typeof t&&i(r.call(t))}},7135:function(t,e,n){(function(e){const r=n("b289"),i=e.allocUnsafe(0),o=e.from([0]),s=n("f0cb"),a=n("966d").nextTick,u=n("34eb")("mqtt-packet:writeToStream"),c=s.cache,l=s.generateNumber,f=s.generateCache,h=s.genBufVariableByteInt,p=s.generate4ByteBuffer;let d=P,_=!0;function g(t,e,n){switch(u("generate called"),e.cork&&(e.cork(),a(b,e)),_&&(_=!1,f()),u("generate: packet.cmd: %s",t.cmd),t.cmd){case"connect":return v(t,e,n);case"connack":return y(t,e,n);case"publish":return m(t,e,n);case"puback":case"pubrec":case"pubrel":case"pubcomp":return w(t,e,n);case"subscribe":return S(t,e,n);case"suback":return k(t,e,n);case"unsubscribe":return E(t,e,n);case"unsuback":return x(t,e,n);case"pingreq":case"pingresp":return O(t,e,n);case"disconnect":return I(t,e,n);case"auth":return C(t,e,n);default:return e.emit("error",new Error("Unknown command")),!1}}function b(t){t.uncork()}function v(t,n,i){const o=t||{},s=o.protocolId||"MQTT";let a=o.protocolVersion||4;const u=o.will;let c=o.clean;const l=o.keepalive||0,f=o.clientId||"",h=o.username,p=o.password,_=o.properties;void 0===c&&(c=!0);let g=0;if(!s||"string"!==typeof s&&!e.isBuffer(s))return n.emit("error",new Error("Invalid protocolId")),!1;if(g+=s.length+2,3!==a&&4!==a&&5!==a)return n.emit("error",new Error("Invalid protocol version")),!1;if(g+=1,("string"===typeof f||e.isBuffer(f))&&(f||a>=4)&&(f||c))g+=e.byteLength(f)+2;else{if(a<4)return n.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(1*c===0)return n.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!==typeof l||l<0||l>65535||l%1!==0)return n.emit("error",new Error("Invalid keepalive")),!1;if(g+=2,g+=1,5===a){var b=B(n,_);if(!b)return!1;g+=b.length}if(u){if("object"!==typeof u)return n.emit("error",new Error("Invalid will")),!1;if(!u.topic||"string"!==typeof u.topic)return n.emit("error",new Error("Invalid will topic")),!1;if(g+=e.byteLength(u.topic)+2,g+=2,u.payload){if(!(u.payload.length>=0))return n.emit("error",new Error("Invalid will payload")),!1;"string"===typeof u.payload?g+=e.byteLength(u.payload):g+=u.payload.length}var v={};if(5===a){if(v=B(n,u.properties),!v)return!1;g+=v.length}}let y=!1;if(null!=h){if(!W(h))return n.emit("error",new Error("Invalid username")),!1;y=!0,g+=e.byteLength(h)+2}if(null!=p){if(!y)return n.emit("error",new Error("Username is required to use password")),!1;if(!W(p))return n.emit("error",new Error("Invalid password")),!1;g+=F(p)+2}n.write(r.CONNECT_HEADER),j(n,g),N(n,s),o.bridgeMode&&(a+=128),n.write(131===a?r.VERSION131:132===a?r.VERSION132:4===a?r.VERSION4:5===a?r.VERSION5:r.VERSION3);let m=0;return m|=null!=h?r.USERNAME_MASK:0,m|=null!=p?r.PASSWORD_MASK:0,m|=u&&u.retain?r.WILL_RETAIN_MASK:0,m|=u&&u.qos?u.qos<0&&d(n,p),null!=b&&b.write(),u("publish: payload: %o",h),n.write(h)}function w(t,n,i){const o=i?i.protocolVersion:4,s=t||{},a=s.cmd||"puback",u=s.messageId,c=s.dup&&"pubrel"===a?r.DUP_MASK:0;let l=0;const f=s.reasonCode,h=s.properties;let p=5===o?3:2;if("pubrel"===a&&(l=1),"number"!==typeof u)return n.emit("error",new Error("Invalid messageId")),!1;let _=null;if(5===o&&"object"===typeof h){if(_=U(n,h,i,p),!_)return!1;p+=_.length}return n.write(r.ACKS[a][l][c][0]),j(n,p),d(n,u),5===o&&n.write(e.from([f])),null!==_&&_.write(),!0}function S(t,n,i){u("subscribe: packet: ");const o=i?i.protocolVersion:4,s=t||{},a=s.dup?r.DUP_MASK:0,c=s.messageId,l=s.subscriptions,f=s.properties;let h=0;if("number"!==typeof c)return n.emit("error",new Error("Invalid messageId")),!1;h+=2;let p=null;if(5===o){if(p=B(n,f),!p)return!1;h+=p.length}if("object"!==typeof l||!l.length)return n.emit("error",new Error("Invalid subscriptions")),!1;for(let r=0;r2)return n.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}h+=e.byteLength(t)+2+1}u("subscribe: writing to stream: %o",r.SUBSCRIBE_HEADER),n.write(r.SUBSCRIBE_HEADER[1][a?1:0][0]),j(n,h),d(n,c),null!==p&&p.write();let _=!0;for(const u of l){const t=u.topic,i=u.qos,s=+u.nl,a=+u.rap,c=u.rh;let l;A(n,t),l=r.SUBSCRIBE_OPTIONS_QOS[i],5===o&&(l|=s?r.SUBSCRIBE_OPTIONS_NL:0,l|=a?r.SUBSCRIBE_OPTIONS_RAP:0,l|=c?r.SUBSCRIBE_OPTIONS_RH[c]:0),_=n.write(e.from([l]))}return _}function k(t,n,i){const o=i?i.protocolVersion:4,s=t||{},a=s.messageId,u=s.granted,c=s.properties;let l=0;if("number"!==typeof a)return n.emit("error",new Error("Invalid messageId")),!1;if(l+=2,"object"!==typeof u||!u.length)return n.emit("error",new Error("Invalid qos vector")),!1;for(let e=0;er.VARBYTEINT_MAX)return t.emit("error",new Error("Invalid variable byte integer: "+e)),!1;let n=R[e];return n||(n=h(e),e<16384&&(R[e]=n)),u("writeVarByteInt: writing to stream: %o",n),t.write(n)}function A(t,n){const r=e.byteLength(n);return d(t,r),u("writeString: %s",n),t.write(n,"utf8")}function T(t,e,n){A(t,e),A(t,n)}function P(t,e){return u("writeNumberCached: number: %d",e),u("writeNumberCached: %o",c[e]),t.write(c[e])}function M(t,e){const n=l(e);return u("writeNumberGenerated: %o",n),t.write(n)}function L(t,e){const n=p(e);return u("write4ByteNumber: %o",n),t.write(n)}function N(t,e){"string"===typeof e?A(t,e):e?(d(t,e.length),t.write(e)):d(t,0)}function B(t,n){if("object"!==typeof n||null!=n.length)return{length:1,write(){q(t,{},0)}};let i=0;function o(n,i){const o=r.propertiesTypes[n];let s=0;switch(o){case"byte":if("boolean"!==typeof i)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=2;break;case"int8":if("number"!==typeof i||i<0||i>255)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=2;break;case"binary":if(i&&null===i)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=1+e.byteLength(i)+2;break;case"int16":if("number"!==typeof i||i<0||i>65535)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=3;break;case"int32":if("number"!==typeof i||i<0||i>4294967295)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=5;break;case"var":if("number"!==typeof i||i<0||i>268435455)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=1+e.byteLength(h(i));break;case"string":if("string"!==typeof i)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=3+e.byteLength(i.toString());break;case"pair":if("object"!==typeof i)return t.emit("error",new Error(`Invalid ${n}: ${i}`)),!1;s+=Object.getOwnPropertyNames(i).reduce((t,n)=>{const r=i[n];return Array.isArray(r)?t+=r.reduce((t,r)=>(t+=3+e.byteLength(n.toString())+2+e.byteLength(r.toString()),t),0):t+=3+e.byteLength(n.toString())+2+e.byteLength(i[n].toString()),t},0);break;default:return t.emit("error",new Error(`Invalid property ${n}: ${i}`)),!1}return s}if(n)for(const e in n){let t=0,r=0;const s=n[e];if(Array.isArray(s))for(let n=0;no){const n=i.shift();if(!n||!e[n])return!1;delete e[n],s=B(t,e)}return s}function D(t,n,i){const o=r.propertiesTypes[n];switch(o){case"byte":t.write(e.from([r.properties[n]])),t.write(e.from([+i]));break;case"int8":t.write(e.from([r.properties[n]])),t.write(e.from([i]));break;case"binary":t.write(e.from([r.properties[n]])),N(t,i);break;case"int16":t.write(e.from([r.properties[n]])),d(t,i);break;case"int32":t.write(e.from([r.properties[n]])),L(t,i);break;case"var":t.write(e.from([r.properties[n]])),j(t,i);break;case"string":t.write(e.from([r.properties[n]])),A(t,i);break;case"pair":Object.getOwnPropertyNames(i).forEach(o=>{const s=i[o];Array.isArray(s)?s.forEach(i=>{t.write(e.from([r.properties[n]])),T(t,o.toString(),i.toString())}):(t.write(e.from([r.properties[n]])),T(t,o.toString(),s.toString()))});break;default:return t.emit("error",new Error(`Invalid property ${n} value: ${i}`)),!1}}function q(t,e,n){j(t,n);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&null!==e[r]){const n=e[r];if(Array.isArray(n))for(let e=0;e>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function c(t,e,n){var r=e.length-1;if(r=0?(i>0&&(t.lastNeed=i-1),i):--r=0?(i>0&&(t.lastNeed=i-2),i):--r=0?(i>0&&(2===i?i=0:t.lastNeed=i-3),i):0))}function l(t,e,n){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,n=l(this,t,e);return void 0!==n?n: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 n=c(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}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 n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function _(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function g(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?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-n))}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 v(t){return t.toString(this.encoding)}function y(t){return t&&t.length?this.write(t):""}e.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(e=this.fillLast(t),void 0===e)return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n":(e.length>100&&(e=e.slice(0,99)+"…"),e=e.replace(i,(function(t){switch(t){case"\n":return"\\n";case"\r":return"\\r";case"\u2028":return"\\u2028";case"\u2029":return"\\u2029";default:throw new Error("Unexpected character")}})),e)}},"7dc8":function(t,e,n){"use strict";var r=n("84d3"),i=n("1793");t.exports=function(t){return i(t)?t:r(t,"%v is not a plain function",arguments[1])}},"7f0f":function(t,e,n){(function(e){const r=n("7135"),i=n("faa1");function o(t,e){const n=new s;return r(t,n,e),n.concat()}class s extends i{constructor(){super(),this._array=new Array(20),this._i=0}write(t){return this._array[this._i++]=t,!0}concat(){let t=0;const n=new Array(this._array.length),r=this._array;let i,o=0;for(i=0;i=55296&&v<=56319&&(S+=t[++n])),S=k?h.call(k,E,S,_):S,e?(p.value=S,d(g,_,p)):g[_]=S,++_;b=_}if(void 0===b)for(b=s(t.length),e&&(g=new e(b)),n=0;n0&&c>u&&(c=u);for(var l=0;l=0?(f=_.substr(0,g),h=_.substr(g+1)):(f=_,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),r(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)}},"91e3":function(t,e,n){"use strict";var r=n("e9bd"),i=n("62c4"),o=n("692b"),s=n("1c4a").iterator,a=Array.isArray;t.exports=function(t){return!!i(t)&&(!!a(t)||(!!o(t)||(!!r(t)||"function"===typeof t[s])))}},"936a":function(t,e,n){"use strict";var r=void 0;t.exports=function(t){return t!==r&&null!==t}},"94ee":function(t,e,n){"use strict";var r,i,o,s=n("f508"),a=n("b380"),u=n("7c4a").Symbol,c=n("964d"),l=n("e03f"),f=n("25be"),h=Object.create,p=Object.defineProperties,d=Object.defineProperty;if("function"===typeof u)try{String(u()),o=!0}catch(_){}else u=null;i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return r(t)},t.exports=r=function t(e){var n;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return o?u(e):(n=h(i.prototype),e=void 0===e?"":String(e),p(n,{__description__:s("",e),__name__:s("",c(e))}))},l(r),f(r),p(i.prototype,{constructor:s(r),toString:s("",(function(){return this.__name__}))}),p(r.prototype,{toString:s((function(){return"Symbol ("+a(this).__description__+")"})),valueOf:s((function(){return a(this)}))}),d(r.prototype,r.toPrimitive,s("",(function(){var t=a(this);return"symbol"===typeof t?t:t.toString()}))),d(r.prototype,r.toStringTag,s("c","Symbol")),d(i.prototype,r.toStringTag,s("c",r.prototype[r.toStringTag])),d(i.prototype,r.toPrimitive,s("c",r.prototype[r.toPrimitive]))},"964d":function(t,e,n){"use strict";var r=n("f508"),i=Object.create,o=Object.defineProperty,s=Object.prototype,a=i(null);t.exports=function(t){var e,n,i=0;while(a[t+(i||"")])++i;return t+=i||"",a[t]=!0,e="@@"+t,o(s,e,r.gs(null,(function(t){n||(n=!0,o(this,e,r(t)),n=!1)}))),e}},"966d":function(t,e,n){"use strict";(function(e){function n(t,n,r,i){if("function"!==typeof t)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return e.nextTick(t);case 2:return e.nextTick((function(){t.call(null,n)}));case 3:return e.nextTick((function(){t.call(null,n,r)}));case 4:return e.nextTick((function(){t.call(null,n,r,i)}));default:o=new Array(a-1),s=0;while(s2?"one of ".concat(e," ").concat(t.slice(0,n-1).join(", "),", or ")+t[n-1]:2===n?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}function a(t,e,n){return t.substr(!n||n<0?0:+n,e.length)===e}function u(t,e,n){return(void 0===n||n>t.length)&&(n=t.length),t.substring(n-e.length,n)===e}function c(t,e,n){return"number"!==typeof n&&(n=0),!(n+e.length>t.length)&&-1!==t.indexOf(e,n)}o("ERR_INVALID_OPT_VALUE",(function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(t,e,n){var r,i;if("string"===typeof e&&a(e,"not ")?(r="must not be",e=e.replace(/^not /,"")):r="must be",u(t," argument"))i="The ".concat(t," ").concat(r," ").concat(s(e,"type"));else{var o=c(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(r," ").concat(s(e,"type"))}return i+=". Received type ".concat(typeof n),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(t){return"The "+t+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(t){return"Cannot call "+t+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(t){return"Unknown encoding: "+t}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=i},"9d37":function(t,e,n){"use strict";t.exports=i;var r=n("fe34");function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n("3fb5")(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},"9df0":function(t,e,n){"use strict";var r=Object.create,i=Object.getPrototypeOf,o={};t.exports=function(){var t=Object.setPrototypeOf,e=arguments[0]||r;return"function"===typeof t&&i(t(e(null),o))===o}},a297:function(t,e,n){"use strict";t.exports=function(){var t=Math.sign;return"function"===typeof t&&(1===t(10)&&-1===t(-20))}},a493:function(t,e,n){"use strict";(function(e){var r=Object.keys||function(t){var e=[];for(var n in t)e.push(n);return e};t.exports=c;var i=n("0e8b"),o=n("f6ba");n("3fb5")(c,i);for(var s=r(o.prototype),a=0;a0?("string"===typeof e||s.objectMode||Object.getPrototypeOf(e)===c.prototype||(e=f(e)),r?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&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?E(t,s,e,!1):P(t,s)):E(t,s,e,!1))):r||(s.reading=!1));return O(s)}function E(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(t.emit("data",n),t.read(0)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&A(t)),P(t,e)}function x(t,e){var n;return h(e)||"string"===typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk")),n}function O(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 R(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=C(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function j(t,e){if(!e.ended){if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,A(t)}}function A(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(_("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?i.nextTick(T,t):T(t))}function T(t){_("emit readable"),t.emit("readable"),D(t)}function P(t,e){e.readingMore||(e.readingMore=!0,i.nextTick(M,t,e))}function M(t,e){var n=e.length;while(!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=F(t,e.buffer,e.decoder),n);var n}function F(t,e,n){var r;return to.length?o.length:t;if(s===o.length?i+=o:i+=o.slice(0,t),t-=s,0===t){s===o.length?(++r,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++r}return e.length-=r,i}function V(t,e){var n=c.allocUnsafe(t),r=e.head,i=1;r.data.copy(n),t-=r.data.length;while(r=r.next){var o=r.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),t-=s,0===t){s===o.length?(++i,r.next?e.head=r.next:e.head=e.tail=null):(e.head=r,r.data=o.slice(s));break}++i}return e.length-=i,n}function z(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 K(t,e){for(var n=0,r=t.length;n=e.highWaterMark||e.ended))return _("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?z(this):A(this),null;if(t=R(t,e),0===t&&e.ended)return 0===e.length&&z(this),null;var r,i=e.needReadable;return _("need readable",i),(0===e.length||e.length-t0?q(t,e):null,null===r?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&z(this)),null!==r&&this.emit("data",r),r},S.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},S.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,_("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){_("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,p())}function l(){_("onend"),t.end()}o.endEmitted?i.nextTick(u):n.once("end",u),t.on("unpipe",c);var f=L(n);t.on("drain",f);var h=!1;function p(){_("cleanup"),t.removeListener("close",v),t.removeListener("finish",y),t.removeListener("drain",f),t.removeListener("error",b),t.removeListener("unpipe",c),n.removeListener("end",l),n.removeListener("end",w),n.removeListener("data",g),h=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||f()}var d=!1;function g(e){_("ondata"),d=!1;var r=t.write(e);!1!==r||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==K(o.pipes,t))&&!h&&(_("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function b(e){_("onerror",e),w(),t.removeListener("error",b),0===a(t,"error")&&t.emit("error",e)}function v(){t.removeListener("finish",y),w()}function y(){_("onfinish"),t.removeListener("close",v),w()}function w(){_("unpipe"),n.unpipe(t)}return n.on("data",g),m(t,"error",b),t.once("close",v),t.once("finish",y),t.emit("pipe",n),o.flowing||(_("pipe resume"),n.resume()),t},S.prototype.unpipe=function(t){var e=this._readableState,n={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,n)),this;if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o[0,1].map(i=>[0,1].map(o=>{const s=e.alloc(1);return s.writeUInt8(n.codes[t]<e.from([t])),n.EMPTY={pingreq:e.from([n.codes.pingreq<<4,0]),pingresp:e.from([n.codes.pingresp<<4,0]),disconnect:e.from([n.codes.disconnect<<4,0])}}).call(this,n("1c35").Buffer)},b380:function(t,e,n){"use strict";var r=n("1126");t.exports=function(t){if(!r(t))throw new TypeError(t+" is not a symbol");return t}},b383:function(t,e,n){"use strict";e.decode=e.parse=n("91dd"),e.encode=e.stringify=n("e099")},b41e:function(t,e){var n=null;"undefined"!==typeof WebSocket?n=WebSocket:"undefined"!==typeof MozWebSocket?n=MozWebSocket:"undefined"!==typeof window&&(n=window.WebSocket||window.MozWebSocket),t.exports=n},b779:function(t,e,n){"use strict";t.exports=function(){return"undefined"!==typeof Map&&"[object Map]"===Object.prototype.toString.call(new Map)}()},b7d1:function(t,e,n){(function(e){function n(t,e){if(r("noDeprecation"))return t;var n=!1;function i(){if(!n){if(r("throwDeprecation"))throw new Error(e);r("traceDeprecation"),n=!0}return t.apply(this,arguments)}return i}function r(t){try{if(!e.localStorage)return!1}catch(r){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=n}).call(this,n("c8ba"))},b98b:function(t,e,n){t.exports=n("faa1").EventEmitter},ba4b:function(t,e,n){"use strict";var r,i=Object.create;n("9df0")()||(r=n("e19c")),t.exports=function(){var t,e,n;return r?1!==r.level?i:(t={},e={},n={configurable:!1,enumerable:!1,writable:!0,value:void 0},Object.getOwnPropertyNames(Object.prototype).forEach((function(t){e[t]="__proto__"!==t?n:{configurable:!0,enumerable:!1,writable:!0,value:void 0}})),Object.defineProperties(t,e),Object.defineProperty(r,"nullPolyfill",{configurable:!1,enumerable:!1,writable:!1,value:t}),function(e,n){return i(null===e?t:e,n)}):i}()},ba61:function(t,e,n){"use strict";var r=n("7c4a"),i={object:!0,symbol:!0};t.exports=function(){var t,e=r.Symbol;if("function"!==typeof e)return!1;t=e("test symbol");try{String(t)}catch(n){return!1}return!!i[typeof e.iterator]&&(!!i[typeof e.toPrimitive]&&!!i[typeof e.toStringTag])}},bae6:function(t,e,n){"use strict";t.exports=n("a297")()?Math.sign:n("ef7a")},bf09:function(t,e,n){"use strict";var r=n("9bfc").codes.ERR_STREAM_PREMATURE_CLOSE;function i(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i=55296&&g<=56319&&(_+=t[++p])),u.call(e,b,_,f),h)break}else c.call(t,(function(t){return u.call(e,b,t,f),h}))}},c4c7:function(t,e,n){"use strict";(function(e){var r,i,o,s=n("e372").Transform,a=n("fb12"),u=n("1fb5"),c=!1;function l(){var t=new s;return t._write=function(t,e,n){r.sendSocketMessage({data:t.buffer,success:function(){n()},fail:function(){n(new Error)}})},t._flush=function(t){r.closeSocket({success:function(){t()}})},t}function f(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function h(t,e){var n="alis"===t.protocol?"wss":"ws",r=n+"://"+t.hostname+t.path;return t.port&&80!==t.port&&443!==t.port&&(r=n+"://"+t.hostname+":"+t.port+t.path),"function"===typeof t.transformWsUrl&&(r=t.transformWsUrl(r,t,e)),r}function p(){c||(c=!0,r.onSocketOpen((function(){o.setReadable(i),o.setWritable(i),o.emit("connect")})),r.onSocketMessage((function(t){if("string"===typeof t.data){var n=u.toByteArray(t.data),r=e.from(n);i.push(r)}else{var o=new FileReader;o.addEventListener("load",(function(){var t=o.result;t=t instanceof ArrayBuffer?e.from(t):e.from(t,"utf8"),i.push(t)})),o.readAsArrayBuffer(t.data)}})),r.onSocketClose((function(){o.end(),o.destroy()})),r.onSocketError((function(t){o.destroy(t)})))}function d(t,e){if(e.hostname=e.hostname||e.host,!e.hostname)throw new Error("Could not determine host. Specify host manually.");var n="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";f(e);var s=h(e,t);return r=e.my,r.connectSocket({url:s,protocols:n}),i=l(),o=a.obj(),p(),o}t.exports=d}).call(this,n("1c35").Buffer)},c5f4:function(t,e,n){"use strict";var r=n("bae6"),i=Math.abs,o=Math.floor;t.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?r(t)*o(i(t)):t)}},c682:function(t,e,n){"use strict";t.exports=n("5a5c")("key","value","key+value")},c9fc:function(t,e,n){"use strict";var r,i,o,s,a,u,c,l=n("f508"),f=n("1a94"),h=Function.prototype.apply,p=Function.prototype.call,d=Object.create,_=Object.defineProperty,g=Object.defineProperties,b=Object.prototype.hasOwnProperty,v={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n;return f(e),b.call(this,"__ee__")?n=this.__ee__:(n=v.value=d(null),_(this,"__ee__",v),v.value=null),n[t]?"object"===typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},i=function(t,e){var n,i;return f(e),i=this,r.call(this,t,n=function(){o.call(i,t,n),h.call(e,this,arguments)}),n.__eeOnceListener__=e,this},o=function(t,e){var n,r,i,o;if(f(e),!b.call(this,"__ee__"))return this;if(n=this.__ee__,!n[t])return this;if(r=n[t],"object"===typeof r)for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},s=function(t){var e,n,r,i,o;if(b.call(this,"__ee__")&&(i=this.__ee__[t],i))if("object"===typeof i){for(n=arguments.length,o=new Array(n-1),e=1;e-1?setImmediate:i.nextTick;y.WritableState=v;var u=Object.create(n("3a7c"));u.inherits=n("3fb5");var c={deprecate:n("b7d1")},l=n("429b"),f=n("8707").Buffer,h=r.Uint8Array||function(){};function p(t){return f.from(t)}function d(t){return f.isBuffer(t)||t instanceof h}var _,g=n("4681");function b(){}function v(t,e){s=s||n("b19a"),t=t||{};var r=e instanceof s;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var i=t.highWaterMark,a=t.writableHighWaterMark,u=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(a||0===a)?a: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===t.decodeStrings;this.decodeStrings=!c,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){I(e,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 o(this)}function y(t){if(s=s||n("b19a"),!_.call(y,this)&&!(this instanceof s))return new y(t);this._writableState=new v(t,this),this.writable=!0,t&&("function"===typeof t.write&&(this._write=t.write),"function"===typeof t.writev&&(this._writev=t.writev),"function"===typeof t.destroy&&(this._destroy=t.destroy),"function"===typeof t.final&&(this._final=t.final)),l.call(this)}function m(t,e){var n=new Error("write after end");t.emit("error",n),i.nextTick(e,n)}function w(t,e,n,r){var o=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"===typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),i.nextTick(r,s),o=!1),o}function S(t,e,n){return t.objectMode||!1===t.decodeStrings||"string"!==typeof e||(e=f.from(e,n)),e}function k(t,e,n,r,i,o){if(!n){var s=S(e,r,i);r!==s&&(n=!0,i="buffer",r=s)}var a=e.objectMode?1:r.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(y.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),y.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},y.prototype._writev=null,y.prototype.end=function(t,e,n){var r=this._writableState;"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||r.finished||L(this,r,n)},Object.defineProperty(y.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),y.prototype.destroy=g.destroy,y.prototype._undestroy=g.undestroy,y.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n("4362"),n("c8ba"))},dc90:function(t,e,n){function r(t){function e(t){let e=0;for(let n=0;n{if("%%"===e)return"%";s++;const o=r.formatters[i];if("function"===typeof o){const r=t[s];e=o.call(n,r),t.splice(s,1),s--}return e}),r.formatArgs.call(n,t);const u=n.log||r.log;u.apply(n,t)}return a.namespace=t,a.useColors=r.useColors(),a.color=r.selectColor(t),a.extend=i,a.destroy=r.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(n!==r.namespaces&&(n=r.namespaces,o=r.enabled(t)),o),set:t=>{s=t}}),"function"===typeof r.init&&r.init(a),a}function i(t,e){const n=r(this.namespace+("undefined"===typeof e?":":e)+t);return n.log=this.log,n}function o(t){let e;r.save(t),r.namespaces=t,r.names=[],r.skips=[];const n=("string"===typeof t?t:"").split(/[\s,]+/),i=n.length;for(e=0;e"-"+t)].join(",");return r.enable(""),t}function a(t){if("*"===t[t.length-1])return!0;let e,n;for(e=0,n=r.skips.length;e{r[e]=t[e]}),r.names=[],r.skips=[],r.formatters={},r.selectColor=e,r.enable(r.load()),r}t.exports=r},df86:function(t,e,n){"use strict";(function(e,r){var i=n("faa1").EventEmitter,o=n("ea08"),s=n("3409"),a=n("e372").Writable,u=n("3fb5"),c=n("29a2"),l=n("ae84"),f=n("53a8"),h=n("34eb")("mqttjs:client"),p=e.setImmediate||function(t){r.nextTick(t)},d={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0},_=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],g={0:"",1:"Unacceptable protocol version",2:"Identifier rejected",3:"Server unavailable",4:"Bad username or password",5:"Not authorized",16:"No matching subscribers",17:"No subscription existed",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",132:"Unsupported Protocol Version",133:"Client Identifier not valid",134:"Bad User Name or Password",135:"Not authorized",136:"Server unavailable",137:"Server busy",138:"Banned",139:"Server shutting down",140:"Bad authentication method",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",145:"Packet identifier in use",146:"Packet Identifier not found",147:"Receive Maximum exceeded",148:"Topic Alias invalid",149:"Packet too large",150:"Message rate too high",151:"Quota exceeded",152:"Administrative action",153:"Payload format invalid",154:"Retain not supported",155:"QoS not supported",156:"Use another server",157:"Server moved",158:"Shared Subscriptions not supported",159:"Connection rate exceeded",160:"Maximum connect time",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"};function b(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function v(t,e,n){h("sendPacket :: packet: %O",e),h("sendPacket :: emitting `packetsend`"),t.emit("packetsend",e),h("sendPacket :: writing to stream");var r=s.writeToStream(e,t.stream,t.options);h("sendPacket :: writeToStream result %s",r),!r&&n?(h("sendPacket :: handle events on `drain` once through callback."),t.stream.once("drain",n)):n&&(h("sendPacket :: invoking cb"),n())}function y(t){t&&(h("flush: queue exists? %b",!!t),Object.keys(t).forEach((function(e){"function"===typeof t[e].cb&&(t[e].cb(new Error("Connection closed")),delete t[e])})))}function m(t){t&&(h("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(t).forEach((function(e){t[e].volatile&&"function"===typeof t[e].cb&&(t[e].cb(new Error("Connection closed")),delete t[e])})))}function w(t,e,n,r){h("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd),t.outgoingStore.put(e,(function(i){if(i)return n&&n(i);r(),v(t,e,n)}))}function S(t){h("nop ::",t)}function k(t,e){var n,r=this;if(!(this instanceof k))return new k(t,e);for(n in this.options=e||{},d)"undefined"===typeof this.options[n]?this.options[n]=d[n]:this.options[n]=e[n];h("MqttClient :: options.protocol",e.protocol),h("MqttClient :: options.protocolVersion",e.protocolVersion),h("MqttClient :: options.username",e.username),h("MqttClient :: options.keepalive",e.keepalive),h("MqttClient :: options.reconnectPeriod",e.reconnectPeriod),h("MqttClient :: options.rejectUnauthorized",e.rejectUnauthorized),this.options.clientId="string"===typeof e.clientId?e.clientId:b(),h("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===e.protocolVersion&&e.customHandleAcks?e.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=t,this.outgoingStore=e.outgoingStore||new o,this.incomingStore=e.incomingStore||new o,this.queueQoSZero=void 0===e.queueQoSZero||e.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.pingTimer=null,this.connected=!1,this.disconnecting=!1,this.queue=[],this.connackTimer=null,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this.nextId=Math.max(1,Math.floor(65535*Math.random())),this.outgoing={},this._firstConnection=!0,this.on("connect",(function(){var t=this.queue;function e(){var n=t.shift();h("deliver :: entry %o",n);var i=null;n&&(i=n.packet,h("deliver :: call _sendPacket for %o",i),r._sendPacket(i,(function(t){n.cb&&n.cb(t),e()})))}h("connect :: sending queued packets"),e()})),this.on("close",(function(){h("close :: connected set to `false`"),this.connected=!1,h("close :: clearing connackTimer"),clearTimeout(this.connackTimer),h("close :: clearing ping timer"),null!==r.pingTimer&&(r.pingTimer.clear(),r.pingTimer=null),h("close :: calling _setupReconnect"),this._setupReconnect()})),i.call(this),h("MqttClient :: setting up stream"),this._setupStream()}u(k,i),k.prototype._setupStream=function(){var t,e=this,n=new a,i=s.parser(this.options),o=null,u=[];function c(){if(u.length)r.nextTick(l);else{var t=o;o=null,t()}}function l(){h("work :: getting next packet in queue");var t=u.shift();if(t)h("work :: packet pulled from queue"),e._handlePacket(t,c);else{h("work :: no packets in queue");var n=o;o=null,h("work :: done flag is %s",!!n),n&&n()}}function p(t){h("streamErrorHandler :: error",t.message),_.includes(t.code)?(h("streamErrorHandler :: emitting error"),e.emit("error",t)):S(t)}if(h("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),h("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),i.on("packet",(function(t){h("parser :: on packet push to packets array."),u.push(t)})),n._write=function(t,e,n){o=n,h("writable stream :: parsing buffer"),i.parse(t),l()},h("_setupStream :: pipe stream to writable stream"),this.stream.pipe(n),this.stream.on("error",p),this.stream.on("close",(function(){h("(%s)stream :: on close",e.options.clientId),m(e.outgoing),h("stream: emit close to MqttClient"),e.emit("close")})),h("_setupStream: sending packet `connect`"),t=Object.create(this.options),t.cmd="connect",v(this,t),i.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return e.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"===typeof this.options.authPacket){var d=f({cmd:"auth",reasonCode:0},this.options.authPacket);v(this,d)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout((function(){h("!!connectTimeout hit!! Calling _cleanUp with force `true`"),e._cleanUp(!0)}),this.options.connectTimeout)},k.prototype._handlePacket=function(t,e){var n=this.options;if(5===n.protocolVersion&&n.properties&&n.properties.maximumPacketSize&&n.properties.maximumPacketSizeo.properties.topicAliasMaximum||!o.properties.topicAliasMaximum&&n.properties.topicAlias))&&delete i.properties.topicAlias),h("publish :: qos",n.qos),n.qos){case 1:case 2:this.outgoing[i.messageId]={volatile:!1,cb:r||S},this._storeProcessing?(h("_storeProcessing enabled"),this._packetIdsDuringStoreProcessing[i.messageId]=!1,this._storePacket(i,void 0,n.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",i.cmd),this._sendPacket(i,void 0,n.cbStorePut));break;default:this._storeProcessing?(h("_storeProcessing enabled"),this._storePacket(i,r,n.cbStorePut)):(h("MqttClient:publish: packet cmd: %s",i.cmd),this._sendPacket(i,r,n.cbStorePut));break}return this},k.prototype.subscribe=function(){for(var t,e=new Array(arguments.length),n=0;n0){var e={qos:t.qos};5===d&&(e.nl=t.nl||!1,e.rap=t.rap||!1,e.rh=t.rh||0,e.properties=t.properties),c._resubscribeTopics[t.topic]=e,g.push(t.topic)}})),c.messageIdToTopic[t.messageId]=g}return this.outgoing[t.messageId]={volatile:!0,cb:function(t,e){if(!t)for(var n=e.granted,r=0;r{h("end :: finish :: calling process.nextTick on closeStores"),r.nextTick(o.bind(i))},e)}return h("end :: (%s)",this.options.clientId),null!=t&&"boolean"===typeof t||(n=e||S,e=t,t=!1,"object"!==typeof e&&(n=e,e=null,"function"!==typeof n&&(n=S))),"object"!==typeof e&&(n=e,e=null),h("end :: cb? %s",!!n),n=n||S,this.disconnecting?(n(),this):(this._clearReconnect(),this.disconnecting=!0,!t&&Object.keys(this.outgoing).length>0?(h("end :: (%s) :: calling finish in 10ms once outgoing is empty",i.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,s,10))):(h("end :: (%s) :: immediately calling finish",i.options.clientId),s()),this)},k.prototype.removeOutgoingMessage=function(t){var e=this.outgoing[t]?this.outgoing[t].cb:null;return delete this.outgoing[t],this.outgoingStore.del({messageId:t},(function(){e(new Error("Message removed"))})),this},k.prototype.reconnect=function(t){h("client reconnect");var e=this,n=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=n:n(),this},k.prototype._reconnect=function(){h("_reconnect: emitting reconnect to client"),this.emit("reconnect"),h("_reconnect: calling _setupStream"),this._setupStream()},k.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0?(this.reconnecting||(h("_setupReconnect :: emit `offline` state"),this.emit("offline"),h("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),h("_setupReconnect :: setting reconnectTimer for %d ms",t.options.reconnectPeriod),t.reconnectTimer=setInterval((function(){h("reconnectTimer :: reconnect triggered!"),t._reconnect()}),t.options.reconnectPeriod)):h("_setupReconnect :: doing nothing...")},k.prototype._clearReconnect=function(){h("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},k.prototype._cleanUp=function(t,e){var n=arguments[2];if(e&&(h("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",e)),h("_cleanUp :: forced? %s",t),t)0===this.options.reconnectPeriod&&this.options.clean&&y(this.outgoing),h("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{var r=f({cmd:"disconnect"},n);h("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(r,p.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(h("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(h("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(h("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",e),e())},k.prototype._sendPacket=function(t,e,n){if(h("_sendPacket :: (%s) :: start",this.options.clientId),n=n||S,!this.connected)return h("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(t,e,n);switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void w(this,t,e,n);default:return void v(this,t,e)}switch(t.qos){case 2:case 1:w(this,t,e,n);break;case 0:default:v(this,t,e);break}h("_sendPacket :: (%s) :: end",this.options.clientId)},k.prototype._storePacket=function(t,e,n){h("_storePacket :: packet: %o",t),h("_storePacket :: cb? %s",!!e),n=n||S,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.outgoing[t.messageId].cb:null,this.outgoingStore.put(t,(function(t){if(t)return e&&e(t);n()}))):e&&e(new Error("No connection to broker"))},k.prototype._setupPingTimer=function(){h("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=c((function(){t._checkPing()}),1e3*this.options.keepalive))},k.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},k.prototype._checkPing=function(){h("_checkPing :: checking ping..."),this.pingResp?(h("_checkPing :: ping response received. Clearing flag and sending `pingreq`"),this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):(h("_checkPing :: calling _cleanUp with force true"),this._cleanUp(!0))},k.prototype._handlePingresp=function(){this.pingResp=!0},k.prototype._handleConnack=function(t){h("_handleConnack");var e=this.options,n=e.protocolVersion,r=5===n?t.reasonCode:t.returnCode;if(clearTimeout(this.connackTimer),t.properties&&(t.properties.topicAliasMaximum&&(e.properties||(e.properties={}),e.properties.topicAliasMaximum=t.properties.topicAliasMaximum),t.properties.serverKeepAlive&&e.keepalive&&(e.keepalive=t.properties.serverKeepAlive,this._shiftPingInterval()),t.properties.maximumPacketSize&&(e.properties||(e.properties={}),e.properties.maximumPacketSize=t.properties.maximumPacketSize)),0===r)this.reconnecting=!1,this._onConnect(t);else if(r>0){var i=new Error("Connection refused: "+g[r]);i.code=r,this.emit("error",i)}},k.prototype._handlePublish=function(t,e){h("_handlePublish: packet %o",t),e="undefined"!==typeof e?e:S;var n=t.topic.toString(),r=t.payload,i=t.qos,o=t.messageId,s=this,a=this.options,u=[0,16,128,131,135,144,145,151,153];switch(h("_handlePublish: qos %d",i),i){case 2:a.customHandleAcks(n,r,t,(function(n,r){return n instanceof Error||(r=n,n=null),n?s.emit("error",n):-1===u.indexOf(r)?s.emit("error",new Error("Wrong reason code for pubrec")):void(r?s._sendPacket({cmd:"pubrec",messageId:o,reasonCode:r},e):s.incomingStore.put(t,(function(){s._sendPacket({cmd:"pubrec",messageId:o},e)})))}));break;case 1:a.customHandleAcks(n,r,t,(function(i,a){return i instanceof Error||(a=i,i=null),i?s.emit("error",i):-1===u.indexOf(a)?s.emit("error",new Error("Wrong reason code for puback")):(a||s.emit("message",n,r,t),void s.handleMessage(t,(function(t){if(t)return e&&e(t);s._sendPacket({cmd:"puback",messageId:o,reasonCode:a},e)})))}));break;case 0:this.emit("message",n,r,t),this.handleMessage(t,e);break;default:h("_handlePublish: unknown QoS. Doing nothing.");break}},k.prototype.handleMessage=function(t,e){e()},k.prototype._handleAck=function(t){var e,n=t.messageId,r=t.cmd,i=null,o=this.outgoing[n]?this.outgoing[n].cb:null,s=this;if(o){switch(h("_handleAck :: packet type",r),r){case"pubcomp":case"puback":var a=t.reasonCode;a&&a>0&&16!==a&&(e=new Error("Publish error: "+g[a]),e.code=a,o(e,t)),delete this.outgoing[n],this.outgoingStore.del(t,o);break;case"pubrec":i={cmd:"pubrel",qos:2,messageId:n};var u=t.reasonCode;u&&u>0&&16!==u?(e=new Error("Publish error: "+g[u]),e.code=u,o(e,t)):this._sendPacket(i);break;case"suback":delete this.outgoing[n];for(var c=0;c0)if(this.options.resubscribe)if(5===this.options.protocolVersion){h("_resubscribe: protocolVersion 5");for(var n=0;n0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value: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}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";var e=this.head,n=""+e.data;while(e=e.next)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return l.alloc(0);var e=l.allocUnsafe(t>>>0),n=this.head,r=0;while(n)d(n.data,e,r),r+=n.data.length,n=n.next;return e}},{key:"consume",value:function(t,e){var n;return ti.length?i.length:t;if(o===i.length?r+=i:r+=i.slice(0,t),t-=o,0===t){o===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(o));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=l.allocUnsafe(t),n=this.head,r=1;n.data.copy(e),t-=n.data.length;while(n=n.next){var i=n.data,o=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,o),t-=o,0===t){o===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(o));break}++r}return this.length-=r,e}},{key:p,value:function(t,e){return h(this,i({},e,{depth:0,customInspect:!1}))}}]),t}()},e9bd:function(t,e,n){"use strict";var r=Object.prototype.toString,i=r.call(function(){return arguments}());t.exports=function(t){return r.call(t)===i}},ea08:function(t,e,n){"use strict";(function(e){var r=n("53a8"),i=n("e372").Readable,o={objectMode:!0},s={clean:!0},a=n("546b");function u(t){if(!(this instanceof u))return new u(t);this.options=t||{},this.options=r(s,t),this._inflights=new a}u.prototype.put=function(t,e){return this._inflights.set(t.messageId,t),e&&e(),this},u.prototype.createStream=function(){var t=new i(o),n=!1,r=[],s=0;return this._inflights.forEach((function(t,e){r.push(t)})),t._read=function(){!n&&s0?1:-1}},f0cb:function(t,e,n){(function(e){const n=65536,r={},i=e.isBuffer(e.from([1,2]).subarray(0,1));function o(t){const n=e.allocUnsafe(2);return n.writeUInt8(t>>8,0),n.writeUInt8(255&t,1),n}function s(){for(let t=0;t0&&(r|=128),s.writeUInt8(r,o++)}while(t>0&&o0&&(o=0),i?s.subarray(0,o):s.slice(0,o)}function u(t){const n=e.allocUnsafe(4);return n.writeUInt32BE(t,0),n}t.exports={cache:r,generateCache:s,generateNumber:o,genBufVariableByteInt:a,generate4ByteBuffer:u}}).call(this,n("1c35").Buffer)},f214:function(t,e,n){e=t.exports=n("0e8b"),e.Stream=e,e.Readable=e,e.Writable=n("f6ba"),e.Duplex=n("a493"),e.Transform=n("fe34"),e.PassThrough=n("9d37"),e.finished=n("bf09"),e.pipeline=n("386b")},f3a6:function(t,e,n){"use strict";var r=n("62c4"),i=Array.prototype.forEach,o=Object.create,s=function(t,e){var n;for(n in t)e[n]=t[n]};t.exports=function(t){var e=o(null);return i.call(arguments,(function(t){r(t)&&s(Object(t),e)})),e}},f482:function(t,e,n){"use strict";(function(e){function n(t,n){var o=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(n?n(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(s,this,t)):e.nextTick(s,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!n&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(i,o):(o._writableState.errorEmitted=!0,e.nextTick(r,o,t)):e.nextTick(r,o,t):n?(e.nextTick(i,o),n(t)):e.nextTick(i,o)})),this)}function r(t,e){s(t,e),i(t)}function i(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}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.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(t,e){t.emit("error",e)}function a(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}t.exports={destroy:n,undestroy:o,errorOrDestroy:a}}).call(this,n("4362"))},f508:function(t,e,n){"use strict";var r=n("936a"),i=n("1793"),o=n("2031"),s=n("f3a6"),a=n("f973"),u=t.exports=function(t,e){var n,i,u,c,l;return arguments.length<2||"string"!==typeof t?(c=e,e=t,t=null):c=arguments[2],r(t)?(n=a.call(t,"c"),i=a.call(t,"e"),u=a.call(t,"w")):(n=u=!0,i=!1),l={value:e,configurable:n,enumerable:i,writable:u},c?o(s(c),l):l};u.gs=function(t,e,n){var u,c,l,f;return"string"!==typeof t?(l=n,n=e,e=t,t=null):l=arguments[3],r(e)?i(e)?r(n)?i(n)||(l=n,n=void 0):n=void 0:(l=e,e=n=void 0):e=void 0,r(t)?(u=a.call(t,"c"),c=a.call(t,"e")):(u=!0,c=!1),f={get:e,set:n,configurable:u,enumerable:c},l?o(s(l),f):f}},f60e:function(t,e,n){"use strict";var r=n("7bdf"),i=n("96ae"),o=Math.max;t.exports=function(t,e){var n,s,a,u=o(arguments.length,2);for(t=Object(i(t)),a=function(r){try{t[r]=e[r]}catch(i){n||(n=i)}},s=1;s-1))throw new E(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(t,e,n){n(new v("_write()"))},C.prototype._writev=null,C.prototype.end=function(t,e,n){var r=this._writableState;return"function"===typeof t?(n=t,t=null,e=null):"function"===typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),r.corked&&(r.corked=1,this.uncork()),r.ending||z(this,r,n),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),C.prototype.destroy=p.destroy,C.prototype._undestroy=p.undestroy,C.prototype._destroy=function(t,e){e(t)}}).call(this,n("c8ba"),n("4362"))},f967:function(t,e,n){"use strict";var r=String.prototype.indexOf;t.exports=function(t){return r.call(this,t,arguments[1])>-1}},f973:function(t,e,n){"use strict";t.exports=n("18ec")()?String.prototype.contains:n("f967")},f9c1:function(t,e){function n(t){var e=t._readableState;return e?e.objectMode||"number"===typeof t._duplexState?t.read():t.read(r(e)):null}function r(t){return t.buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length}t.exports=n},faa1:function(t,e,n){"use strict";var r,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};function s(t){console&&console.warn}r=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!==t};function u(){u.init.call(this)}t.exports=u,t.exports.once=m,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function l(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function f(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function h(t,e,n,r){var i,o,a;if(l(n),o=t._events,void 0===o?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),o=t._events),a=o[e]),void 0===a)a=o[e]=n,++t._eventsCount;else if("function"===typeof a?a=o[e]=r?[n,a]:[a,n]:r?a.unshift(n):a.push(n),i=f(t),i>0&&a.length>i&&!a.warned){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,s(u)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=p.bind(r);return i.listener=n,r.wrapFn=i,i}function _(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"===typeof i?n?[i.listener||i]:[i]:n?y(i):b(i,i.length)}function g(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"===typeof n)return 1;if(void 0!==n)return n.length}return 0}function b(t,e){for(var n=new Array(e),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[t];if(void 0===u)return!1;if("function"===typeof u)o(u,this,e);else{var c=u.length,l=b(u,c);for(n=0;n=0;o--)if(n[o]===e||n[o].listener===e){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():v(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,n,r;if(n=this._events,void 0===n)return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,o=Object.keys(n);for(r=0;r=0;r--)this.removeListener(t,e[r]);return this},u.prototype.listeners=function(t){return _(this,t,!0)},u.prototype.rawListeners=function(t){return _(this,t,!1)},u.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):g.call(t,e)},u.prototype.listenerCount=g,u.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},fb12:function(t,e,n){(function(e,r){var i=n("e372"),o=n("ab52"),s=n("3fb5"),a=n("f9c1"),u=e.from&&e.from!==Uint8Array.from?e.from([0]):new e([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(n){n?l(t,"premature close"===n.message?null:n):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,n){if(!(this instanceof d))return new d(t,e,n);i.Duplex.call(this,n),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!n||!1!==n.autoDestroy,this._forwardDestroy=!n||!1!==n.destroy,this._forwardEnd=!n||!1!==n.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,n){return n||(n={}),n.objectMode=!0,n.highWaterMark=16,new d(t,e,n)},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,n=o(t,{writable:!1,readable:!0},f(this)),r=function(){e._forward()},i=function(){e.push(null)},s=function(){e._readable2.removeListener("readable",r),e._readable2.removeListener("end",i),n()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:p(t),this._readable2.on("readable",r),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,n){return this.destroyed?n():this._corked?c(this,this._write.bind(this,t,e,n)):t===u?this._finish(n):this._writable?void(!1===this._writable.write(t)?this._ondrain=n:n()):n()},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,n){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,n))},t.exports=d}).call(this,n("1c35").Buffer,n("4362"))},fcb9:function(t,e,n){"use strict";(function(e){var r=n("34eb")("mqttjs:ws"),i=n("553e"),o=n("0b16"),s=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],a="browser"===e.title;function u(t,e){var n=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"===typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,e)),n}function c(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={}),a||"wss"!==t.protocol||s.forEach((function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])}))}function l(t,e){r("createWebSocket");var n="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";c(e);var o=u(e,t);return r("url %s protocol %s",o,n),i(o,[n],e.wsOptions)}function f(t,e){return l(t,e)}function h(t,e){if(r("browserStreamBuilder"),e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"===typeof document)throw new Error("Could not determine host. Specify host manually.");var n=o.parse(document.URL);e.hostname=n.hostname,e.port||(e.port=n.port)}return l(t,e)}t.exports=a?h:f}).call(this,n("4362"))},fe34:function(t,e,n){"use strict";t.exports=l;var r=n("9bfc").codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,o=r.ERR_MULTIPLE_CALLBACK,s=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=r.ERR_TRANSFORM_WITH_LENGTH_0,u=n("a493");function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new o);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length