import{$ as ur,$a as ut,A as We,C as He,Ca as et,Ga as tt,Ia as it,La as nt,O as nr,P as or,Pa as ot,S as sr,Sa as st,T as ar,U as lr,Ua as at,V as Ve,Xa as lt,_ as qe,aa as Tt,bb as ct,ca as Ke,da as cr,db as ht,e as Ue,fa as hr,fb as ft,ga as fr,ha as pr,hb as pt,ia as dr,j as tr,ja as gr,jb as dt,ka as mr,kb as yr,la as Qe,n as rr,pa as Ge,ra as Ye,ta as $e,u as je,ua as Je,v as ze,wa as Xe,ya as Ze,z as ir}from"./chunk-WD6SV3WH.js";import{Ab as Jt,Bb as Xt,Cb as Zt,Db as Et,Eb as we,Fb as Ee,Fe as xt,Gb as er,Ge as Ne,He as It,I as Wt,J as Ht,Jb as Se,K as Vt,Ka as pe,Le as De,Nf as rt,Oa as be,Ta as Ce,Va as _e,X as qt,Y as Kt,Za as Gt,a as _t,b as bt,c as mt,cc as St,dc as Ct,f as ei,gb as ge,h as Lt,ha as Qt,hb as de,hf as Le,ib as ke,ja as Mt,k as Re,ka as Ot,l as Ft,lf as Fe,m as Ut,mb as Yt,n as jt,na as ve,nc as Te,o as Pt,p as zt,qb as Ae,sa as Rt,sb as Be,ta as kt,tb as wt,ub as vt,vb as $t}from"./chunk-VDRVUQCF.js";var Nt=ei((Xr,Bt)=>{"use strict";(function(se){if(typeof Xr=="object"&&typeof Bt<"u")Bt.exports=se();else if(typeof define=="function"&&define.amd)define([],se);else{var ae;typeof window<"u"?ae=window:typeof global<"u"?ae=global:typeof self<"u"?ae=self:ae=this,ae.mqtt=se()}})(function(){var se,ae,me;return function(){function m(P,v,p){function f(o,i){if(!v[o]){if(!P[o]){var r=typeof mt=="function"&&mt;if(!i&&r)return r(o,!0);if(y)return y(o,!0);var e=new Error("Cannot find module '"+o+"'");throw e.code="MODULE_NOT_FOUND",e}var t=v[o]={exports:{}};P[o][0].call(t.exports,function(s){var u=P[o][1][s];return f(u||s)},t,t.exports,m,P,v,p)}return v[o].exports}for(var y=typeof mt=="function"&&mt,c=0;c0)throw new Error("Invalid string. Length must be a multiple of 4");var E=_.indexOf("=");E===-1&&(E=h);var M=E===h?0:4-E%4;return[E,M]}function e(_){var h=r(_),E=h[0],M=h[1];return(E+M)*3/4-M}function t(_,h,E){return(h+E)*3/4-E}function s(_){var h,E=r(_),M=E[0],T=E[1],z=new y(t(_,M,T)),j=0,x=T>0?M-4:M,O;for(O=0;O>16&255,z[j++]=h>>8&255,z[j++]=h&255;return T===2&&(h=f[_.charCodeAt(O)]<<2|f[_.charCodeAt(O+1)]>>4,z[j++]=h&255),T===1&&(h=f[_.charCodeAt(O)]<<10|f[_.charCodeAt(O+1)]<<4|f[_.charCodeAt(O+2)]>>2,z[j++]=h>>8&255,z[j++]=h&255),z}function u(_){return p[_>>18&63]+p[_>>12&63]+p[_>>6&63]+p[_&63]}function d(_,h,E){for(var M,T=[],z=h;zx?x:j+z));return M===1?(h=_[E-1],T.push(p[h>>2]+p[h<<4&63]+"==")):M===2&&(h=(_[E-2]<<8)+_[E-1],T.push(p[h>>10]+p[h>>4&63]+p[h<<2&63]+"=")),T.join("")}},{}],2:[function(m,P,v){},{}],3:[function(m,P,v){(function(p){(function(){"use strict";var f=m("base64-js"),y=m("ieee754");v.Buffer=r,v.SlowBuffer=M,v.INSPECT_MAX_BYTES=50;var c=2147483647;v.kMaxLength=c,r.TYPED_ARRAY_SUPPORT=o(),!r.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var l=new Uint8Array(1);return l.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},l.foo()===42}catch{return!1}}Object.defineProperty(r.prototype,"parent",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.buffer}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){if(r.isBuffer(this))return this.byteOffset}});function i(l){if(l>c)throw new RangeError('The value "'+l+'" is invalid for option "size"');var n=new Uint8Array(l);return n.__proto__=r.prototype,n}function r(l,n,a){if(typeof l=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(l)}return e(l,n,a)}typeof Symbol<"u"&&Symbol.species!=null&&r[Symbol.species]===r&&Object.defineProperty(r,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),r.poolSize=8192;function e(l,n,a){if(typeof l=="string")return d(l,n);if(ArrayBuffer.isView(l))return g(l);if(l==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l);if(G(l,ArrayBuffer)||l&&G(l.buffer,ArrayBuffer))return _(l,n,a);if(typeof l=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var w=l.valueOf&&l.valueOf();if(w!=null&&w!==l)return r.from(w,n,a);var D=h(l);if(D)return D;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof l[Symbol.toPrimitive]=="function")return r.from(l[Symbol.toPrimitive]("string"),n,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof l)}r.from=function(l,n,a){return e(l,n,a)},r.prototype.__proto__=Uint8Array.prototype,r.__proto__=Uint8Array;function t(l){if(typeof l!="number")throw new TypeError('"size" argument must be of type number');if(l<0)throw new RangeError('The value "'+l+'" is invalid for option "size"')}function s(l,n,a){return t(l),l<=0?i(l):n!==void 0?typeof a=="string"?i(l).fill(n,a):i(l).fill(n):i(l)}r.alloc=function(l,n,a){return s(l,n,a)};function u(l){return t(l),i(l<0?0:E(l)|0)}r.allocUnsafe=function(l){return u(l)},r.allocUnsafeSlow=function(l){return u(l)};function d(l,n){if((typeof n!="string"||n==="")&&(n="utf8"),!r.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var a=T(l,n)|0,w=i(a),D=w.write(l,n);return D!==a&&(w=w.slice(0,D)),w}function g(l){for(var n=l.length<0?0:E(l.length)|0,a=i(n),w=0;w=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return l|0}function M(l){return+l!=l&&(l=0),r.alloc(+l)}r.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==r.prototype},r.compare=function(n,a){if(G(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),G(a,Uint8Array)&&(a=r.from(a,a.offset,a.byteLength)),!r.isBuffer(n)||!r.isBuffer(a))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===a)return 0;for(var w=n.length,D=a.length,K=0,J=Math.min(w,D);K2&&arguments[2]===!0;if(!w&&a===0)return 0;for(var D=!1;;)switch(n){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return te(l).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a*2;case"hex":return a>>>1;case"base64":return N(l).length;default:if(D)return w?-1:te(l).length;n=(""+n).toLowerCase(),D=!0}}r.byteLength=T;function z(l,n,a){var w=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((a===void 0||a>this.length)&&(a=this.length),a<=0)||(a>>>=0,n>>>=0,a<=n))return"";for(l||(l="utf8");;)switch(l){case"hex":return ee(this,n,a);case"utf8":case"utf-8":return S(this,n,a);case"ascii":return V(this,n,a);case"latin1":case"binary":return re(this,n,a);case"base64":return Y(this,n,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,n,a);default:if(w)throw new TypeError("Unknown encoding: "+l);l=(l+"").toLowerCase(),w=!0}}r.prototype._isBuffer=!0;function j(l,n,a){var w=l[n];l[n]=l[a],l[a]=w}r.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var a=0;aa&&(n+=" ... "),""},r.prototype.compare=function(n,a,w,D,K){if(G(n,Uint8Array)&&(n=r.from(n,n.offset,n.byteLength)),!r.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof n);if(a===void 0&&(a=0),w===void 0&&(w=n?n.length:0),D===void 0&&(D=0),K===void 0&&(K=this.length),a<0||w>n.length||D<0||K>this.length)throw new RangeError("out of range index");if(D>=K&&a>=w)return 0;if(D>=K)return-1;if(a>=w)return 1;if(a>>>=0,w>>>=0,D>>>=0,K>>>=0,this===n)return 0;for(var J=K-D,ue=w-a,ce=Math.min(J,ue),he=this.slice(D,K),ye=n.slice(a,w),fe=0;fe2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),a=+a,b(a)&&(a=D?0:l.length-1),a<0&&(a=l.length+a),a>=l.length){if(D)return-1;a=l.length-1}else if(a<0)if(D)a=0;else return-1;if(typeof n=="string"&&(n=r.from(n,w)),r.isBuffer(n))return n.length===0?-1:O(l,n,a,w,D);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?D?Uint8Array.prototype.indexOf.call(l,n,a):Uint8Array.prototype.lastIndexOf.call(l,n,a):O(l,[n],a,w,D);throw new TypeError("val must be string, number or Buffer")}function O(l,n,a,w,D){var K=1,J=l.length,ue=n.length;if(w!==void 0&&(w=String(w).toLowerCase(),w==="ucs2"||w==="ucs-2"||w==="utf16le"||w==="utf-16le")){if(l.length<2||n.length<2)return-1;K=2,J/=2,ue/=2,a/=2}function ce(Pe,Ie){return K===1?Pe[Ie]:Pe.readUInt16BE(Ie*K)}var he;if(D){var ye=-1;for(he=a;heJ&&(a=J-ue),he=a;he>=0;he--){for(var fe=!0,xe=0;xeD&&(w=D)):w=D;var K=n.length;w>K/2&&(w=K/2);for(var J=0;J>>0,isFinite(w)?(w=w>>>0,D===void 0&&(D="utf8")):(D=w,w=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var K=this.length-a;if((w===void 0||w>K)&&(w=K),n.length>0&&(w<0||a<0)||a>this.length)throw new RangeError("Attempt to write outside buffer bounds");D||(D="utf8");for(var J=!1;;)switch(D){case"hex":return C(this,n,a,w);case"utf8":case"utf-8":return H(this,n,a,w);case"ascii":return B(this,n,a,w);case"latin1":case"binary":return ne(this,n,a,w);case"base64":return oe(this,n,a,w);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ie(this,n,a,w);default:if(J)throw new TypeError("Unknown encoding: "+D);D=(""+D).toLowerCase(),J=!0}},r.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Y(l,n,a){return n===0&&a===l.length?f.fromByteArray(l):f.fromByteArray(l.slice(n,a))}function S(l,n,a){a=Math.min(l.length,a);for(var w=[],D=n;D239?4:K>223?3:K>191?2:1;if(D+ue<=a){var ce,he,ye,fe;switch(ue){case 1:K<128&&(J=K);break;case 2:ce=l[D+1],(ce&192)===128&&(fe=(K&31)<<6|ce&63,fe>127&&(J=fe));break;case 3:ce=l[D+1],he=l[D+2],(ce&192)===128&&(he&192)===128&&(fe=(K&15)<<12|(ce&63)<<6|he&63,fe>2047&&(fe<55296||fe>57343)&&(J=fe));break;case 4:ce=l[D+1],he=l[D+2],ye=l[D+3],(ce&192)===128&&(he&192)===128&&(ye&192)===128&&(fe=(K&15)<<18|(ce&63)<<12|(he&63)<<6|ye&63,fe>65535&&fe<1114112&&(J=fe))}}J===null?(J=65533,ue=1):J>65535&&(J-=65536,w.push(J>>>10&1023|55296),J=56320|J&1023),w.push(J),D+=ue}return L(w)}var A=4096;function L(l){var n=l.length;if(n<=A)return String.fromCharCode.apply(String,l);for(var a="",w=0;ww)&&(a=w);for(var D="",K=n;Kw&&(n=w),a<0?(a+=w,a<0&&(a=0)):a>w&&(a=w),aa)throw new RangeError("Trying to access beyond buffer length")}r.prototype.readUIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n],K=1,J=0;++J>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n+--a],K=1;a>0&&(K*=256);)D+=this[n+--a]*K;return D},r.prototype.readUInt8=function(n,a){return n=n>>>0,a||U(n,1,this.length),this[n]},r.prototype.readUInt16LE=function(n,a){return n=n>>>0,a||U(n,2,this.length),this[n]|this[n+1]<<8},r.prototype.readUInt16BE=function(n,a){return n=n>>>0,a||U(n,2,this.length),this[n]<<8|this[n+1]},r.prototype.readUInt32LE=function(n,a){return n=n>>>0,a||U(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},r.prototype.readUInt32BE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},r.prototype.readIntLE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=this[n],K=1,J=0;++J=K&&(D-=Math.pow(2,8*a)),D},r.prototype.readIntBE=function(n,a,w){n=n>>>0,a=a>>>0,w||U(n,a,this.length);for(var D=a,K=1,J=this[n+--D];D>0&&(K*=256);)J+=this[n+--D]*K;return K*=128,J>=K&&(J-=Math.pow(2,8*a)),J},r.prototype.readInt8=function(n,a){return n=n>>>0,a||U(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},r.prototype.readInt16LE=function(n,a){n=n>>>0,a||U(n,2,this.length);var w=this[n]|this[n+1]<<8;return w&32768?w|4294901760:w},r.prototype.readInt16BE=function(n,a){n=n>>>0,a||U(n,2,this.length);var w=this[n+1]|this[n]<<8;return w&32768?w|4294901760:w},r.prototype.readInt32LE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},r.prototype.readInt32BE=function(n,a){return n=n>>>0,a||U(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},r.prototype.readFloatLE=function(n,a){return n=n>>>0,a||U(n,4,this.length),y.read(this,n,!0,23,4)},r.prototype.readFloatBE=function(n,a){return n=n>>>0,a||U(n,4,this.length),y.read(this,n,!1,23,4)},r.prototype.readDoubleLE=function(n,a){return n=n>>>0,a||U(n,8,this.length),y.read(this,n,!0,52,8)},r.prototype.readDoubleBE=function(n,a){return n=n>>>0,a||U(n,8,this.length),y.read(this,n,!1,52,8)};function X(l,n,a,w,D,K){if(!r.isBuffer(l))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>D||nl.length)throw new RangeError("Index out of range")}r.prototype.writeUIntLE=function(n,a,w,D){if(n=+n,a=a>>>0,w=w>>>0,!D){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=1,ue=0;for(this[a]=n&255;++ue>>0,w=w>>>0,!D){var K=Math.pow(2,8*w)-1;X(this,n,a,w,K,0)}var J=w-1,ue=1;for(this[a+J]=n&255;--J>=0&&(ue*=256);)this[a+J]=n/ue&255;return a+w},r.prototype.writeUInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,255,0),this[a]=n&255,a+1},r.prototype.writeUInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeUInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,65535,0),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeUInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a+3]=n>>>24,this[a+2]=n>>>16,this[a+1]=n>>>8,this[a]=n&255,a+4},r.prototype.writeUInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,4294967295,0),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4},r.prototype.writeIntLE=function(n,a,w,D){if(n=+n,a=a>>>0,!D){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=0,ue=1,ce=0;for(this[a]=n&255;++J>0)-ce&255;return a+w},r.prototype.writeIntBE=function(n,a,w,D){if(n=+n,a=a>>>0,!D){var K=Math.pow(2,8*w-1);X(this,n,a,w,K-1,-K)}var J=w-1,ue=1,ce=0;for(this[a+J]=n&255;--J>=0&&(ue*=256);)n<0&&ce===0&&this[a+J+1]!==0&&(ce=1),this[a+J]=(n/ue>>0)-ce&255;return a+w},r.prototype.writeInt8=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,1,127,-128),n<0&&(n=255+n+1),this[a]=n&255,a+1},r.prototype.writeInt16LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n&255,this[a+1]=n>>>8,a+2},r.prototype.writeInt16BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,2,32767,-32768),this[a]=n>>>8,this[a+1]=n&255,a+2},r.prototype.writeInt32LE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),this[a]=n&255,this[a+1]=n>>>8,this[a+2]=n>>>16,this[a+3]=n>>>24,a+4},r.prototype.writeInt32BE=function(n,a,w){return n=+n,a=a>>>0,w||X(this,n,a,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[a]=n>>>24,this[a+1]=n>>>16,this[a+2]=n>>>8,this[a+3]=n&255,a+4};function $(l,n,a,w,D,K){if(a+w>l.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function le(l,n,a,w,D){return n=+n,a=a>>>0,D||$(l,n,a,4,34028234663852886e22,-34028234663852886e22),y.write(l,n,a,w,23,4),a+4}r.prototype.writeFloatLE=function(n,a,w){return le(this,n,a,!0,w)},r.prototype.writeFloatBE=function(n,a,w){return le(this,n,a,!1,w)};function Z(l,n,a,w,D){return n=+n,a=a>>>0,D||$(l,n,a,8,17976931348623157e292,-17976931348623157e292),y.write(l,n,a,w,52,8),a+8}r.prototype.writeDoubleLE=function(n,a,w){return Z(this,n,a,!0,w)},r.prototype.writeDoubleBE=function(n,a,w){return Z(this,n,a,!1,w)},r.prototype.copy=function(n,a,w,D){if(!r.isBuffer(n))throw new TypeError("argument should be a Buffer");if(w||(w=0),!D&&D!==0&&(D=this.length),a>=n.length&&(a=n.length),a||(a=0),D>0&&D=this.length)throw new RangeError("Index out of range");if(D<0)throw new RangeError("sourceEnd out of bounds");D>this.length&&(D=this.length),n.length-a=0;--J)n[J+a]=this[J+w];else Uint8Array.prototype.set.call(n,this.subarray(w,D),a);return K},r.prototype.fill=function(n,a,w,D){if(typeof n=="string"){if(typeof a=="string"?(D=a,a=0,w=this.length):typeof w=="string"&&(D=w,w=this.length),D!==void 0&&typeof D!="string")throw new TypeError("encoding must be a string");if(typeof D=="string"&&!r.isEncoding(D))throw new TypeError("Unknown encoding: "+D);if(n.length===1){var K=n.charCodeAt(0);(D==="utf8"&&K<128||D==="latin1")&&(n=K)}}else typeof n=="number"&&(n=n&255);if(a<0||this.length>>0,w=w===void 0?this.length:w>>>0,n||(n=0);var J;if(typeof n=="number")for(J=a;J55295&&a<57344){if(!D){if(a>56319){(n-=3)>-1&&K.push(239,191,189);continue}else if(J+1===w){(n-=3)>-1&&K.push(239,191,189);continue}D=a;continue}if(a<56320){(n-=3)>-1&&K.push(239,191,189),D=a;continue}a=(D-55296<<10|a-56320)+65536}else D&&(n-=3)>-1&&K.push(239,191,189);if(D=null,a<128){if((n-=1)<0)break;K.push(a)}else if(a<2048){if((n-=2)<0)break;K.push(a>>6|192,a&63|128)}else if(a<65536){if((n-=3)<0)break;K.push(a>>12|224,a>>6&63|128,a&63|128)}else if(a<1114112){if((n-=4)<0)break;K.push(a>>18|240,a>>12&63|128,a>>6&63|128,a&63|128)}else throw new Error("Invalid code point")}return K}function R(l){for(var n=[],a=0;a>8,D=a%256,K.push(D),K.push(w);return K}function N(l){return f.toByteArray(k(l))}function q(l,n,a,w){for(var D=0;D=n.length||D>=l.length);++D)n[D+a]=l[D];return D}function G(l,n){return l instanceof n||l!=null&&l.constructor!=null&&l.constructor.name!=null&&l.constructor.name===n.name}function b(l){return l!==l}}).call(this)}).call(this,m("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:5}],4:[function(m,P,v){"use strict";var p=typeof Reflect=="object"?Reflect:null,f=p&&typeof p.apply=="function"?p.apply:function(O,C,H){return Function.prototype.apply.call(O,C,H)},y;p&&typeof p.ownKeys=="function"?y=p.ownKeys:Object.getOwnPropertySymbols?y=function(O){return Object.getOwnPropertyNames(O).concat(Object.getOwnPropertySymbols(O))}:y=function(O){return Object.getOwnPropertyNames(O)};function c(x){console&&console.warn&&console.warn(x)}var o=Number.isNaN||function(O){return O!==O};function i(){i.init.call(this)}P.exports=i,P.exports.once=T,i.EventEmitter=i,i.prototype._events=void 0,i.prototype._eventsCount=0,i.prototype._maxListeners=void 0;var r=10;function e(x){if(typeof x!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof x)}Object.defineProperty(i,"defaultMaxListeners",{enumerable:!0,get:function(){return r},set:function(x){if(typeof x!="number"||x<0||o(x))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+x+".");r=x}}),i.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},i.prototype.setMaxListeners=function(O){if(typeof O!="number"||O<0||o(O))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+O+".");return this._maxListeners=O,this};function t(x){return x._maxListeners===void 0?i.defaultMaxListeners:x._maxListeners}i.prototype.getMaxListeners=function(){return t(this)},i.prototype.emit=function(O){for(var C=[],H=1;H0&&(oe=C[0]),oe instanceof Error)throw oe;var ie=new Error("Unhandled error."+(oe?" ("+oe.message+")":""));throw ie.context=oe,ie}var Y=ne[O];if(Y===void 0)return!1;if(typeof Y=="function")f(Y,this,C);else for(var S=Y.length,A=h(Y,S),H=0;H0&&oe.length>B&&!oe.warned){oe.warned=!0;var ie=new Error("Possible EventEmitter memory leak detected. "+oe.length+" "+String(O)+" listeners added. Use emitter.setMaxListeners() to increase limit");ie.name="MaxListenersExceededWarning",ie.emitter=x,ie.type=O,ie.count=oe.length,c(ie)}return x}i.prototype.addListener=function(O,C){return s(this,O,C,!1)},i.prototype.on=i.prototype.addListener,i.prototype.prependListener=function(O,C){return s(this,O,C,!0)};function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(x,O,C){var H={fired:!1,wrapFn:void 0,target:x,type:O,listener:C},B=u.bind(H);return B.listener=C,H.wrapFn=B,B}i.prototype.once=function(O,C){return e(C),this.on(O,d(this,O,C)),this},i.prototype.prependOnceListener=function(O,C){return e(C),this.prependListener(O,d(this,O,C)),this},i.prototype.removeListener=function(O,C){var H,B,ne,oe,ie;if(e(C),B=this._events,B===void 0)return this;if(H=B[O],H===void 0)return this;if(H===C||H.listener===C)--this._eventsCount===0?this._events=Object.create(null):(delete B[O],B.removeListener&&this.emit("removeListener",O,H.listener||C));else if(typeof H!="function"){for(ne=-1,oe=H.length-1;oe>=0;oe--)if(H[oe]===C||H[oe].listener===C){ie=H[oe].listener,ne=oe;break}if(ne<0)return this;ne===0?H.shift():E(H,ne),H.length===1&&(B[O]=H[0]),B.removeListener!==void 0&&this.emit("removeListener",O,ie||C)}return this},i.prototype.off=i.prototype.removeListener,i.prototype.removeAllListeners=function(O){var C,H,B;if(H=this._events,H===void 0)return this;if(H.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):H[O]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete H[O]),this;if(arguments.length===0){var ne=Object.keys(H),oe;for(B=0;B=0;B--)this.removeListener(O,C[B]);return this};function g(x,O,C){var H=x._events;if(H===void 0)return[];var B=H[O];return B===void 0?[]:typeof B=="function"?C?[B.listener||B]:[B]:C?M(B):h(B,B.length)}i.prototype.listeners=function(O){return g(this,O,!0)},i.prototype.rawListeners=function(O){return g(this,O,!1)},i.listenerCount=function(x,O){return typeof x.listenerCount=="function"?x.listenerCount(O):_.call(x,O)},i.prototype.listenerCount=_;function _(x){var O=this._events;if(O!==void 0){var C=O[x];if(typeof C=="function")return 1;if(C!==void 0)return C.length}return 0}i.prototype.eventNames=function(){return this._eventsCount>0?y(this._events):[]};function h(x,O){for(var C=new Array(O),H=0;H>1,u=-7,d=y?o-1:0,g=y?-1:1,_=p[f+d];for(d+=g,i=_&(1<<-u)-1,_>>=-u,u+=e;u>0;i=i*256+p[f+d],d+=g,u-=8);for(r=i&(1<<-u)-1,i>>=-u,u+=c;u>0;r=r*256+p[f+d],d+=g,u-=8);if(i===0)i=1-s;else{if(i===t)return r?NaN:(_?-1:1)*(1/0);r=r+Math.pow(2,c),i=i-s}return(_?-1:1)*r*Math.pow(2,i-c)},v.write=function(p,f,y,c,o,i){var r,e,t,s=i*8-o-1,u=(1<>1,g=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=c?0:i-1,h=c?1:-1,E=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(e=isNaN(f)?1:0,r=u):(r=Math.floor(Math.log(f)/Math.LN2),f*(t=Math.pow(2,-r))<1&&(r--,t*=2),r+d>=1?f+=g/t:f+=g*Math.pow(2,1-d),f*t>=2&&(r++,t/=2),r+d>=u?(e=0,r=u):r+d>=1?(e=(f*t-1)*Math.pow(2,o),r=r+d):(e=f*Math.pow(2,d-1)*Math.pow(2,o),r=0));o>=8;p[y+_]=e&255,_+=h,e/=256,o-=8);for(r=r<0;p[y+_]=r&255,_+=h,r/=256,s-=8);p[y+_-h]|=E*128}},{}],6:[function(m,P,v){(function(p,f){(function(){"use strict";let y=m("events").EventEmitter,c=m("./store"),o=m("./topic-alias-recv"),i=m("./topic-alias-send"),r=m("mqtt-packet"),e=m("./default-message-id-provider"),t=m("readable-stream").Writable,s=m("inherits"),u=m("reinterval"),d=m("rfdc/default"),g=m("./validations"),_=m("xtend"),h=m("debug")("mqttjs:client"),E=p?p.nextTick:function(S){setTimeout(S,0)},M=f.setImmediate||function(S){E(S)},T={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:30*1e3,clean:!0,resubscribe:!0},z=["ECONNREFUSED","EADDRINUSE","ECONNRESET","ENOTFOUND"],j={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 x(){return"mqttjs_"+Math.random().toString(16).substr(2,8)}function O(S,A){if(S.options.protocolVersion===5&&A.cmd==="publish"){let L;A.properties&&(L=A.properties.topicAlias);let V=A.topic.toString();if(S.topicAliasSend)if(L){if(V.length!==0&&(h("applyTopicAlias :: register topic: %s - alias: %d",V,L),!S.topicAliasSend.put(V,L)))return h("applyTopicAlias :: error out of range. topic: %s - alias: %d",V,L),new Error("Sending Topic Alias out of range")}else V.length!==0&&(S.options.autoAssignTopicAlias?(L=S.topicAliasSend.getAliasByTopic(V),L?(A.topic="",A.properties=bt(_t({},A.properties),{topicAlias:L}),h("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",V,L)):(L=S.topicAliasSend.getLruAlias(),S.topicAliasSend.put(V,L),A.properties=bt(_t({},A.properties),{topicAlias:L}),h("applyTopicAlias :: auto assign topic: %s - alias: %d",V,L))):S.options.autoUseTopicAlias&&(L=S.topicAliasSend.getAliasByTopic(V),L&&(A.topic="",A.properties=bt(_t({},A.properties),{topicAlias:L}),h("applyTopicAlias :: auto use topic: %s - alias: %d",V,L))));else if(L)return h("applyTopicAlias :: error out of range. topic: %s - alias: %d",V,L),new Error("Sending Topic Alias out of range")}}function C(S,A){let L;A.properties&&(L=A.properties.topicAlias);let V=A.topic.toString();if(V.length===0){if(typeof L>"u")return new Error("Unregistered Topic Alias");if(V=S.topicAliasSend.getTopicByAlias(L),typeof V>"u")return new Error("Unregistered Topic Alias");A.topic=V}L&&delete A.properties.topicAlias}function H(S,A,L){h("sendPacket :: packet: %O",A),h("sendPacket :: emitting `packetsend`"),S.emit("packetsend",A),h("sendPacket :: writing to stream");let V=r.writeToStream(A,S.stream,S.options);h("sendPacket :: writeToStream result %s",V),!V&&L&&L!==ie?(h("sendPacket :: handle events on `drain` once through callback."),S.stream.once("drain",L)):L&&(h("sendPacket :: invoking cb"),L())}function B(S){S&&(h("flush: queue exists? %b",!!S),Object.keys(S).forEach(function(A){typeof S[A].cb=="function"&&(S[A].cb(new Error("Connection closed")),delete S[A])}))}function ne(S){S&&(h("flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(S).forEach(function(A){S[A].volatile&&typeof S[A].cb=="function"&&(S[A].cb(new Error("Connection closed")),delete S[A])}))}function oe(S,A,L,V){h("storeAndSend :: store packet with cmd %s to outgoingStore",A.cmd);let re=A,ee;if(re.cmd==="publish"&&(re=d(A),ee=C(S,re),ee))return L&&L(ee);S.outgoingStore.put(re,function(U){if(U)return L&&L(U);V(),H(S,A,L)})}function ie(S){h("nop ::",S)}function Y(S,A){let L,V=this;if(!(this instanceof Y))return new Y(S,A);this.options=A||{};for(L in T)typeof this.options[L]>"u"?this.options[L]=T[L]:this.options[L]=A[L];h("MqttClient :: options.protocol",A.protocol),h("MqttClient :: options.protocolVersion",A.protocolVersion),h("MqttClient :: options.username",A.username),h("MqttClient :: options.keepalive",A.keepalive),h("MqttClient :: options.reconnectPeriod",A.reconnectPeriod),h("MqttClient :: options.rejectUnauthorized",A.rejectUnauthorized),h("MqttClient :: options.topicAliasMaximum",A.topicAliasMaximum),this.options.clientId=typeof A.clientId=="string"?A.clientId:x(),h("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=A.protocolVersion===5&&A.customHandleAcks?A.customHandleAcks:function(){arguments[3](0)},this.streamBuilder=S,this.messageIdProvider=typeof this.options.messageIdProvider>"u"?new e:this.options.messageIdProvider,this.outgoingStore=A.outgoingStore||new c,this.incomingStore=A.incomingStore||new c,this.queueQoSZero=A.queueQoSZero===void 0?!0:A.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._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,A.topicAliasMaximum>0&&(A.topicAliasMaximum>65535?h("MqttClient :: options.topicAliasMaximum is out of range"):this.topicAliasRecv=new o(A.topicAliasMaximum)),this.on("connect",function(){let re=this.queue;function ee(){let W=re.shift();h("deliver :: entry %o",W);let U=null;if(!W){V._resubscribe();return}U=W.packet,h("deliver :: call _sendPacket for %o",U);let X=!0;U.messageId&&U.messageId!==0&&(V.messageIdProvider.register(U.messageId)||(X=!1)),X?V._sendPacket(U,function($){W.cb&&W.cb($),ee()}):(h("messageId: %d has already used. The message is skipped and removed.",U.messageId),ee())}h("connect :: sending queued packets"),ee()}),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"),V.pingTimer!==null&&(V.pingTimer.clear(),V.pingTimer=null),this.topicAliasRecv&&this.topicAliasRecv.clear(),h("close :: calling _setupReconnect"),this._setupReconnect()}),y.call(this),h("MqttClient :: setting up stream"),this._setupStream()}s(Y,y),Y.prototype._setupStream=function(){let S=this,A=new t,L=r.parser(this.options),V=null,re=[];h("_setupStream :: calling method to clear reconnect"),this._clearReconnect(),h("_setupStream :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),L.on("packet",function($){h("parser :: on packet push to packets array."),re.push($)});function ee(){if(re.length)E(W);else{let $=V;V=null,$()}}function W(){h("work :: getting next packet in queue");let $=re.shift();if($)h("work :: packet pulled from queue"),S._handlePacket($,ee);else{h("work :: no packets in queue");let le=V;V=null,h("work :: done flag is %s",!!le),le&&le()}}A._write=function($,le,Z){V=Z,h("writable stream :: parsing buffer"),L.parse($),W()};function U($){h("streamErrorHandler :: error",$.message),z.includes($.code)?(h("streamErrorHandler :: emitting error"),S.emit("error",$)):ie($)}h("_setupStream :: pipe stream to writable stream"),this.stream.pipe(A),this.stream.on("error",U),this.stream.on("close",function(){h("(%s)stream :: on close",S.options.clientId),ne(S.outgoing),h("stream: emit close to MqttClient"),S.emit("close")}),h("_setupStream: sending packet `connect`");let X=Object.create(this.options);if(X.cmd="connect",this.topicAliasRecv&&(X.properties||(X.properties={}),this.topicAliasRecv&&(X.properties.topicAliasMaximum=this.topicAliasRecv.max)),H(this,X),L.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return S.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&typeof this.options.authPacket=="object"){let $=_({cmd:"auth",reasonCode:0},this.options.authPacket);H(this,$)}}this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(function(){h("!!connectTimeout hit!! Calling _cleanUp with force `true`"),S._cleanUp(!0)},this.options.connectTimeout)},Y.prototype._handlePacket=function(S,A){let L=this.options;if(L.protocolVersion===5&&L.properties&&L.properties.maximumPacketSize&&L.properties.maximumPacketSize0||!U())&&this._storeProcessingQueue.push({invoke:U,cbStorePut:L.cbStorePut,callback:V}),this},Y.prototype.subscribe=function(){let S=this,A=new Array(arguments.length);for(let Z=0;Z0){let te={qos:Q.qos};U===5&&(te.nl=Q.nl||!1,te.rap=Q.rap||!1,te.rh=Q.rh||0,te.properties=Q.properties),S._resubscribeTopics[Q.topic]=te,k.push(Q.topic)}}),S.messageIdToTopic[F.messageId]=k}return S.outgoing[F.messageId]={volatile:!0,cb:function(k,Q){if(!k){let te=Q.granted;for(let R=0;R0||!le())&&this._storeProcessingQueue.push({invoke:le,callback:ee}),this},Y.prototype.unsubscribe=function(){let S=this,A=new Array(arguments.length);for(let U=0;U0||!W())&&this._storeProcessingQueue.push({invoke:W,callback:V}),this},Y.prototype.end=function(S,A,L){let V=this;h("end :: (%s)",this.options.clientId),(S==null||typeof S!="boolean")&&(L=A||ie,A=S,S=!1,typeof A!="object"&&(L=A,A=null,typeof L!="function"&&(L=ie))),typeof A!="object"&&(L=A,A=null),h("end :: cb? %s",!!L),L=L||ie;function re(){h("end :: closeStores: closing incoming and outgoing stores"),V.disconnected=!0,V.incomingStore.close(function(W){V.outgoingStore.close(function(U){if(h("end :: closeStores: emitting end"),V.emit("end"),L){let X=W||U;h("end :: closeStores: invoking callback with args"),L(X)}})}),V._deferredReconnect&&V._deferredReconnect()}function ee(){h("end :: (%s) :: finish :: calling _cleanUp with force %s",V.options.clientId,S),V._cleanUp(S,()=>{h("end :: finish :: calling process.nextTick on closeStores"),E(re.bind(V))},A)}return this.disconnecting?(L(),this):(this._clearReconnect(),this.disconnecting=!0,!S&&Object.keys(this.outgoing).length>0?(h("end :: (%s) :: calling finish in 10ms once outgoing is empty",V.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,ee,10))):(h("end :: (%s) :: immediately calling finish",V.options.clientId),ee()),this)},Y.prototype.removeOutgoingMessage=function(S){let A=this.outgoing[S]?this.outgoing[S].cb:null;return delete this.outgoing[S],this.outgoingStore.del({messageId:S},function(){A(new Error("Message removed"))}),this},Y.prototype.reconnect=function(S){h("client reconnect");let A=this,L=function(){S?(A.options.incomingStore=S.incomingStore,A.options.outgoingStore=S.outgoingStore):(A.options.incomingStore=null,A.options.outgoingStore=null),A.incomingStore=A.options.incomingStore||new c,A.outgoingStore=A.options.outgoingStore||new c,A.disconnecting=!1,A.disconnected=!1,A._deferredReconnect=null,A._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=L:L(),this},Y.prototype._reconnect=function(){h("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this._setupStream()}),h("client already connected. disconnecting first.")):(h("_reconnect: calling _setupStream"),this._setupStream())},Y.prototype._setupReconnect=function(){let S=this;!S.disconnecting&&!S.reconnectTimer&&S.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",S.options.reconnectPeriod),S.reconnectTimer=setInterval(function(){h("reconnectTimer :: reconnect triggered!"),S._reconnect()},S.options.reconnectPeriod)):h("_setupReconnect :: doing nothing...")},Y.prototype._clearReconnect=function(){h("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)},Y.prototype._cleanUp=function(S,A){let L=arguments[2];if(A&&(h("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",A)),h("_cleanUp :: forced? %s",S),S)this.options.reconnectPeriod===0&&this.options.clean&&B(this.outgoing),h("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{let V=_({cmd:"disconnect"},L);h("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(V,M.bind(null,this.stream.end.bind(this.stream)))}this.disconnecting||(h("_cleanUp :: client not disconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this.pingTimer!==null&&(h("_cleanUp :: clearing pingTimer"),this.pingTimer.clear(),this.pingTimer=null),A&&!this.connected&&(h("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",A),A())},Y.prototype._sendPacket=function(S,A,L){h("_sendPacket :: (%s) :: start",this.options.clientId),L=L||ie,A=A||ie;let V=O(this,S);if(V){A(V);return}if(!this.connected){if(S.cmd==="auth"){this._shiftPingInterval(),H(this,S,A);return}h("_sendPacket :: client not connected. Storing packet offline."),this._storePacket(S,A,L);return}switch(this._shiftPingInterval(),S.cmd){case"publish":break;case"pubrel":oe(this,S,A,L);return;default:H(this,S,A);return}switch(S.qos){case 2:case 1:oe(this,S,A,L);break;case 0:default:H(this,S,A);break}h("_sendPacket :: (%s) :: end",this.options.clientId)},Y.prototype._storePacket=function(S,A,L){h("_storePacket :: packet: %o",S),h("_storePacket :: cb? %s",!!A),L=L||ie;let V=S;if(V.cmd==="publish"){V=d(S);let re=C(this,V);if(re)return A&&A(re)}(V.qos||0)===0&&this.queueQoSZero||V.cmd!=="publish"?this.queue.push({packet:V,cb:A}):V.qos>0?(A=this.outgoing[V.messageId]?this.outgoing[V.messageId].cb:null,this.outgoingStore.put(V,function(re){if(re)return A&&A(re);L()})):A&&A(new Error("No connection to broker"))},Y.prototype._setupPingTimer=function(){h("_setupPingTimer :: keepalive %d (seconds)",this.options.keepalive);let S=this;!this.pingTimer&&this.options.keepalive&&(this.pingResp=!0,this.pingTimer=u(function(){S._checkPing()},this.options.keepalive*1e3))},Y.prototype._shiftPingInterval=function(){this.pingTimer&&this.options.keepalive&&this.options.reschedulePings&&this.pingTimer.reschedule(this.options.keepalive*1e3)},Y.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))},Y.prototype._handlePingresp=function(){this.pingResp=!0},Y.prototype._handleConnack=function(S){h("_handleConnack");let A=this.options,V=A.protocolVersion===5?S.reasonCode:S.returnCode;if(clearTimeout(this.connackTimer),delete this.topicAliasSend,S.properties){if(S.properties.topicAliasMaximum){if(S.properties.topicAliasMaximum>65535){this.emit("error",new Error("topicAliasMaximum from broker is out of range"));return}S.properties.topicAliasMaximum>0&&(this.topicAliasSend=new i(S.properties.topicAliasMaximum))}S.properties.serverKeepAlive&&A.keepalive&&(A.keepalive=S.properties.serverKeepAlive,this._shiftPingInterval()),S.properties.maximumPacketSize&&(A.properties||(A.properties={}),A.properties.maximumPacketSize=S.properties.maximumPacketSize)}if(V===0)this.reconnecting=!1,this._onConnect(S);else if(V>0){let re=new Error("Connection refused: "+j[V]);re.code=V,this.emit("error",re)}},Y.prototype._handleAuth=function(S){let L=this.options.protocolVersion,V=L===5?S.reasonCode:S.returnCode;if(L!==5){let ee=new Error("Protocol error: Auth packets are only supported in MQTT 5. Your version:"+L);ee.code=V,this.emit("error",ee);return}let re=this;this.handleAuth(S,function(ee,W){if(ee){re.emit("error",ee);return}if(V===24)re.reconnecting=!1,re._sendPacket(W);else{let U=new Error("Connection refused: "+j[V]);ee.code=V,re.emit("error",U)}})},Y.prototype.handleAuth=function(S,A){A()},Y.prototype._handlePublish=function(S,A){h("_handlePublish: packet %o",S),A=typeof A<"u"?A:ie;let L=S.topic.toString(),V=S.payload,re=S.qos,ee=S.messageId,W=this,U=this.options,X=[0,16,128,131,135,144,145,151,153];if(this.options.protocolVersion===5){let $;if(S.properties&&($=S.properties.topicAlias),typeof $<"u")if(L.length===0)if($>0&&$<=65535){let le=this.topicAliasRecv.getTopicByAlias($);if(le)L=le,h("_handlePublish :: topic complemented by alias. topic: %s - alias: %d",L,$);else{h("_handlePublish :: unregistered topic alias. alias: %d",$),this.emit("error",new Error("Received unregistered Topic Alias"));return}}else{h("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}else if(this.topicAliasRecv.put(L,$))h("_handlePublish :: registered topic: %s - alias: %d",L,$);else{h("_handlePublish :: topic alias out of range. alias: %d",$),this.emit("error",new Error("Received Topic Alias is out of range"));return}}switch(h("_handlePublish: qos %d",re),re){case 2:{U.customHandleAcks(L,V,S,function($,le){if($ instanceof Error||(le=$,$=null),$)return W.emit("error",$);if(X.indexOf(le)===-1)return W.emit("error",new Error("Wrong reason code for pubrec"));le?W._sendPacket({cmd:"pubrec",messageId:ee,reasonCode:le},A):W.incomingStore.put(S,function(){W._sendPacket({cmd:"pubrec",messageId:ee},A)})});break}case 1:{U.customHandleAcks(L,V,S,function($,le){if($ instanceof Error||(le=$,$=null),$)return W.emit("error",$);if(X.indexOf(le)===-1)return W.emit("error",new Error("Wrong reason code for puback"));le||W.emit("message",L,V,S),W.handleMessage(S,function(Z){if(Z)return A&&A(Z);W._sendPacket({cmd:"puback",messageId:ee,reasonCode:le},A)})});break}case 0:this.emit("message",L,V,S),this.handleMessage(S,A);break;default:h("_handlePublish: unknown QoS. Doing nothing.");break}},Y.prototype.handleMessage=function(S,A){A()},Y.prototype._handleAck=function(S){let A=S.messageId,L=S.cmd,V=null,re=this.outgoing[A]?this.outgoing[A].cb:null,ee=this,W;if(!re){h("_handleAck :: Server sent an ack in error. Ignoring.");return}switch(h("_handleAck :: packet type",L),L){case"pubcomp":case"puback":{let U=S.reasonCode;U&&U>0&&U!==16&&(W=new Error("Publish error: "+j[U]),W.code=U,re(W,S)),delete this.outgoing[A],this.outgoingStore.del(S,re),this.messageIdProvider.deallocate(A),this._invokeStoreProcessingQueue();break}case"pubrec":{V={cmd:"pubrel",qos:2,messageId:A};let U=S.reasonCode;U&&U>0&&U!==16?(W=new Error("Publish error: "+j[U]),W.code=U,re(W,S)):this._sendPacket(V);break}case"suback":{delete this.outgoing[A],this.messageIdProvider.deallocate(A);for(let U=0;U0)if(this.options.resubscribe)if(this.options.protocolVersion===5){h("_resubscribe: protocolVersion 5");for(let A=0;A0){let S=this._storeProcessingQueue[0];if(S&&S.invoke())return this._storeProcessingQueue.shift(),!0}return!1},Y.prototype._invokeAllStoreProcessingQueue=function(){for(;this._invokeStoreProcessingQueue(););},Y.prototype._flushStoreProcessingQueue=function(){for(let S of this._storeProcessingQueue)S.cbStorePut&&S.cbStorePut(new Error("Connection closed")),S.callback&&S.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)},P.exports=Y}).call(this)}).call(this,m("_process"),typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{"./default-message-id-provider":12,"./store":13,"./topic-alias-recv":14,"./topic-alias-send":15,"./validations":16,_process:85,debug:20,events:4,inherits:24,"mqtt-packet":48,"readable-stream":72,reinterval:73,"rfdc/default":74,xtend:82}],7:[function(m,P,v){"use strict";let{Buffer:p}=m("buffer"),f=m("readable-stream").Transform,y=m("duplexify"),c,o,i,r=!1;function e(){let g=new f;return g._write=function(_,h,E){c.sendSocketMessage({data:_.buffer,success:function(){E()},fail:function(){E(new Error)}})},g._flush=function(h){c.closeSocket({success:function(){h()}})},g}function t(g){g.hostname||(g.hostname="localhost"),g.path||(g.path="/"),g.wsOptions||(g.wsOptions={})}function s(g,_){let h=g.protocol==="alis"?"wss":"ws",E=h+"://"+g.hostname+g.path;return g.port&&g.port!==80&&g.port!==443&&(E=h+"://"+g.hostname+":"+g.port+g.path),typeof g.transformWsUrl=="function"&&(E=g.transformWsUrl(E,g,_)),E}function u(){r||(r=!0,c.onSocketOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),c.onSocketMessage(function(g){if(typeof g.data=="string"){let _=p.from(g.data,"base64");o.push(_)}else{let _=new FileReader;_.addEventListener("load",function(){let h=_.result;h instanceof ArrayBuffer?h=p.from(h):h=p.from(h,"utf8"),o.push(h)}),_.readAsArrayBuffer(g.data)}}),c.onSocketClose(function(){i.end(),i.destroy()}),c.onSocketError(function(g){i.destroy(g)}))}function d(g,_){if(_.hostname=_.hostname||_.host,!_.hostname)throw new Error("Could not determine host. Specify host manually.");let h=_.protocolId==="MQIsdp"&&_.protocolVersion===3?"mqttv3.1":"mqtt";t(_);let E=s(_,g);return c=_.my,c.connectSocket({url:E,protocols:h}),o=e(),i=y.obj(),u(),i}P.exports=d},{buffer:3,duplexify:22,"readable-stream":72}],8:[function(m,P,v){"use strict";let p=m("net"),f=m("debug")("mqttjs:tcp");function y(c,o){o.port=o.port||1883,o.hostname=o.hostname||o.host||"localhost";let i=o.port,r=o.hostname;return f("port %d and host %s",i,r),p.createConnection(i,r)}P.exports=y},{debug:20,net:2}],9:[function(m,P,v){"use strict";let p=m("tls"),f=m("net"),y=m("debug")("mqttjs:tls");function c(o,i){i.port=i.port||8883,i.host=i.hostname||i.host||"localhost",f.isIP(i.host)===0&&(i.servername=i.host),i.rejectUnauthorized=i.rejectUnauthorized!==!1,delete i.path,y("port %d host %s rejectUnauthorized %b",i.port,i.host,i.rejectUnauthorized);let r=p.connect(i);r.on("secureConnect",function(){i.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",e)});function e(t){i.rejectUnauthorized&&o.emit("error",t),r.end()}return r.on("error",e),r}P.exports=c},{debug:20,net:2,tls:2}],10:[function(m,P,v){(function(p){(function(){"use strict";let{Buffer:f}=m("buffer"),y=m("ws"),c=m("debug")("mqttjs:ws"),o=m("duplexify"),i=m("readable-stream").Transform,r=["rejectUnauthorized","ca","cert","key","pfx","passphrase"],e=typeof p<"u"&&p.title==="browser"||typeof __webpack_require__=="function";function t(E,M){let T=E.protocol+"://"+E.hostname+":"+E.port+E.path;return typeof E.transformWsUrl=="function"&&(T=E.transformWsUrl(T,E,M)),T}function s(E){let M=E;return E.hostname||(M.hostname="localhost"),E.port||(E.protocol==="wss"?M.port=443:M.port=80),E.path||(M.path="/"),E.wsOptions||(M.wsOptions={}),!e&&E.protocol==="wss"&&r.forEach(function(T){Object.prototype.hasOwnProperty.call(E,T)&&!Object.prototype.hasOwnProperty.call(E.wsOptions,T)&&(M.wsOptions[T]=E[T])}),M}function u(E){let M=s(E);if(M.hostname||(M.hostname=M.host),!M.hostname){if(typeof document>"u")throw new Error("Could not determine host. Specify host manually.");let T=new URL(document.URL);M.hostname=T.hostname,M.port||(M.port=T.port)}return M.objectMode===void 0&&(M.objectMode=!(M.binary===!0||M.binary===void 0)),M}function d(E,M,T){c("createWebSocket"),c("protocol: "+T.protocolId+" "+T.protocolVersion);let z=T.protocolId==="MQIsdp"&&T.protocolVersion===3?"mqttv3.1":"mqtt";return c("creating new Websocket for url: "+M+" and protocol: "+z),new y(M,[z],T.wsOptions)}function g(E,M){let T=M.protocolId==="MQIsdp"&&M.protocolVersion===3?"mqttv3.1":"mqtt",z=t(M,E),j=new WebSocket(z,[T]);return j.binaryType="arraybuffer",j}function _(E,M){c("streamBuilder");let T=s(M),z=t(T,E),j=d(E,z,T),x=y.createWebSocketStream(j,T.wsOptions);return x.url=z,j.on("close",()=>{x.destroy()}),x}function h(E,M){c("browserStreamBuilder");let T,j=u(M).browserBufferSize||1024*512,x=M.browserBufferTimeout||1e3,O=!M.objectMode,C=g(E,M),H=ne(M,L,V);M.objectMode||(H._writev=A),H.on("close",()=>{C.close()});let B=typeof C.addEventListener<"u";C.readyState===C.OPEN?T=H:(T=T=o(void 0,void 0,M),M.objectMode||(T._writev=A),B?C.addEventListener("open",oe):C.onopen=oe),T.socket=C,B?(C.addEventListener("close",ie),C.addEventListener("error",Y),C.addEventListener("message",S)):(C.onclose=ie,C.onerror=Y,C.onmessage=S);function ne(re,ee,W){let U=new i({objectModeMode:re.objectMode});return U._write=ee,U._flush=W,U}function oe(){T.setReadable(H),T.setWritable(H),T.emit("connect")}function ie(){T.end(),T.destroy()}function Y(re){T.destroy(re)}function S(re){let ee=re.data;ee instanceof ArrayBuffer?ee=f.from(ee):ee=f.from(ee,"utf8"),H.push(ee)}function A(re,ee){let W=new Array(re.length);for(let U=0;Uj&&setTimeout(L,x,re,ee,W),O&&typeof re=="string"&&(re=f.from(re,"utf8"));try{C.send(re)}catch(U){return W(U)}W()}function V(re){C.close(),re()}return T}e?P.exports=h:P.exports=_}).call(this)}).call(this,m("_process"))},{_process:85,buffer:3,debug:20,duplexify:22,"readable-stream":72,ws:81}],11:[function(m,P,v){"use strict";let{Buffer:p}=m("buffer"),f=m("readable-stream").Transform,y=m("duplexify"),c,o,i;function r(){let d=new f;return d._write=function(g,_,h){c.send({data:g.buffer,success:function(){h()},fail:function(E){h(new Error(E))}})},d._flush=function(_){c.close({success:function(){_()}})},d}function e(d){d.hostname||(d.hostname="localhost"),d.path||(d.path="/"),d.wsOptions||(d.wsOptions={})}function t(d,g){let _=d.protocol==="wxs"?"wss":"ws",h=_+"://"+d.hostname+d.path;return d.port&&d.port!==80&&d.port!==443&&(h=_+"://"+d.hostname+":"+d.port+d.path),typeof d.transformWsUrl=="function"&&(h=d.transformWsUrl(h,d,g)),h}function s(){c.onOpen(function(){i.setReadable(o),i.setWritable(o),i.emit("connect")}),c.onMessage(function(d){let g=d.data;g instanceof ArrayBuffer?g=p.from(g):g=p.from(g,"utf8"),o.push(g)}),c.onClose(function(){i.end(),i.destroy()}),c.onError(function(d){i.destroy(new Error(d.errMsg))})}function u(d,g){if(g.hostname=g.hostname||g.host,!g.hostname)throw new Error("Could not determine host. Specify host manually.");let _=g.protocolId==="MQIsdp"&&g.protocolVersion===3?"mqttv3.1":"mqtt";e(g);let h=t(g,d);c=wx.connectSocket({url:h,protocols:[_]}),o=r(),i=y.obj(),i._destroy=function(M,T){c.close({success:function(){T&&T(M)}})};let E=i.destroy;return i.destroy=(function(){i.destroy=E;let M=this;setTimeout(function(){c.close({fail:function(){M._destroy(new Error)}})},0)}).bind(i),s(),i}P.exports=u},{buffer:3,duplexify:22,"readable-stream":72}],12:[function(m,P,v){"use strict";function p(){if(!(this instanceof p))return new p;this.nextId=Math.max(1,Math.floor(Math.random()*65535))}p.prototype.allocate=function(){let f=this.nextId++;return this.nextId===65536&&(this.nextId=1),f},p.prototype.getLastAllocated=function(){return this.nextId===1?65535:this.nextId-1},p.prototype.register=function(f){return!0},p.prototype.deallocate=function(f){},p.prototype.clear=function(){},P.exports=p},{}],13:[function(m,P,v){"use strict";let p=m("xtend"),f=m("readable-stream").Readable,y={objectMode:!0},c={clean:!0};function o(i){if(!(this instanceof o))return new o(i);this.options=i||{},this.options=p(c,i),this._inflights=new Map}o.prototype.put=function(i,r){return this._inflights.set(i.messageId,i),r&&r(),this},o.prototype.createStream=function(){let i=new f(y),r=[],e=!1,t=0;return this._inflights.forEach(function(s,u){r.push(s)}),i._read=function(){!e&&tthis.max?!1:(this.aliasToTopic[y]=f,this.length=Object.keys(this.aliasToTopic).length,!0)},p.prototype.getTopicByAlias=function(f){return this.aliasToTopic[f]},p.prototype.clear=function(){this.aliasToTopic={}},P.exports=p},{}],15:[function(m,P,v){"use strict";let p=m("lru-cache"),f=m("number-allocator").NumberAllocator;function y(c){if(!(this instanceof y))return new y(c);c>0&&(this.aliasToTopic=new p({max:c}),this.topicToAlias={},this.numberAllocator=new f(1,c),this.max=c,this.length=0)}y.prototype.put=function(c,o){if(o===0||o>this.max)return!1;let i=this.aliasToTopic.get(o);return i&&delete this.topicToAlias[i],this.aliasToTopic.set(o,c),this.topicToAlias[c]=o,this.numberAllocator.use(o),this.length=this.aliasToTopic.length,!0},y.prototype.getTopicByAlias=function(c){return this.aliasToTopic.get(c)},y.prototype.getAliasByTopic=function(c){let o=this.topicToAlias[c];return typeof o<"u"&&this.aliasToTopic.get(o),o},y.prototype.clear=function(){this.aliasToTopic.reset(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0},y.prototype.getLruAlias=function(){let c=this.numberAllocator.firstVacant();return c||this.aliasToTopic.keys()[this.aliasToTopic.length-1]},P.exports=y},{"lru-cache":45,"number-allocator":54}],16:[function(m,P,v){"use strict";function p(y){let c=y.split("/");for(let o=0;othis.length||o<0)return;let i=this._offset(o);return this._bufs[i[0]][i[1]]},y.prototype.slice=function(o,i){return typeof o=="number"&&o<0&&(o+=this.length),typeof i=="number"&&i<0&&(i+=this.length),this.copy(null,0,o,i)},y.prototype.copy=function(o,i,r,e){if((typeof r!="number"||r<0)&&(r=0),(typeof e!="number"||e>this.length)&&(e=this.length),r>=this.length||e<=0)return o||p.alloc(0);let t=!!o,s=this._offset(r),u=e-r,d=u,g=t&&i||0,_=s[1];if(r===0&&e===this.length){if(!t)return this._bufs.length===1?this._bufs[0]:p.concat(this._bufs,this.length);for(let h=0;hE)this._bufs[h].copy(o,g,_),g+=E;else{this._bufs[h].copy(o,g,_,_+d),g+=E;break}d-=E,_&&(_=0)}return o.length>g?o.slice(0,g):o},y.prototype.shallowSlice=function(o,i){if(o=o||0,i=typeof i!="number"?this.length:i,o<0&&(o+=this.length),i<0&&(i+=this.length),o===i)return this._new();let r=this._offset(o),e=this._offset(i),t=this._bufs.slice(r[0],e[0]+1);return e[1]===0?t.pop():t[t.length-1]=t[t.length-1].slice(0,e[1]),r[1]!==0&&(t[0]=t[0].slice(r[1])),this._new(t)},y.prototype.toString=function(o,i,r){return this.slice(i,r).toString(o)},y.prototype.consume=function(o){if(o=Math.trunc(o),Number.isNaN(o)||o<=0)return this;for(;this._bufs.length;)if(o>=this._bufs[0].length)o-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift();else{this._bufs[0]=this._bufs[0].slice(o),this.length-=o;break}return this},y.prototype.duplicate=function(){let o=this._new();for(let i=0;ithis.length?this.length:o;let r=this._offset(o),e=r[0],t=r[1];for(;e=c.length){let d=s.indexOf(c,t);if(d!==-1)return this._reverseOffset([e,d]);t=s.length-c.length+1}else{let d=this._reverseOffset([e,t]);if(this._match(d,c))return d;t++}t=0}return-1},y.prototype._match=function(c,o){if(this.length-c{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),v.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"];function f(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function y(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+P.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let s=0,u=0;e[0].replace(/%[a-zA-Z%]/g,d=>{d!=="%%"&&(s++,d==="%c"&&(u=s))}),e.splice(u,0,t)}v.log=console.debug||console.log||(()=>{});function c(e){try{e?v.storage.setItem("debug",e):v.storage.removeItem("debug")}catch{}}function o(){let e;try{e=v.storage.getItem("debug")}catch{}return!e&&typeof p<"u"&&"env"in p&&(e=p.env.DEBUG),e}function i(){try{return localStorage}catch{}}P.exports=m("./common")(v);let{formatters:r}=P.exports;r.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this)}).call(this,m("_process"))},{"./common":21,_process:85}],21:[function(m,P,v){function p(f){c.debug=c,c.default=c,c.coerce=s,c.disable=r,c.enable=i,c.enabled=e,c.humanize=m("ms"),c.destroy=u,Object.keys(f).forEach(d=>{c[d]=f[d]}),c.names=[],c.skips=[],c.formatters={};function y(d){let g=0;for(let _=0;_{if(H==="%%")return"%";O++;let ne=c.formatters[B];if(typeof ne=="function"){let oe=T[O];H=ne.call(z,oe),T.splice(O,1),O--}return H}),c.formatArgs.call(z,T),(z.log||c.log).apply(z,T)}return M.namespace=d,M.useColors=c.useColors(),M.color=c.selectColor(d),M.extend=o,M.destroy=c.destroy,Object.defineProperty(M,"enabled",{enumerable:!0,configurable:!1,get:()=>_!==null?_:(h!==c.namespaces&&(h=c.namespaces,E=c.enabled(d)),E),set:T=>{_=T}}),typeof c.init=="function"&&c.init(M),M}function o(d,g){let _=c(this.namespace+(typeof g>"u"?":":g)+d);return _.log=this.log,_}function i(d){c.save(d),c.namespaces=d,c.names=[],c.skips=[];let g,_=(typeof d=="string"?d:"").split(/[\s,]+/),h=_.length;for(g=0;g"-"+g)].join(",");return c.enable(""),d}function e(d){if(d[d.length-1]==="*")return!0;let g,_;for(g=0,_=c.skips.length;g<_;g++)if(c.skips[g].test(d))return!1;for(g=0,_=c.names.length;g<_;g++)if(c.names[g].test(d))return!0;return!1}function t(d){return d.toString().substring(2,d.toString().length-2).replace(/\.\*\?$/,"*")}function s(d){return d instanceof Error?d.stack||d.message:d}function u(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return c.enable(c.load()),c}P.exports=p},{ms:53}],22:[function(m,P,v){(function(p,f){(function(){var y=m("readable-stream"),c=m("end-of-stream"),o=m("inherits"),i=m("stream-shift"),r=f.from&&f.from!==Uint8Array.from?f.from([0]):new f([0]),e=function(h,E){h._corked?h.once("uncork",E):E()},t=function(h,E){h._autoDestroy&&h.destroy(E)},s=function(h,E){return function(M){M?t(h,M.message==="premature close"?null:M):E&&!h._ended&&h.end()}},u=function(h,E){if(!h||h._writableState&&h._writableState.finished)return E();if(h._writableState)return h.end(E);h.end(),E()},d=function(){},g=function(h){return new y.Readable({objectMode:!0,highWaterMark:16}).wrap(h)},_=function(h,E,M){if(!(this instanceof _))return new _(h,E,M);y.Duplex.call(this,M),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!M||M.autoDestroy!==!1,this._forwardDestroy=!M||M.destroy!==!1,this._forwardEnd=!M||M.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,h&&this.setWritable(h),E&&this.setReadable(E)};o(_,y.Duplex),_.obj=function(h,E,M){return M||(M={}),M.objectMode=!0,M.highWaterMark=16,new _(h,E,M)},_.prototype.cork=function(){++this._corked===1&&this.emit("cork")},_.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")},_.prototype.setWritable=function(h){if(this._unwrite&&this._unwrite(),this.destroyed){h&&h.destroy&&h.destroy();return}if(h===null||h===!1){this.end();return}var E=this,M=c(h,{writable:!0,readable:!1},s(this,this._forwardEnd)),T=function(){var j=E._ondrain;E._ondrain=null,j&&j()},z=function(){E._writable.removeListener("drain",T),M()};this._unwrite&&p.nextTick(T),this._writable=h,this._writable.on("drain",T),this._unwrite=z,this.uncork()},_.prototype.setReadable=function(h){if(this._unread&&this._unread(),this.destroyed){h&&h.destroy&&h.destroy();return}if(h===null||h===!1){this.push(null),this.resume();return}var E=this,M=c(h,{writable:!1,readable:!0},s(this)),T=function(){E._forward()},z=function(){E.push(null)},j=function(){E._readable2.removeListener("readable",T),E._readable2.removeListener("end",z),M()};this._drained=!0,this._readable=h,this._readable2=h._readableState?h:g(h),this._readable2.on("readable",T),this._readable2.on("end",z),this._unread=j,this._forward()},_.prototype._read=function(){this._drained=!0,this._forward()},_.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var h;this._drained&&(h=i(this._readable2))!==null;)this.destroyed||(this._drained=this.push(h));this._forwarding=!1}},_.prototype.destroy=function(h,E){if(E||(E=d),this.destroyed)return E(null);this.destroyed=!0;var M=this;p.nextTick(function(){M._destroy(h),E(null)})},_.prototype._destroy=function(h){if(h){var E=this._ondrain;this._ondrain=null,E?E(h):this.emit("error",h)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")},_.prototype._write=function(h,E,M){if(!this.destroyed){if(this._corked)return e(this,this._write.bind(this,h,E,M));if(h===r)return this._finish(M);if(!this._writable)return M();this._writable.write(h)===!1?this._ondrain=M:this.destroyed||M()}},_.prototype._finish=function(h){var E=this;this.emit("preend"),e(this,function(){u(E._forwardEnd&&E._writable,function(){E._writableState.prefinished===!1&&(E._writableState.prefinished=!0),E.emit("prefinish"),e(E,h)})})},_.prototype.end=function(h,E,M){return typeof h=="function"?this.end(null,null,h):typeof E=="function"?this.end(h,null,E):(this._ended=!0,h&&this.write(h),!this._writableState.ending&&!this._writableState.destroyed&&this.write(r),y.Writable.prototype.end.call(this,M))},P.exports=_}).call(this)}).call(this,m("_process"),m("buffer").Buffer)},{_process:85,buffer:3,"end-of-stream":23,inherits:24,"readable-stream":72,"stream-shift":77}],23:[function(m,P,v){(function(p){(function(){var f=m("once"),y=function(){},c=function(r){return r.setHeader&&typeof r.abort=="function"},o=function(r){return r.stdio&&Array.isArray(r.stdio)&&r.stdio.length===3},i=function(r,e,t){if(typeof e=="function")return i(r,null,e);e||(e={}),t=f(t||y);var s=r._writableState,u=r._readableState,d=e.readable||e.readable!==!1&&r.readable,g=e.writable||e.writable!==!1&&r.writable,_=!1,h=function(){r.writable||E()},E=function(){g=!1,d||t.call(r)},M=function(){d=!1,g||t.call(r)},T=function(C){t.call(r,C?new Error("exited with error code: "+C):null)},z=function(C){t.call(r,C)},j=function(){p.nextTick(x)},x=function(){if(!_){if(d&&!(u&&u.ended&&!u.destroyed))return t.call(r,new Error("premature close"));if(g&&!(s&&s.ended&&!s.destroyed))return t.call(r,new Error("premature close"))}},O=function(){r.req.on("finish",E)};return c(r)?(r.on("complete",E),r.on("abort",j),r.req?O():r.on("request",O)):g&&!s&&(r.on("end",h),r.on("close",h)),o(r)&&r.on("exit",T),r.on("end",M),r.on("finish",E),e.error!==!1&&r.on("error",z),r.on("close",j),function(){_=!0,r.removeListener("complete",E),r.removeListener("abort",j),r.removeListener("request",O),r.req&&r.req.removeListener("finish",E),r.removeListener("end",h),r.removeListener("close",h),r.removeListener("finish",E),r.removeListener("exit",T),r.removeListener("end",M),r.removeListener("error",z),r.removeListener("close",j)}};P.exports=i}).call(this)}).call(this,m("_process"))},{_process:85,once:56}],24:[function(m,P,v){typeof Object.create=="function"?P.exports=function(f,y){y&&(f.super_=y,f.prototype=Object.create(y.prototype,{constructor:{value:f,enumerable:!1,writable:!0,configurable:!0}}))}:P.exports=function(f,y){if(y){f.super_=y;var c=function(){};c.prototype=y.prototype,f.prototype=new c,f.prototype.constructor=f}}},{}],25:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.ContainerIterator=v.Container=v.Base=void 0;class p{constructor(o=0){this.iteratorType=o}equals(o){return this.o===o.o}}v.ContainerIterator=p;class f{constructor(){this.i=0}get length(){return this.i}size(){return this.i}empty(){return this.i===0}}v.Base=f;class y extends f{}v.Container=y},{}],26:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.HashContainerIterator=v.HashContainer=void 0;var p=m("../../ContainerBase"),f=c(m("../../../utils/checkObject")),y=m("../../../utils/throwError");function c(r){return r&&r.t?r:{default:r}}class o extends p.ContainerIterator{constructor(e,t,s){super(s),this.o=e,this.h=t,this.iteratorType===0?(this.pre=function(){return this.o.L===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.L,this},this.next=function(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.B,this}):(this.pre=function(){return this.o.B===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.B,this},this.next=function(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o=this.o.L,this})}}v.HashContainerIterator=o;class i extends p.Container{constructor(){super(),this.H=[],this.g={},this.HASH_TAG=Symbol("@@HASH_TAG"),Object.setPrototypeOf(this.g,null),this.h={},this.h.L=this.h.B=this.p=this._=this.h}V(e){let{L:t,B:s}=e;t.B=s,s.L=t,e===this.p&&(this.p=s),e===this._&&(this._=t),this.i-=1}M(e,t,s){s===void 0&&(s=(0,f.default)(e));let u;if(s){let d=e[this.HASH_TAG];if(d!==void 0)return this.H[d].l=t,this.i;Object.defineProperty(e,this.HASH_TAG,{value:this.H.length,configurable:!0}),u={u:e,l:t,L:this._,B:this.h},this.H.push(u)}else{let d=this.g[e];if(d)return d.l=t,this.i;u={u:e,l:t,L:this._,B:this.h},this.g[e]=u}return this.i===0?(this.p=u,this.h.B=u):this._.B=u,this._=u,this.h.L=u,++this.i}I(e,t){if(t===void 0&&(t=(0,f.default)(e)),t){let s=e[this.HASH_TAG];return s===void 0?this.h:this.H[s]}else return this.g[e]||this.h}clear(){let e=this.HASH_TAG;this.H.forEach(function(t){delete t.u[e]}),this.H=[],this.g={},Object.setPrototypeOf(this.g,null),this.i=0,this.p=this._=this.h.L=this.h.B=this.h}eraseElementByKey(e,t){let s;if(t===void 0&&(t=(0,f.default)(e)),t){let u=e[this.HASH_TAG];if(u===void 0)return!1;delete e[this.HASH_TAG],s=this.H[u],delete this.H[u]}else{if(s=this.g[e],s===void 0)return!1;delete this.g[e]}return this.V(s),!0}eraseElementByIterator(e){let t=e.o;return t===this.h&&(0,y.throwIteratorAccessError)(),this.V(t),e.next()}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;let t=this.p;for(;e--;)t=t.B;return this.V(t),this.i}}v.HashContainer=i},{"../../../utils/checkObject":43,"../../../utils/throwError":44,"../../ContainerBase":25}],27:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=m("./Base"),f=c(m("../../utils/checkObject")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends p.HashContainerIterator{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){this.o===this.h&&(0,y.throwIteratorAccessError)();let t=this;return new Proxy([],{get(s,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(s,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends p.HashContainer{constructor(t=[]){super();let s=this;t.forEach(function(u){s.setElement(u[0],u[1])})}begin(){return new o(this.p,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this._,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i!==0)return[this.p.u,this.p.l]}back(){if(this.i!==0)return[this._.u,this._.l]}setElement(t,s,u){return this.M(t,s,u)}getElementByKey(t,s){if(s===void 0&&(s=(0,f.default)(t)),s){let d=t[this.HASH_TAG];return d!==void 0?this.H[d].l:void 0}let u=this.g[t];return u?u.l:void 0}getElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return[s.u,s.l]}find(t,s){let u=this.I(t,s);return new o(u,this.h,this)}forEach(t){let s=0,u=this.p;for(;u!==this.h;)t([u.u,u.l],s++,this),u=u.B}[Symbol.iterator](){return(function*(){let t=this.p;for(;t!==this.h;)yield[t.u,t.l],t=t.B}).bind(this)()}}var r=i;v.default=r},{"../../utils/checkObject":43,"../../utils/throwError":44,"./Base":26}],28:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=m("./Base"),f=m("../../utils/throwError");class y extends p.HashContainerIterator{constructor(r,e,t,s){super(r,e,s),this.container=t}get pointer(){return this.o===this.h&&(0,f.throwIteratorAccessError)(),this.o.u}copy(){return new y(this.o,this.h,this.container,this.iteratorType)}}class c extends p.HashContainer{constructor(r=[]){super();let e=this;r.forEach(function(t){e.insert(t)})}begin(){return new y(this.p,this.h,this)}end(){return new y(this.h,this.h,this)}rBegin(){return new y(this._,this.h,this,1)}rEnd(){return new y(this.h,this.h,this,1)}front(){return this.p.u}back(){return this._.u}insert(r,e){return this.M(r,void 0,e)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=this.p;for(;r--;)e=e.B;return e.u}find(r,e){let t=this.I(r,e);return new y(t,this.h,this)}forEach(r){let e=0,t=this.p;for(;t!==this.h;)r(t.u,e++,this),t=t.B}[Symbol.iterator](){return(function*(){let r=this.p;for(;r!==this.h;)yield r.u,r=r.B}).bind(this)()}}var o=c;v.default=o},{"../../utils/throwError":44,"./Base":26}],29:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=m("../ContainerBase");class f extends p.Base{constructor(o=[],i=function(e,t){return e>t?-1:e>1;for(let t=this.i-1>>1;t>=0;--t)this.k(t,e)}m(o){let i=this.C[o];for(;o>0;){let r=o-1>>1,e=this.C[r];if(this.v(e,i)<=0)break;this.C[o]=e,o=r}this.C[o]=i}k(o,i){let r=this.C[o];for(;o0&&(e=t,s=this.C[t]),this.v(s,r)>=0)break;this.C[o]=s,o=e}this.C[o]=r}clear(){this.i=0,this.C.length=0}push(o){this.C.push(o),this.m(this.i),this.i+=1}pop(){if(this.i===0)return;let o=this.C[0],i=this.C.pop();return this.i-=1,this.i&&(this.C[0]=i,this.k(0,this.i>>1)),o}top(){return this.C[0]}find(o){return this.C.indexOf(o)>=0}remove(o){let i=this.C.indexOf(o);return i<0?!1:(i===0?this.pop():i===this.i-1?(this.C.pop(),this.i-=1):(this.C.splice(i,1,this.C.pop()),this.i-=1,this.m(i),this.k(i,this.i>>1)),!0)}updateItem(o){let i=this.C.indexOf(o);return i<0?!1:(this.m(i),this.k(i,this.i>>1),!0)}toArray(){return[...this.C]}}var y=f;v.default=y},{"../ContainerBase":25}],30:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=m("../ContainerBase");class f extends p.Base{constructor(o=[]){super(),this.j=0,this.q=[];let i=this;o.forEach(function(r){i.push(r)})}clear(){this.q=[],this.i=this.j=0}push(o){let i=this.q.length;if(this.j/i>.5&&this.j+this.i>=i&&i>4096){let r=this.i;for(let e=0;e{if(typeof e.length=="number")return e.length;if(typeof e.size=="number")return e.size;if(typeof e.size=="function")return e.size();throw new TypeError("Cannot get the length or size of the container")})();this.F=t,this.P=Math.max(Math.ceil(s/this.F),1);for(let g=0;g>1)-(u>>1),this.D=this.N=this.F-s%this.F>>1;let d=this;e.forEach(function(g){d.pushBack(g)})}T(){let e=[],t=Math.max(this.P>>1,1);for(let s=0;s>1}begin(){return new c(0,this)}end(){return new c(this.i,this)}rBegin(){return new c(this.i-1,this,1)}rEnd(){return new c(-1,this,1)}front(){if(this.i!==0)return this.A[this.j][this.D]}back(){if(this.i!==0)return this.A[this.R][this.N]}pushBack(e){return this.i&&(this.N0?this.N-=1:this.R>0?(this.R-=1,this.N=this.F-1):(this.R=this.P-1,this.N=this.F-1)),this.i-=1,e}pushFront(e){return this.i&&(this.D>0?this.D-=1:this.j>0?(this.j-=1,this.D=this.F-1):(this.j=this.P-1,this.D=this.F-1),this.j===this.R&&this.D===this.N&&this.T()),this.i+=1,this.A[this.j][this.D]=e,this.i}popFront(){if(this.i===0)return;let e=this.A[this.j][this.D];return this.i!==1&&(this.Dthis.i-1)throw new RangeError;let{curNodeBucketIndex:t,curNodePointerIndex:s}=this.O(e);return this.A[t][s]}setElementByPos(e,t){if(e<0||e>this.i-1)throw new RangeError;let{curNodeBucketIndex:s,curNodePointerIndex:u}=this.O(e);this.A[s][u]=t}insert(e,t,s=1){if(e<0||e>this.i)throw new RangeError;if(e===0)for(;s--;)this.pushFront(t);else if(e===this.i)for(;s--;)this.pushBack(t);else{let u=[];for(let d=e;dthis.i-1)throw new RangeError;if(e===0)this.popFront();else if(e===this.i-1)this.popBack();else{let t=[];for(let u=e+1;ue;)this.popBack();return this.i}sort(e){let t=[];for(let s=0;sthis.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return s.l}eraseElementByPos(t){if(t<0||t>this.i-1)throw new RangeError;let s=this.p;for(;t--;)s=s.B;return this.V(s),this.i}eraseElementByValue(t){let s=this.p;for(;s!==this.h;)s.l===t&&this.V(s),s=s.B;return this.i}eraseElementByIterator(t){let s=t.o;return s===this.h&&(0,y.throwIteratorAccessError)(),t=t.next(),this.V(s),t}pushBack(t){return this.G(t,this._),this.i}popBack(){if(this.i===0)return;let t=this._.l;return this.V(this._),t}pushFront(t){return this.G(t,this.h),this.i}popFront(){if(this.i===0)return;let t=this.p.l;return this.V(this.p),t}setElementByPos(t,s){if(t<0||t>this.i-1)throw new RangeError;let u=this.p;for(;t--;)u=u.B;u.l=s}insert(t,s,u=1){if(t<0||t>this.i)throw new RangeError;if(u<=0)return this.i;if(t===0)for(;u--;)this.pushFront(s);else if(t===this.i)for(;u--;)this.pushBack(s);else{let d=this.p;for(let _=1;_this.i-1)throw new RangeError;return this.J[e]}eraseElementByPos(e){if(e<0||e>this.i-1)throw new RangeError;return this.J.splice(e,1),this.i-=1,this.i}eraseElementByValue(e){let t=0;for(let s=0;sthis.i-1)throw new RangeError;this.J[e]=t}insert(e,t,s=1){if(e<0||e>this.i)throw new RangeError;return this.J.splice(e,0,...new Array(s).fill(t)),this.i+=s,this.i}find(e){for(let t=0;ts?1:0},e=!1){super(),this.Y=void 0,this.v=r,e?(this.re=p.TreeNodeEnableIndex,this.M=function(t,s,u){let d=this.ne(t,s,u);if(d){let g=d.tt;for(;g!==this.h;)g.rt+=1,g=g.tt;let _=this.he(d);if(_){let{parentNode:h,grandParent:E,curNode:M}=_;h.ie(),E.ie(),M.ie()}}return this.i},this.V=function(t){let s=this.fe(t);for(;s!==this.h;)s.rt-=1,s=s.tt}):(this.re=p.TreeNode,this.M=function(t,s,u){let d=this.ne(t,s,u);return d&&this.he(d),this.i},this.V=this.fe),this.h=new this.re}X(r,e){let t=this.h;for(;r;){let s=this.v(r.u,e);if(s<0)r=r.W;else if(s>0)t=r,r=r.U;else return r}return t}Z(r,e){let t=this.h;for(;r;)this.v(r.u,e)<=0?r=r.W:(t=r,r=r.U);return t}$(r,e){let t=this.h;for(;r;){let s=this.v(r.u,e);if(s<0)t=r,r=r.W;else if(s>0)r=r.U;else return r}return t}rr(r,e){let t=this.h;for(;r;)this.v(r.u,e)<0?(t=r,r=r.W):r=r.U;return t}ue(r){for(;;){let e=r.tt;if(e===this.h)return;if(r.ee===1){r.ee=0;return}if(r===e.U){let t=e.W;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.te():e.te();else if(t.W&&t.W.ee===1){t.ee=e.ee,e.ee=0,t.W.ee=0,e===this.Y?this.Y=e.te():e.te();return}else t.U&&t.U.ee===1?(t.ee=1,t.U.ee=0,t.se()):(t.ee=1,r=e)}else{let t=e.U;if(t.ee===1)t.ee=0,e.ee=1,e===this.Y?this.Y=e.se():e.se();else if(t.U&&t.U.ee===1){t.ee=e.ee,e.ee=0,t.U.ee=0,e===this.Y?this.Y=e.se():e.se();return}else t.W&&t.W.ee===1?(t.ee=1,t.W.ee=0,t.te()):(t.ee=1,r=e)}}}fe(r){if(this.i===1)return this.clear(),this.h;let e=r;for(;e.U||e.W;){if(e.W)for(e=e.W;e.U;)e=e.U;else e=e.U;[r.u,e.u]=[e.u,r.u],[r.l,e.l]=[e.l,r.l],r=e}this.h.U===e?this.h.U=e.tt:this.h.W===e&&(this.h.W=e.tt),this.ue(e);let t=e.tt;return e===t.U?t.U=void 0:t.W=void 0,this.i-=1,this.Y.ee=0,t}oe(r,e){return r===void 0?!1:this.oe(r.U,e)||e(r)?!0:this.oe(r.W,e)}he(r){for(;;){let e=r.tt;if(e.ee===0)return;let t=e.tt;if(e===t.U){let s=t.W;if(s&&s.ee===1){if(s.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.W){if(r.ee=0,r.U&&(r.U.tt=e),r.W&&(r.W.tt=t),e.W=r.U,t.U=r.W,r.U=e,r.W=t,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.se():t.se(),t.ee=1}else{let s=t.U;if(s&&s.ee===1){if(s.ee=e.ee=0,t===this.Y)return;t.ee=1,r=t;continue}else if(r===e.U){if(r.ee=0,r.U&&(r.U.tt=t),r.W&&(r.W.tt=e),t.W=r.U,e.U=r.W,r.U=t,r.W=e,t===this.Y)this.Y=r,this.h.tt=r;else{let u=t.tt;u.U===t?u.U=r:u.W=r}return r.tt=t.tt,e.tt=r,t.tt=r,t.ee=1,{parentNode:e,grandParent:t,curNode:r}}else e.ee=0,t===this.Y?this.Y=t.te():t.te(),t.ee=1}return}}ne(r,e,t){if(this.Y===void 0){this.i+=1,this.Y=new this.re(r,e),this.Y.ee=0,this.Y.tt=this.h,this.h.tt=this.Y,this.h.U=this.Y,this.h.W=this.Y;return}let s,u=this.h.U,d=this.v(u.u,r);if(d===0){u.l=e;return}else if(d>0)u.U=new this.re(r,e),u.U.tt=u,s=u.U,this.h.U=s;else{let g=this.h.W,_=this.v(g.u,r);if(_===0){g.l=e;return}else if(_<0)g.W=new this.re(r,e),g.W.tt=g,s=g.W,this.h.W=s;else{if(t!==void 0){let h=t.o;if(h!==this.h){let E=this.v(h.u,r);if(E===0){h.l=e;return}else if(E>0){let M=h.L(),T=this.v(M.u,r);if(T===0){M.l=e;return}else T<0&&(s=new this.re(r,e),M.W===void 0?(M.W=s,s.tt=M):(h.U=s,s.tt=h))}}}if(s===void 0)for(s=this.Y;;){let h=this.v(s.u,r);if(h>0){if(s.U===void 0){s.U=new this.re(r,e),s.U.tt=s,s=s.U;break}s=s.U}else if(h<0){if(s.W===void 0){s.W=new this.re(r,e),s.W.tt=s,s=s.W;break}s=s.W}else{s.l=e;return}}}}return this.i+=1,s}I(r,e){for(;r;){let t=this.v(r.u,e);if(t<0)r=r.W;else if(t>0)r=r.U;else return r}return r||this.h}clear(){this.i=0,this.Y=void 0,this.h.tt=void 0,this.h.U=this.h.W=void 0}updateKeyByIterator(r,e){let t=r.o;if(t===this.h&&(0,y.throwIteratorAccessError)(),this.i===1)return t.u=e,!0;if(t===this.h.U)return this.v(t.B().u,e)>0?(t.u=e,!0):!1;if(t===this.h.W)return this.v(t.L().u,e)<0?(t.u=e,!0):!1;let s=t.L().u;if(this.v(s,e)>=0)return!1;let u=t.B().u;return this.v(u,e)<=0?!1:(t.u=e,!0)}eraseElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e=0,t=this;return this.oe(this.Y,function(s){return r===e?(t.V(s),!0):(e+=1,!1)}),this.i}eraseElementByKey(r){if(this.i===0)return!1;let e=this.I(this.Y,r);return e===this.h?!1:(this.V(e),!0)}eraseElementByIterator(r){let e=r.o;e===this.h&&(0,y.throwIteratorAccessError)();let t=e.W===void 0;return r.iteratorType===0?t&&r.next():(!t||e.U===void 0)&&r.next(),this.V(e),r}forEach(r){let e=0;for(let t of this)r(t,e++,this)}getElementByPos(r){if(r<0||r>this.i-1)throw new RangeError;let e,t=0;for(let s of this){if(t===r){e=s;break}t+=1}return e}getHeight(){if(this.i===0)return 0;let r=function(e){return e?Math.max(r(e.U),r(e.W))+1:0};return r(this.Y)}}var o=c;v.default=o},{"../../../utils/throwError":44,"../../ContainerBase":25,"./TreeNode":38}],40:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=c(m("./Base")),f=c(m("./Base/TreeIterator")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends f.default{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){this.o===this.h&&(0,y.throwIteratorAccessError)();let t=this;return new Proxy([],{get(s,u){if(u==="0")return t.o.u;if(u==="1")return t.o.l},set(s,u,d){if(u!=="1")throw new TypeError("props must be 1");return t.o.l=d,!0}})}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends p.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(g){d.setElement(g[0],g[1])})}*K(t){t!==void 0&&(yield*Re(this.K(t.U)),yield[t.u,t.l],yield*Re(this.K(t.W)))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){if(this.i===0)return;let t=this.h.U;return[t.u,t.l]}back(){if(this.i===0)return;let t=this.h.W;return[t.u,t.l]}lowerBound(t){let s=this.X(this.Y,t);return new o(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new o(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new o(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new o(s,this.h,this)}setElement(t,s,u){return this.M(t,s,u)}find(t){let s=this.I(this.Y,t);return new o(s,this.h,this)}getElementByKey(t){return this.I(this.Y,t).l}union(t){let s=this;return t.forEach(function(u){s.setElement(u[0],u[1])}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;v.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],41:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=void 0;var p=c(m("./Base")),f=c(m("./Base/TreeIterator")),y=m("../../utils/throwError");function c(e){return e&&e.t?e:{default:e}}class o extends f.default{constructor(t,s,u,d){super(t,s,d),this.container=u}get pointer(){return this.o===this.h&&(0,y.throwIteratorAccessError)(),this.o.u}copy(){return new o(this.o,this.h,this.container,this.iteratorType)}}class i extends p.default{constructor(t=[],s,u){super(s,u);let d=this;t.forEach(function(g){d.insert(g)})}*K(t){t!==void 0&&(yield*Re(this.K(t.U)),yield t.u,yield*Re(this.K(t.W)))}begin(){return new o(this.h.U||this.h,this.h,this)}end(){return new o(this.h,this.h,this)}rBegin(){return new o(this.h.W||this.h,this.h,this,1)}rEnd(){return new o(this.h,this.h,this,1)}front(){return this.h.U?this.h.U.u:void 0}back(){return this.h.W?this.h.W.u:void 0}insert(t,s){return this.M(t,void 0,s)}find(t){let s=this.I(this.Y,t);return new o(s,this.h,this)}lowerBound(t){let s=this.X(this.Y,t);return new o(s,this.h,this)}upperBound(t){let s=this.Z(this.Y,t);return new o(s,this.h,this)}reverseLowerBound(t){let s=this.$(this.Y,t);return new o(s,this.h,this)}reverseUpperBound(t){let s=this.rr(this.Y,t);return new o(s,this.h,this)}union(t){let s=this;return t.forEach(function(u){s.insert(u)}),this.i}[Symbol.iterator](){return this.K(this.Y)}}var r=i;v.default=r},{"../../utils/throwError":44,"./Base":39,"./Base/TreeIterator":37}],42:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),Object.defineProperty(v,"Deque",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(v,"HashMap",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(v,"HashSet",{enumerable:!0,get:function(){return t.default}}),Object.defineProperty(v,"LinkList",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(v,"OrderedMap",{enumerable:!0,get:function(){return e.default}}),Object.defineProperty(v,"OrderedSet",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(v,"PriorityQueue",{enumerable:!0,get:function(){return y.default}}),Object.defineProperty(v,"Queue",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(v,"Stack",{enumerable:!0,get:function(){return p.default}}),Object.defineProperty(v,"Vector",{enumerable:!0,get:function(){return c.default}});var p=u(m("./container/OtherContainer/Stack")),f=u(m("./container/OtherContainer/Queue")),y=u(m("./container/OtherContainer/PriorityQueue")),c=u(m("./container/SequentialContainer/Vector")),o=u(m("./container/SequentialContainer/LinkList")),i=u(m("./container/SequentialContainer/Deque")),r=u(m("./container/TreeContainer/OrderedSet")),e=u(m("./container/TreeContainer/OrderedMap")),t=u(m("./container/HashContainer/HashSet")),s=u(m("./container/HashContainer/HashMap"));function u(d){return d&&d.t?d:{default:d}}},{"./container/HashContainer/HashMap":27,"./container/HashContainer/HashSet":28,"./container/OtherContainer/PriorityQueue":29,"./container/OtherContainer/Queue":30,"./container/OtherContainer/Stack":31,"./container/SequentialContainer/Deque":34,"./container/SequentialContainer/LinkList":35,"./container/SequentialContainer/Vector":36,"./container/TreeContainer/OrderedMap":40,"./container/TreeContainer/OrderedSet":41}],43:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.default=p;function p(f){let y=typeof f;return y==="object"&&f!==null||y==="function"}},{}],44:[function(m,P,v){"use strict";Object.defineProperty(v,"t",{value:!0}),v.throwIteratorAccessError=p;function p(){throw new RangeError("Iterator access denied!")}},{}],45:[function(m,P,v){"use strict";let p=m("yallist"),f=Symbol("max"),y=Symbol("length"),c=Symbol("lengthCalculator"),o=Symbol("allowStale"),i=Symbol("maxAge"),r=Symbol("dispose"),e=Symbol("noDisposeOnSet"),t=Symbol("lruList"),s=Symbol("cache"),u=Symbol("updateAgeOnGet"),d=()=>1;class g{constructor(x){if(typeof x=="number"&&(x={max:x}),x||(x={}),x.max&&(typeof x.max!="number"||x.max<0))throw new TypeError("max must be a non-negative number");let O=this[f]=x.max||1/0,C=x.length||d;if(this[c]=typeof C!="function"?d:C,this[o]=x.stale||!1,x.maxAge&&typeof x.maxAge!="number")throw new TypeError("maxAge must be a number");this[i]=x.maxAge||0,this[r]=x.dispose,this[e]=x.noDisposeOnSet||!1,this[u]=x.updateAgeOnGet||!1,this.reset()}set max(x){if(typeof x!="number"||x<0)throw new TypeError("max must be a non-negative number");this[f]=x||1/0,E(this)}get max(){return this[f]}set allowStale(x){this[o]=!!x}get allowStale(){return this[o]}set maxAge(x){if(typeof x!="number")throw new TypeError("maxAge must be a non-negative number");this[i]=x,E(this)}get maxAge(){return this[i]}set lengthCalculator(x){typeof x!="function"&&(x=d),x!==this[c]&&(this[c]=x,this[y]=0,this[t].forEach(O=>{O.length=this[c](O.value,O.key),this[y]+=O.length})),E(this)}get lengthCalculator(){return this[c]}get length(){return this[y]}get itemCount(){return this[t].length}rforEach(x,O){O=O||this;for(let C=this[t].tail;C!==null;){let H=C.prev;z(this,x,C,O),C=H}}forEach(x,O){O=O||this;for(let C=this[t].head;C!==null;){let H=C.next;z(this,x,C,O),C=H}}keys(){return this[t].toArray().map(x=>x.key)}values(){return this[t].toArray().map(x=>x.value)}reset(){this[r]&&this[t]&&this[t].length&&this[t].forEach(x=>this[r](x.key,x.value)),this[s]=new Map,this[t]=new p,this[y]=0}dump(){return this[t].map(x=>h(this,x)?!1:{k:x.key,v:x.value,e:x.now+(x.maxAge||0)}).toArray().filter(x=>x)}dumpLru(){return this[t]}set(x,O,C){if(C=C||this[i],C&&typeof C!="number")throw new TypeError("maxAge must be a number");let H=C?Date.now():0,B=this[c](O,x);if(this[s].has(x)){if(B>this[f])return M(this,this[s].get(x)),!1;let ie=this[s].get(x).value;return this[r]&&(this[e]||this[r](x,ie.value)),ie.now=H,ie.maxAge=C,ie.value=O,this[y]+=B-ie.length,ie.length=B,this.get(x),E(this),!0}let ne=new T(x,O,B,H,C);return ne.length>this[f]?(this[r]&&this[r](x,O),!1):(this[y]+=ne.length,this[t].unshift(ne),this[s].set(x,this[t].head),E(this),!0)}has(x){if(!this[s].has(x))return!1;let O=this[s].get(x).value;return!h(this,O)}get(x){return _(this,x,!0)}peek(x){return _(this,x,!1)}pop(){let x=this[t].tail;return x?(M(this,x),x.value):null}del(x){M(this,this[s].get(x))}load(x){this.reset();let O=Date.now();for(let C=x.length-1;C>=0;C--){let H=x[C],B=H.e||0;if(B===0)this.set(H.k,H.v);else{let ne=B-O;ne>0&&this.set(H.k,H.v,ne)}}}prune(){this[s].forEach((x,O)=>_(this,O,!1))}}let _=(j,x,O)=>{let C=j[s].get(x);if(C){let H=C.value;if(h(j,H)){if(M(j,C),!j[o])return}else O&&(j[u]&&(C.value.now=Date.now()),j[t].unshiftNode(C));return H.value}},h=(j,x)=>{if(!x||!x.maxAge&&!j[i])return!1;let O=Date.now()-x.now;return x.maxAge?O>x.maxAge:j[i]&&O>j[i]},E=j=>{if(j[y]>j[f])for(let x=j[t].tail;j[y]>j[f]&&x!==null;){let O=x.prev;M(j,x),x=O}},M=(j,x)=>{if(x){let O=x.value;j[r]&&j[r](O.key,O.value),j[y]-=O.length,j[s].delete(O.key),j[t].removeNode(x)}};class T{constructor(x,O,C,H,B){this.key=x,this.value=O,this.length=C,this.now=H,this.maxAge=B||0}}let z=(j,x,O,C)=>{let H=O.value;h(j,H)&&(M(j,O),j[o]||(H=void 0)),H&&x.call(C,H.value,H.key,j)};P.exports=g},{yallist:84}],46:[function(m,P,v){(function(p){(function(){let f=P.exports;f.types={0:"reserved",1:"connect",2:"connack",3:"publish",4:"puback",5:"pubrec",6:"pubrel",7:"pubcomp",8:"subscribe",9:"suback",10:"unsubscribe",11:"unsuback",12:"pingreq",13:"pingresp",14:"disconnect",15:"auth"},f.codes={};for(let c in f.types){let o=f.types[c];f.codes[o]=c}f.CMD_SHIFT=4,f.CMD_MASK=240,f.DUP_MASK=8,f.QOS_MASK=3,f.QOS_SHIFT=1,f.RETAIN_MASK=1,f.VARBYTEINT_MASK=127,f.VARBYTEINT_FIN_MASK=128,f.VARBYTEINT_MAX=268435455,f.SESSIONPRESENT_MASK=1,f.SESSIONPRESENT_HEADER=p.from([f.SESSIONPRESENT_MASK]),f.CONNACK_HEADER=p.from([f.codes.connack<[0,1].map(i=>[0,1].map(r=>{let e=p.alloc(1);return e.writeUInt8(f.codes[c]<p.from([c])),f.EMPTY={pingreq:p.from([f.codes.pingreq<<4,0]),pingresp:p.from([f.codes.pingresp<<4,0]),disconnect:p.from([f.codes.disconnect<<4,0])}}).call(this)}).call(this,m("buffer").Buffer)},{buffer:3}],47:[function(m,P,v){(function(p){(function(){let f=m("./writeToStream"),y=m("events");function c(i,r){let e=new o;return f(i,e,r),e.concat()}class o extends y{constructor(){super(),this._array=new Array(20),this._i=0}write(r){return this._array[this._i++]=r,!0}concat(){let r=0,e=new Array(this._array.length),t=this._array,s=0,u;for(u=0;u>8,0),s.writeUInt8(t&255,1),s}function i(){for(let t=0;t<65536;t++)y[t]=o(t)}function r(t){let u=0,d=0,g=p.allocUnsafe(4);do u=t%128|0,t=t/128|0,t>0&&(u=u|128),g.writeUInt8(u,d++);while(t>0&&d<4);return t>0&&(d=0),c?g.subarray(0,d):g.slice(0,d)}function e(t){let s=p.allocUnsafe(4);return s.writeUInt32BE(t,0),s}P.exports={cache:y,generateCache:i,generateNumber:o,genBufVariableByteInt:r,generate4ByteBuffer:e}}).call(this)}).call(this,m("buffer").Buffer)},{buffer:3}],50:[function(m,P,v){class p{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}P.exports=p},{}],51:[function(m,P,v){let p=m("bl"),f=m("events"),y=m("./packet"),c=m("./constants"),o=m("debug")("mqtt-packet:parser");class i extends f{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof i?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):new i().parser(e)}_resetState(){o("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new y,this.error=null,this._list=p(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),o("parse: current state: %s",this._states[this._stateCounter]);(this.packet.length!==-1||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,o("parse: state complete. _stateCounter is now: %d",this._stateCounter),o("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return o("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){let e=this._list.readUInt8(0);return this.packet.cmd=c.types[e>>c.CMD_SHIFT],this.packet.retain=(e&c.RETAIN_MASK)!==0,this.packet.qos=e>>c.QOS_SHIFT&c.QOS_MASK,this.packet.dup=(e&c.DUP_MASK)!==0,o("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0}_parseLength(){let e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),o("_parseLength %d",e.value),!!e}_parsePayload(){o("_parsePayload: payload %O",this._list);let e=!1;if(this.packet.length===0||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"))}e=!0}return o("_parsePayload complete result: %s",e),e}_parseConnect(){o("_parseConnect");let e,t,s,u,d={},g=this.packet,_=this._parseString();if(_===null)return this._emitError(new Error("Cannot parse protocolId"));if(_!=="MQTT"&&_!=="MQIsdp")return this._emitError(new Error("Invalid protocolId"));if(g.protocolId=_,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(g.protocolVersion=this._list.readUInt8(this._pos),g.protocolVersion>=128&&(g.bridgeMode=!0,g.protocolVersion=g.protocolVersion-128),g.protocolVersion!==3&&g.protocolVersion!==4&&g.protocolVersion!==5)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(d.username=this._list.readUInt8(this._pos)&c.USERNAME_MASK,d.password=this._list.readUInt8(this._pos)&c.PASSWORD_MASK,d.will=this._list.readUInt8(this._pos)&c.WILL_FLAG_MASK,d.will&&(g.will={},g.will.retain=(this._list.readUInt8(this._pos)&c.WILL_RETAIN_MASK)!==0,g.will.qos=(this._list.readUInt8(this._pos)&c.WILL_QOS_MASK)>>c.WILL_QOS_SHIFT),g.clean=(this._list.readUInt8(this._pos)&c.CLEAN_SESSION_MASK)!==0,this._pos++,g.keepalive=this._parseNum(),g.keepalive===-1)return this._emitError(new Error("Packet too short"));if(g.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(g.properties=E)}let h=this._parseString();if(h===null)return this._emitError(new Error("Packet too short"));if(g.clientId=h,o("_parseConnect: packet.clientId: %s",g.clientId),d.will){if(g.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(g.will.properties=E)}if(e=this._parseString(),e===null)return this._emitError(new Error("Cannot parse will topic"));if(g.will.topic=e,o("_parseConnect: packet.will.topic: %s",g.will.topic),t=this._parseBuffer(),t===null)return this._emitError(new Error("Cannot parse will payload"));g.will.payload=t,o("_parseConnect: packet.will.paylaod: %s",g.will.payload)}if(d.username){if(u=this._parseString(),u===null)return this._emitError(new Error("Cannot parse username"));g.username=u,o("_parseConnect: packet.username: %s",g.username)}if(d.password){if(s=this._parseBuffer(),s===null)return this._emitError(new Error("Cannot parse password"));g.password=s}return this.settings=g,o("_parseConnect: complete"),g}_parseConnack(){o("_parseConnack");let e=this.packet;if(this._list.length<1)return null;if(e.sessionPresent=!!(this._list.readUInt8(this._pos++)&c.SESSIONPRESENT_MASK),this.settings.protocolVersion===5)this._list.length>=2?e.reasonCode=this._list.readUInt8(this._pos++):e.reasonCode=0;else{if(this._list.length<2)return null;e.returnCode=this._list.readUInt8(this._pos++)}if(e.returnCode===-1||e.reasonCode===-1)return this._emitError(new Error("Cannot parse return code"));if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}o("_parseConnack: complete")}_parsePublish(){o("_parsePublish");let e=this.packet;if(e.topic=this._parseString(),e.topic===null)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0&&!this._parseMessageId())){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),o("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){o("_parseSubscribe");let e=this.packet,t,s,u,d,g,_,h;if(e.qos!==1)return this._emitError(new Error("Wrong subscribe header"));if(e.subscriptions=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let E=this._parseProperties();Object.getOwnPropertyNames(E).length&&(e.properties=E)}for(;this._pos=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));s=this._parseByte(),u=s&c.SUBSCRIBE_OPTIONS_QOS_MASK,_=(s>>c.SUBSCRIBE_OPTIONS_NL_SHIFT&c.SUBSCRIBE_OPTIONS_NL_MASK)!==0,g=(s>>c.SUBSCRIBE_OPTIONS_RAP_SHIFT&c.SUBSCRIBE_OPTIONS_RAP_MASK)!==0,d=s>>c.SUBSCRIBE_OPTIONS_RH_SHIFT&c.SUBSCRIBE_OPTIONS_RH_MASK,h={topic:t,qos:u},this.settings.protocolVersion===5?(h.nl=_,h.rap=g,h.rh=d):this.settings.bridgeMode&&(h.rh=0,h.rap=!0,h.nl=!0),o("_parseSubscribe: push subscription `%s` to subscription",h),e.subscriptions.push(h)}}}_parseSuback(){o("_parseSuback");let e=this.packet;if(this.packet.granted=[],!!this._parseMessageId()){if(this.settings.protocolVersion===5){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}for(;this._pos2?(e.reasonCode=this._parseByte(),o("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)):e.reasonCode=0,e.length>3)){let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return!0}_parseDisconnect(){let e=this.packet;if(o("_parseDisconnect"),this.settings.protocolVersion===5){this._list.length>0?e.reasonCode=this._parseByte():e.reasonCode=0;let t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return o("_parseDisconnect result: true"),!0}_parseAuth(){o("_parseAuth");let e=this.packet;if(this.settings.protocolVersion!==5)return this._emitError(new Error("Not supported auth packet for this version MQTT"));e.reasonCode=this._parseByte();let t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),o("_parseAuth: result: true"),!0}_parseMessageId(){let e=this.packet;return e.messageId=this._parseNum(),e.messageId===null?(this._emitError(new Error("Cannot parse messageId")),!1):(o("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){let t=this._parseNum(),s=t+this._pos;if(t===-1||s>this._list.length||s>this.packet.length)return null;let u=this._list.toString("utf8",this._pos,s);return this._pos+=t,o("_parseString: result: %s",u),u}_parseStringPair(){return o("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){let e=this._parseNum(),t=e+this._pos;if(e===-1||t>this._list.length||t>this.packet.length)return null;let s=this._list.slice(this._pos,t);return this._pos+=e,o("_parseBuffer: result: %o",s),s}_parseNum(){if(this._list.length-this._pos<2)return-1;let e=this._list.readUInt16BE(this._pos);return this._pos+=2,o("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;let e=this._list.readUInt32BE(this._pos);return this._pos+=4,o("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){o("_parseVarByteNum");let t=4,s=0,u=1,d=0,g=!1,_,h=this._pos?this._pos:0;for(;s=s&&this._emitError(new Error("Invalid variable byte integer")),h&&(this._pos+=s),g=g?e?{bytes:s,value:d}:d:!1,o("_parseVarByteNum: result: %o",g),g}_parseByte(){let e;return this._pos=4)&&(b||q))w+=p.byteLength(b)+2;else{if(I<4)return k.emit("error",new Error("clientId must be supplied before 3.1.1")),!1;if(q*1===0)return k.emit("error",new Error("clientId must be given if cleanSession set to 0")),!1}if(typeof G!="number"||G<0||G>65535||G%1!==0)return k.emit("error",new Error("Invalid keepalive")),!1;if(w+=2,w+=1,I===5){var D=W(k,a);if(!D)return!1;w+=D.length}if(N){if(typeof N!="object")return k.emit("error",new Error("Invalid will")),!1;if(!N.topic||typeof N.topic!="string")return k.emit("error",new Error("Invalid will topic")),!1;if(w+=p.byteLength(N.topic)+2,w+=2,N.payload)if(N.payload.length>=0)typeof N.payload=="string"?w+=p.byteLength(N.payload):w+=N.payload.length;else return k.emit("error",new Error("Invalid will payload")),!1;var K={};if(I===5){if(K=W(k,N.properties),!K)return!1;w+=K.length}}let J=!1;if(l!=null)if(Z(l))J=!0,w+=p.byteLength(l)+2;else return k.emit("error",new Error("Invalid username")),!1;if(n!=null){if(!J)return k.emit("error",new Error("Username is required to use password")),!1;if(Z(n))w+=le(n)+2;else return k.emit("error",new Error("Invalid password")),!1}k.write(f.CONNECT_HEADER),Y(k,w),ee(k,R),te.bridgeMode&&(I+=128),k.write(I===131?f.VERSION131:I===132?f.VERSION132:I===4?f.VERSION4:I===5?f.VERSION5:f.VERSION3);let ue=0;return ue|=l!=null?f.USERNAME_MASK:0,ue|=n!=null?f.PASSWORD_MASK:0,ue|=N&&N.retain?f.WILL_RETAIN_MASK:0,ue|=N&&N.qos?N.qos<0&&g(k,b),a?.write(),r("publish: payload: %o",G),k.write(G)}function j(F,k,Q){let te=Q?Q.protocolVersion:4,R=F||{},I=R.cmd||"puback",N=R.messageId,q=R.dup&&I==="pubrel"?f.DUP_MASK:0,G=0,b=R.reasonCode,l=R.properties,n=te===5?3:2;if(I==="pubrel"&&(G=1),typeof N!="number")return k.emit("error",new Error("Invalid messageId")),!1;let a=null;if(te===5&&typeof l=="object"){if(a=U(k,l,Q,n),!a)return!1;n+=a.length}return k.write(f.ACKS[I][G][q][0]),Y(k,n),g(k,N),te===5&&k.write(p.from([b])),a!==null&&a.write(),!0}function x(F,k,Q){r("subscribe: packet: ");let te=Q?Q.protocolVersion:4,R=F||{},I=R.dup?f.DUP_MASK:0,N=R.messageId,q=R.subscriptions,G=R.properties,b=0;if(typeof N!="number")return k.emit("error",new Error("Invalid messageId")),!1;b+=2;let l=null;if(te===5){if(l=W(k,G),!l)return!1;b+=l.length}if(typeof q=="object"&&q.length)for(let a=0;a2)return k.emit("error",new Error("Invalid subscriptions - invalid Retain Handling")),!1}b+=p.byteLength(w)+2+1}else return k.emit("error",new Error("Invalid subscriptions")),!1;r("subscribe: writing to stream: %o",f.SUBSCRIBE_HEADER),k.write(f.SUBSCRIBE_HEADER[1][I?1:0][0]),Y(k,b),g(k,N),l!==null&&l.write();let n=!0;for(let a of q){let w=a.topic,D=a.qos,K=+a.nl,J=+a.rap,ue=a.rh,ce;S(k,w),ce=f.SUBSCRIBE_OPTIONS_QOS[D],te===5&&(ce|=K?f.SUBSCRIBE_OPTIONS_NL:0,ce|=J?f.SUBSCRIBE_OPTIONS_RAP:0,ce|=ue?f.SUBSCRIBE_OPTIONS_RH[ue]:0),n=k.write(p.from([ce]))}return n}function O(F,k,Q){let te=Q?Q.protocolVersion:4,R=F||{},I=R.messageId,N=R.granted,q=R.properties,G=0;if(typeof I!="number")return k.emit("error",new Error("Invalid messageId")),!1;if(G+=2,typeof N=="object"&&N.length)for(let l=0;lf.VARBYTEINT_MAX)return F.emit("error",new Error(`Invalid variable byte integer: ${k}`)),!1;let Q=ie[k];return Q||(Q=u(k),k<16384&&(ie[k]=Q)),r("writeVarByteInt: writing to stream: %o",Q),F.write(Q)}function S(F,k){let Q=p.byteLength(k);return g(F,Q),r("writeString: %s",k),F.write(k,"utf8")}function A(F,k,Q){S(F,k),S(F,Q)}function L(F,k){return r("writeNumberCached: number: %d",k),r("writeNumberCached: %o",e[k]),F.write(e[k])}function V(F,k){let Q=t(k);return r("writeNumberGenerated: %o",Q),F.write(Q)}function re(F,k){let Q=d(k);return r("write4ByteNumber: %o",Q),F.write(Q)}function ee(F,k){typeof k=="string"?S(F,k):k?(g(F,k.length),F.write(k)):g(F,0)}function W(F,k){if(typeof k!="object"||k.length!=null)return{length:1,write(){$(F,{},0)}};let Q=0;function te(I,N){let q=f.propertiesTypes[I],G=0;switch(q){case"byte":{if(typeof N!="boolean")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=2;break}case"int8":{if(typeof N!="number"||N<0||N>255)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=2;break}case"binary":{if(N&&N===null)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=1+p.byteLength(N)+2;break}case"int16":{if(typeof N!="number"||N<0||N>65535)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=3;break}case"int32":{if(typeof N!="number"||N<0||N>4294967295)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=5;break}case"var":{if(typeof N!="number"||N<0||N>268435455)return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=1+p.byteLength(u(N));break}case"string":{if(typeof N!="string")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=3+p.byteLength(N.toString());break}case"pair":{if(typeof N!="object")return F.emit("error",new Error(`Invalid ${I}: ${N}`)),!1;G+=Object.getOwnPropertyNames(N).reduce((b,l)=>{let n=N[l];return Array.isArray(n)?b+=n.reduce((a,w)=>(a+=3+p.byteLength(l.toString())+2+p.byteLength(w.toString()),a),0):b+=3+p.byteLength(l.toString())+2+p.byteLength(N[l].toString()),b},0);break}default:return F.emit("error",new Error(`Invalid property ${I}: ${N}`)),!1}return G}if(k)for(let I in k){let N=0,q=0,G=k[I];if(Array.isArray(G))for(let b=0;bI;){let q=R.shift();if(q&&k[q])delete k[q],N=W(F,k);else return!1}return N}function X(F,k,Q){switch(f.propertiesTypes[k]){case"byte":{F.write(p.from([f.properties[k]])),F.write(p.from([+Q]));break}case"int8":{F.write(p.from([f.properties[k]])),F.write(p.from([Q]));break}case"binary":{F.write(p.from([f.properties[k]])),ee(F,Q);break}case"int16":{F.write(p.from([f.properties[k]])),g(F,Q);break}case"int32":{F.write(p.from([f.properties[k]])),re(F,Q);break}case"var":{F.write(p.from([f.properties[k]])),Y(F,Q);break}case"string":{F.write(p.from([f.properties[k]])),S(F,Q);break}case"pair":{Object.getOwnPropertyNames(Q).forEach(R=>{let I=Q[R];Array.isArray(I)?I.forEach(N=>{F.write(p.from([f.properties[k]])),A(F,R.toString(),N.toString())}):(F.write(p.from([f.properties[k]])),A(F,R.toString(),I.toString()))});break}default:return F.emit("error",new Error(`Invalid property ${k} value: ${Q}`)),!1}}function $(F,k,Q){Y(F,Q);for(let te in k)if(Object.prototype.hasOwnProperty.call(k,te)&&k[te]!==null){let R=k[te];if(Array.isArray(R))for(let I=0;I0)return r(u);if(g==="number"&&isFinite(u))return d.long?t(u):e(u);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(u))};function r(u){if(u=String(u),!(u.length>100)){var d=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(u);if(d){var g=parseFloat(d[1]),_=(d[2]||"ms").toLowerCase();switch(_){case"years":case"year":case"yrs":case"yr":case"y":return g*i;case"weeks":case"week":case"w":return g*o;case"days":case"day":case"d":return g*c;case"hours":case"hour":case"hrs":case"hr":case"h":return g*y;case"minutes":case"minute":case"mins":case"min":case"m":return g*f;case"seconds":case"second":case"secs":case"sec":case"s":return g*p;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return g;default:return}}}}function e(u){var d=Math.abs(u);return d>=c?Math.round(u/c)+"d":d>=y?Math.round(u/y)+"h":d>=f?Math.round(u/f)+"m":d>=p?Math.round(u/p)+"s":u+"ms"}function t(u){var d=Math.abs(u);return d>=c?s(u,d,c,"day"):d>=y?s(u,d,y,"hour"):d>=f?s(u,d,f,"minute"):d>=p?s(u,d,p,"second"):u+" ms"}function s(u,d,g,_){var h=d>=g*1.5;return Math.round(u/g)+" "+_+(h?"s":"")}},{}],54:[function(m,P,v){let p=m("./lib/number-allocator.js");P.exports.NumberAllocator=p},{"./lib/number-allocator.js":55}],55:[function(m,P,v){"use strict";let p=m("js-sdsl").OrderedSet,f=m("debug")("number-allocator:trace"),y=m("debug")("number-allocator:error");function c(i,r){this.low=i,this.high=r}c.prototype.equals=function(i){return this.low===i.low&&this.high===i.high},c.prototype.compare=function(i){return this.lowe.compare(t)),f("Create"),this.clear()}o.prototype.firstVacant=function(){return this.ss.size()===0?null:this.ss.front().low},o.prototype.alloc=function(){if(this.ss.size()===0)return f("alloc():empty"),null;let i=this.ss.begin(),r=i.pointer.low,e=i.pointer.high,t=r;return t+1<=e?this.ss.updateKeyByIterator(i,new c(r+1,e)):this.ss.eraseElementByPos(0),f("alloc():"+t),t},o.prototype.use=function(i){let r=new c(i,i),e=this.ss.lowerBound(r);if(!e.equals(this.ss.end())){let t=e.pointer.low,s=e.pointer.high;return e.pointer.equals(r)?(this.ss.eraseElementByIterator(e),f("use():"+i),!0):t>i?!1:t===i?(this.ss.updateKeyByIterator(e,new c(t+1,s)),f("use():"+i),!0):s===i?(this.ss.updateKeyByIterator(e,new c(t,s-1)),f("use():"+i),!0):(this.ss.updateKeyByIterator(e,new c(i+1,s)),this.ss.insert(new c(t,i-1)),f("use():"+i),!0)}return f("use():failed"),!1},o.prototype.free=function(i){if(ithis.max){y("free():"+i+" is out of range");return}let r=new c(i,i),e=this.ss.upperBound(r);if(e.equals(this.ss.end())){if(e.equals(this.ss.begin())){this.ss.insert(r);return}e.pre();let t=e.pointer.high;e.pointer.high+1===i?this.ss.updateKeyByIterator(e,new c(t,i)):this.ss.insert(r)}else if(e.equals(this.ss.begin()))if(i+1===e.pointer.low){let t=e.pointer.high;this.ss.updateKeyByIterator(e,new c(i,t))}else this.ss.insert(r);else{let t=e.pointer.low,s=e.pointer.high;e.pre();let u=e.pointer.low;e.pointer.high+1===i?i+1===t?(this.ss.eraseElementByIterator(e),this.ss.updateKeyByIterator(e,new c(u,s))):this.ss.updateKeyByIterator(e,new c(u,i)):i+1===t?(this.ss.eraseElementByIterator(e.next()),this.ss.insert(new c(i,s))):this.ss.insert(r)}f("free():"+i)},o.prototype.clear=function(){f("clear()"),this.ss.clear(),this.ss.insert(new c(this.min,this.max))},o.prototype.intervalCount=function(){return this.ss.size()},o.prototype.dump=function(){console.log("length:"+this.ss.size());for(let i of this.ss)console.log(i)},P.exports=o},{debug:20,"js-sdsl":42}],56:[function(m,P,v){var p=m("wrappy");P.exports=p(f),P.exports.strict=p(y),f.proto=f(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return f(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return y(this)},configurable:!0})});function f(c){var o=function(){return o.called?o.value:(o.called=!0,o.value=c.apply(this,arguments))};return o.called=!1,o}function y(c){var o=function(){if(o.called)throw new Error(o.onceError);return o.called=!0,o.value=c.apply(this,arguments)},i=c.name||"Function wrapped with `once`";return o.onceError=i+" shouldn't be called more than once",o.called=!1,o}},{wrappy:80}],57:[function(m,P,v){(function(p){(function(){"use strict";typeof p>"u"||!p.version||p.version.indexOf("v0.")===0||p.version.indexOf("v1.")===0&&p.version.indexOf("v1.8.")!==0?P.exports={nextTick:f}:P.exports=p;function f(y,c,o,i){if(typeof y!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,e,t;switch(r){case 0:case 1:return p.nextTick(y);case 2:return p.nextTick(function(){y.call(null,c)});case 3:return p.nextTick(function(){y.call(null,c,o)});case 4:return p.nextTick(function(){y.call(null,c,o,i)});default:for(e=new Array(r-1),t=0;t2?"one of ".concat(t," ").concat(e.slice(0,s-1).join(", "),", or ")+e[s-1]:s===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function o(e,t,s){return e.substr(!s||s<0?0:+s,t.length)===t}function i(e,t,s){return(s===void 0||s>e.length)&&(s=e.length),e.substring(s-t.length,s)===t}function r(e,t,s){return typeof s!="number"&&(s=0),s+t.length>e.length?!1:e.indexOf(t,s)!==-1}y("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),y("ERR_INVALID_ARG_TYPE",function(e,t,s){var u;typeof t=="string"&&o(t,"not ")?(u="must not be",t=t.replace(/^not /,"")):u="must be";var d;if(i(e," argument"))d="The ".concat(e," ").concat(u," ").concat(c(t,"type"));else{var g=r(e,".")?"property":"argument";d='The "'.concat(e,'" ').concat(g," ").concat(u," ").concat(c(t,"type"))}return d+=". Received type ".concat(typeof s),d},TypeError),y("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),y("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),y("ERR_STREAM_PREMATURE_CLOSE","Premature close"),y("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),y("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),y("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),y("ERR_STREAM_WRITE_AFTER_END","write after end"),y("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),y("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),y("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),P.exports.codes=f},{}],59:[function(m,P,v){(function(p){(function(){"use strict";var f=Object.keys||function(u){var d=[];for(var g in u)d.push(g);return d};P.exports=e;var y=m("./_stream_readable"),c=m("./_stream_writable");m("inherits")(e,y);for(var o=f(c.prototype),i=0;i0)if(typeof l!="string"&&!D.objectMode&&Object.getPrototypeOf(l)!==r.prototype&&(l=t(l)),a)D.endEmitted?B(b,new x):A(b,D,l,!0);else if(D.ended)B(b,new z);else{if(D.destroyed)return!1;D.reading=!1,D.decoder&&!n?(l=D.decoder.write(l),D.objectMode||l.length!==0?A(b,D,l,!1):$(b,D)):A(b,D,l,!1)}else a||(D.reading=!1,$(b,D))}return!D.ended&&(D.length=V?b=V:(b--,b|=b>>>1,b|=b>>>2,b|=b>>>4,b|=b>>>8,b|=b>>>16,b++),b}function ee(b,l){return b<=0||l.length===0&&l.ended?0:l.objectMode?1:b!==b?l.flowing&&l.length?l.buffer.head.data.length:l.length:(b>l.highWaterMark&&(l.highWaterMark=re(b)),b<=l.length?b:l.ended?l.length:(l.needReadable=!0,0))}Y.prototype.read=function(b){d("read",b),b=parseInt(b,10);var l=this._readableState,n=b;if(b!==0&&(l.emittedReadable=!1),b===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended))return d("read: emitReadable",l.length,l.ended),l.length===0&&l.ended?N(this):U(this),null;if(b=ee(b,l),b===0&&l.ended)return l.length===0&&N(this),null;var a=l.needReadable;d("need readable",a),(l.length===0||l.length-b0?w=I(b,l):w=null,w===null?(l.needReadable=l.length<=l.highWaterMark,b=0):(l.length-=b,l.awaitDrain=0),l.length===0&&(l.ended||(l.needReadable=!0),n!==b&&l.ended&&N(this)),w!==null&&this.emit("data",w),w};function W(b,l){if(d("onEofChunk"),!l.ended){if(l.decoder){var n=l.decoder.end();n&&n.length&&(l.buffer.push(n),l.length+=l.objectMode?1:n.length)}l.ended=!0,l.sync?U(b):(l.needReadable=!1,l.emittedReadable||(l.emittedReadable=!0,X(b)))}}function U(b){var l=b._readableState;d("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,l.emittedReadable||(d("emitReadable",l.flowing),l.emittedReadable=!0,p.nextTick(X,b))}function X(b){var l=b._readableState;d("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&(l.length||l.ended)&&(b.emit("readable"),l.emittedReadable=!1),l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,R(b)}function $(b,l){l.readingMore||(l.readingMore=!0,p.nextTick(le,b,l))}function le(b,l){for(;!l.reading&&!l.ended&&(l.length1&&G(a.pipes,b)!==-1)&&!ce&&(d("false write response, pause",a.awaitDrain),a.awaitDrain++),n.pause())}function fe(Me){d("onerror",Me),Ie(),b.removeListener("error",fe),o(b,"error")===0&&B(b,Me)}oe(b,"error",fe);function xe(){b.removeListener("finish",Pe),Ie()}b.once("close",xe);function Pe(){d("onfinish"),b.removeListener("close",xe),Ie()}b.once("finish",Pe);function Ie(){d("unpipe"),n.unpipe(b)}return b.emit("pipe",n),a.flowing||(d("pipe resume"),n.resume()),b};function Z(b){return function(){var n=b._readableState;d("pipeOnDrain",n.awaitDrain),n.awaitDrain&&n.awaitDrain--,n.awaitDrain===0&&o(b,"data")&&(n.flowing=!0,R(b))}}Y.prototype.unpipe=function(b){var l=this._readableState,n={hasUnpiped:!1};if(l.pipesCount===0)return this;if(l.pipesCount===1)return b&&b!==l.pipes?this:(b||(b=l.pipes),l.pipes=null,l.pipesCount=0,l.flowing=!1,b&&b.emit("unpipe",this,n),this);if(!b){var a=l.pipes,w=l.pipesCount;l.pipes=null,l.pipesCount=0,l.flowing=!1;for(var D=0;D0,a.flowing!==!1&&this.resume()):b==="readable"&&!a.endEmitted&&!a.readableListening&&(a.readableListening=a.needReadable=!0,a.flowing=!1,a.emittedReadable=!1,d("on readable",a.length,a.reading),a.length?U(this):a.reading||p.nextTick(k,this)),n},Y.prototype.addListener=Y.prototype.on,Y.prototype.removeListener=function(b,l){var n=i.prototype.removeListener.call(this,b,l);return b==="readable"&&p.nextTick(F,this),n},Y.prototype.removeAllListeners=function(b){var l=i.prototype.removeAllListeners.apply(this,arguments);return(b==="readable"||b===void 0)&&p.nextTick(F,this),l};function F(b){var l=b._readableState;l.readableListening=b.listenerCount("readable")>0,l.resumeScheduled&&!l.paused?l.flowing=!0:b.listenerCount("data")>0&&b.resume()}function k(b){d("readable nexttick read 0"),b.read(0)}Y.prototype.resume=function(){var b=this._readableState;return b.flowing||(d("resume"),b.flowing=!b.readableListening,Q(this,b)),b.paused=!1,this};function Q(b,l){l.resumeScheduled||(l.resumeScheduled=!0,p.nextTick(te,b,l))}function te(b,l){d("resume",l.reading),l.reading||b.read(0),l.resumeScheduled=!1,b.emit("resume"),R(b),l.flowing&&!l.reading&&b.read(0)}Y.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function R(b){var l=b._readableState;for(d("flow",l.flowing);l.flowing&&b.read()!==null;);}Y.prototype.wrap=function(b){var l=this,n=this._readableState,a=!1;b.on("end",function(){if(d("wrapped end"),n.decoder&&!n.ended){var K=n.decoder.end();K&&K.length&&l.push(K)}l.push(null)}),b.on("data",function(K){if(d("wrapped data"),n.decoder&&(K=n.decoder.write(K)),!(n.objectMode&&K==null)&&!(!n.objectMode&&(!K||!K.length))){var J=l.push(K);J||(a=!0,b.pause())}});for(var w in b)this[w]===void 0&&typeof b[w]=="function"&&(this[w]=function(J){return function(){return b[J].apply(b,arguments)}}(w));for(var D=0;D=l.length?(l.decoder?n=l.buffer.join(""):l.buffer.length===1?n=l.buffer.first():n=l.buffer.concat(l.length),l.buffer.clear()):n=l.buffer.consume(b,l.decoder),n}function N(b){var l=b._readableState;d("endReadable",l.endEmitted),l.endEmitted||(l.ended=!0,p.nextTick(q,l,b))}function q(b,l){if(d("endReadableNT",b.endEmitted,b.length),!b.endEmitted&&b.length===0&&(b.endEmitted=!0,l.readable=!1,l.emit("end"),b.autoDestroy)){var n=l._writableState;(!n||n.autoDestroy&&n.finished)&&l.destroy()}}typeof Symbol=="function"&&(Y.from=function(b,l){return H===void 0&&(H=m("./internal/streams/from")),H(Y,b,l)});function G(b,l){for(var n=0,a=b.length;n-1))throw new C(I);return this._writableState.defaultEncoding=I,this},Object.defineProperty(ie.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function A(R,I,N){return!R.objectMode&&R.decodeStrings!==!1&&typeof I=="string"&&(I=e.from(I,N)),I}Object.defineProperty(ie.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function L(R,I,N,q,G,b){if(!N){var l=A(I,q,G);q!==l&&(N=!0,G="buffer",q=l)}var n=I.objectMode?1:q.length;I.length+=n;var a=I.length0?this.tail.next=E:this.head=E,this.tail=E,++this.length}},{key:"unshift",value:function(h){var E={data:h,next:this.head};this.length===0&&(this.tail=E),this.head=E,++this.length}},{key:"shift",value:function(){if(this.length!==0){var h=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,h}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(h){if(this.length===0)return"";for(var E=this.head,M=""+E.data;E=E.next;)M+=h+E.data;return M}},{key:"concat",value:function(h){if(this.length===0)return e.alloc(0);for(var E=e.allocUnsafe(h>>>0),M=this.head,T=0;M;)d(M.data,E,T),T+=M.data.length,M=M.next;return E}},{key:"consume",value:function(h,E){var M;return hz.length?z.length:h;if(j===z.length?T+=z:T+=z.slice(0,h),h-=j,h===0){j===z.length?(++M,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=z.slice(j));break}++M}return this.length-=M,T}},{key:"_getBuffer",value:function(h){var E=e.allocUnsafe(h),M=this.head,T=1;for(M.data.copy(E),h-=M.data.length;M=M.next;){var z=M.data,j=h>z.length?z.length:h;if(z.copy(E,E.length-h,0,j),h-=j,h===0){j===z.length?(++T,M.next?this.head=M.next:this.head=this.tail=null):(this.head=M,M.data=z.slice(j));break}++T}return this.length-=T,E}},{key:u,value:function(h,E){return s(this,f({},E,{depth:0,customInspect:!1}))}}]),g}()},{buffer:3,util:2}],66:[function(m,P,v){(function(p){(function(){"use strict";function f(e,t){var s=this,u=this._readableState&&this._readableState.destroyed,d=this._writableState&&this._writableState.destroyed;return u||d?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,p.nextTick(i,this,e)):p.nextTick(i,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(g){!t&&g?s._writableState?s._writableState.errorEmitted?p.nextTick(c,s):(s._writableState.errorEmitted=!0,p.nextTick(y,s,g)):p.nextTick(y,s,g):t?(p.nextTick(c,s),t(g)):p.nextTick(c,s)}),this)}function y(e,t){i(e,t),c(e)}function c(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.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 i(e,t){e.emit("error",t)}function r(e,t){var s=e._readableState,u=e._writableState;s&&s.autoDestroy||u&&u.autoDestroy?e.destroy(t):e.emit("error",t)}P.exports={destroy:f,undestroy:o,errorOrDestroy:r}}).call(this)}).call(this,m("_process"))},{_process:85}],67:[function(m,P,v){"use strict";var p=m("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function f(i){var r=!1;return function(){if(!r){r=!0;for(var e=arguments.length,t=new Array(e),s=0;s0;return e(z,x,O,function(C){M||(M=C),C&&T.forEach(t),!x&&(T.forEach(t),E(M))})});return _.reduce(s)}P.exports=d},{"../../../errors":58,"./end-of-stream":67}],70:[function(m,P,v){"use strict";var p=m("../../../errors").codes.ERR_INVALID_OPT_VALUE;function f(c,o,i){return c.highWaterMark!=null?c.highWaterMark:o?c[i]:null}function y(c,o,i,r){var e=f(o,r,i);if(e!=null){if(!(isFinite(e)&&Math.floor(e)===e)||e<0){var t=r?i:"highWaterMark";throw new p(t,e)}return Math.floor(e)}return c.objectMode?16:16*1024}P.exports={getHighWaterMark:y}},{"../../../errors":58}],71:[function(m,P,v){P.exports=m("events").EventEmitter},{events:4}],72:[function(m,P,v){v=P.exports=m("./lib/_stream_readable.js"),v.Stream=v,v.Readable=v,v.Writable=m("./lib/_stream_writable.js"),v.Duplex=m("./lib/_stream_duplex.js"),v.Transform=m("./lib/_stream_transform.js"),v.PassThrough=m("./lib/_stream_passthrough.js"),v.finished=m("./lib/internal/streams/end-of-stream.js"),v.pipeline=m("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":59,"./lib/_stream_passthrough.js":60,"./lib/_stream_readable.js":61,"./lib/_stream_transform.js":62,"./lib/_stream_writable.js":63,"./lib/internal/streams/end-of-stream.js":67,"./lib/internal/streams/pipeline.js":69}],73:[function(m,P,v){"use strict";function p(y,c,o){var i=this;this._callback=y,this._args=o,this._interval=setInterval(y,c,this._args),this.reschedule=function(r){r||(r=i._interval),i._interval&&clearInterval(i._interval),i._interval=setInterval(i._callback,r,i._args)},this.clear=function(){i._interval&&(clearInterval(i._interval),i._interval=void 0)},this.destroy=function(){i._interval&&clearInterval(i._interval),i._callback=void 0,i._interval=void 0,i._args=void 0}}function f(){if(typeof arguments[0]!="function")throw new Error("callback needed");if(typeof arguments[1]!="number")throw new Error("interval needed");var y;if(arguments.length>0){y=new Array(arguments.length-2);for(var c=0;c>5===6?2:T>>4===14?3:T>>3===30?4:T>>6===2?-1:-2}function r(T,z,j){var x=z.length-1;if(x=0?(O>0&&(T.lastNeed=O-1),O):--x=0?(O>0&&(T.lastNeed=O-2),O):--x=0?(O>0&&(O===2?O=0:T.lastNeed=O-3),O):0))}function e(T,z,j){if((z[0]&192)!==128)return T.lastNeed=0,"\uFFFD";if(T.lastNeed>1&&z.length>1){if((z[1]&192)!==128)return T.lastNeed=1,"\uFFFD";if(T.lastNeed>2&&z.length>2&&(z[2]&192)!==128)return T.lastNeed=2,"\uFFFD"}}function t(T){var z=this.lastTotal-this.lastNeed,j=e(this,T,z);if(j!==void 0)return j;if(this.lastNeed<=T.length)return T.copy(this.lastChar,z,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);T.copy(this.lastChar,z,0,T.length),this.lastNeed-=T.length}function s(T,z){var j=r(this,T,z);if(!this.lastNeed)return T.toString("utf8",z);this.lastTotal=j;var x=T.length-(j-this.lastNeed);return T.copy(this.lastChar,0,x),T.toString("utf8",z,x)}function u(T){var z=T&&T.length?this.write(T):"";return this.lastNeed?z+"\uFFFD":z}function d(T,z){if((T.length-z)%2===0){var j=T.toString("utf16le",z);if(j){var x=j.charCodeAt(j.length-1);if(x>=55296&&x<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1],j.slice(0,-1)}return j}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=T[T.length-1],T.toString("utf16le",z,T.length-1)}function g(T){var z=T&&T.length?this.write(T):"";if(this.lastNeed){var j=this.lastTotal-this.lastNeed;return z+this.lastChar.toString("utf16le",0,j)}return z}function _(T,z){var j=(T.length-z)%3;return j===0?T.toString("base64",z):(this.lastNeed=3-j,this.lastTotal=3,j===1?this.lastChar[0]=T[T.length-1]:(this.lastChar[0]=T[T.length-2],this.lastChar[1]=T[T.length-1]),T.toString("base64",z,T.length-j))}function h(T){var z=T&&T.length?this.write(T):"";return this.lastNeed?z+this.lastChar.toString("base64",0,3-this.lastNeed):z}function E(T){return T.toString(this.encoding)}function M(T){return T&&T.length?this.write(T):""}},{"safe-buffer":76}],79:[function(m,P,v){(function(p){(function(){P.exports=f;function f(c,o){if(y("noDeprecation"))return c;var i=!1;function r(){if(!i){if(y("throwDeprecation"))throw new Error(o);y("traceDeprecation")?console.trace(o):console.warn(o),i=!0}return c.apply(this,arguments)}return r}function y(c){try{if(!p.localStorage)return!1}catch{return!1}var o=p.localStorage[c];return o==null?!1:String(o).toLowerCase()==="true"}}).call(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],80:[function(m,P,v){P.exports=p;function p(f,y){if(f&&y)return p(f)(y);if(typeof f!="function")throw new TypeError("need wrapper function");return Object.keys(f).forEach(function(o){c[o]=f[o]}),c;function c(){for(var o=new Array(arguments.length),i=0;i0)for(var e=0,t=arguments.length;e1)e=r;else if(this.head)t=this.head.next,e=this.head.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=0;t!==null;s++)e=i(e,t.value,s),t=t.next;return e},p.prototype.reduceReverse=function(i,r){var e,t=this.tail;if(arguments.length>1)e=r;else if(this.tail)t=this.tail.prev,e=this.tail.value;else throw new TypeError("Reduce of empty list with no initial value");for(var s=this.length-1;t!==null;s--)e=i(e,t.value,s),t=t.prev;return e},p.prototype.toArray=function(){for(var i=new Array(this.length),r=0,e=this.head;e!==null;r++)i[r]=e.value,e=e.next;return i},p.prototype.toArrayReverse=function(){for(var i=new Array(this.length),r=0,e=this.tail;e!==null;r++)i[r]=e.value,e=e.prev;return i},p.prototype.slice=function(i,r){r=r||this.length,r<0&&(r+=this.length),i=i||0,i<0&&(i+=this.length);var e=new p;if(rthis.length&&(r=this.length);for(var t=0,s=this.head;s!==null&&tthis.length&&(r=this.length);for(var t=this.length,s=this.tail;s!==null&&t>r;t--)s=s.prev;for(;s!==null&&t>i;t--,s=s.prev)e.push(s.value);return e},p.prototype.splice=function(i,r,...e){i>this.length&&(i=this.length-1),i<0&&(i=this.length+i);for(var t=0,s=this.head;s!==null&&t1)for(var T=1;T= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=e-t,x=Math.floor,O=String.fromCharCode,C;function H(W){throw new RangeError(z[W])}function B(W,U){for(var X=W.length,$=[];X--;)$[X]=U(W[X]);return $}function ne(W,U){var X=W.split("@"),$="";X.length>1&&($=X[0]+"@",W=X[1]),W=W.replace(T,".");var le=W.split("."),Z=B(le,U).join(".");return $+Z}function oe(W){for(var U=[],X=0,$=W.length,le,Z;X<$;)le=W.charCodeAt(X++),le>=55296&&le<=56319&&X<$?(Z=W.charCodeAt(X++),(Z&64512)==56320?U.push(((le&1023)<<10)+(Z&1023)+65536):(U.push(le),X--)):U.push(le);return U}function ie(W){return B(W,function(U){var X="";return U>65535&&(U-=65536,X+=O(U>>>10&1023|55296),U=56320|U&1023),X+=O(U),X}).join("")}function Y(W){return W-48<10?W-22:W-65<26?W-65:W-97<26?W-97:e}function S(W,U){return W+22+75*(W<26)-((U!=0)<<5)}function A(W,U,X){var $=0;for(W=X?x(W/d):W>>1,W+=x(W/U);W>j*s>>1;$+=e)W=x(W/j);return x($+(j+1)*W/(W+u))}function L(W){var U=[],X=W.length,$,le=0,Z=_,F=g,k,Q,te,R,I,N,q,G,b;for(k=W.lastIndexOf(h),k<0&&(k=0),Q=0;Q=128&&H("not-basic"),U.push(W.charCodeAt(Q));for(te=k>0?k+1:0;te=X&&H("invalid-input"),q=Y(W.charCodeAt(te++)),(q>=e||q>x((r-le)/I))&&H("overflow"),le+=q*I,G=N<=F?t:N>=F+s?s:N-F,!(qx(r/b)&&H("overflow"),I*=b;$=U.length+1,F=A(le-R,$,R==0),x(le/$)>r-Z&&H("overflow"),Z+=x(le/$),le%=$,U.splice(le++,0,Z)}return ie(U)}function V(W){var U,X,$,le,Z,F,k,Q,te,R,I,N=[],q,G,b,l;for(W=oe(W),q=W.length,U=_,X=0,Z=g,F=0;F=U&&Ix((r-X)/G)&&H("overflow"),X+=(k-U)*G,U=k,F=0;Fr&&H("overflow"),I==U){for(Q=X,te=e;R=te<=Z?t:te>=Z+s?s:te-Z,!(Q0&&s>t&&(s=t);for(var u=0;u=0?(_=d.substr(0,g),h=d.substr(g+1)):(_=d,h=""),E=decodeURIComponent(_),M=decodeURIComponent(h),p(r,E)?f(r[E])?r[E].push(M):r[E]=[r[E],M]:r[E]=M}return r};var f=Array.isArray||function(y){return Object.prototype.toString.call(y)==="[object Array]"}},{}],88:[function(m,P,v){"use strict";var p=function(o){switch(typeof o){case"string":return o;case"boolean":return o?"true":"false";case"number":return isFinite(o)?o:"";default:return""}};P.exports=function(o,i,r,e){return i=i||"&",r=r||"=",o===null&&(o=void 0),typeof o=="object"?y(c(o),function(t){var s=encodeURIComponent(p(t))+r;return f(o[t])?y(o[t],function(u){return s+encodeURIComponent(p(u))}).join(i):s+encodeURIComponent(p(o[t]))}).join(i):e?encodeURIComponent(p(e))+r+encodeURIComponent(p(o)):""};var f=Array.isArray||function(o){return Object.prototype.toString.call(o)==="[object Array]"};function y(o,i){if(o.map)return o.map(i);for(var r=[],e=0;e",'"',"`"," ","\r",` `," "],e=["{","}","|","\\","^","`"].concat(r),t=["'"].concat(e),s=["%","/","?",";","#"].concat(t),u=["/","?","#"],d=255,g=/^[+a-z0-9A-Z_-]{0,63}$/,_=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,h={javascript:!0,"javascript:":!0},E={javascript:!0,"javascript:":!0},M={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},T=m("querystring");function z(C,H,B){if(C&&f.isObject(C)&&C instanceof y)return C;var ne=new y;return ne.parse(C,H,B),ne}y.prototype.parse=function(C,H,B){if(!f.isString(C))throw new TypeError("Parameter 'url' must be a string, not "+typeof C);var ne=C.indexOf("?"),oe=ne!==-1&&ne127?Q+="x":Q+=k[te];if(!Q.match(g)){var I=Z.slice(0,W),N=Z.slice(W+1),q=k.match(_);q&&(I.push(q[1]),N.unshift(q[2])),N.length&&(S="/"+N.join(".")+S),this.hostname=I.join(".");break}}}this.hostname.length>d?this.hostname="":this.hostname=this.hostname.toLowerCase(),le||(this.hostname=p.toASCII(this.hostname));var G=this.port?":"+this.port:"",b=this.hostname||"";this.host=b+G,this.href+=this.host,le&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),S[0]!=="/"&&(S="/"+S))}if(!h[V])for(var W=0,F=t.length;W0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return B.search=C.search,B.query=C.query,(!f.isNull(B.pathname)||!f.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.href=B.format(),B}if(!Z.length)return B.pathname=null,B.search?B.path="/"+B.search:B.path=null,B.href=B.format(),B;for(var te=Z.slice(-1)[0],R=(B.host||C.host||Z.length>1)&&(te==="."||te==="..")||te==="",I=0,N=Z.length;N>=0;N--)te=Z[N],te==="."?Z.splice(N,1):te===".."?(Z.splice(N,1),I++):I&&(Z.splice(N,1),I--);if(!$&&!le)for(;I--;I)Z.unshift("..");$&&Z[0]!==""&&(!Z[0]||Z[0].charAt(0)!=="/")&&Z.unshift(""),R&&Z.join("/").substr(-1)!=="/"&&Z.push("");var q=Z[0]===""||Z[0]&&Z[0].charAt(0)==="/";if(k){B.hostname=B.host=q?"":Z.length?Z.shift():"";var Q=B.host&&B.host.indexOf("@")>0?B.host.split("@"):!1;Q&&(B.auth=Q.shift(),B.host=B.hostname=Q.shift())}return $=$||B.host&&Z.length,$&&!q&&Z.unshift(""),Z.length?B.pathname=Z.join("/"):(B.pathname=null,B.path=null),(!f.isNull(B.pathname)||!f.isNull(B.search))&&(B.path=(B.pathname?B.pathname:"")+(B.search?B.search:"")),B.auth=C.auth||B.auth,B.slashes=B.slashes||C.slashes,B.href=B.format(),B},y.prototype.parseHost=function(){var C=this.host,H=o.exec(C);H&&(H=H[0],H!==":"&&(this.port=H.substr(1)),C=C.substr(0,C.length-H.length)),C&&(this.hostname=C)}},{"./util":91,punycode:86,querystring:89}],91:[function(m,P,v){"use strict";P.exports={isString:function(p){return typeof p=="string"},isObject:function(p){return typeof p=="object"&&p!==null},isNull:function(p){return p===null},isNullOrUndefined:function(p){return p==null}}},{}]},{},[17])(17)})});function ri(se,ae){if(se&1&&(ge(0,"th",5),we(1),de()),se&2){let me=ae.$implicit;pe(),Ee(me.title)}}function ii(se,ae){if(se&1&&(ge(0,"td",7),we(1),de()),se&2){let me=ae.$implicit,m=Be().$implicit;pe(),Ee(m[me.key])}}function ni(se,ae){if(se&1&&(ge(0,"tr"),Ce(1,ii,2,1,"td",6),de()),se&2){let me=Be();pe(),_e("ngForOf",me.columns)}}var wi=(()=>{let ae=class ae{constructor(){this.columns=[],this.data=[]}ngOnInit(){console.log(this.data)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["app-data-v-lj-table"]],inputs:{columns:"columns",data:"data"},standalone:!0,features:[Se],decls:7,vars:4,consts:[["nzBordered","","nzSize","small",3,"nzData","nzPageSize"],["dynamicTable",""],["style",` background: rgb(8 22 48); /* color: #bfceff !important; */ color: #75f9fd; text-align: center; border: 0.5px solid #ffffff !important; `,"nzShowSort","true",4,"ngFor","ngForOf"],[2,"background","rgb(8 22 48)"],[4,"ngFor","ngForOf"],["nzShowSort","true",2,"background","rgb(8 22 48)","/* color","#bfceff !important",`*/ color`,"#75f9fd","text-align","center","border","0.5px solid #ffffff !important"],["style","text-align: center; color: #75f9fd; border: 0.5px solid #ffffff !important; transition: background 0.3s",4,"ngFor","ngForOf"],[2,"text-align","center","color","#75f9fd","border","0.5px solid #ffffff !important","transition","background 0.3s"]],template:function(P,v){if(P&1&&(ge(0,"nz-table",0,1)(2,"thead")(3,"tr"),Ce(4,ri,2,1,"th",2),de()(),ge(5,"tbody",3),Ce(6,ni,2,1,"tr",4),de()()),P&2){let p=Et(1);_e("nzData",v.data)("nzPageSize",5),pe(4),_e("ngForOf",v.columns),pe(2),_e("ngForOf",p.data)}},dependencies:[je,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,Ge,Ye,ct,pt,qe,ht,rt,Ve,Je,Qe,pr,hr,cr,fr,mr,dr,gr,ft,Fe,Le,ot,He,Ne,We,Ke,Te,St,Tt],styles:[".ant-table-bordered[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%], .ant-table-bordered[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-color:#fff!important}.tableColor[_ngcontent-%COMP%] .ant-table-tbody[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > td[_ngcontent-%COMP%]{border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important;transition:background .3s}.tableColor[_ngcontent-%COMP%] .ant-table-thead[_ngcontent-%COMP%] > tr[_ngcontent-%COMP%] > th[_ngcontent-%COMP%]{color:#bfceff!important;background-color:transparent!important;border-right:3px solid #2b3e71!important;border-bottom:1px solid #334474!important}"]});let se=ae;return se})();var Si=(()=>{let ae=class ae{agInit(m){this.cellValue=this.getValueToDisplay(m)}refresh(m){return this.cellValue=this.getValueToDisplay(m),!0}buttonClicked(){alert(`\u70B9\u51FB\u4E86 ${this.cellValue}`)}getValueToDisplay(m){return m.valueFormatted?m.valueFormatted:m.value}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["ng-component"]],standalone:!0,features:[Se],decls:3,vars:1,consts:[[2,"display","flex","justify-content","center","align-items","center","height","100%"],[1,"ag-grid-button-style",3,"click"]],template:function(P,v){P&1&&(ge(0,"span",0)(1,"button",1),Ae("click",function(){return v.buttonClicked()}),we(2),de()()),P&2&&(pe(2),Ee(v.cellValue))},styles:[".ag-grid-button-style[_ngcontent-%COMP%]{cursor:pointer;display:inline-block;width:90px;margin:4px;padding:8px 12px;font-weight:800;color:#e0e0e0;text-align:center;text-decoration:none;background-color:#1e4d6b;border:none;transition:background-color .3s,color .3s}.ag-grid-button-style[_ngcontent-%COMP%]:hover{color:#fff;text-decoration:underline;background-color:#3a6d8c}"]});let se=ae;return se})();function si(se,ae){se&1&&(ge(0,"button",7),we(1,"\u63D0\u4EA4"),de())}function ai(se,ae){se&1&&(ge(0,"button",7),we(1,"\u6253\u5370"),de())}function li(se,ae){se&1&&ke(0,"span",8)}var ui=["*"],Jr=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.showEditButton=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-data-v-card"]],inputs:{showSetting:"showSetting",showEditButton:"showEditButton",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Se],ngContentSelectors:ui,decls:10,vars:4,consts:[[1,"card-content"],[1,"card-top-content"],[1,"card-content-title"],[1,"card-content-l"],[1,"buttons-container"],["class","card-button",4,"ngIf"],["nz-icon","","nzType","setting","nzTheme","outline",4,"ngIf"],[1,"card-button"],["nz-icon","","nzType","setting","nzTheme","outline"]],template:function(P,v){P&1&&(wt(),ge(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),we(4),de()(),ge(5,"div",4),Ce(6,si,2,0,"button",5)(7,ai,2,0,"button",5)(8,li,1,0,"span",6),de()(),vt(9),de()),P&2&&(pe(4),Ee(v.title),pe(2),_e("ngIf",v.showEditButton),pe(),_e("ngIf",v.showEditButton),pe(),_e("ngIf",v.showSetting))},dependencies:[Ne,xt,Te,Ct,Ve,je,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,It,Ge,Ye,ct,pt,qe,ht,rt,Je,Qe,ft,Fe,Le,ot,He,We,Ke],styles:['.card-top-content[_ngcontent-%COMP%]{display:grid;grid-template-columns:auto auto;align-items:start;justify-content:space-between;margin-bottom:10px}.buttons-container[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:flex-end}.card-button[_ngcontent-%COMP%], span[nz-icon][_ngcontent-%COMP%]{margin-left:.5rem}.card-button[_ngcontent-%COMP%]{cursor:pointer;width:72px;height:40px;font-size:24px;line-height:20px;color:#00eff8;text-align:center;background-color:#213069;border:none;border-radius:3px}.card-content[_ngcontent-%COMP%]{overflow:hidden;height:250px;margin-bottom:.5rem;padding:1rem 1.5rem;padding:1rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-repeat:no-repeat;background-position:center;background-size:100% 100%}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;flex-grow:1;align-items:center;justify-content:space-between;width:fit-content;height:fit-content;margin-bottom:.5rem;padding:5px 20px;font-size:28px;font-weight:600;line-height:22px;color:#74fafb;color:#00eff8;text-align:center;background-color:#19426e;border:1px solid #1f6f97;border-radius:10px 10px 0 0;box-shadow:inset 0 0 10px #1f6f97}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{flex:1;align-self:flex-start}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var ci=["myGrid"],Wi=(()=>{let ae=class ae{constructor(){this.title="",this.gridOptions={headerHeight:0,suppressHorizontalScroll:!1,suppressNoRowsOverlay:!0,domLayout:"autoHeight"},this.showEditButton=!1,this.showSetting=!1,this.showPageTurning=!0,this.defaultColDef={width:80,editable:!1,headerClass:"ag-header-center",cellStyle:{"font-weight":"bold",textAlign:"center","justify-content":"center","line-height":"38px"}},this.columnDefs=[],this.rowData=[],this.gridThemeClass="ag-theme-quartz",this.paginationThemeClass="ag-theme-quartz",this.tableColumns=[{key:"sort",title:"\u5E8F\u53F7"},{key:"time",title:"\u65F6\u95F4"},{key:"option",title:"\u64CD\u4F5C"},{key:"optionDesc",title:"\u64CD\u4F5C\u63CF\u8FF0"},{key:"optionMan",title:"\u64CD\u4F5C\u4EBA\u5458"},{key:"mark",title:"\u5907\u6CE8"},{key:"edit",title:"\u7F16\u8F91"}],this.tableData=[{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u9501\u5B9A",optionDesc:"\u9501\u5B9A1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"},{sort:"1",time:"2024.1.12 18:23",option:"\u91CA\u653E",optionDesc:"\u91CA\u653E1\u53F7\u78C5",optionMan:"\u5F20\u4E09",mark:"\u65E9\u6668",edit:"\u6309\u94AE"}]}ngOnInit(){this.showPageTurning?console.log("showPageTurning:",this.showPageTurning):console.log("showPageTurning has not true"),this.title?console.log("Title has been passed:",this.title):console.log("Title has not been passed"),console.log("-----\u8868\u683C\u521D\u59CB\u5316-----"),this.pageSize=5,this.pageIndex=1,this.pageRowTotal=this.rowData.length,this.gridOptions={headerHeight:0,rowData:this.rowData,columnDefs:this.columnDefs}}onGridReady(m){console.log("onGridReady"),console.log(m),setTimeout(()=>{m.api.sizeColumnsToFit()},100)}nzPageSizeChange(m){this.pageSize=m}nzPageIndexChange(m){console.log(`nzPageIndexChange${m}`),this.grid.api&&(m==1?this.grid.api.paginationGoToFirstPage():this.grid.api.paginationGoToPage(m))}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["lj-app-ag-grid-component"]],viewQuery:function(P,v){if(P&1&&Jt(ci,5),P&2){let p;Xt(p=Zt())&&(v.grid=p.first)}},inputs:{title:"title",showEditButton:"showEditButton",showSetting:"showSetting",showPageTurning:"showPageTurning",defaultColDef:"defaultColDef",columnDefs:"columnDefs",rowData:"rowData",gridThemeClass:"gridThemeClass",paginationThemeClass:"paginationThemeClass"},standalone:!0,features:[Se],decls:8,vars:18,consts:[["nz-col","","nzSpan","24","nzXs","24","nzSm","24","nzMd","12","nzLg","12","nzXl","12","nzXXl","12",3,"showEditButton","showSetting","title"],[3,"suppressPaginationPanel","suppressScrollOnNewData","paginationPageSize","defaultColDef","rowHeight","gridOptions","gridReady"],["myGrid",""],[1,"grid-pagination",3,"hidden"],[1,"page-total-style"],["nzShowSizeChanger","",3,"nzPageIndex","nzPageSize","nzTotal","className","nzPageSizeChange","nzPageIndexChange"]],template:function(P,v){P&1&&(ge(0,"lj-data-v-card",0)(1,"ag-grid-angular",1,2),Ae("gridReady",function(f){return v.onGridReady(f)}),de(),ke(3,"br"),ge(4,"div",3)(5,"div",4),we(6),de(),ge(7,"nz-pagination",5),Ae("nzPageSizeChange",function(f){return v.nzPageSizeChange(f)})("nzPageIndexChange",function(f){return v.nzPageIndexChange(f)}),de()()()),P&2&&($t("title",v.title),_e("showEditButton",v.showEditButton)("showSetting",v.showSetting),pe(),Gt(v.gridThemeClass),_e("suppressPaginationPanel",!0)("suppressPaginationPanel",!0)("suppressScrollOnNewData",!0)("paginationPageSize",v.pageSize)("defaultColDef",v.defaultColDef)("rowHeight",38)("gridOptions",v.gridOptions),pe(3),_e("hidden",!v.showPageTurning),pe(2),er("\u5171 ",v.pageRowTotal," \u9879\u6570\u636E"),pe(),_e("nzPageIndex",v.pageIndex)("nzPageSize",v.pageSize)("nzTotal",v.pageRowTotal)("className",v.paginationThemeClass))},dependencies:[Te,yr,Tt,ur,Jr],styles:[".grid-pagination[_ngcontent-%COMP%]{display:flex;justify-content:space-between;height:32px}.grid-pagination[_ngcontent-%COMP%] .ant-select-selection-item, .ant-select-selector[_ngcontent-%COMP%]{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .page-total-style{font-size:medium;font-weight:700;color:#00eff8} .ant-select-item-option{color:#00eff8!important} .ant-select-item-option-active div{font-weight:800!important;color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .anticon{color:#00eff8}.grid-pagination[_ngcontent-%COMP%] .ant-select-selector{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-prev .ant-pagination-item-link{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item{color:#00eff8;border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item a{color:#00eff8!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active a{color:#000!important}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-next button, .ant-pagination-prev[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{color:#00eff8;border-color:transparent}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active:focus-visible, .ant-pagination-item-active[_ngcontent-%COMP%]:hover, .ant-pagination-next[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%], .ant-pagination-prev[_ngcontent-%COMP%]:hover button[_ngcontent-%COMP%]{border-color:#00eff8;border-width:2px}.grid-pagination[_ngcontent-%COMP%] .ant-pagination-item-active{font-weight:500;background-color:#00eff8;border-color:#00eff8;border-width:2px}"]});let se=ae;return se})();function hi(se,ae){if(se&1){let me=Yt();ge(0,"li",9)(1,"label",10),Ae("ngModelChange",function(P){let p=Rt(me).$implicit;return kt(p.checked=P)})("ngModelChange",function(){Rt(me);let P=Be(2);return kt(P.onCheckChange())}),we(2),de()()}if(se&2){let me=ae.$implicit;pe(),_e("ngModel",me.checked),pe(),Ee(me.label)}}function fi(se,ae){if(se&1&&(ge(0,"div",4),ke(1,"a",5),ge(2,"nz-dropdown-menu",null,6)(4,"ul",7),Ce(5,hi,3,2,"li",8),de()()()),se&2){let me=Et(3),m=Be();pe(),_e("nzDropdownMenu",me),pe(4),_e("ngForOf",m.optionsList)}}var pi=["*"],en=(()=>{let ae=class ae{constructor(){this.showSetting=!1,this.optionsList=[],this.onCheckedItemsChange=new be,this.title=""}getCheckedItems(){return this.optionsList.filter(m=>m.checked)}onCheckChange(){let m=this.getCheckedItems();this.onCheckedItemsChange.emit(m)}};ae.\u0275fac=function(P){return new(P||ae)},ae.\u0275cmp=ve({type:ae,selectors:[["data-v-card"]],inputs:{showSetting:"showSetting",optionsList:"optionsList",title:"title"},outputs:{onCheckedItemsChange:"onCheckedItemsChange"},standalone:!0,features:[Se],ngContentSelectors:pi,decls:6,vars:2,consts:[[1,"card-content"],[1,"card-content-title"],[1,"card-content-l"],["class","card-content-r",4,"ngIf"],[1,"card-content-r"],["nz-dropdown","","nz-icon","","nzType","setting","nzTrigger","click","nzTheme","outline",3,"nzDropdownMenu"],["menu","nzDropdownMenu"],["nz-menu","","nzSelectable",""],["nz-menu-item","",4,"ngFor","ngForOf"],["nz-menu-item",""],["nz-checkbox","",3,"ngModel","ngModelChange"]],template:function(P,v){P&1&&(wt(),ge(0,"div",0)(1,"div",1)(2,"div",2),we(3),de(),Ce(4,fi,6,2,"div",3),de(),vt(5),de()),P&2&&(pe(3),Ee(v.title),pe(),_e("ngIf",v.showSetting))},dependencies:[Ne,xt,Te,St,Ct,Ve,or,nr,sr,ar,lr,je,tr,rr,ze,st,Ze,lt,ut,at,nt,Ue,$e,Xe,dt,it,tt,et,De,It,Ge,Ye,ct,pt,qe,ht,rt,Je,Qe,ft,Fe,Le,ot,He,We,ir,Ke],styles:['.card-content[_ngcontent-%COMP%]{overflow:hidden;padding:1rem 1.5rem;background-image:url("./media/dashboard_card_bg-2QFDBQFD.jpg");background-position:top;background-size:cover;margin-bottom:.5rem}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%]{display:flex;margin-bottom:.5rem;font-size:18px;font-weight:600;color:#74fafb}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-l[_ngcontent-%COMP%]{align-self:flex-start;flex:1}.card-content[_ngcontent-%COMP%] .card-content-title[_ngcontent-%COMP%] .card-content-r[_ngcontent-%COMP%]{align-self:flex-end}']});let se=ae;return se})();var hn=Lt(Nt(),1),Zr=Lt(Nt(),1);var gt=function(se){return se[se.CLOSED=0]="CLOSED",se[se.CONNECTING=1]="CONNECTING",se[se.CONNECTED=2]="CONNECTED",se}(gt||{});var di=new Mt("NgxMqttServiceConfig"),gi=new Mt("NgxMqttClientService");function At(se,...ae){if(!ae.length)return se;let me=ae.shift();if(Dt(se)&&Dt(me))for(let m in me)Dt(me[m])?(se[m]||Object.assign(se,{[m]:{}}),At(se[m],me[m])):Object.assign(se,{[m]:me[m]});return At(se,...ae)}function Dt(se){return se&&typeof se=="object"&&!Array.isArray(se)}var dn=(()=>{let ae=class ae{constructor(m,P){this.options=m,this.observables={},this.state=new zt(gt.CLOSED),this.messages=new Pt,this._clientId=this._generateClientId(),this._connectTimeout=1e4,this._reconnectPeriod=1e4,this._onConnect=new be,this._onReconnect=new be,this._onClose=new be,this._onOffline=new be,this._onError=new be,this._onEnd=new be,this._onMessage=new be,this._onSuback=new be,this._onPacketsend=new be,this._onPacketreceive=new be,this._handleOnConnect=v=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(p=>{this.client.subscribe(p)}),this.state.next(gt.CONNECTED),this._onConnect.emit(v)},this._handleOnReconnect=()=>{this.options.connectOnCreate===!0&&Object.keys(this.observables).forEach(v=>{this.client.subscribe(v)}),this.state.next(gt.CONNECTING),this._onReconnect.emit()},this._handleOnClose=()=>{this.state.next(gt.CLOSED),this._onClose.emit()},this._handleOnOffline=()=>{this._onOffline.emit()},this._handleOnError=v=>{this._onError.emit(v),console.error(v)},this._handleOnEnd=()=>{this._onEnd.emit()},this._handleOnMessage=(v,p,f)=>{this._onMessage.emit(f),f.cmd==="publish"&&this.messages.next(f)},this._handleOnPacketsend=v=>{this._onPacketsend.emit(v)},this._handleOnPacketreceive=v=>{this._onPacketreceive.emit(v)},m.connectOnCreate!==!1&&this.connect({},P),this.state.subscribe()}get clientId(){return this._clientId}get onConnect(){return this._onConnect}get onReconnect(){return this._onReconnect}get onClose(){return this._onClose}get onOffline(){return this._onOffline}get onError(){return this._onError}get onEnd(){return this._onEnd}get onMessage(){return this._onMessage}get onPacketsend(){return this._onPacketsend}get onPacketreceive(){return this._onPacketreceive}get onSuback(){return this._onSuback}static filterMatchesTopic(m,P){if(m[0]==="#"&&P[0]==="$")return!1;let v=(m||"").split("/").reverse(),p=(P||"").split("/").reverse(),f=()=>{let y=v.pop(),c=p.pop();switch(y){case"#":return!0;case"+":return c?f():!1;default:return y===c&&(y===void 0?!0:f())}};return f()}connect(m,P){let v=At(this.options||{},m),p=v.protocol||"ws",f=v.hostname||"localhost";v.url?this._url=v.url:(this._url=`${p}://${f}`,this._url+=v.port?`:${v.port}`:"",this._url+=v.path?`${v.path}`:""),this.state.next(gt.CONNECTING);let y=At({clientId:this._clientId,reconnectPeriod:this._reconnectPeriod,connectTimeout:this._connectTimeout},v);this.client&&this.client.end(!0),P?this.client=P:this.client=(0,Zr.connect)(this._url,y),this._clientId=y.clientId,this.client.on("connect",this._handleOnConnect),this.client.on("reconnect",this._handleOnReconnect),this.client.on("close",this._handleOnClose),this.client.on("offline",this._handleOnOffline),this.client.on("error",this._handleOnError),this.client.stream.on("error",this._handleOnError),this.client.on("end",this._handleOnEnd),this.client.on("message",this._handleOnMessage),this.client.on("packetsend",this._handleOnPacketsend),this.client.on("packetreceive",this._handleOnPacketreceive)}disconnect(m=!0){if(!this.client)throw new Error("mqtt client not connected");this.client.end(m)}observeRetained(m,P={qos:1}){return this._generalObserve(m,()=>Kt(1),P)}observe(m,P={qos:1}){return this._generalObserve(m,()=>qt(),P)}_generalObserve(m,P,v){if(!this.client)throw new Error("mqtt client not connected");if(!this.observables[m]){let p=new Pt;this.observables[m]=Vt(()=>{let f=new Ft;return this.client.subscribe(m,v,(y,c)=>{c&&c.forEach(o=>{o.qos===128&&(delete this.observables[o.topic],this.client.unsubscribe(o.topic),p.error(`subscription for '${o.topic}' rejected!`)),this._onSuback.emit({filter:m,granted:o.qos!==128})})}),f.add(()=>{delete this.observables[m],this.client.unsubscribe(m)}),f},f=>Wt(p,this.messages)).pipe(Ht(f=>ae.filterMatchesTopic(m,f.topic)),P(),jt())}return this.observables[m]}publish(m,P,v={}){if(!this.client)throw new Error("mqtt client not connected");return Ut.create(p=>{this.client.publish(m,P,v,f=>{f?p.error(f):(p.next(),p.complete())})})}unsafePublish(m,P,v={}){if(!this.client)throw new Error("mqtt client not connected");this.client.publish(m,P,v,p=>{if(p)throw p})}_generateClientId(){return"client-"+Math.random().toString(36).substr(2,19)}};ae.\u0275fac=function(P){return new(P||ae)(Ot(di),Ot(gi))},ae.\u0275prov=Qt({token:ae,factory:ae.\u0275fac,providedIn:"root"});let se=ae;return se})();export{Si as a,wi as b,Wi as c,en as d,dn as e};