(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5f0ec173"],{"05ee":function(t,e,r){"use strict";var n=r(5);function o(t,e){var r,o;return e.port=e.port||1883,e.hostname=e.hostname||e.host||"localhost",r=e.port,o=e.hostname,n.createConnection(r,o)}t.exports=o},"06a2":function(t,e,r){"use strict";var n,o=r("a671"),i=r("2031"),s=r("1a94"),a=r("96ae"),c=r("f508"),l=r("986b"),u=r("1c4a"),p=Object.defineProperty,h=Object.defineProperties;t.exports=n=function(t,e){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");h(this,{__list__:c("w",a(t)),__context__:c("w",e),__nextIndex__:c("w",0)}),e&&(s(e.on),e.on("_add",this._onAdd),e.on("_delete",this._onDelete),e.on("_clear",this._onClear))},delete n.prototype.constructor,h(n.prototype,i({_next:c(function(){var t;if(this.__list__)return this.__redo__&&(t=this.__redo__.shift(),void 0!==t)?t:this.__nextIndex__=this.__nextIndex__||(++this.__nextIndex__,this.__redo__?(this.__redo__.forEach(function(e,r){e>=t&&(this.__redo__[r]=++e)},this),this.__redo__.push(t)):p(this,"__redo__",c("c",[t])))}),_onDelete:c(function(t){var e;t>=this.__nextIndex__||(--this.__nextIndex__,this.__redo__&&(e=this.__redo__.indexOf(t),-1!==e&&this.__redo__.splice(e,1),this.__redo__.forEach(function(e,r){e>t&&(this.__redo__[r]=--e)},this)))}),_onClear:c(function(){this.__redo__&&o.call(this.__redo__),this.__nextIndex__=0})}))),p(n.prototype,u.iterator,c(function(){return this}))},"09d9":function(t,e,r){"use strict";var n,o=r("e0f6"),i=r("f508"),s=r("1c4a"),a=r("06a2"),c=Object.defineProperty;n=t.exports=function(t){if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");t=String(t),a.call(this,t),c(this,"__length__",i("",t.length))},o&&o(n,a),delete n.prototype.constructor,n.prototype=Object.create(a.prototype,{_next:i(function(){if(this.__list__)return this.__nextIndex__=55296&&e<=56319?r+this.__list__[this.__nextIndex__++]:r)})}),c(n.prototype,s.toStringTag,i("c","String Iterator"))},"0b16":function(t,e,r){"use strict";var n=r("9d88"),o=r("35e86");function i(){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=I,e.format=S,e.Url=i;var s=/^([a-z0-9.+-]+:)/i,a=/:[0-9]*$/,c=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,l=["<",">",'"',"`"," ","\r","\n","\t"],u=["{","}","|","\\","^","`"].concat(l),p=["'"].concat(u),h=["%","/","?",";","#"].concat(p),f=["/","?","#"],d=255,_=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,b={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},v={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r("b383");function w(t,e,r){if(t&&o.isObject(t)&&t instanceof i)return t;var n=new i;return n.parse(t,e,r),n}function S(t){return o.isString(t)&&(t=w(t)),t instanceof i?t.format():i.prototype.format.call(t)}function k(t,e){return w(t,!1,!0).resolve(e)}function I(t,e){return t?w(t,!1,!0).resolveObject(e):e}i.prototype.parse=function(t,e,r){if(!o.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),a=-1!==i&&i127?q+="x":q+=M[N];if(!q.match(_)){var U=j.slice(0,T),L=j.slice(T+1),D=M.match(m);D&&(U.push(D[1]),L.unshift(D[2])),L.length&&(w="/"+L.join(".")+w),this.hostname=U.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),A||(this.hostname=n.toASCII(this.hostname));var $=this.port?":"+this.port:"",K=this.hostname||"";this.host=K+$,this.href+=this.host,A&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==w[0]&&(w="/"+w))}if(!b[I])for(T=0,R=p.length;T0)&&r.host.split("@");E&&(r.auth=E.shift(),r.host=r.hostname=E.shift())}return r.search=t.search,r.query=t.query,o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!k.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var x=k.slice(-1)[0],O=(r.host||t.host||k.length>1)&&("."===x||".."===x)||""===x,P=0,T=k.length;T>=0;T--)x=k[T],"."===x?k.splice(T,1):".."===x?(k.splice(T,1),P++):P&&(k.splice(T,1),P--);if(!w&&!S)for(;P--;P)k.unshift("..");!w||""===k[0]||k[0]&&"/"===k[0].charAt(0)||k.unshift(""),O&&"/"!==k.join("/").substr(-1)&&k.push("");var C=""===k[0]||k[0]&&"/"===k[0].charAt(0);if(I){r.hostname=r.host=C?"":k.length?k.shift():"";E=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");E&&(r.auth=E.shift(),r.host=r.hostname=E.shift())}return w=w||r.host&&k.length,w&&!C&&k.unshift(""),k.length?r.pathname=k.join("/"):(r.pathname=null,r.path=null),o.isNull(r.pathname)&&o.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},i.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,r){"use strict";var n,o=r("a671"),i=r("3527"),s=r("e0f6"),a=r("1a94"),c=r("96ae"),l=r("f508"),u=r("c9fc"),p=r("1c4a"),h=r("3473"),f=r("c351"),d=r("1195"),_=r("b779"),m=Function.prototype.call,b=Object.defineProperties,g=Object.getPrototypeOf;t.exports=n=function(){var t,e,r,o=arguments[0];if(!(this instanceof n))throw new TypeError("Constructor requires 'new'");return r=_&&s&&Map!==n?s(new Map,g(this)):this,null!=o&&h(o),b(r,{__mapKeysData__:l("c",t=[]),__mapValuesData__:l("c",e=[])}),o?(f(o,function(r){var n=c(r)[0];r=r[1],-1===i.call(t,n)&&(t.push(n),e.push(r))},r),r):r},_&&(s&&s(n,Map),n.prototype=Object.create(Map.prototype,{constructor:l(n)})),u(b(n.prototype,{clear:l(function(){this.__mapKeysData__.length&&(o.call(this.__mapKeysData__),o.call(this.__mapValuesData__),this.emit("_clear"))}),delete:l(function(t){var e=i.call(this.__mapKeysData__,t);return-1!==e&&(this.__mapKeysData__.splice(e,1),this.__mapValuesData__.splice(e,1),this.emit("_delete",e,t),!0)}),entries:l(function(){return new d(this,"key+value")}),forEach:l(function(t){var e,r,n=arguments[1];a(t),e=this.entries(),r=e._next();while(void 0!==r)m.call(t,n,this.__mapValuesData__[r],this.__mapKeysData__[r],this),r=e._next()}),get:l(function(t){var e=i.call(this.__mapKeysData__,t);if(-1!==e)return this.__mapValuesData__[e]}),has:l(function(t){return-1!==i.call(this.__mapKeysData__,t)}),keys:l(function(){return new d(this,"key")}),set:l(function(t,e){var r,n=i.call(this.__mapKeysData__,t);return-1===n&&(n=this.__mapKeysData__.push(t)-1,r=!0),this.__mapValuesData__[n]=e,r&&this.emit("_add",n,t),this}),size:l.gs(function(){return this.__mapKeysData__.length}),values:l(function(){return new d(this,"value")}),toString:l(function(){return"[object Map]"})})),Object.defineProperty(n.prototype,p.iterator,l(function(){return this.entries()})),Object.defineProperty(n.prototype,p.toStringTag,l("c","Map"))},1126:function(t,e,r){"use strict";t.exports=function(t){return!!t&&("symbol"===typeof t||!!t.constructor&&("Symbol"===t.constructor.name&&"Symbol"===t[t.constructor.toStringTag]))}},1195:function(t,e,r){"use strict";var n,o=r("e0f6"),i=r("f508"),s=r("06a2"),a=r("1c4a").toStringTag,c=r("c682"),l=Object.defineProperties,u=s.prototype._unBind;n=t.exports=function(t,e){if(!(this instanceof n))return new n(t,e);s.call(this,t.__mapKeysData__,t),e&&c[e]||(e="key+value"),l(this,{__kind__:i("",e),__values__:i("w",t.__mapValuesData__)})},o&&o(n,s),n.prototype=Object.create(s.prototype,{constructor:i(n),_resolve:i(function(t){return"value"===this.__kind__?this.__values__[t]:"key"===this.__kind__?this.__list__[t]:[this.__list__[t],this.__values__[t]]}),_unBind:i(function(){this.__values__=null,u.call(this)}),toString:i(function(){return"[object Map Iterator]"})}),Object.defineProperty(n.prototype,a,i("c","Map Iterator"))},"14ab":function(t,e,r){"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,r){"use strict";t.exports=function(){var t,e,r=Array.from;return"function"===typeof r&&(t=["raz","dwa"],e=r(t),Boolean(e&&e!==t&&"dwa"===e[1]))}},"175c":function(t,e,r){"use strict";r.r(e);var n=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"websocket"},[r("div",{staticClass:"app-wrapper"},[r("el-tabs",{attrs:{type:"card","before-leave":t.handleBeforeLeave},on:{"tab-remove":t.handleTabEdit},model:{value:t.activeTab,callback:function(e){t.activeTab=e},expression:"activeTab"}},[t._l(t.tabs,function(e,n){return r("el-tab-pane",{key:n,attrs:{closable:n>0,name:e.name}},[r("span",{attrs:{slot:"label"},slot:"label"},[r("el-badge",{staticClass:"message-count",attrs:{hidden:0===e.messageCount,value:e.messageCount,max:99}},[t._v("\n "+t._s(e.label)+"\n ")])],1)])}),r("el-tab-pane",{key:"add",staticClass:"add-btn",attrs:{name:"add"}},[r("span",{attrs:{slot:"label"},slot:"label"},[r("i",{staticClass:"el-icon-plus"})])])],2),t._l(t.tabs,function(e,n){return r("web-socket-item",{directives:[{name:"show",rawName:"v-show",value:e.name===t.activeTab,expression:"item.name === activeTab"}],key:n,ref:e.name,refInFor:!0,attrs:{"message-count":e.messageCount},on:{"update:messageCount":function(r){return t.$set(e,"messageCount",r)},"update:message-count":function(r){return t.$set(e,"messageCount",r)}}})})],2)])},o=[],i=(r("ac6a"),r("6b54"),r("7f7f"),r("7514"),function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"websocket-item"},[r("el-card",{staticClass:"emq-list-card"},[r("div",{staticClass:"websocket-config"},[r("div",{staticClass:"emq-title"},[t._v("\n "+t._s(t.$t("Tools.connectionConfiguration"))+"\n ")]),r("el-form",{ref:"configForm",attrs:{"hide-required-asterisk":"",size:"small","label-position":"top",model:t.connection,rules:t.connectionRules},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.createConnection(e)}}},[r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"host",label:t.$t("Tools.host")}},[r("el-input",{attrs:{readonly:t.client.connected},model:{value:t.connection.host,callback:function(e){t.$set(t.connection,"host",e)},expression:"connection.host"}})],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"port",label:t.$t("Tools.port")}},[r("el-input",{attrs:{type:"number",placeholder:"8083/8084",readonly:t.client.connected},model:{value:t.connection.port,callback:function(e){t.$set(t.connection,"port",t._n(e))},expression:"connection.port"}})],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"endpoint",label:t.$t("Tools.mountPoint")}},[r("el-input",{attrs:{placeholder:"/mqtt",readonly:t.client.connected},model:{value:t.connection.endpoint,callback:function(e){t.$set(t.connection,"endpoint",e)},expression:"connection.endpoint"}})],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"clientId",label:"Client ID"}},[r("el-input",{attrs:{readonly:t.client.connected},model:{value:t.connection.clientId,callback:function(e){t.$set(t.connection,"clientId",e)},expression:"connection.clientId"}},[r("i",{staticClass:"el-icon-refresh el-input_icon",attrs:{slot:"suffix",title:t.$t("Tools.randomGeneration"),disabled:t.client.connected},on:{click:t.refreshClientId},slot:"suffix"})])],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"username",label:"Username"}},[r("el-input",{attrs:{readonly:t.client.connected},model:{value:t.connection.username,callback:function(e){t.$set(t.connection,"username",e)},expression:"connection.username"}})],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"password",label:"Password"}},[r("el-input",{attrs:{readonly:t.client.connected},model:{value:t.connection.password,callback:function(e){t.$set(t.connection,"password",e)},expression:"connection.password"}})],1)],1),r("el-col",{attrs:{span:8}},[r("el-form-item",{attrs:{prop:"keepalive",label:"Keepalive"}},[r("el-input",{attrs:{readonly:t.client.connected,type:"number",placeholder:"60"},model:{value:t.connection.keepalive,callback:function(e){t.$set(t.connection,"keepalive",t._n(e))},expression:"connection.keepalive"}})],1)],1),r("el-col",{staticClass:"footer-area",attrs:{span:24}},[r("el-checkbox",{attrs:{disabled:t.client.connected},model:{value:t.connection.clean,callback:function(e){t.$set(t.connection,"clean",e)},expression:"connection.clean"}},[t._v("\n Clean Session\n ")]),r("el-checkbox",{attrs:{disabled:t.client.connected},on:{change:t.protocolsChange},model:{value:t.connection.ssl,callback:function(e){t.$set(t.connection,"ssl",e)},expression:"connection.ssl"}},[t._v("\n SSL\n ")])],1),r("el-col",{staticClass:"footer-area",attrs:{span:24}},[r("el-button",{staticClass:"conn-btn",staticStyle:{"margin-right":"20px"},attrs:{type:"primary",size:"small",disabled:t.client.connected||t.connecting},on:{click:t.createConnection}},[t._v("\n "+t._s(t.client.connected?t.$t("Tools.connected"):t.connecting?t.$t("Tools.inConnection"):t.$t("Tools.connect"))+"\n ")]),r("el-button",{staticClass:"conn-btn",attrs:{type:"danger",size:"small",disabled:!t.client.connected&&!t.connecting},on:{click:t.destroyConnection}},[t._v("\n "+t._s(t.connecting?t.$t("Tools.cancelConnection"):t.$t("Tools.disconnect"))+"\n ")])],1)],1)],1)],1)]),r("el-card",{staticClass:"emq-list-card"},[r("div",{staticClass:"emq-title"},[t._v("\n "+t._s(t.$t("Tools.Subscription"))+"\n ")]),r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:12}},[r("el-form",{ref:"subForm",attrs:{"hide-required-asterisk":"",model:t.subscriptionsRecord,rules:t.subscriptionsRules,size:"small","label-position":"top"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t._doSubscribe(e)}}},[r("el-form-item",{attrs:{prop:"topic",label:"Topic"}},[r("el-input",{model:{value:t.subscriptionsRecord.topic,callback:function(e){t.$set(t.subscriptionsRecord,"topic",e)},expression:"subscriptionsRecord.topic"}})],1),r("el-form-item",{attrs:{prop:"qos",label:"QoS"}},[r("emq-select",{attrs:{field:{list:[0,1,2]}},model:{value:t.subscriptionsRecord.qos,callback:function(e){t.$set(t.subscriptionsRecord,"qos",t._n(e))},expression:"subscriptionsRecord.qos"}})],1),r("div",[r("el-form-item",[r("el-button",{staticClass:"conn-btn",attrs:{type:"primary",size:"small"},on:{click:t._doSubscribe}},[t._v("\n "+t._s(t.$t("Tools.Subscribe"))+"\n ")])],1)],1)],1)],1),r("el-col",{attrs:{span:12}},[r("el-table",{staticStyle:{"margin-top":"10px"},attrs:{data:t.subscriptions,"max-height":"400px"}},[r("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"topic",label:"Topic","min-width":"180px"}}),r("el-table-column",{attrs:{prop:"qos",label:"QoS",width:"80px"}}),r("el-table-column",{attrs:{prop:"createAt",label:t.$t("Tools.time")}}),r("el-table-column",{attrs:{width:"80px"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("a",{staticClass:"btn",on:{click:function(e){return t._doUnSubscribe(n)}}},[t._v(t._s(t.$t("Base.cancel")))])]}}])})],1)],1)],1)],1),r("el-card",{staticClass:"emq-list-card"},[r("div",{staticClass:"emq-title"},[t._v("\n "+t._s(t.$t("Tools.publish"))+"\n ")]),r("div",{staticClass:"connection-wrapper"},[r("el-form",{ref:"pubForm",attrs:{"hide-required-asterisk":"","label-position":"top",model:t.messageRecord,rules:t.messageRecordRules,size:"small"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t._doPublish(e)}}},[r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:6}},[r("el-form-item",{attrs:{prop:"topic",label:"Topic"}},[r("el-input",{attrs:{size:"small"},model:{value:t.messageRecord.topic,callback:function(e){t.$set(t.messageRecord,"topic",e)},expression:"messageRecord.topic"}})],1)],1),r("el-col",{attrs:{span:6}},[r("el-form-item",{attrs:{prop:"payload",label:"Payload"}},[r("el-input",{attrs:{size:"small"},model:{value:t.messageRecord.payload,callback:function(e){t.$set(t.messageRecord,"payload",e)},expression:"messageRecord.payload"}})],1)],1),r("el-col",{attrs:{span:6}},[r("el-form-item",{attrs:{prop:"qos",label:"QoS"}},[r("emq-select",{attrs:{field:{list:[0,1,2]},size:"small"},model:{value:t.messageRecord.qos,callback:function(e){t.$set(t.messageRecord,"qos",t._n(e))},expression:"messageRecord.qos"}})],1)],1),r("el-col",{attrs:{span:6}},[r("el-form-item",[r("span",{attrs:{slot:"label"},slot:"label"},[t._v(" ")]),r("el-checkbox",{staticStyle:{"margin-right":"20px"},model:{value:t.messageRecord.retain,callback:function(e){t.$set(t.messageRecord,"retain",e)},expression:"messageRecord.retain"}},[t._v("Retain")]),r("el-button",{staticClass:"conn-btn",staticStyle:{float:"right"},attrs:{type:"primary",size:"small"},on:{click:t._doPublish}},[t._v("\n "+t._s(t.$t("Tools.publish"))+"\n ")])],1)],1)],1)],1)],1),r("el-row",{attrs:{gutter:20}},[r("el-col",{attrs:{span:12}},[r("div",{staticClass:"message-btn"},[t._v("\n "+t._s(t.$t("Tools.received"))+"\n "),r("i",{staticClass:"icon el-icon-refresh",attrs:{title:t.$t("Tools.clear")},on:{click:function(e){t.messageIn=[]}}})]),r("el-table",{staticClass:"list-table",staticStyle:{"margin-top":"10px"},attrs:{data:t.messageIn,"max-height":"400px"}},[r("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"topic",label:"Topic","min-width":"120px"}}),r("el-table-column",{attrs:{prop:"qos",label:"QoS",width:"80px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[t._v(" "+t._s(r.qos)+" "+t._s(r.retain?" Retain":"")+" ")]}}])}),r("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"payload",label:"Payload","min-width":"180px"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("code",[t._v(t._s(n.payload))])]}}])}),r("el-table-column",{attrs:{prop:"createAt",label:t.$t("Tools.time")}})],1)],1),r("el-col",{attrs:{span:12}},[r("div",{staticClass:"message-btn"},[t._v("\n "+t._s(t.$t("Tools.published"))+"\n "),r("i",{staticClass:"icon el-icon-refresh",attrs:{title:t.$t("Tools.clear")},on:{click:function(e){t.messageOut=[]}}})]),r("el-table",{staticClass:"list-table",staticStyle:{"margin-top":"10px"},attrs:{data:t.messageOut,"max-height":"400px"}},[r("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"topic",label:"Topic","min-width":"120px"}}),r("el-table-column",{attrs:{prop:"qos",label:"QoS",width:"80px"},scopedSlots:t._u([{key:"default",fn:function(e){var r=e.row;return[t._v(" "+t._s(r.qos)+" "+t._s(r.retain?" Retain":"")+" ")]}}])}),r("el-table-column",{attrs:{"show-overflow-tooltip":"",prop:"payload",label:"Payload","min-width":"180px"},scopedSlots:t._u([{key:"default",fn:function(e){var n=e.row;return[r("code",[t._v(t._s(n.payload))])]}}])}),r("el-table-column",{attrs:{prop:"createAt",label:t.$t("Tools.time")}})],1)],1)],1)],1)],1)}),s=[],a=r("cebc"),c=(r("6762"),r("2fdb"),r("96cf"),r("3b8d")),l=(r("f559"),r("c5f6"),r("e7fc")),u=r.n(l),p=r("c1df"),h=r.n(p),f={name:"WebSocketItem",components:{},props:{messageCount:{type:Number,default:0}},data:function(){return{times:0,maxTims:4,connecting:!1,messageRecordRules:{topic:{required:!0,message:this.$t("Tools.pleaseEnter")}},stateIcon:{0:"el-icon-message",1:"el-icon-loading",3:"el-icon-warning"},connectionRules:{host:{required:!0},port:[{type:"number",required:!0,message:this.$t("Tools.pleaseEnter")},{type:"number",min:1,max:65535,message:this.$t("Tools.rangeError")}],keepalive:[{type:"number",required:!0,message:this.$t("Tools.pleaseEnter")},{type:"number",min:0,message:this.$t("Tools.rangeError")}]},subscriptionsRules:{topic:[{required:!0,message:this.$t("Tools.pleaseEnter")}]},client:{reconnecting:!1},connection:{host:this.getOption().host,port:this.getOption().port,protocols:this.getOption().protocols,clientId:this.getOption().clientId,ssl:this.getOption().ssl,endpoint:"/mqtt",username:"",password:"",keepalive:60,clean:!0,reconnectPeriod:4e3,connectTimeout:4e3,will:{topic:"",payload:"",qos:0,retain:!1}},messageRecord:{topic:"testtopic/1",qos:0,payload:'{ "msg": "hello" }',retain:!1},subscriptionsRecord:{topic:"testtopic/#",qos:0},subscriptions:[],messageIn:[],messageOut:[],activeIndex:"0",sessions:[]}},computed:{btnStatusText:function(){var t=this.$t("Tools.connect");return this.client.connected?t=this.$t("Tools.disconnect"):this.client.connecting&&(t=this.$t("Tools.inConnection")),t},connectUrl:function(){var t=this.connection,e=t.host,r=t.port,n=t.ssl,o=t.endpoint,i=n?"wss://":"ws://";return"".concat(i).concat(e,":").concat(r).concat(o.startsWith("/")?"":"/").concat(o)}},beforeDestroy:function(){this.destroyConnection()},methods:{addMessages:function(t,e){var r=5e3;this[t].unshift(e),this[t].length>r&&this[t].pop()},getNow:function(){return h()().format("HH:mm:ss")},onMessage:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n={out:!1,createAt:this.getNow(),topic:t,payload:e.toString(),qos:r.qos,retain:r.retain};this.addMessages("messageIn",n);var o=this.messageCount;this.$emit("update:messageCount",o+=1)},handleConnect:function(){this.client.connected?this.client.end():this.createConnection()},destroyConnection:function(){if(this.client.connected||this.connecting)try{this.connecting=!1,this.times=0,this.client.end(),this.$notify({title:this.$t("Tools.disconnected"),message:"",type:"success"}),this.connecting=!1}catch(t){this.$message.error(t.toString())}},_doUnSubscribe:function(t){var e=this;this.client.connected?this.client.unsubscribe(t.topic,function(r){r||(e.subscriptions=e.subscriptions.filter(function(e){return e.topic!==t.topic}))}):this.$message.error(this.$t("Tools.clientNotConnected"))},_doSubscribe:function(){var t=Object(c["a"])(regeneratorRuntime.mark(function t(){var e,r,n,o,i=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$refs.subForm.validate();case 2:if(e=t.sent,e){t.next=5;break}return t.abrupt("return");case 5:if(this.client.connected){t.next=8;break}return this.$message.error(this.$t("Tools.clientNotConnected")),t.abrupt("return");case 8:r=this.subscriptionsRecord,n=r.topic,o=r.qos,this.client.subscribe(n,{qos:o},function(t,e){var r=!1;e.forEach(function(t){[0,1,2].includes(t.qos)||(r=!0)}),t||r?i.$message.error(i.$t("Tools.subscriptionFailure")):i.subscriptions.find(function(t){return t.topic===n})||i.subscriptions.unshift({topic:n,qos:o,createAt:i.getNow()})});case 10:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),_doPublish:function(){var t=Object(c["a"])(regeneratorRuntime.mark(function t(){var e,r,n,o,i,s,a=this;return regeneratorRuntime.wrap(function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,this.$refs.pubForm.validate();case 2:if(e=t.sent,e){t.next=5;break}return t.abrupt("return");case 5:if(this.client.connected){t.next=8;break}return this.$message.error(this.$t("Tools.clientNotConnected")),t.abrupt("return");case 8:r=this.messageRecord,n=r.topic,o=r.qos,i=r.payload,s=r.retain,this.client.publish(n,i,{qos:o,retain:s},function(t){if(t)a.$message.error(a.$t("Tools.publishingFailure"));else{var e={out:!0,createAt:a.getNow(),topic:n,payload:i,qos:o,retain:s};a.addMessages("messageOut",e)}});case 10:case"end":return t.stop()}},t,this)}));function e(){return t.apply(this,arguments)}return e}(),_getDefaultConnection:function(){return Object(a["a"])({},this.getOption(),{endpoint:"/mqtt",username:"",password:"",keepalive:60,clean:!0,reconnectPeriod:4e3,connectTimeout:4e3,will:{topic:"",payload:"",qos:0,retain:!1}})},protocolsChange:function(){var t=this.connection,e=t.port,r=t.ssl;r||8084!==e?r&&8083===e&&(this.connection.port=8084):this.connection.port=8083},refreshClientId:function(){this.client.connected||(this.connection.clientId=this.getOption().clientId)},createConnection:function(){var t=this;if(this.client.connected)return this.connecting=!1,void(this.times=0);this.$refs.configForm.validate(function(e){if(e){var r=t.connection,n=r.clientId,o=r.username,i=r.port,s=r.password,a=r.reconnectPeriod,c=r.keepalive,l=r.clean,p=r.connectTimeout,h=r.will;t.connecting=!0,t.times=0;try{t.client=u.a.connect(t.connectUrl,{port:i,clientId:n,username:o,password:s,reconnectPeriod:a,keepalive:c,clean:l,connectTimeout:p,will:h.topic?h:void 0}),window.client=t.client,t.client.on("error",function(e){t.$message.error(e.toString()),t.connecting=!1;try{t.client.end()}catch(r){t.$message.error(r.toString())}}),t.client.on("reconnect",function(){t.times>t.maxTims&&(t.destroyConnection(),t.$message.error(t.$t("Tools.connectionDisconnected"))),t.connecting&&(t.times+=1)}),t.client.on("connect",function(){t.$notify({title:t.$t("Tools.connected"),message:"",type:"success"}),t.connecting=!1}),t.client.on("message",t.onMessage),t.client.on("reconnection",t.onMessage)}catch(f){t.connecting=!1,t.$message.error(f.toString())}}})},getOption:function(){var t=window.location,e=t.protocol,r=t.hostname;return{host:r,protocols:"http:"===e?"ws":"wss",port:"http:"===e?8083:8084,clientId:"mqttjs_".concat(Math.random().toString(16).substr(2,8)),ssl:"https:"===e}},atSessionChange:function(t){this.activeIndex=t;var e=this.sessions[t];e&&(this.client=e.client||{},this.connection=e.connection||{},this.messageRecord=e.messageRecord||{},this.subscriptionsRecord=e.subscriptionsRecord||{},this.subscriptions=e.subscriptions||[])},sessionChange:function(t){this.activeIndex=t}}},d=f,_=(r("d751"),r("2877")),m=Object(_["a"])(d,i,s,!1,null,null,null),b=m.exports,g={name:"WebSocket",components:{WebSocketItem:b},props:{},data:function(){return{activeTab:"0",tabs:[{name:"0",label:this.$t("Tools.defaultConnection"),messageCount:0}]}},watch:{activeTab:function(t,e){var r=this.tabs.find(function(e){return e.name===t}),n=this.tabs.find(function(t){return t.name===e});n&&(n.messageCount=0),r||(r.messageCount=0)}},methods:{handleBeforeLeave:function(t){return"add"!==t||(this.handleTabEdit("add"),!1)},handleTabEdit:function(t){var e=this;if("add"===t){if(this.tabs.length>6)return void this.$message.error(this.$t("Tools.maxSix"));var r=this.tabs.length.toString();this.tabs.push({name:r,label:this.$t("Tools.connectionName"),messageCount:0}),this.activeTab=r}else{var n=this.$refs[t]&&this.$refs[t][0];if(!n)return;n.client&&n.client.connected&&n.client.end(),this.tabs.forEach(function(r,n){if(r.name===t){var o=e.tabs[n+1]||e.tabs[n-1];o&&(e.activeTab=o.name)}}),this.tabs=this.tabs.filter(function(e){return e.name!==t})}}}},v=g,y=(r("6bc4"),Object(_["a"])(v,n,o,!1,null,null,null));e["default"]=y.exports},"18ec":function(t,e,r){"use strict";var n="razdwatrzy";t.exports=function(){return"function"===typeof n.contains&&(!0===n.contains("dwa")&&!1===n.contains("foo"))}},"1a94":function(t,e,r){"use strict";t.exports=function(t){if("function"!==typeof t)throw new TypeError(t+" is not a function");return t}},"1c4a":function(t,e,r){"use strict";t.exports=r("ba61")()?Symbol:r("94ee")},"1fad":function(t,e,r){"use strict";var n=r("51e9"),o=r("3fb5"),i=r("faa1").EventEmitter,s=r("a7c9"),a=r("b289");function c(t){if(!(this instanceof c))return new c(t);this.settings=t||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState()}o(c,i),c.prototype._resetState=function(){this.packet=new s,this.error=null,this._list=n(),this._stateCounter=0},c.prototype.parse=function(t){this.error&&this._resetState(),this._list.append(t);while((-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error)this._stateCounter++,this._stateCounter>=this._states.length&&(this._stateCounter=0);return this._list.length},c.prototype._parseHeader=function(){var t=this._list.readUInt8(0);return this.packet.cmd=a.types[t>>a.CMD_SHIFT],this.packet.retain=0!==(t&a.RETAIN_MASK),this.packet.qos=t>>a.QOS_SHIFT&a.QOS_MASK,this.packet.dup=0!==(t&a.DUP_MASK),this._list.consume(1),!0},c.prototype._parseLength=function(){var t=this._parseVarByteNum(!0);return t&&(this.packet.length=t.value,this._list.consume(t.bytes)),!!t},c.prototype._parsePayload=function(){var t=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._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 t},c.prototype._parseConnect=function(){var t,e,r,n,o,i,s={},c=this.packet;if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==t&&"MQIsdp"!==t)return this._emitError(new Error("Invalid protocolId"));if(c.protocolId=t,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(c.protocolVersion=this._list.readUInt8(this._pos),3!==c.protocolVersion&&4!==c.protocolVersion&&5!==c.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(s.username=this._list.readUInt8(this._pos)&a.USERNAME_MASK,s.password=this._list.readUInt8(this._pos)&a.PASSWORD_MASK,s.will=this._list.readUInt8(this._pos)&a.WILL_FLAG_MASK,s.will&&(c.will={},c.will.retain=0!==(this._list.readUInt8(this._pos)&a.WILL_RETAIN_MASK),c.will.qos=(this._list.readUInt8(this._pos)&a.WILL_QOS_MASK)>>a.WILL_QOS_SHIFT),c.clean=0!==(this._list.readUInt8(this._pos)&a.CLEAN_SESSION_MASK),this._pos++,c.keepalive=this._parseNum(),-1===c.keepalive)return this._emitError(new Error("Packet too short"));if(5===c.protocolVersion){var l=this._parseProperties();Object.getOwnPropertyNames(l).length&&(c.properties=l)}if(e=this._parseString(),null===e)return this._emitError(new Error("Packet too short"));if(c.clientId=e,s.will){if(5===c.protocolVersion){var u=this._parseProperties();Object.getOwnPropertyNames(u).length&&(c.will.properties=u)}if(r=this._parseString(),null===r)return this._emitError(new Error("Cannot parse will topic"));if(c.will.topic=r,n=this._parseBuffer(),null===n)return this._emitError(new Error("Cannot parse will payload"));c.will.payload=n}if(s.username){if(i=this._parseString(),null===i)return this._emitError(new Error("Cannot parse username"));c.username=i}if(s.password){if(o=this._parseBuffer(),null===o)return this._emitError(new Error("Cannot parse password"));c.password=o}return this.settings=c,c},c.prototype._parseConnack=function(){var t=this.packet;if(this._list.length<2)return null;if(t.sessionPresent=!!(this._list.readUInt8(this._pos++)&a.SESSIONPRESENT_MASK),5===this.settings.protocolVersion?t.reasonCode=this._list.readUInt8(this._pos++):t.returnCode=this._list.readUInt8(this._pos++),-1===t.returnCode||-1===t.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){var e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}},c.prototype._parsePublish=function(){var 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){var e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}t.payload=this._list.slice(this._pos,t.length)}},c.prototype._parseSubscribe=function(){var t,e,r,n,o,i,s,c=this.packet;if(1!==c.qos)return this._emitError(new Error("Wrong subscribe header"));if(c.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var l=this._parseProperties();Object.getOwnPropertyNames(l).length&&(c.properties=l)}while(this._pos=c.length)return this._emitError(new Error("Malformed Subscribe Payload"));e=this._parseByte(),r=e&a.SUBSCRIBE_OPTIONS_QOS_MASK,i=0!==(e>>a.SUBSCRIBE_OPTIONS_NL_SHIFT&a.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(e>>a.SUBSCRIBE_OPTIONS_RAP_SHIFT&a.SUBSCRIBE_OPTIONS_RAP_MASK),n=e>>a.SUBSCRIBE_OPTIONS_RH_SHIFT&a.SUBSCRIBE_OPTIONS_RH_MASK,s={topic:t,qos:r},5===this.settings.protocolVersion&&(s.nl=i,s.rap=o,s.rh=n),c.subscriptions.push(s)}}},c.prototype._parseSuback=function(){var t=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){var e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}while(this._pos2){t.reasonCode=this._parseByte();var e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}return!0},c.prototype._parseDisconnect=function(){var t=this.packet;if(5===this.settings.protocolVersion){t.reasonCode=this._parseByte();var e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(t.properties=e)}return!0},c.prototype._parseAuth=function(){var 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();var e=this._parseProperties();return Object.getOwnPropertyNames(e).length&&(t.properties=e),!0},c.prototype._parseMessageId=function(){var t=this.packet;return t.messageId=this._parseNum(),null!==t.messageId||(this._emitError(new Error("Cannot parse messageId")),!1)},c.prototype._parseString=function(t){var e,r=this._parseNum(),n=r+this._pos;return-1===r||n>this._list.length||n>this.packet.length?null:(e=this._list.toString("utf8",this._pos,n),this._pos+=r,e)},c.prototype._parseStringPair=function(){return{name:this._parseString(),value:this._parseString()}},c.prototype._parseBuffer=function(){var t,e=this._parseNum(),r=e+this._pos;return-1===e||r>this._list.length||r>this.packet.length?null:(t=this._list.slice(this._pos,r),this._pos+=e,t)},c.prototype._parseNum=function(){if(this._list.length-this._pos<2)return-1;var t=this._list.readUInt16BE(this._pos);return this._pos+=2,t},c.prototype._parse4ByteNum=function(){if(this._list.length-this._pos<4)return-1;var t=this._list.readUInt32BE(this._pos);return this._pos+=4,t},c.prototype._parseVarByteNum=function(t){var e,r=0,n=1,o=0,i=!0,s=this._pos?this._pos:0;while(r<5){if(e=this._list.readUInt8(s+r++),o+=n*(e&a.LENGTH_MASK),n*=128,0===(e&a.LENGTH_FIN_MASK))break;if(this._list.length<=r){i=!1;break}}return s&&(this._pos+=r),i=!!i&&(t?{bytes:r,value:o}:o),i},c.prototype._parseByte=function(){var t=this._list.readUInt8(this._pos);return this._pos++,t},c.prototype._parseByType=function(t){switch(t){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}},c.prototype._parseProperties=function(){var t=this._parseVarByteNum(),e=this._pos,r=e+t,n={};while(this._pos0){t=new Array(arguments.length-2);for(var e=0;e=0?l(u):o(this.length)-l(c(u)),e=u;ethis.length)&&(n=this.length),r>=this.length)return t||i.alloc(0);if(n<=0)return t||i.alloc(0);var o,s,a=!!t,c=this._offset(r),l=n-r,u=l,p=a&&e||0,h=c[1];if(0===r&&n==this.length){if(!a)return 1===this._bufs.length?this._bufs[0]:i.concat(this._bufs,this.length);for(s=0;so)){this._bufs[s].copy(t,p,h,h+u);break}this._bufs[s].copy(t,p,h),p+=o,u-=o,h&&(h=0)}return t},s.prototype.shallowSlice=function(t,e){t=t||0,e=e||this.length,t<0&&(t+=this.length),e<0&&(e+=this.length);var r=this._offset(t),n=this._offset(e),o=this._bufs.slice(r[0],n[0]+1);return 0==n[1]?o.pop():o[o.length-1]=o[o.length-1].slice(0,n[1]),0!=r[1]&&(o[0]=o[0].slice(r[1])),new s(o)},s.prototype.toString=function(t,e,r){return this.slice(e,r).toString(t)},s.prototype.consume=function(t){while(this._bufs.length){if(!(t>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(t),this.length-=t;break}t-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},s.prototype.duplicate=function(){for(var t=0,e=new s;t_)setTimeout(v,m,t,e,r);else{b&&"string"===typeof t&&(t=a.from(t,"utf8"));try{u.send(t)}catch(n){return r(n)}r()}}function y(t){u.close(),t()}function w(){l.setReadable(d),l.setWritable(d),l.emit("connect")}function S(){l.end(),l.destroy()}function k(t){l.destroy(t)}function I(t){var e=t.data;e=e instanceof ArrayBuffer?a.from(e):a.from(e,"utf8"),d.push(e)}function E(){u.close()}function x(t,e){for(var r=new Array(t.length),n=0;n65535||u%1!==0)return e.emit("error",new Error("Invalid keepalive")),!1;if(m+=2,m+=1,5===a){var b=B(e,_);m+=b.length}if(c){if("object"!==typeof c)return e.emit("error",new Error("Invalid will")),!1;if(!c.topic||"string"!==typeof c.topic)return e.emit("error",new Error("Invalid will topic")),!1;if(m+=o.byteLength(c.topic)+2,m+=2,c.payload){if(!(c.payload.length>=0))return e.emit("error",new Error("Invalid will payload")),!1;"string"===typeof c.payload?m+=o.byteLength(c.payload):m+=c.payload.length}var g={};5===a&&(g=B(e,c.properties),m+=g.length)}var v=!1;if(null!=h){if(!$(h))return e.emit("error",new Error("Invalid username")),!1;v=!0,m+=o.byteLength(h)+2}if(null!=f){if(!v)return e.emit("error",new Error("Username is required to use password")),!1;if(!$(f))return e.emit("error",new Error("Invalid password")),!1;m+=D(f)+2}e.write(n.CONNECT_HEADER),C(e,m),N(e,s),e.write(4===a?n.VERSION4:5===a?n.VERSION5:n.VERSION3);var y=0;return y|=null!=h?n.USERNAME_MASK:0,y|=null!=f?n.PASSWORD_MASK:0,y|=c&&c.retain?n.WILL_RETAIN_MASK:0,y|=c&&c.qos?c.qos<0&&d(e,h),null!=m&&m.write(),e.write(p)}function w(t,e,r){var i=r?r.protocolVersion:4,s=t||{},a=s.cmd||"puback",c=s.messageId,l=s.dup&&"pubrel"===a?n.DUP_MASK:0,u=0,p=s.reasonCode,h=s.properties,f=5===i?3:2;if("pubrel"===a&&(u=1),"number"!==typeof c)return e.emit("error",new Error("Invalid messageId")),!1;var _=null;if(5===i){if(_=U(e,h,r,f),!_)return!1;f+=_.length}return e.write(n.ACKS[a][u][l][0]),C(e,f),d(e,c),5===i&&e.write(o.from([p])),null!==_&&_.write(),!0}function S(t,e,r){var i=r?r.protocolVersion:4,s=t||{},a=s.dup?n.DUP_MASK:0,c=s.messageId,l=s.subscriptions,u=s.properties,p=0;if("number"!==typeof c)return e.emit("error",new Error("Invalid messageId")),!1;p+=2;var h=null;if(5===i&&(h=B(e,u),p+=h.length),"object"!==typeof l||!l.length)return e.emit("error",new Error("Invalid subscriptions")),!1;for(var f=0;f2)return e.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}p+=o.byteLength(_)+2+1}e.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),C(e,p),d(e,c),null!==h&&h.write();for(var y=!0,w=0;wi){var a=o.shift();if(!a||!e[a])return!1;delete e[a],s=B(t,e)}return s}function L(t,e,r){for(var i in C(t,r),e)if(e.hasOwnProperty(i)&&null!==e[i]){var s=e[i],a=n.propertiesTypes[i];switch(a){case"byte":t.write(o.from([n.properties[i]])),t.write(o.from([+s]));break;case"int8":t.write(o.from([n.properties[i]])),t.write(o.from([s]));break;case"binary":t.write(o.from([n.properties[i]])),N(t,s);break;case"int16":t.write(o.from([n.properties[i]])),d(t,s);break;case"int32":t.write(o.from([n.properties[i]])),q(t,s);break;case"var":t.write(o.from([n.properties[i]])),C(t,s);break;case"string":t.write(o.from([n.properties[i]])),A(t,s);break;case"pair":Object.getOwnPropertyNames(s).forEach(function(e){var r=s[e];Array.isArray(r)?r.forEach(function(r){t.write(o.from([n.properties[i]])),j(t,e.toString(),r.toString())}):(t.write(o.from([n.properties[i]])),j(t,e.toString(),r.toString()))});break;default:return t.emit("error",new Error("Invalid property "+i)),!1}}}function D(t){return t?t instanceof o?t.length:o.byteLength(t):0}function $(t){return"string"===typeof t||t instanceof o}t.exports=m},"724e":function(t,e,r){"use strict";t.exports=r("29b0")()?Number.isNaN:r("56c4")},7373:function(t,e,r){"use strict";var n=r("62c4"),o=Object.keys;t.exports=function(t){return o(n(t)?Object(t):t)}},"7bdf":function(t,e,r){"use strict";t.exports=r("ecf9")()?Object.keys:r("7373")},"7f0f":function(t,e,r){"use strict";var n=r("8707").Buffer,o=r("7135"),i=r("faa1").EventEmitter,s=r("3fb5");function a(t,e){var r=new c;return o(t,r,e),r.concat()}function c(){this._array=new Array(20),this._i=0}s(c,i),c.prototype.write=function(t){return this._array[this._i++]=t,!0},c.prototype.concat=function(){var t,e,r=0,o=new Array(this._array.length),i=this._array,s=0;for(t=0;t=55296&&g<=56319&&(S+=t[++r])),S=k?h.call(k,I,S,_):S,e?(f.value=S,d(m,_,f)):m[_]=S,++_;b=_}if(void 0===b)for(b=s(t.length),e&&(m=new e(b)),r=0;r0&&l>c&&(l=c);for(var u=0;u=0?(p=_.substr(0,m),h=_.substr(m+1)):(p=_,h=""),f=decodeURIComponent(p),d=decodeURIComponent(h),n(s,f)?o(s[f])?s[f].push(d):s[f]=[s[f],d]:s[f]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},"91e3":function(t,e,r){"use strict";var n=r("e9bd"),o=r("62c4"),i=r("692b1"),s=r("1c4a").iterator,a=Array.isArray;t.exports=function(t){return!!o(t)&&(!!a(t)||(!!i(t)||(!!n(t)||"function"===typeof t[s])))}},"94ee":function(t,e,r){"use strict";var n,o,i,s,a=r("f508"),c=r("b380"),l=Object.create,u=Object.defineProperties,p=Object.defineProperty,h=Object.prototype,f=l(null);if("function"===typeof Symbol){n=Symbol;try{String(n()),s=!0}catch(_){}}var d=function(){var t=l(null);return function(e){var r,n,o=0;while(t[e+(o||"")])++o;return e+=o||"",t[e]=!0,r="@@"+e,p(h,r,a.gs(null,function(t){n||(n=!0,p(this,r,a(t)),n=!1)})),r}}();i=function(t){if(this instanceof i)throw new TypeError("Symbol is not a constructor");return o(t)},t.exports=o=function t(e){var r;if(this instanceof t)throw new TypeError("Symbol is not a constructor");return s?n(e):(r=l(i.prototype),e=void 0===e?"":String(e),u(r,{__description__:a("",e),__name__:a("",d(e))}))},u(o,{for:a(function(t){return f[t]?f[t]:f[t]=o(String(t))}),keyFor:a(function(t){var e;for(e in c(t),f)if(f[e]===t)return e}),hasInstance:a("",n&&n.hasInstance||o("hasInstance")),isConcatSpreadable:a("",n&&n.isConcatSpreadable||o("isConcatSpreadable")),iterator:a("",n&&n.iterator||o("iterator")),match:a("",n&&n.match||o("match")),replace:a("",n&&n.replace||o("replace")),search:a("",n&&n.search||o("search")),species:a("",n&&n.species||o("species")),split:a("",n&&n.split||o("split")),toPrimitive:a("",n&&n.toPrimitive||o("toPrimitive")),toStringTag:a("",n&&n.toStringTag||o("toStringTag")),unscopables:a("",n&&n.unscopables||o("unscopables"))}),u(i.prototype,{constructor:a(o),toString:a("",function(){return this.__name__})}),u(o.prototype,{toString:a(function(){return"Symbol ("+c(this).__description__+")"}),valueOf:a(function(){return c(this)})}),p(o.prototype,o.toPrimitive,a("",function(){var t=c(this);return"symbol"===typeof t?t:t.toString()})),p(o.prototype,o.toStringTag,a("c","Symbol")),p(i.prototype,o.toStringTag,a("c",o.prototype[o.toStringTag])),p(i.prototype,o.toPrimitive,a("c",o.prototype[o.toPrimitive]))},"96ae":function(t,e,r){"use strict";var n=r("62c4");t.exports=function(t){if(!n(t))throw new TypeError("Cannot use null or undefined");return t}},"986b":function(t,e,r){"use strict";var n,o=r("d66f"),i=r("f3a6"),s=r("1a94"),a=r("4665"),c=r("1a94"),l=r("96ae"),u=Function.prototype.bind,p=Object.defineProperty,h=Object.prototype.hasOwnProperty;n=function(t,e,r){var n,i=l(e)&&c(e.value);return n=o(e),delete n.writable,delete n.value,n.get=function(){return!r.overwriteDefinition&&h.call(this,t)?i:(e.value=u.call(i,r.resolveContext?r.resolveContext(this):this),p(this,t,e),this[t])},n},t.exports=function(t){var e=i(arguments[1]);return null!=e.resolveContext&&s(e.resolveContext),a(t,function(t,r){return n(r,t,e)})}},"9c0f":function(t,e,r){"use strict";t.exports=function(t){return"function"===typeof t}},"9d88":function(t,e,r){(function(t,n){var o;/*! https://mths.be/punycode v1.4.1 by @mathias */(function(i){e&&e.nodeType,t&&t.nodeType;var s="object"==typeof n&&n;s.global!==s&&s.window!==s&&s.self;var a,c=2147483647,l=36,u=1,p=26,h=38,f=700,d=72,_=128,m="-",b=/^xn--/,g=/[^\x20-\x7E]/,v=/[\x2E\u3002\uFF0E\uFF61]/g,y={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},w=l-u,S=Math.floor,k=String.fromCharCode;function I(t){throw new RangeError(y[t])}function E(t,e){var r=t.length,n=[];while(r--)n[r]=e(t[r]);return n}function x(t,e){var r=t.split("@"),n="";r.length>1&&(n=r[0]+"@",t=r[1]),t=t.replace(v,".");var o=t.split("."),i=E(o,e).join(".");return n+i}function O(t){var e,r,n=[],o=0,i=t.length;while(o=55296&&e<=56319&&o65535&&(t-=65536,e+=k(t>>>10&1023|55296),t=56320|1023&t),e+=k(t),e}).join("")}function T(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:l}function C(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function A(t,e,r){var n=0;for(t=r?S(t/f):t>>1,t+=S(t/e);t>w*p>>1;n+=l)t=S(t/w);return S(n+(w+1)*t/(t+h))}function j(t){var e,r,n,o,i,s,a,h,f,b,g=[],v=t.length,y=0,w=_,k=d;for(r=t.lastIndexOf(m),r<0&&(r=0),n=0;n=128&&I("not-basic"),g.push(t.charCodeAt(n));for(o=r>0?r+1:0;o=v&&I("invalid-input"),h=T(t.charCodeAt(o++)),(h>=l||h>S((c-y)/s))&&I("overflow"),y+=h*s,f=a<=k?u:a>=k+p?p:a-k,hS(c/b)&&I("overflow"),s*=b}e=g.length+1,k=A(y-i,e,0==i),S(y/e)>c-w&&I("overflow"),w+=S(y/e),y%=e,g.splice(y++,0,w)}return P(g)}function R(t){var e,r,n,o,i,s,a,h,f,b,g,v,y,w,E,x=[];for(t=O(t),v=t.length,e=_,r=0,i=d,s=0;s=e&&gS((c-r)/y)&&I("overflow"),r+=(a-e)*y,e=a,s=0;sc&&I("overflow"),g==e){for(h=r,f=l;;f+=l){if(b=f<=i?u:f>=i+p?p:f-i,h=55296&&m<=56319&&(_+=t[++f])),c.call(e,b,_,p),h)break}else l.call(t,function(t){return c.call(e,b,t,p),h})}},c4c7:function(t,e,r){"use strict";(function(e){var n,o,i,s=r("e372").Transform,a=r("fb12"),c=r("1fb5"),l=!1;function u(){var t=new s;return t._write=function(t,e,r){n.sendSocketMessage({data:t.buffer,success:function(){r()},fail:function(){r(new Error)}})},t._flush=function(t){n.closeSocket({success:function(){t()}})},t}function p(t){t.hostname||(t.hostname="localhost"),t.path||(t.path="/"),t.wsOptions||(t.wsOptions={})}function h(t,e){var r="alis"===t.protocol?"wss":"ws",n=r+"://"+t.hostname+t.path;return t.port&&80!==t.port&&443!==t.port&&(n=r+"://"+t.hostname+":"+t.port+t.path),"function"===typeof t.transformWsUrl&&(n=t.transformWsUrl(n,t,e)),n}function f(){l||(l=!0,n.onSocketOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),n.onSocketMessage(function(t){if("string"===typeof t.data){var r=c.toByteArray(t.data),n=e.from(r);o.push(n)}else{var i=new FileReader;i.addEventListener("load",function(){var t=i.result;t=t instanceof ArrayBuffer?e.from(t):e.from(t,"utf8"),o.push(t)}),i.readAsArrayBuffer(t.data)}}),n.onSocketClose(function(){i.end(),i.destroy()}),n.onSocketError(function(t){i.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 r="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";p(e);var s=h(e,t);return n=e.my,n.connectSocket({url:s,protocols:r}),o=u(),i=a.obj(),f(),i}t.exports=d}).call(this,r("b639").Buffer)},c5f4:function(t,e,r){"use strict";var n=r("bae6"),o=Math.abs,i=Math.floor;t.exports=function(t){return isNaN(t)?0:(t=Number(t),0!==t&&isFinite(t)?n(t)*i(o(t)):t)}},c682:function(t,e,r){"use strict";t.exports=r("5a5c")("key","value","key+value")},c9fc:function(t,e,r){"use strict";var n,o,i,s,a,c,l,u=r("f508"),p=r("1a94"),h=Function.prototype.apply,f=Function.prototype.call,d=Object.create,_=Object.defineProperty,m=Object.defineProperties,b=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};n=function(t,e){var r;return p(e),b.call(this,"__ee__")?r=this.__ee__:(r=g.value=d(null),_(this,"__ee__",g),g.value=null),r[t]?"object"===typeof r[t]?r[t].push(e):r[t]=[r[t],e]:r[t]=e,this},o=function(t,e){var r,o;return p(e),o=this,n.call(this,t,r=function(){i.call(o,t,r),h.call(e,this,arguments)}),r.__eeOnceListener__=e,this},i=function(t,e){var r,n,o,i;if(p(e),!b.call(this,"__ee__"))return this;if(r=this.__ee__,!r[t])return this;if(n=r[t],"object"===typeof n)for(i=0;o=n[i];++i)o!==e&&o.__eeOnceListener__!==e||(2===n.length?r[t]=n[i?0:1]:n.splice(i,1));else n!==e&&n.__eeOnceListener__!==e||delete r[t];return this},s=function(t){var e,r,n,o,i;if(b.call(this,"__ee__")&&(o=this.__ee__[t],o))if("object"===typeof o){for(r=arguments.length,i=new Array(r-1),e=1;ei.properties.topicAliasMaximum||!i.properties.topicAliasMaximum&&r.properties.topicAlias))&&delete o.properties.topicAlias),r.qos){case 1:case 2:this.outgoing[o.messageId]={volatile:!1,cb:n||y},this._storeProcessing?(this._packetIdsDuringStoreProcessing[o.messageId]=!1,this._storePacket(o,void 0,r.cbStorePut)):this._sendPacket(o,void 0,r.cbStorePut);break;default:this._storeProcessing?this._storePacket(o,n,r.cbStorePut):this._sendPacket(o,n,r.cbStorePut);break}return this},w.prototype.subscribe=function(){for(var t,e=new Array(arguments.length),r=0;r0){var e={qos:t.qos};5===f&&(e.nl=t.nl||!1,e.rap=t.rap||!1,e.rh=t.rh||0,e.properties=t.properties),l._resubscribeTopics[t.topic]=e,_.push(t.topic)}}),l.messageIdToTopic[t.messageId]=_}return this.outgoing[t.messageId]={volatile:!0,cb:function(t,e){if(!t)for(var r=e.granted,n=0;n0?this.once("outgoingEmpty",setTimeout.bind(null,i,10)):i(),this)},w.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},w.prototype.reconnect=function(t){var e=this,r=function(){t?(e.options.incomingStore=t.incomingStore,e.options.outgoingStore=t.outgoingStore):(e.options.incomingStore=null,e.options.outgoingStore=null),e.incomingStore=e.options.incomingStore||new i,e.outgoingStore=e.options.outgoingStore||new i,e.disconnecting=!1,e.disconnected=!1,e._deferredReconnect=null,e._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=r:r(),this},w.prototype._reconnect=function(){this.emit("reconnect"),this._setupStream()},w.prototype._setupReconnect=function(){var t=this;!t.disconnecting&&!t.reconnectTimer&&t.options.reconnectPeriod>0&&(this.reconnecting||(this.emit("offline"),this.reconnecting=!0),t.reconnectTimer=setInterval(function(){t._reconnect()},t.options.reconnectPeriod))},w.prototype._clearReconnect=function(){this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},w.prototype._cleanUp=function(t,e){var r=arguments[2];if(e&&this.stream.on("close",e),t)0===this.options.reconnectPeriod&&this.options.clean&&b(this.outgoing),this.stream.destroy();else{var n=p({cmd:"disconnect"},r);this._sendPacket(n,h.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(this._clearReconnect(),this._setupReconnect()),null!==this.pingTimer&&(this.pingTimer.clear(),this.pingTimer=null),e&&!this.connected&&(this.stream.removeListener("close",e),e())},w.prototype._sendPacket=function(t,e,r){if(r=r||y,this.connected){switch(this._shiftPingInterval(),t.cmd){case"publish":break;case"pubrel":return void v(this,t,e,r);default:return void m(this,t,e)}switch(t.qos){case 2:case 1:v(this,t,e,r);break;case 0:default:m(this,t,e);break}}else this._storePacket(t,e,r)},w.prototype._storePacket=function(t,e,r){r=r||y,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);r()})):e&&e(new Error("No connection to broker"))},w.prototype._setupPingTimer=function(){var t=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=l(function(){t._checkPing()},1e3*this.options.keepalive))},w.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(1e3*this.options.keepalive)},w.prototype._checkPing=function(){this.pingResp?(this.pingResp=!1,this._sendPacket({cmd:"pingreq"})):this._cleanUp(!0)},w.prototype._handlePingresp=function(){this.pingResp=!0},w.prototype._handleConnack=function(t){var e=this.options,r=e.protocolVersion,n=5===r?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===n)this.reconnecting=!1,this._onConnect(t);else if(n>0){var o=new Error("Connection refused: "+d[n]);o.code=n,this.emit("error",o)}},w.prototype._handlePublish=function(t,e){e="undefined"!==typeof e?e:y;var r=t.topic.toString(),n=t.payload,o=t.qos,i=t.messageId,s=this,a=this.options,c=[0,16,128,131,135,144,145,151,153];switch(o){case 2:a.customHandleAcks(r,n,t,function(r,n){return r instanceof Error||(n=r,r=null),r?s.emit("error",r):-1===c.indexOf(n)?s.emit("error",new Error("Wrong reason code for pubrec")):void(n?s._sendPacket({cmd:"pubrec",messageId:i,reasonCode:n},e):s.incomingStore.put(t,function(){s._sendPacket({cmd:"pubrec",messageId:i},e)}))});break;case 1:a.customHandleAcks(r,n,t,function(o,a){return o instanceof Error||(a=o,o=null),o?s.emit("error",o):-1===c.indexOf(a)?s.emit("error",new Error("Wrong reason code for puback")):(a||s.emit("message",r,n,t),void s.handleMessage(t,function(t){if(t)return e&&e(t);s._sendPacket({cmd:"puback",messageId:i,reasonCode:a},e)}))});break;case 0:this.emit("message",r,n,t),this.handleMessage(t,e);break;default:break}},w.prototype.handleMessage=function(t,e){e()},w.prototype._handleAck=function(t){var e,r=t.messageId,n=t.cmd,o=null,i=this.outgoing[r]?this.outgoing[r].cb:null,s=this;if(i){switch(n){case"pubcomp":case"puback":var a=t.reasonCode;a&&a>0&&16!==a&&(e=new Error("Publish error: "+d[a]),e.code=a,i(e,t)),delete this.outgoing[r],this.outgoingStore.del(t,i);break;case"pubrec":o={cmd:"pubrel",qos:2,messageId:r};var c=t.reasonCode;c&&c>0&&16!==c?(e=new Error("Publish error: "+d[c]),e.code=c,i(e,t)):this._sendPacket(o);break;case"suback":delete this.outgoing[r];for(var l=0;l0)if(this.options.resubscribe)if(5===this.options.protocolVersion)for(var r=0;r0?1:-1}},f0cb:function(t,e,r){"use strict";var n=r("8707").Buffer,o=65536,i={};function s(t){var e=n.allocUnsafe(2);return e.writeUInt8(t>>8,0),e.writeUInt8(255&t,1),e}function a(){for(var t=0;t=0&&t<128?1:t>=128&&t<16384?2:t>=16384&&t<2097152?3:t>=2097152&&t<268435456?4:0}function l(t){var e=0,r=0,o=c(t),i=n.allocUnsafe(o);do{e=t%128|0,t=t/128|0,t>0&&(e|=128),i.writeUInt8(e,r++)}while(t>0);return{data:i,length:o}}function u(t){var e=n.allocUnsafe(4);return e.writeUInt32BE(t,0),e}t.exports={cache:i,generateCache:a,generateNumber:s,genBufVariableByteInt:l,generate4ByteBuffer:u}},f3a6:function(t,e,r){"use strict";var n=r("62c4"),o=Array.prototype.forEach,i=Object.create,s=function(t,e){var r;for(r in t)e[r]=t[r]};t.exports=function(t){var e=i(null);return o.call(arguments,function(t){n(t)&&s(Object(t),e)}),e}},f508:function(t,e,r){"use strict";var n,o=r("2031"),i=r("f3a6"),s=r("9c0f"),a=r("f973");n=t.exports=function(t,e){var r,n,s,c,l;return arguments.length<2||"string"!==typeof t?(c=e,e=t,t=null):c=arguments[2],null==t?(r=s=!0,n=!1):(r=a.call(t,"c"),n=a.call(t,"e"),s=a.call(t,"w")),l={value:e,configurable:r,enumerable:n,writable:s},c?o(i(c),l):l},n.gs=function(t,e,r){var n,c,l,u;return"string"!==typeof t?(l=r,r=e,e=t,t=null):l=arguments[3],null==e?e=void 0:s(e)?null==r?r=void 0:s(r)||(l=r,r=void 0):(l=e,e=r=void 0),null==t?(n=!0,c=!1):(n=a.call(t,"c"),c=a.call(t,"e")),u={get:e,set:r,configurable:n,enumerable:c},l?o(i(l),u):u}},f60e:function(t,e,r){"use strict";var n=r("7bdf"),o=r("96ae"),i=Math.max;t.exports=function(t,e){var r,s,a,c=i(arguments.length,2);for(t=Object(o(t)),a=function(n){try{t[n]=e[n]}catch(o){r||(r=o)}},s=1;s-1}},f973:function(t,e,r){"use strict";t.exports=r("18ec")()?String.prototype.contains:r("f967")},f9c1:function(t,e){function r(t){var e=t._readableState;return e?e.objectMode?t.read():t.read(n(e)):null}function n(t){return t.buffer.length?t.buffer.head?t.buffer.head.data.length:t.buffer[0].length:t.length}t.exports=r},fb12:function(t,e,r){(function(e,n){var o=r("e372"),i=r("ab52"),s=r("3fb5"),a=r("f9c1"),c=e.from&&e.from!==Uint8Array.from?e.from([0]):new e([0]),l=function(t,e){t._corked?t.once("uncork",e):e()},u=function(t,e){t._autoDestroy&&t.destroy(e)},p=function(t,e){return function(r){r?u(t,"premature close"===r.message?null:r):e&&!t._ended&&t.end()}},h=function(t,e){return t?t._writableState&&t._writableState.finished?e():t._writableState?t.end(e):(t.end(),void e()):e()},f=function(t){return new o.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},d=function(t,e,r){if(!(this instanceof d))return new d(t,e,r);o.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||!1!==r.autoDestroy,this._forwardDestroy=!r||!1!==r.destroy,this._forwardEnd=!r||!1!==r.end,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};s(d,o.Duplex),d.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new d(t,e,r)},d.prototype.cork=function(){1===++this._corked&&this.emit("cork")},d.prototype.uncork=function(){this._corked&&0===--this._corked&&this.emit("uncork")},d.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed)t&&t.destroy&&t.destroy();else if(null!==t&&!1!==t){var e=this,r=i(t,{writable:!0,readable:!1},p(this,this._forwardEnd)),o=function(){var t=e._ondrain;e._ondrain=null,t&&t()},s=function(){e._writable.removeListener("drain",o),r()};this._unwrite&&n.nextTick(o),this._writable=t,this._writable.on("drain",o),this._unwrite=s,this.uncork()}else this.end()},d.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed)t&&t.destroy&&t.destroy();else{if(null===t||!1===t)return this.push(null),void this.resume();var e=this,r=i(t,{writable:!1,readable:!0},p(this)),n=function(){e._forward()},o=function(){e.push(null)},s=function(){e._readable2.removeListener("readable",n),e._readable2.removeListener("end",o),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:f(t),this._readable2.on("readable",n),this._readable2.on("end",o),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;n.nextTick(function(){e._destroy(t)})}},d.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},d.prototype._write=function(t,e,r){return this.destroyed?r():this._corked?l(this,this._write.bind(this,t,e,r)):t===c?this._finish(r):this._writable?void(!1===this._writable.write(t)?this._ondrain=r:r()):r()},d.prototype._finish=function(t){var e=this;this.emit("preend"),l(this,function(){h(e._forwardEnd&&e._writable,function(){!1===e._writableState.prefinished&&(e._writableState.prefinished=!0),e.emit("prefinish"),l(e,t)})})},d.prototype.end=function(t,e,r){return"function"===typeof t?this.end(null,null,t):"function"===typeof e?this.end(t,null,e):(this._ended=!0,t&&this.write(t),this._writableState.ending||this.write(c),o.Writable.prototype.end.call(this,r))},t.exports=d}).call(this,r("b639").Buffer,r("f28c"))},fcb9:function(t,e,r){"use strict";(function(e){var n=r("553e"),o=r("0b16"),i=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],s="browser"===e.title;function a(t,e){var r=t.protocol+"://"+t.hostname+":"+t.port+t.path;return"function"===typeof t.transformWsUrl&&(r=t.transformWsUrl(r,t,e)),r}function 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={}),s||"wss"!==t.protocol||i.forEach(function(e){t.hasOwnProperty(e)&&!t.wsOptions.hasOwnProperty(e)&&(t.wsOptions[e]=t[e])})}function l(t,e){var r="MQIsdp"===e.protocolId&&3===e.protocolVersion?"mqttv3.1":"mqtt";c(e);var o=a(e,t);return n(o,[r],e.wsOptions)}function u(t,e){return l(t,e)}function p(t,e){if(e.hostname||(e.hostname=e.host),!e.hostname){if("undefined"===typeof document)throw new Error("Could not determine host. Specify host manually.");var r=o.parse(document.URL);e.hostname=r.hostname,e.port||(e.port=r.port)}return l(t,e)}t.exports=s?p:u}).call(this,r("f28c"))},fe3c:function(t,e,r){"use strict";var n=r(6);function o(t,e){var r;function o(n){e.rejectUnauthorized&&t.emit("error",n),r.end()}return e.port=e.port||8883,e.host=e.hostname||e.host||"localhost",e.rejectUnauthorized=!1!==e.rejectUnauthorized,delete e.path,r=n.connect(e),r.on("secureConnect",function(){e.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",o)}),r.on("error",o),r}t.exports=o}}]);