vrpc 3.16.0 → 3.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser/vrpc.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see vrpc.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vrpc=t():e.vrpc=t()}(self,()=>(()=>{var e={41:(e,t,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!s&&s(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===a&&f?f.enumerable:!a,value:r,writable:null===l&&f?f.writable:!l});else{if(!u&&(a||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},76:e=>{"use strict";e.exports=Function.prototype.call},128:(e,t)=>{"use strict";function r(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.validateTopic=r,t.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!r(e[t]))return e[t];return null}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+e[t+f],f+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*g}},397:(e,t,r)=>{"use strict";const n=r(8287),i=r(9584),o=r(2635);let s,a,l,c=!1;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const u=function(e,t){const r="alis"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return s=t.my,s.connectSocket({url:u,protocols:r}),a=function(){const e=new i.Transform;return e._write=(e,t,r)=>{s.sendSocketMessage({data:e.buffer,success(){r()},fail(){r(new Error)}})},e._flush=e=>{s.closeSocket({success(){e()}})},e}(),l=new o.BufferedDuplex(t,a,s),c||(c=!0,s.onSocketOpen(()=>{l.socketReady()}),s.onSocketMessage(e=>{if("string"==typeof e.data){const t=n.Buffer.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?a.push(n.Buffer.from(t.result)):a.push(n.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),s.onSocketClose(()=>{l.end(),l.destroy()}),s.onSocketError(e=>{l.destroy(e)})),l}},414:e=>{"use strict";e.exports=Math.round},453:(e,t,r)=>{"use strict";var n,i=r(9612),o=r(9383),s=r(1237),a=r(9290),l=r(9538),c=r(8068),u=r(9675),f=r(5345),h=r(1514),d=r(8968),p=r(6188),g=r(8002),b=r(5880),y=r(414),_=r(3093),m=Function,w=function(e){try{return m('"use strict"; return ('+e+").constructor;")()}catch(e){}},v=r(5795),S=r(655),E=function(){throw new u},A=v?function(){try{return E}catch(e){try{return v(arguments,"callee").get}catch(e){return E}}}():E,k=r(4039)(),I=r(3628),O=r(1064),R=r(8648),T=r(1002),x=r(76),P={},N="undefined"!=typeof Uint8Array&&I?I(Uint8Array):n,j={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&I?I([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&I?I(I([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&I?I((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&I?I((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&I?I(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":A,"%TypedArray%":N,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":x,"%Function.prototype.apply%":T,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":O,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":g,"%Math.pow%":b,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":R};if(I)try{null.error}catch(e){var M=I(I(e));j["%Error.prototype%"]=M}var C=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&I&&(r=I(i.prototype))}return j[t]=r,r},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=r(6743),F=r(9957),$=D.call(x,Array.prototype.concat),B=D.call(T,Array.prototype.splice),U=D.call(x,String.prototype.replace),W=D.call(x,String.prototype.slice),q=D.call(x,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,H=function(e,t){var r,n=e;if(F(L,n)&&(n="%"+(r=L[n])[0]+"%"),F(j,n)){var i=j[n];if(i===P&&(i=C(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=W(e,0,1),r=W(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,V,function(e,t,r,i){n[n.length]=r?U(i,z,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=H("%"+n+"%",t),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],B(r,$([0,1],l)));for(var f=1,h=!0;f<r.length;f+=1){var d=r[f],p=W(d,0,1),g=W(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===g||"'"===g||"`"===g)&&p!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&h||(a=!0),F(j,o="%"+(n+="."+d)+"%"))s=j[o];else if(null!=s){if(!(d in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&f+1>=r.length){var b=v(s,d);s=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[d]}else h=F(s,d),s=s[d];h&&!a&&(j[o]=s)}}return s}},487:(e,t,r)=>{"use strict";var n=r(6897),i=r(655),o=r(3126),s=r(2205);e.exports=function(e){var t=o(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:s}):e.exports.apply=s},495:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(1021),o=n(r(3497)),s=r(4723);t.default=(e,t,r)=>{e.log("_handleConnack");const{options:n}=e,a=5===n.protocolVersion?t.reasonCode:t.returnCode;if(e.connackReceived){const t=new s.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",t)}if(e.connackReceived=!0,clearTimeout(e.connackTimer),delete e.topicAliasSend,e._serverProperties=t.properties,t.properties&&t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new o.default(t.properties.topicAliasMaximum))}if(0===a)e.reconnecting=!1,e._onConnect(t);else if(a>0){e.log("_handleConnack :: connection refused with reason code %d",a);const t=new s.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[a]}`,a);r?.discardParsedPackets(),e.reconnectSuppressed=!0,e._cleanUp(!0);try{e.emit("error",t)}finally{n.reconnectOnConnackError&&(e.reconnectSuppressed=!1,e._setupReconnect())}}}},507:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(9675),a=n("%Map%",!0),l=i("Map.prototype.get",!0),c=i("Map.prototype.set",!0),u=i("Map.prototype.has",!0),f=i("Map.prototype.delete",!0),h=i("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+o(e))},delete:function(t){if(e){var r=f(e,t);return 0===h(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},519:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(4469);e.exports=o;const i=r(6269);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n(o.prototype,i.prototype),n(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},537:(e,t,r)=>{var n=r(2045),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<i;a=n[++r])y(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+l+"$","i")}function c(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),h(n,e,n.depth)}function u(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function f(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=h(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return _(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(k(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var c,u="",f=!1,S=["{","}"];return g(r)&&(f=!0,S=["[","]"]),k(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(u=" "+RegExp.prototype.toString.call(r)),E(r)&&(u=" "+Date.prototype.toUTCString.call(r)),A(r)&&(u=" "+d(r)),0!==s.length||f&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)T(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,f)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,S)):S[0]+u+S[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),T(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=y(r)?h(e,l.value,null):h(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function g(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function y(e){return null===e}function _(e){return"number"==typeof e}function m(e){return"string"==typeof e}function w(e){return void 0===e}function v(e){return S(e)&&"[object RegExp]"===I(e)}function S(e){return"object"==typeof e&&null!==e}function E(e){return S(e)&&"[object Date]"===I(e)}function A(e){return S(e)&&("[object Error]"===I(e)||e instanceof Error)}function k(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=g,t.isBoolean=b,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=_,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=v,t.types.isRegExp=v,t.isObject=S,t.isDate=E,t.types.isDate=E,t.isError=A,t.types.isNativeError=A,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[O((e=new Date).getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(x&&e[x]){var t;if("function"!=typeof(t=e[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),x&&Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=x,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then(function(e){n.nextTick(s.bind(null,null,e))},function(e){n.nextTick(P.bind(null,e,s))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},544:e=>{const t=/^Connection refused/;class r{constructor(e,{max:t=3e4}={}){this._client=e,this._base=e.options.reconnectPeriod,this._max=Math.max(t,this._base),this._next=this._base,e.on("error",e=>{r.isRefusal(e)&&this._slowDown()}),e.on("connect",()=>this._restore())}static isRefusal(e){return!!e&&"number"==typeof e.code&&t.test(e.message||"")}get period(){return this._client.options.reconnectPeriod}hurry(){this._restore();const e=this._client;e.connected||e.disconnecting||!e.reconnecting||"function"==typeof e._clearReconnect&&(e._clearReconnect(),e._setupReconnect())}_slowDown(){const e=this._client;e.options.reconnectPeriod=this._next,this._next=Math.min(2*this._next,this._max),"function"==typeof e._clearReconnect&&e._clearReconnect()}_restore(){this._next=this._base,this._client.options.reconnectPeriod=this._base}}e.exports=r},576:e=>{e.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},577:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:i,codes:o}=r(2074),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:c}=r(7797),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:d}=r(1580),{Promise:p,PromisePrototypeThen:g,SymbolDispose:b}=r(4469),{isClosed:y,isReadable:_,isReadableNodeStream:m,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:T,kIsClosedPromise:x}=r(5980);let P;const N=()=>{};function j(e,t,o){var d,p;if(2===arguments.length?(o=t,t=l):null==t?t=l:h(t,"options"),f(o,"callback"),u(t.signal,"options.signal"),o=c(o),w(e)||k(e))return function(e,t,o){let s=!1,a=N;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{P=P||r(7797).addAbortListener;const n=P(t.signal,a),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[x].promise,l,l),N}(e,t,o);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const j=null!==(d=t.readable)&&void 0!==d?d:m(e),M=null!==(p=t.writable)&&void 0!==p?p:A(e),C=e._writableState,L=e._readableState,D=()=>{e.writable||B()};let F=T(e)&&m(e)===j&&A(e)===M,$=I(e,!1);const B=()=>{$=!0,e.destroyed&&(F=!1),(!F||e.readable&&!j)&&(j&&!U||o.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(F=!1),(!F||e.writable&&!M)&&(M&&!$||o.call(e))},q=t=>{o.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?o.call(e,t):j&&!U&&m(e,!0)&&!v(e,!1)?o.call(e,new a):!M||$||I(e,!1)?void o.call(e):o.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?M&&!C&&(e.on("end",D),e.on("close",D)):(e.on("complete",B),F||e.on("abort",z),e.req?G():e.on("request",G)),F||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=C&&C.errorEmitted||null!=L&&L.errorEmitted?F||n.nextTick(H):(j||F&&!_(e)||!$&&!1!==E(e))&&(M||F&&!E(e)||!U&&!1!==_(e))?L&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{o=N,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",D),e.removeListener("close",D),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{P=P||r(7797).addAbortListener;const n=P(t.signal,s),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}}return K}e.exports=j,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p((r,i)=>{const o=j(e,t,e=>{n&&o(),e?i(e):r()})})}},579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}},592:(e,t,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(i(e,r))return!1;for(const r of t.names)if(i(e,r))return!0;return!1},t.humanize=r(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},778:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(1428)),o=n(r(7833)),s=n(r(6968)),a=(0,o.default)("mqttjs:tcp");t.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,s.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});const{port:r,path:n}=t,o=t.hostname;return a("port %d and host %s",r,o),i.default.createConnection({port:r,host:o,path:n})}},920:(e,t,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(4803),s=r(507),a=r(2271)||s||o;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+i(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},968:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},982:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(4469),{AbortError:i,codes:o}=r(2074),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(5980),c=r(577),{ERR_INVALID_ARG_TYPE:u}=o;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{f=f||r(7797).addAbortListener;const i=f(e,o);c(t,i[n])}return t}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=void 0;const n=r(4723);t.ReasonCodes={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"};const i={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]};t.default=(e,r)=>{const{messageId:o}=r,s=r.cmd;let a=null;const l=e.outgoing[o],c=l?l.cb:null;let u=null;if(c){if(!i[l.cmd]?.includes(s))return e.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",s,l.cmd,o),void e.emit("error",new Error(`Protocol error: ${s} does not answer the ${l.cmd} pending on message id ${o}`));switch(e.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{const i=r.reasonCode;i&&i>0&&16!==i?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[i]}`,i),e._removeOutgoingAndStoreMessage(o,()=>{c(u,r)})):e._removeOutgoingAndStoreMessage(o,c);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:o};const i=r.reasonCode;i&&i>0&&16!==i?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[i]}`,i),e._removeOutgoingAndStoreMessage(o,()=>{c(u,r)})):e._sendPacket(a);break}case"suback":{delete e.outgoing[o],e.messageIdProvider.deallocate(o);const n=r.granted;for(let r=0;r<n.length;r++){const i=n[r];if(128&i){u=new Error(`Subscribe error: ${t.ReasonCodes[i]}`),u.code=i;const r=e.messageIdToTopic[o];r&&r.forEach(t=>{delete e._resubscribeTopics[t]})}}delete e.messageIdToTopic[o],e._invokeStoreProcessingQueue(),c(u,r);break}case"unsuback":delete e.outgoing[o],e.messageIdProvider.deallocate(o),e._invokeStoreProcessingQueue(),c(null,r);break;default:e.emit("error",new Error("unrecognized packet type"))}e.disconnecting&&0===Object.keys(e.outgoing).length&&e.emit("outgoingEmpty")}else e.log("_handleAck :: Server sent an ack in error. Ignoring.")}},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1072:(e,t)=>{t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},1077:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(1093),o=Object.keys,s=o?function(e){return o(e)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},1237:e=>{"use strict";e.exports=EvalError},1278:(e,t,r)=>{t.parser=r(3079).parser,t.generate=r(2535),t.writeToStream=r(3132)},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},1396:(e,t,r)=>{e.exports=r(7007).EventEmitter},1401:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=r(4469),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(2074).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const h=new e({objectMode:!0,highWaterMark:1,...r});let d=!1;return h._read=function(){d||(d=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new c;if(h.push(t))continue;d=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},h}},1428:()=>{},1514:e=>{"use strict";e.exports=Math.abs},1580:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:b}=r(4469),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(2074),{normalizeEncoding:E}=r(7797),{isAsyncFunction:A,isArrayBufferView:k}=r(7797).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),x=y((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new v(t,`>= ${n} && <= ${i}`,e)});function P(e,t){if("string"!=typeof e)throw new m(t,"string",e)}const N=y((e,t,r)=>{if(!i(r,e)){const n=o(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function j(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function M(e,t,r){return null!=e&&h(e,t)?e[t]:r}const C=y((e,t,r=null)=>{const i=M(r,"allowArray",!1),o=M(r,"allowFunction",!1);if(!M(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)}),L=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)}),D=y((e,t,r=0)=>{if(!n(e))throw new m(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),F=y((e,t="buffer")=>{if(!k(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}),$=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new m(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!d(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===d(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return x(e,t),e},validateArray:D,validateStringArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)P(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++){const n=e[r],i=`${t}[${r}]`;if(null==n)throw new m(i,"AbortSignal",n);$(n,i)}},validateBoolean:j,validateBuffer:F,validateDictionary:L,validateEncoding:function(e,t){const r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:T,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:N,validatePlainFunction:U,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===b(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new _(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(P(e,t),void 0===I[e]){if(void 0!==I[g(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:P,validateUint32:x,validateUndefined:W,validateUnion:function(e,t,r){if(!i(r,e))throw new m(t,`('${o(r,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const i=e[n];V(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},1591:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1676:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=t.KeepaliveManager=t.UniqueMessageIdProvider=t.DefaultMessageIdProvider=t.Store=t.MqttClient=t.connectAsync=t.connect=t.Client=void 0;const c=l(r(9777));t.MqttClient=c.default;const u=l(r(579));t.DefaultMessageIdProvider=u.default;const f=l(r(2099));t.UniqueMessageIdProvider=f.default;const h=l(r(7969));t.Store=h.default;const d=s(r(2793));t.connect=d.default,Object.defineProperty(t,"connectAsync",{enumerable:!0,get:function(){return d.connectAsync}});const p=l(r(3175));t.KeepaliveManager=p.default,t.Client=c.default,a(r(9777),t),a(r(4723),t),a(r(128),t);var g=r(1021);Object.defineProperty(t,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})},1766:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var l=r(8287).Buffer,c=r(3779).inspect,u=c&&c.custom||"inspect";function f(e,t,r){l.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return l.alloc(0);for(var t=l.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=l.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1787:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=r(2074),{Symbol:a}=r(4469),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(5980),h=a("kDestroy"),d=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,r){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(b,e,t):n.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function b(e,t){_(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function _(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(_,e,t):_(e,t))}function w(e){let t=!1;function r(r){if(t)return void m(e,null!=r?r:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,r):r?m(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(d)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(d,t),e.listenerCount(d)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,o=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,function(r){g(this,i(r,e),t)}),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}},1860:(e,t,r)=>{"use strict";e.exports={VrpcClient:r(8577),VrpcAgent:r(6171),VrpcAdapter:r(8665)}},1999:(e,t,r)=>{"use strict";var n,i=r(2045);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=k,k.WritableState=A;var s,a={deprecate:r(4643)},l=r(1396),c=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(4347),h=r(6644).getHighWaterMark,d=r(2463).F,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function A(e,t,s){n=n||r(8101),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(P,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),P(e,t))}(e,r,n,t,o);else{var s=T(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(e,r),n?i.nextTick(O,e,r,s,o):O(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function k(e){var t=this instanceof(n=n||r(8101));if(!t&&!s.call(k,this))return new k(e);this._writableState=new A(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function I(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function R(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,l=!0;r;)i[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;i.allBuffers=l,I(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(I(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var r=T(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(k,l),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===k&&e&&e._writableState instanceof A}})):s=function(e){return e instanceof this},k.prototype.pipe=function(){S(this,new y)},k.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof u);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new w;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,a,n,i,o);return l}(this,o,a,e,t,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new g("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}},2045:(e,t,r)=>{"use strict";const n=r(5606);n.nextTick=function(e,...t){queueMicrotask(()=>e(...t))},e.exports=n},2070:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=r(2768),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(9157).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const h=new e({objectMode:!0,highWaterMark:1,...r});let d=!1;return h._read=function(){d||(d=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new c;if(h.push(t))continue;d=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},h}},2074:(e,t,r)=>{"use strict";const{format:n,inspect:i}=r(2858),{AggregateError:o}=r(4469),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return f(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?o.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),d("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),d("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=h(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=h(n)),n+="n"}else n=i(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},2099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4807);t.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new n.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}},2100:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(4469),{validateInteger:o}=r(1580),{ERR_INVALID_ARG_VALUE:s}=r(2074).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,o){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=a){if(!i(a)||a<0)throw new s(o?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?l=t:a=t}}},2205:(e,t,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(3144);e.exports=function(){return o(n,i,arguments)}},2271:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(507),a=r(9675),l=n("%WeakMap%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),h=i("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+o(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return h(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?f(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},2299:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(4133);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),g=h(Object.prototype.toString),b=r(537).types,y=b.isAnyArrayBuffer,_=b.isArrayBufferView,m=b.isDate,w=b.isMap,v=b.isRegExp,S=b.isSet,E=b.isNativeError,A=b.isBoxedPrimitive,k=b.isNumberObject,I=b.isStringObject,O=b.isBooleanObject,R=b.isBigIntObject,T=b.isSymbolObject,x=b.isFloat32Array,P=b.isFloat64Array;function N(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function j(e){return Object.keys(e).filter(N).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function M(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function C(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==o(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i,a,l,u,h=g(e);if(h!==g(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=j(e),p=j(t);return d.length===p.length&&D(e,t,r,n,1,d)}if("[object Object]"===h&&(!w(e)&&w(t)||!S(e)&&S(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(v(e)){if(!v(t)||(l=e,u=t,!(s?l.source===u.source&&l.flags===u.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(u))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(_(e)){if(r||!x(e)&&!P(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===M(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var b=j(e),N=j(t);return b.length===N.length&&D(e,t,r,n,0,b)}if(S(e))return!(!S(t)||e.size!==t.size)&&D(e,t,r,n,2);if(w(e))return!(!w(t)||e.size!==t.size)&&D(e,t,r,n,3);if(y(e)){if(a=t,(i=e).byteLength!==a.byteLength||0!==M(new Uint8Array(i),new Uint8Array(a)))return!1}else if(A(e)&&!function(e,t){return k(e)?k(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):I(e)?I(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):R(e)?R(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):T(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return D(e,t,r,n,0)}function L(e,t){return t.filter(function(t){return p(e,t)})}function D(e,t,r,i,s,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var h=0;h<c.length;h++)if(!d(t,c[h]))return!1;if(r&&5===arguments.length){var g=u(e);if(0!==g.length){var b=0;for(h=0;h<g.length;h++){var y=g[h];if(p(e,y)){if(!p(t,y))return!1;c.push(y),b++}else if(p(t,y))return!1}var _=u(t);if(g.length!==_.length&&L(t,_).length!==b)return!1}else{var m=u(t);if(0!==m.length&&0!==L(t,m).length)return!1}}if(0===c.length&&(0===s||1===s&&0===e.length||0===e.size))return!0;if(void 0===i)i={val1:new Map,val2:new Map,position:0};else{var w=i.val1.get(e);if(void 0!==w){var v=i.val2.get(t);if(void 0!==v)return w===v}i.position++}i.val1.set(e,i.position),i.val2.set(t,i.position);var S=function(e,t,r,i,s,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var i=null,s=a(e),l=0;l<s.length;l++){var c=s[l];if("object"===o(c)&&null!==c)null===i&&(i=new Set),i.add(c);else if(!t.has(c)){if(r)return!1;if(!B(e,t,c))return!1;null===i&&(i=new Set),i.add(c)}}if(null!==i){for(var u=a(t),f=0;f<u.length;f++){var h=u[f];if("object"===o(h)&&null!==h){if(!F(i,h,r,n))return!1}else if(!r&&!e.has(h)&&!F(i,h,r,n))return!1}return 0===i.size}return!0}(e,t,r,s))return!1}else if(3===c){if(!function(e,t,r,i){for(var s=null,a=l(e),c=0;c<a.length;c++){var u=n(a[c],2),f=u[0],h=u[1];if("object"===o(f)&&null!==f)null===s&&(s=new Set),s.add(f);else{var d=t.get(f);if(void 0===d&&!t.has(f)||!C(h,d,r,i)){if(r)return!1;if(!U(e,t,f,h,i))return!1;null===s&&(s=new Set),s.add(f)}}}if(null!==s){for(var p=l(t),g=0;g<p.length;g++){var b=n(p[g],2),y=b[0],_=b[1];if("object"===o(y)&&null!==y){if(!W(s,e,y,_,r,i))return!1}else if(!(r||e.has(y)&&C(e.get(y),_,!1,i)||W(s,e,y,_,!1,i)))return!1}return 0===s.size}return!0}(e,t,r,s))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var f=Object.keys(e);u<f.length;u++){var h=f[u];if(!d(t,h)||!C(e[h],t[h],r,s))return!1}return f.length===Object.keys(t).length}if(!d(t,u)||!C(e[u],t[u],r,s))return!1}for(u=0;u<i.length;u++){var p=i[u];if(!C(e[p],t[p],r,s))return!1}return!0}(e,t,r,c,i,s);return i.val1.delete(e),i.val2.delete(t),S}function F(e,t,r,n){for(var i=a(e),o=0;o<i.length;o++){var s=i[o];if(C(t,s,r,n))return e.delete(s),!0}return!1}function $(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function B(e,t,r){var n=$(r);return null!=n?n:t.has(n)&&!e.has(n)}function U(e,t,r,n,i){var o=$(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!C(n,s,!1,i))&&!e.has(o)&&C(n,s,!1,i)}function W(e,t,r,n,i,o){for(var s=a(e),l=0;l<s.length;l++){var c=s[l];if(C(r,c,i,o)&&C(n,t.get(c),i,o))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return C(e,t,!1)},isDeepStrictEqual:function(e,t){return C(e,t,!0)}}},2463:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,l;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof l&&(l=0),l+1>(a=e).length||-1===a.indexOf(".",l)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},2464:(e,t,r)=>{"use strict";var n=r(8452),i=r(6642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2535:(e,t,r)=>{const n=r(3132),{EventEmitter:i}=r(7007),{Buffer:o}=r(8287);class s extends i{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let n,i=0;for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?t[n]=r[n].length:t[n]=o.byteLength(r[n]),e+=t[n];const s=o.allocUnsafe(e);for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?(r[n].copy(s,i),i+=t[n]):(s.write(r[n],i),i+=t[n]);return s}destroy(e){e&&this.emit("error",e)}}e.exports=function(e,t){const r=new s;return n(e,r,t),r.concat()}},2634:()=>{},2635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedDuplex=void 0,t.writev=o;const n=r(9584),i=r(8287);function o(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=i.Buffer.from(e[t].chunk,"utf8"):r[t]=e[t].chunk;this._write(i.Buffer.concat(r),"binary",t)}class s extends n.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=o.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){const{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}}t.BufferedDuplex=s},2639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}},2642:(e,t,r)=>{"use strict";var n=r(7720),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,r,o){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(s),u=c?s.slice(0,c.index):s,f=[];if(u){if(!r.plainObjects&&i.call(Object.prototype,u)&&!r.allowPrototypes)return;f.push(u)}for(var h=0;r.depth>0&&null!==(c=a.exec(s))&&h<r.depth;){if(h+=1,!r.plainObjects&&i.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(c[1])}if(c){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");f.push("["+s.slice(c.index)+"]")}return function(e,t,r,i){var o=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");o=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=i?t:l(t,r,o),c=e.length-1;c>=0;--c){var u,f=e[c];if("[]"===f&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:n.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var h="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,d=r.decodeDotInKeys?h.replace(/%2E/g,"."):h,p=parseInt(d,10);r.parseArrays||""!==d?!isNaN(p)&&f!==d&&String(p)===d&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(u=[])[p]=a:"__proto__"!==d&&(u[d]=a):u={0:a}}a=u}return a}(f,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?s.charset:e.charset,r=void 0===e.duplicates?s.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||s.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var r={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,f=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&f.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var h,d=-1,p=t.charset;if(t.charsetSentinel)for(h=0;h<f.length;++h)0===f[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[h]?p="utf-8":"utf8=%26%2310003%3B"===f[h]&&(p="iso-8859-1"),d=h,h=f.length);for(h=0;h<f.length;++h)if(h!==d){var g,b,y=f[h],_=y.indexOf("]="),m=-1===_?y.indexOf("="):_+1;-1===m?(g=t.decoder(y,s.decoder,p,"key"),b=t.strictNullHandling?null:""):(g=t.decoder(y.slice(0,m),s.decoder,p,"key"),b=n.maybeMap(l(y.slice(m+1),t,o(r[g])?r[g].length:0),function(e){return t.decoder(e,s.decoder,p,"value")})),b&&t.interpretNumericEntities&&"iso-8859-1"===p&&(b=a(String(b))),y.indexOf("[]=")>-1&&(b=o(b)?[b]:b);var w=i.call(r,g);w&&"combine"===t.duplicates?r[g]=n.combine(r[g],b):w&&"last"!==t.duplicates||(r[g]=b)}return r}(e,r):e,f=r.plainObjects?{__proto__:null}:{},h=Object.keys(u),d=0;d<h.length;++d){var p=h[d],g=c(p,u[p],r,"string"==typeof e);f=n.merge(f,g,r)}return!0===r.allowSparse?f:n.compact(f)}},2648:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=r(2768);e.exports=c;const a=r(9214),l=r(7602);s(c.prototype,a.prototype),s(c,a);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function h(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5224)),f(e,"body")}},2682:(e,t,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=e,"[object Array]"===i.call(a)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,s):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s)}},2729:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:p,Symbol:g}=r(4469);e.exports=G,G.ReadableState=H;const{EventEmitter:b}=r(7007),{Stream:y,prependListener:_}=r(4474),{Buffer:m}=r(8287),{addAbortSignal:w}=r(982),v=r(577);let S=r(7797).debuglog("stream",e=>{S=e});const E=r(3158),A=r(1787),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(2100),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:x,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:j}=r(2074),{validateObject:M}=r(1580),C=g("kPaused"),{StringDecoder:L}=r(7487),D=r(1401);u(G.prototype,y.prototype),u(G,y);const F=()=>{},{errorOrDestroy:$}=A,B=1,U=16,W=32,q=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(7323);this._readableState=new H(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const i=e._readableState;let o;if(0===(i.state&B)&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=m.from(t,r).toString(i.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new R("chunk",["string","Buffer","Uint8Array"],t))),o)$(e,o);else if(null===t)i.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,i);else if(0!==(i.state&B)||t&&t.length>0)if(n)if(4&i.state)$(e,new N);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)$(e,new P);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else n||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),64&t.state&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function oe(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=F;function i(t){this===e?(n(),n=F):n=t}e.on("readable",i);const o=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=F});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(i)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),o()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[d]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new x("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,i=!!(64&t.state);if(S("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,S("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,S("reading, ended or constructing",i);else if(i){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){$(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),S("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===n.stdout||e===n.stderr?g:s;function s(){S("onend"),e.end()}let a;i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",function t(n,o){S("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,S("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(S("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(S("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?$(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",p),g()}function p(){S("onfinish"),e.removeListener("close",d),g()}function g(){S("unpipe"),r.unpipe(e)}return r.on("data",u),_(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():i.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=i(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){const r=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S("on readable",i.length,i.reading),i.length?Y(this):i.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{$(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return oe(this)},G.prototype.iterator=function(e){return void 0!==e&&M(e,"options"),oe(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[C]},set(e){this[C]=!!e}}}),G._fromList=se,G.from=function(e,t){return D(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},2732:e=>{"use strict";function t(e,t){let r=0,n=0,i=-1,o=0;for(;n<t.length;)if(r<e.length&&"*"===e[r])i=r++,o=n;else if(r<e.length&&e[r]===t[n])r++,n++;else{if(-1===i)return!1;r=i+1,n=++o}for(;r<e.length&&"*"===e[r];)r++;return r===e.length}e.exports={matches:t,isSelection:function(e){const t=e=>"string"==typeof e&&e.length>0;return Array.isArray(e)?e.length>0&&e.every(t):t(e)},selects:function(e,r){return Array.isArray(e)?e.some(e=>t(e,r)):t(e,r)},selectsAll:function(e){return Array.isArray(e)?e.includes("*"):"*"===e}}},2768:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:t,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},2793:function(e,t,r){"use strict";var n=r(2045),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.connectAsync=function(e,t,r=!0){return new Promise((n,i)=>{const o=f(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach(e=>{o.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{o.on(e,s[e])})})};const o=i(r(7833)),s=i(r(8835)),a=i(r(9777)),l=i(r(6887));"function"!=typeof n?.nextTick&&(n.nextTick=setImmediate);const c=(0,o.default)("mqttjs");let u=null;function f(e,t){if(c("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){const r=s.default.parse(e,!0),n={},i=!r.protocol&&!r.hostname&&r.path?.startsWith("/")&&(l.default||t.forceNativeWebSocket);if(null!=r.port&&(n.port=Number(r.port)),n.host=r.hostname,n.query=r.query,n.auth=r.auth,n.protocol=r.protocol,n.path=r.path,!(t={...n,...t}).protocol&&!i)throw new Error("Missing protocol");t.protocol=(t.protocol||("undefined"!=typeof location?"https:"===location.protocol?"wss":"ws":"undefined"!=typeof document&&"https:"===new URL(document.URL).protocol?"wss":"ws")).replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):t.protocol?.startsWith("ws")||t.protocol?.startsWith("wx")||delete t.path,function(e){let t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/),t){const[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),l.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&void 0!==n&&(t.socksProxy=n.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(u||(u={},l.default||t.forceNativeWebSocket?(u.ws=r(8203).browserStreamBuilder,u.wss=r(8203).browserStreamBuilder,u.wx=r(5670).A,u.wxs=r(5670).A,u.ali=r(397).A,u.alis=r(397).A):(u.ws=r(8203).streamBuilder,u.wss=r(8203).streamBuilder,u.mqtt=r(778).default,u.tcp=r(778).default,u.ssl=r(3936).default,u.tls=u.ssl,u.mqtts=r(3936).default)),!u[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof u[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const i=new a.default(function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),c("calling streambuilder for",t.protocol),u[t.protocol](e,t)},t);return i.on("error",()=>{}),i}t.default=f},2858:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}},2860:e=>{"use strict";e.exports={version:"5.16.0"}},2861:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3003:e=>{"use strict";e.exports=function(e){return e!=e}},3079:(e,t,r)=>{const n=r(9868),{EventEmitter:i}=r(7007),o=r(576),s=r(5399),a=r(7833)("mqtt-packet:parser");class l extends i{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof l?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new l).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new o,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0),t=e>>s.CMD_SHIFT;this.packet.cmd=s.types[t];const r=15&e,n=s.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(s.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=0!==(e&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,r,n;a("_parseConnect");const i={},o=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;const c=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),u=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(i.will)o.will={},o.will.retain=c,o.will.qos=u;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(u)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(o.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error("Packet too short"));if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.properties=e)}const f=this._parseString();if(null===f)return this._emitError(new Error("Packet too short"));if(o.clientId=f,a("_parseConnect: packet.clientId: %s",o.clientId),i.will){if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,a("_parseConnect: packet.will.topic: %s",o.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));o.username=n,a("_parseConnect: packet.username: %s",o.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));o.password=r}return this.settings=o,a("_parseConnect: complete"),o}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;const t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)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(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,r,n,i,o,l,c;if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(r=this._parseByte(),5===this.settings.protocolVersion){if(192&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(l=0!==(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),i=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,i>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:t,qos:n},5===this.settings.protocolVersion?(c.nl=l,c.rap=o,c.rh=i):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!s.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!s.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!s.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,r=0,n=1,i=0,o=!1;const l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&s.VARBYTEINT_MASK),n*=128,0===(t&s.VARBYTEINT_FIN_MASK)){o=!0;break}if(this._list.length<=r)break}return!o&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),o=!!o&&(e?{bytes:r,value:i}:i),a("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t])}return r}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),a("_newPacket: new packet"),this.packet=new o,this._pos=0,!0}_emitError(e){a("_emitError",e),this.error=e,this.emit("error",e)}}e.exports=l},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),i=r(9675),o=r(76),s=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return s(n,o,e)}},3132:(e,t,r)=>{const n=r(5399),{Buffer:i}=r(8287),o=i.allocUnsafe(0),s=i.from([0]),a=r(6172),l=r(3225).nextTick,c=r(7833)("mqtt-packet:writeToStream"),u=a.cache,f=a.generateNumber,h=a.generateCache,d=a.genBufVariableByteInt,p=a.generate4ByteBuffer;let g=E,b=!0;function y(e,t,r){switch(c("generate called"),t.cork&&(t.cork(),l(_,t)),b&&(b=!1,h()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){const r=e||{},o=r.protocolId||"MQTT";let s=r.protocolVersion||4;const a=r.will;let l=r.clean;const c=r.keepalive||0,u=r.clientId||"",f=r.username,h=r.password,d=r.properties;void 0===l&&(l=!0);let p,b,y=0;if(!o||"string"!=typeof o&&!i.isBuffer(o))return t.destroy(new Error("Invalid protocolId")),!1;if(y+=o.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(y+=1,("string"==typeof u||i.isBuffer(u))&&(u||s>=4)&&(u||l))y+=i.byteLength(u)+2;else{if(s<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(y+=2,y+=1,5===s){if(p=I(t,d),!p)return!1;y+=p.length}if(a){if("object"!=typeof a)return t.destroy(new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.destroy(new Error("Invalid will topic")),!1;if(y+=i.byteLength(a.topic)+2,y+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?y+=i.byteLength(a.payload):y+=a.payload.length}if(b={},5===s){if(b=I(t,a.properties),!b)return!1;y+=b.length}}let _=!1;if(null!=f){if(!P(f))return t.destroy(new Error("Invalid username")),!1;_=!0,y+=i.byteLength(f)+2}if(null!=h){if(!_)return t.destroy(new Error("Username is required to use password")),!1;if(!P(h))return t.destroy(new Error("Invalid password")),!1;y+=x(h)+2}t.write(n.CONNECT_HEADER),w(t,y),k(t,o),r.bridgeMode&&(s+=128),t.write(131===s?n.VERSION131:132===s?n.VERSION132:4===s?n.VERSION4:5===s?n.VERSION5:n.VERSION3);let m=0;return m|=null!=f?n.USERNAME_MASK:0,m|=null!=h?n.PASSWORD_MASK:0,m|=a&&a.retain?n.WILL_RETAIN_MASK:0,m|=a&&a.qos?a.qos<<n.WILL_QOS_SHIFT:0,m|=a?n.WILL_FLAG_MASK:0,m|=l?n.CLEAN_SESSION_MASK:0,t.write(i.from([m])),g(t,c),5===s&&p.write(),k(t,u),a&&(5===s&&b.write(),v(t,a.topic),k(t,a.payload)),null!=f&&k(t,f),null!=h&&k(t,h),!0}(e,t);case"connack":return function(e,t,r){const o=r?r.protocolVersion:4,a=e||{},l=5===o?a.reasonCode:a.returnCode,c=a.properties;let u=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let f=null;if(5===o){if(f=I(t,c),!f)return!1;u+=f.length}return t.write(n.CONNACK_HEADER),w(t,u),t.write(a.sessionPresent?n.SESSIONPRESENT_HEADER:s),t.write(i.from([l])),null!=f&&f.write(),!0}(e,t,r);case"publish":return function(e,t,r){c("publish: packet: %o",e);const s=r?r.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?n.RETAIN_MASK:0,f=a.topic,h=a.payload||o,d=a.messageId,p=a.properties;let b=0;if("string"==typeof f)b+=i.byteLength(f)+2;else{if(!i.isBuffer(f))return t.destroy(new Error("Invalid topic")),!1;b+=f.length+2}if(i.isBuffer(h)?b+=h.length:b+=i.byteLength(h),l&&"number"!=typeof d)return t.destroy(new Error("Invalid messageId")),!1;l&&(b+=2);let y=null;if(5===s){if(y=I(t,p),!y)return!1;b+=y.length}return t.write(n.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),w(t,b),g(t,x(f)),t.write(f),l>0&&g(t,d),null!=y&&y.write(),c("publish: payload: %o",h),t.write(h)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,c=s.dup&&"pubrel"===a?n.DUP_MASK:0;let u=0;const f=s.reasonCode,h=s.properties;let d=5===o?3:2;if("pubrel"===a&&(u=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===o&&"object"==typeof h){if(p=O(t,h,r,d),!p)return!1;d+=p.length}return t.write(n.ACKS[a][u][c][0]),3===d&&(d+=0!==f?1:-1),w(t,d),g(t,l),5===o&&2!==d&&t.write(i.from([f])),null!==p?p.write():4===d&&t.write(i.from([0])),!0}(e,t,r);case"subscribe":return function(e,t,r){c("subscribe: packet: ");const o=r?r.protocolVersion:4,s=e||{},a=s.dup?n.DUP_MASK:0,l=s.messageId,u=s.subscriptions,f=s.properties;let h=0;if("number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;h+=2;let d=null;if(5===o){if(d=I(t,f),!d)return!1;h+=d.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,n=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof n)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}h+=i.byteLength(r)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),t.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,h),g(t,l),null!==d&&d.write();let p=!0;for(const e of u){const r=e.topic,s=e.qos,a=+e.nl,l=+e.rap,c=e.rh;let u;v(t,r),u=n.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(u|=a?n.SUBSCRIBE_OPTIONS_NL:0,u|=l?n.SUBSCRIBE_OPTIONS_RAP:0,u|=c?n.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(i.from([u]))}return p}(e,t,r);case"suback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,c=s.properties;let u=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;u+=1}let f=null;if(5===o){if(f=O(t,c,r,u),!f)return!1;u+=f.length}return t.write(n.SUBACK_HEADER),w(t,u),g(t,a),null!==f&&f.write(),t.write(i.from(l))}(e,t,r);case"unsubscribe":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.unsubscriptions,u=s.properties;let f=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(f+=2,"object"!=typeof c||!c.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<c.length;e+=1){if("string"!=typeof c[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;f+=i.byteLength(c[e])+2}let h=null;if(5===o){if(h=I(t,u),!h)return!1;f+=h.length}t.write(n.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,f),g(t,a),null!==h&&h.write();let d=!0;for(let e=0;e<c.length;e++)d=v(t,c[e]);return d}(e,t,r);case"unsuback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.granted,u=s.properties,f=s.cmd;let h=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.destroy(new Error("Invalid qos vector")),!1;h+=1}}let d=null;if(5===o){if(d=O(t,u,r,h),!d)return!1;h+=d.length}return t.write(n.ACKS[f][0][l][0]),w(t,h),g(t,a),null!==d&&d.write(),5===o&&t.write(i.from(c)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(n.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===o?1:0,u=null;if(5===o){if(u=O(t,l,r,c),!u)return!1;c+=u.length}return t.write(i.from([n.codes.disconnect<<4])),w(t,c),5===o&&t.write(i.from([a])),null!==u&&u.write(),!0}(e,t,r);case"auth":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));const u=O(t,l,r,c);return!!u&&(c+=u.length,t.write(i.from([n.codes.auth<<4])),w(t,c),t.write(i.from([a])),null!==u&&u.write(),!0)}(e,t,r);default:return t.destroy(new Error("Unknown command")),!1}}function _(e){e.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>g===E,set(e){e?(u&&0!==Object.keys(u).length||(b=!0),g=E):(b=!1,g=A)}});const m={};function w(e,t){if(t>n.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let r=m[t];return r||(r=d(t),t<16384&&(m[t]=r)),c("writeVarByteInt: writing to stream: %o",r),e.write(r)}function v(e,t){const r=i.byteLength(t);return g(e,r),c("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){v(e,t),v(e,r)}function E(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){const r=f(t);return c("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?v(e,t):t?(g(e,t.length),e.write(t)):g(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){T(e,{},0)}};let r=0;function o(t,r){let o=0;switch(n.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"binary":if(r&&null===r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(d(r));break;case"string":if("string"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=3+i.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce((e,r)=>e+(3+i.byteLength(t.toString())+2+i.byteLength(r.toString())),0):e+=3+i.byteLength(t.toString())+2+i.byteLength(r[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${r}`)),!1}return o}if(t)for(const e in t){let n=0,i=0;const s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(i=o(e,s[t]),!i)return!1;n+=i}else{if(i=o(e,s),!i)return!1;n=i}if(!n)return!1;r+=n}}return{length:i.byteLength(d(r))+r,write(){T(e,t,r)}}}function O(e,t,r,n){const i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=I(e,t);if(o)for(;n+s.length>o;){const r=i.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,r){switch(n.propertiesTypes[t]){case"byte":e.write(i.from([n.properties[t]])),e.write(i.from([+r]));break;case"int8":e.write(i.from([n.properties[t]])),e.write(i.from([r]));break;case"binary":e.write(i.from([n.properties[t]])),k(e,r);break;case"int16":e.write(i.from([n.properties[t]])),g(e,r);break;case"int32":e.write(i.from([n.properties[t]])),function(e,t){const r=p(t);c("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(i.from([n.properties[t]])),w(e,r);break;case"string":e.write(i.from([n.properties[t]])),v(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(o=>{const s=r[o];Array.isArray(s)?s.forEach(r=>{e.write(i.from([n.properties[t]])),S(e,o.toString(),r.toString())}):(e.write(i.from([n.properties[t]])),S(e,o.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${r}`)),!1}}function T(e,t,r){w(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function x(e){return e?e instanceof i?e.length:i.byteLength(e):0}function P(e){return"string"==typeof e||e instanceof i}e.exports=y},3141:(e,t,r)=>{"use strict";var n=r(5003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3144:(e,t,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(76),s=r(7119);e.exports=s||n.call(o,i)},3158:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=r(4469),{Buffer:a}=r(8287),{inspect:l}=r(7797);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,i=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(o(t,a,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}o(t,a,r-e),e-=a.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},3175:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(7732));t.default=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,i.default)(t),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;const e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}}},3225:(e,t,r)=>{"use strict";var n=r(2045);void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return n.nextTick(function(){e.apply(null,o)})}}}:e.exports=n},3425:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(2768),{isIterable:o,isNodeStream:s,isWebStream:a}=r(6801),{pipelineImpl:l}=r(3616),{finished:c}=r(6364);r(5244),e.exports={finished:c,pipeline:function(...e){return new i((t,r)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!o(u)&&!a(u)){const t=n(e);i=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:i,end:c})})}}},3497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9096),i=r(4807);t.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new n.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new i.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}},3513:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(2768),{validateInteger:o}=r(4947),{ERR_INVALID_ARG_VALUE:s}=r(9157).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,o){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=a){if(!i(a)||a<0)throw new s(o?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?l=t:a=t}}},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const i=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${i} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),i)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}static outcome(e,t){const r=Array.isArray(t)?t:[],n=e&&e.packet&&Array.isArray(e.packet.granted)?e.packet.granted:null;if(n){const e=[],t=[];return r.forEach(({topic:r},i)=>{128&n[i]?e.push(r):t.push({topic:r,qos:n[i]})}),{refused:e,granted:t,error:null}}return e?{refused:[],granted:[],error:e}:{refused:r.filter(e=>128===e.qos).map(e=>e.topic),granted:r.filter(e=>128!==e.qos),error:null}}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>o,nanoid:()=>a,random:()=>i,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",i=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(o=t)=>{let s="";for(;;){let t=r(i),a=0|i;for(;a--;)if(s+=e[t[a]&n]||"",s.length===o)return s}}},s=(e,t=21)=>o(e,t,i),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3616:(e,t,r)=>{const n=r(5606),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:a}=r(2768),l=r(6364),{once:c}=r(9862),u=r(7302),f=r(2648),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=r(9157),{validateFunction:m,validateAbortSignal:w}=r(4947),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(6801),T=globalThis.AbortController||r(5568).AbortController;let x,P,N;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function M(e){if(v(e))return e;if(E(e))return async function*(e){P||(P=r(9214)),yield*P.prototype[s].call(e)}(e);throw new d("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let i,s=null;const a=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},c=()=>new o((e,t)=>{i?t(i):s=()=>{i?t(i):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function L(e,t,r,{end:n}){k(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function D(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const s=new T,l=s.signal,c=null==o?void 0:o.signal,u=[];function h(){B(new _)}let b,y,m;w(c,"options.signal"),N=N||r(9862).addAbortListener,c&&(b=N(c,h));const R=[];let P,D=0;function $(e){B(e,0===--D)}function B(e,r){var i;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(i=b)||void 0===i||i[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,m))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==o?void 0:o.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&$(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if(P=z({signal:l}),!v(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if(P=k(P)?M(null===(W=P)||void 0===W?void 0:W.readable):M(P),P=z(P,{signal:l}),H){if(!v(P,!0))throw new p("AsyncIterable",`transform[${V-1}]`,P)}else{var q;x||(x=r(5258));const X=new x({objectMode:!0}),Z=null===(q=P)||void 0===q?void 0:q.then;if("function"==typeof Z)D++,Z.call(P,e=>{m=e,null!=e&&X.write(e),K&&X.end(),n.nextTick($)},e=>{X.destroy(e),n.nextTick($,e)});else if(v(P,!0))D++,C(P,X,$,{end:K});else{if(!O(P)&&!k(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,C(re,X,$,{end:K})}}P=X;const{destroy:ee,cleanup:te}=j(P,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E(P)){D+=2;const ne=F(P,z,$,{end:K});S(z)&&Q&&u.push(ne)}else if(k(P)||O(P)){const ie=P.readable||P;D++,C(ie,z,$,{end:K})}else{if(!v(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,C(P,z,$,{end:K})}P=z}else if(I(z)){if(E(P))D++,L(M(P),z,$,{end:K});else if(O(P)||v(P))D++,L(P,z,$,{end:K});else{if(!k(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,L(P.readable,z,$,{end:K})}P=z}else P=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(h),P}function F(e,t,r,{end:i}){let o=!1;if(t.on("close",()=>{o||r(new y)}),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:D,pipeline:function(...e){return D(e,c(function(e){return m(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},3628:(e,t,r)=>{"use strict";var n=r(8648),i=r(1064),o=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},3681:(e,t,r)=>{"use strict";e.exports=i;var n=r(9083);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},3779:()=>{},3885:(e,t,r)=>{"use strict";e.exports=r(9844)()},3918:(e,t,r)=>{"use strict";var n=r(2045);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],(i=a(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!==g(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===g(t)?t:String(t)}function l(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},u(e)}function f(e,t,r){return f=h()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&d(i,r.prototype),i},f.apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}var b=r(537).inspect,y=r(9597).codes.ERR_INVALID_ARG_TYPE;function _(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",w="",v="",S="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return b(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var I=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(I,e);var r,i,a,u,f=(r=I,i=h(),function(){var e,t=p(r);if(i){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function I(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,I),"object"!==g(e)||null===e)throw new y("options","Object",e);var r=e.message,i=e.operator,o=e.stackStartFn,s=e.actual,a=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="",w="",S="",v=""):(m="",w="",S="",v="")),"object"===g(s)&&null!==s&&"object"===g(a)&&null!==a&&"stack"in s&&s instanceof Error&&"stack"in a&&a instanceof Error&&(s=A(s),a=A(a)),"deepStrictEqual"===i||"strictEqual"===i)t=f.call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=k(e),u=c.split("\n"),f=k(t).split("\n"),h=0,d="";if("strictEqual"===r&&"object"===g(e)&&"object"===g(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===f.length&&u[0]!==f[0]){var p=u[0].length+f[0].length;if(p<=10){if(!("object"===g(e)&&null!==e||"object"===g(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(u[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][h]===f[0][h];)h++;h>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var b=u[u.length-1],y=f[f.length-1];b===y&&(h++<2?a="\n ".concat(b).concat(a):i=b,u.pop(),f.pop(),0!==u.length&&0!==f.length);)b=u[u.length-1],y=f[f.length-1];var A=Math.max(u.length,f.length);if(0===A){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(m,"...").concat(S);I.length>27;)I.pop();return"".concat(E.notIdentical,"\n\n").concat(I.join("\n"),"\n")}h>3&&(a="\n".concat(m,"...").concat(S).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,R=E[r]+"\n".concat(w,"+ actual").concat(S," ").concat(v,"- expected").concat(S),T=" ".concat(m,"...").concat(S," Lines skipped");for(h=0;h<A;h++){var x=h-s;if(u.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(f[h-2]),O++),o+="\n ".concat(f[h-1]),O++),s=h,i+="\n".concat(v,"-").concat(S," ").concat(f[h]),O++;else if(f.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(u[h-2]),O++),o+="\n ".concat(u[h-1]),O++),s=h,o+="\n".concat(w,"+").concat(S," ").concat(u[h]),O++;else{var P=f[h],N=u[h],j=N!==P&&(!_(N,",")||N.slice(0,-1)!==P);j&&_(P,",")&&P.slice(0,-1)===N&&(j=!1,N+=","),j?(x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(u[h-2]),O++),o+="\n ".concat(u[h-1]),O++),s=h,o+="\n".concat(w,"+").concat(S," ").concat(N),i+="\n".concat(v,"-").concat(S," ").concat(P),O+=2):(o+=i,i="",1!==x&&0!==h||(o+="\n ".concat(N),O++))}if(O>20&&h<A-2)return"".concat(R).concat(T,"\n").concat(o,"\n").concat(m,"...").concat(S).concat(i,"\n")+"".concat(m,"...").concat(S)}return"".concat(R).concat(l?T:"","\n").concat(o).concat(i).concat(a).concat(d)}(s,a,i));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var h=E[i],d=k(s).split("\n");if("notStrictEqual"===i&&"object"===g(s)&&null!==s&&(h=E.notStrictEqualObject),d.length>30)for(d[26]="".concat(m,"...").concat(S);d.length>27;)d.pop();t=1===d.length?f.call(this,"".concat(h," ").concat(d[0])):f.call(this,"".concat(h,"\n\n").concat(d.join("\n"),"\n"))}else{var p=k(s),b="",O=E[i];"notDeepEqual"===i||"notEqual"===i?(p="".concat(E[i],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(b="".concat(k(a)),p.length>512&&(p="".concat(p.slice(0,509),"...")),b.length>512&&(b="".concat(b.slice(0,509),"...")),"deepEqual"===i||"equal"===i?p="".concat(O,"\n\n").concat(p,"\n\nshould equal\n\n"):b=" ".concat(i," ").concat(b)),t=f.call(this,"".concat(p).concat(b))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=a,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(t),o),t.stack,t.name="AssertionError",l(t)}return a=I,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return b(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),I}(u(Error),b.custom);e.exports=I},3936:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6370),o=n(r(1428)),s=n(r(7833)),a=n(r(6968)),l=(0,s.default)("mqttjs:tls");t.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0!==o.default.isIP(t.host)||t.servername||(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,l("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=function(e){const{host:t,port:r,socksProxy:n,...o}=e;if(void 0!==n){const s=(0,a.default)(t,r,n,{timeout:e.socksTimeout});return(0,i.connect)({...o,socket:s})}return(0,i.connect)(e)}(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)}),r.on("error",n),r}},3942:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(4469),{isIterable:o,isNodeStream:s,isWebStream:a}=r(5980),{pipelineImpl:l}=r(4867),{finished:c}=r(577);r(9037),e.exports={finished:c,pipeline:function(...e){return new i((t,r)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!o(u)&&!a(u)){const t=n(e);i=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:i,end:c})})}}},4035:(e,t,r)=>{"use strict";var n,i=r(6556),o=r(9092)(),s=r(9957),a=r(5795);if(o){var l=i("RegExp.prototype.exec"),c={},u=function(){throw c},f={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=u),n=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{l(e,f)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},4133:(e,t,r)=>{"use strict";var n=r(487),i=r(8452),o=r(3003),s=r(6642),a=r(2464),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4148:(e,t,r)=>{"use strict";var n=r(2045);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function s(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}var l,c,u=r(9597).codes,f=u.ERR_AMBIGUOUS_ARGUMENT,h=u.ERR_INVALID_ARG_TYPE,d=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,g=u.ERR_MISSING_ARGS,b=r(3918),y=r(537).inspect,_=r(537).types,m=_.isPromise,w=_.isRegExp,v=r(9133)(),S=r(9394)(),E=r(8075)("RegExp.prototype.test");function A(){var e=r(2299);l=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var k=!1,I=e.exports=x,O={};function R(e){if(e.message instanceof Error)throw e.message;throw new b(e)}function T(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new b({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function x(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[x,t.length].concat(t))}I.fail=function e(t,r,i,o,s){var a,l=arguments.length;if(0===l?a="Failed":1===l?(i=t,t=void 0):(!1===k&&(k=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===l&&(o="!=")),i instanceof Error)throw i;var c={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:s||e};void 0!==i&&(c.message=i);var u=new b(c);throw a&&(u.message=a,u.generatedMessage=!0),u},I.AssertionError=b,I.ok=x,I.equal=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");t!=r&&R({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},I.notEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");t==r&&R({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},I.deepEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),l(t,r)||R({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},I.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),l(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},I.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),c(t,r)||R({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},I.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),c(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},I.strictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");S(t,r)||R({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},I.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");S(t,r)&&R({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var P=s(function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&E(t[e],n[e])?i[e]=n[e]:i[e]=t[e])})});function N(e,t,r,n){if("function"!=typeof t){if(w(t))return E(t,e);if(2===arguments.length)throw new h("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new b({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new d("error",t,"may not be an empty object");return void 0===l&&A(),s.forEach(function(i){"string"==typeof e[i]&&w(t[i])&&E(t[i],e[i])||function(e,t,r,n,i,o){if(!(r in e)||!c(e[r],t[r])){if(!n){var s=new P(e,i),a=new P(t,i,e),l=new b({actual:s,expected:a,operator:"deepStrictEqual",stackStartFn:o});throw l.actual=e,l.expected=t,l.operator=o.name,l}R({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,s,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function j(e){if("function"!=typeof e)throw new h("fn","Function",e);try{e()}catch(e){return e}return O}function M(e){return m(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function C(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!M(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!M(e))throw new h("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return O}).catch(function(e){return e})})}function L(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new h("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new h("error",["Object","Error","Function","RegExp"],r);if(t===O){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";R({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(o),stackStartFn:e})}if(r&&!N(t,r,n,e))throw t}function D(e,t,r,n){if(t!==O){if("string"==typeof r&&(n=r,r=void 0),!r||N(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";R({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function F(e,t,r,n,o){if(!w(t))throw new h("regexp","RegExp",t);var s="match"===o;if("string"!=typeof e||E(t,e)!==s){if(r instanceof Error)throw r;var a=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(i(e)," (").concat(y(e),")"):(s?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(t),". Input:\n\n").concat(y(e),"\n"));var l=new b({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw l.generatedMessage=a,l}}function $(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[$,t.length].concat(t))}I.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,j(t)].concat(n))},I.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},I.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,j(t)].concat(n))},I.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return C(t).then(function(t){return D.apply(void 0,[e,t].concat(n))})},I.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new b({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var s=o.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},I.match=function e(t,r,n){F(t,r,n,e,"match")},I.doesNotMatch=function e(t,r,n){F(t,r,n,e,"doesNotMatch")},I.strict=v($,I,{equal:I.strictEqual,deepEqual:I.deepStrictEqual,notEqual:I.notStrictEqual,notDeepEqual:I.notDeepStrictEqual}),I.strict.strict=I.strict},4152:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEventEmitter=void 0;const i=n(r(7007)),o=r(4723);class s{}t.TypedEventEmitter=s,(0,o.applyMixin)(s,i.default)},4233:e=>{"use strict";const t=function*(){}.constructor;e.exports=()=>t},4257:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",p),t.req?g():t.on("request",g)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",h),t.on("finish",u),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",u),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._releaseIncomingQoS2Publish(i),e._sendPacket(o,n)}))})}},4269:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(9157),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(4947),h=r(2768).Symbol("kWeak"),d=r(2768).Symbol("kResistStopPropagation"),{finished:p}=r(6364),g=r(9848),{addAbortSignalNoValidate:b}=r(5121),{isWritable:y,isNodeStream:_}=r(6801),{deprecate:m}=r(9862),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:T}=r(2768),x=T("kEmpty"),P=T("kEof");function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=S(t.highWaterMark)),u(n,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=n,async function*(){const o=r(9862).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:o};let u,f,h=!1,d=0;function p(){h=!0,g()}function g(){d-=1,b()}function b(){f&&!h&&d<n&&a.length<i&&(f(),f=null)}!async function(){try{for await(let t of s){if(h)return;if(o.aborted)throw new l;try{if(t=e(t,c),t===x)continue;t=O(t)}catch(e){t=I(e)}d+=1,R(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||d>=n)&&await new k(e=>{f=e})}a.push(P)}catch(e){const t=I(e);R(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===P)return;if(o.aborted)throw new l;e!==x&&(yield e),a.shift(),b()}await new k(e=>{u=e})}}finally{h=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of M.call(this,e,t))return!0;return!1}function M(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return N.call(this,async function(t,r){return await e(t,r)?t:x},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:m(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:M,flatMap:function(e,t){const r=N.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:N,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),_(e)&&!y(e))throw new i("stream",e,"must be writable");const r=g(this,e);return null!=t&&t.signal&&b(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await j.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const r of N.call(this,async function(t,r){return await e(t,r),x},t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[h]:this,[d]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let g=!1;try{for await(const n of this){var b;if(g=!0,null!=r&&null!==(b=r.signal)&&void 0!==b&&b.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!g&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of M.call(this,e,t))return r}}},4347:(e,t,r)=>{"use strict";var n=r(2045);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4469:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:t,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},4474:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(4469),{EventEmitter:o}=r(7007);function s(e){o.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},4723:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.MQTTJS_VERSION=t.nextTick=t.ErrorWithSubackPacket=t.ErrorWithReasonCode=void 0,t.applyMixin=function(e,t,r=!1){const n=[t];for(;;){const e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(const t of n)for(const n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};class i extends Error{code;constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,i.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}t.ErrorWithReasonCode=i;class o extends Error{packet;constructor(e,t){super(e),this.packet=t,Object.setPrototypeOf(this,o.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}}t.ErrorWithSubackPacket=o,t.nextTick="function"==typeof n?.nextTick?n.nextTick:e=>{setTimeout(e,0)},t.MQTTJS_VERSION=r(2860).version},4765:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},4803:(e,t,r)=>{"use strict";var n=r(8859),i=r(9675),o=function(e,t,r){for(var n,i=e;null!=(n=i.next);i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return o(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=o(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!o(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=o(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},4807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberAllocator=void 0,t.NumberAllocator=class{used;min;max;lowWaterMark;constructor(e,t){this.min=e,this.max=t,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return!(e<this.min||e>this.max||this.used.has(e)||(this.used.add(e),0))}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}}},4867:(e,t,r)=>{const n=r(5606),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:a}=r(4469),l=r(577),{once:c}=r(7797),u=r(1787),f=r(7323),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=r(2074),{validateFunction:m,validateAbortSignal:w}=r(1580),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(5980),T=globalThis.AbortController||r(5568).AbortController;let x,P,N;function j(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function M(e){if(v(e))return e;if(E(e))return async function*(e){P||(P=r(2729)),yield*P.prototype[s].call(e)}(e);throw new d("val",["Readable","Iterable","AsyncIterable"],e)}async function C(e,t,r,{end:n}){let i,s=null;const a=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},c=()=>new o((e,t)=>{i?t(i):s=()=>{i?t(i):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function L(e,t,r,{end:n}){k(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function D(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const s=new T,l=s.signal,c=null==o?void 0:o.signal,u=[];function h(){B(new _)}let b,y,m;w(c,"options.signal"),N=N||r(7797).addAbortListener,c&&(b=N(c,h));const R=[];let P,D=0;function $(e){B(e,0===--D)}function B(e,r){var i;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(i=b)||void 0===i||i[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,m))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==o?void 0:o.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=j(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&$(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if(P=z({signal:l}),!v(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if(P=k(P)?M(null===(W=P)||void 0===W?void 0:W.readable):M(P),P=z(P,{signal:l}),H){if(!v(P,!0))throw new p("AsyncIterable",`transform[${V-1}]`,P)}else{var q;x||(x=r(519));const X=new x({objectMode:!0}),Z=null===(q=P)||void 0===q?void 0:q.then;if("function"==typeof Z)D++,Z.call(P,e=>{m=e,null!=e&&X.write(e),K&&X.end(),n.nextTick($)},e=>{X.destroy(e),n.nextTick($,e)});else if(v(P,!0))D++,C(P,X,$,{end:K});else{if(!O(P)&&!k(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,C(re,X,$,{end:K})}}P=X;const{destroy:ee,cleanup:te}=j(P,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E(P)){D+=2;const ne=F(P,z,$,{end:K});S(z)&&Q&&u.push(ne)}else if(k(P)||O(P)){const ie=P.readable||P;D++,C(ie,z,$,{end:K})}else{if(!v(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,C(P,z,$,{end:K})}P=z}else if(I(z)){if(E(P))D++,L(M(P),z,$,{end:K});else if(O(P)||v(P))D++,L(P,z,$,{end:K});else{if(!k(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,L(P.readable,z,$,{end:K})}P=z}else P=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(h),P}function F(e,t,r,{end:i}){let o=!1;if(t.on("close",()=>{o||r(new y)}),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:D,pipeline:function(...e){return D(e,c(function(e){return m(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},4947:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:b}=r(2768),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(9157),{normalizeEncoding:E}=r(9862),{isAsyncFunction:A,isArrayBufferView:k}=r(9862).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),x=y((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new v(t,`>= ${n} && <= ${i}`,e)});function P(e,t){if("string"!=typeof e)throw new m(t,"string",e)}const N=y((e,t,r)=>{if(!i(r,e)){const n=o(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function j(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function M(e,t,r){return null!=e&&h(e,t)?e[t]:r}const C=y((e,t,r=null)=>{const i=M(r,"allowArray",!1),o=M(r,"allowFunction",!1);if(!M(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)}),L=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)}),D=y((e,t,r=0)=>{if(!n(e))throw new m(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),F=y((e,t="buffer")=>{if(!k(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}),$=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new m(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!d(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===d(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return x(e,t),e},validateArray:D,validateStringArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)P(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)j(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++){const n=e[r],i=`${t}[${r}]`;if(null==n)throw new m(i,"AbortSignal",n);$(n,i)}},validateBoolean:j,validateBuffer:F,validateDictionary:L,validateEncoding:function(e,t){const r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:T,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:C,validateOneOf:N,validatePlainFunction:U,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===b(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new _(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(P(e,t),void 0===I[e]){if(void 0!==I[g(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:P,validateUint32:x,validateUndefined:W,validateUnion:function(e,t,r){if(!i(r,e))throw new m(t,`('${o(r,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const i=e[n];V(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},4959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),i=[0,16,128,131,135,144,145,151,153],o=(e,t,r,i,o=148)=>{i?.discardParsedPackets(),i&&!i.isCurrent()||e._cleanUp(!0),r(),e.emit("error",new n.ErrorWithReasonCode(t,o))},s=(e,t,r)=>{r(),e.emit("error",t)};t.default=(e,t,r,n)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let a=t.topic.toString();const l=t.payload,{qos:c}=t,{messageId:u}=t,{options:f}=e;if(5===e.options.protocolVersion){let i;if(t.properties&&(i=t.properties.topicAlias),void 0!==i){const t=e.topicAliasRecv;if(!t)return e.log("handlePublish :: received unexpected topic alias. alias: %d",i),void o(e,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);if(0===a.length){if(!(i>0&&i<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",i),void o(e,`Received Topic Alias ${i} is outside the valid range 1-65535`,r,n);{const s=t.getTopicByAlias(i);if(!s)return e.log("handlePublish :: unregistered topic alias. alias: %d",i),void o(e,"Received unregistered Topic Alias",r,n,130);a=s,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,i)}}else{if(!t.put(a,i))return e.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",i,t.max),void o(e,`Received Topic Alias ${i} is outside the advertised Topic Alias Maximum range 1-${t.max}`,r,n);e.log("handlePublish :: registered topic: %s - alias: %d",a,i)}}}switch(e.log("handlePublish: qos %d",c),c){case 2:f.customHandleAcks(a,l,t,(o,a)=>{if("number"==typeof o&&(a=o,o=null),o)return s(e,o,r);if(-1===i.indexOf(a))return s(e,new Error("Wrong reason code for pubrec"),r);if(a)e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:a},r);else{if(!e._trackIncomingQoS2Publish(u,r,n))return;e.incomingStore.put(t,()=>{e._sendPacket({cmd:"pubrec",messageId:u},r)})}});break;case 1:f.customHandleAcks(a,l,t,(n,o)=>("number"==typeof n&&(o=n,n=null),n?s(e,n,r):-1===i.indexOf(o)?s(e,new Error("Wrong reason code for puback"),r):(o||e.emit("message",a,l,t),void e.handleMessage(t,t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:o},r)}))));break;case 0:e.emit("message",a,l,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},5003:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5016:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(2768);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:o}=r(9157).codes,s=r(2648),{getHighWaterMark:a}=r(3513);n(c.prototype,s.prototype),n(c,s);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new o("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5034:(e,t,r)=>{"use strict";var n,i=r(2045);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(4257),a=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function b(e){i.nextTick(g,e)}var y=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[c]?r(e[c]):t(p(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(p(void 0,!0)):t[h](r,n)},n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(_,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[f]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[a]=null,r[l]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[u]=!0}),e.on("readable",b.bind(null,r)),r}},5121:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(2768),{AbortError:i,codes:o}=r(9157),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(6801),c=r(6364),{ERR_INVALID_ARG_TYPE:u}=o;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{f=f||r(9862).addAbortListener;const i=f(e,o);c(t,i[n])}return t}},5224:(e,t,r)=>{const n=r(5606),i=r(8287),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:d}=r(6801),p=r(6364),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:y}}=r(9157),{destroyer:_}=r(7302),m=r(2648),w=r(9214),v=r(7602),{createDeferredPromise:S}=r(9862),E=r(2070),A=globalThis.Blob||i.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(2768);class R extends m{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,i,a,l,c,u=!!o(t),f=!!s(r);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&_(t,e),h(e)}),c._write=function(e,t,i){r.write(e,t)?i():n=i},c._final=function(e){r.end(),i=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(i){const e=i;i=null,e()}})),u&&(p(t,e=>{u=!1,e&&_(t,e),h(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,o){e||null===l||(e=new g),a=null,n=null,i=null,null===l?o(e):(l=o,_(r,e),_(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(h(t))return T({readable:w.fromWeb(t)});if(d(t))return T({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:r}=S();const i=new I,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:r}=S()),yield i}}(),{signal:o}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:i,final:o,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{_(t,e)});return t=new R({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&d(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return O(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new b(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),i=130,o=(e,t,r)=>{e.log("handleAuth :: %s",t.message),r?.discardParsedPackets(),r&&!r.isCurrent()||e._cleanUp(!0),e.emit("error",t)};t.default=(e,t,r)=>{const{options:s}=e,a=s.protocolVersion,l=5===a?t.reasonCode:t.returnCode;if(5!==a)return void o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,i),r);const c=e._authenticationMethod;c?t.properties?.authenticationMethod===c?e.handleAuth(t,(t,s)=>{if(t)o(e,t,r);else{if(0!==l)return 24===l?s?(e.reconnecting=!1,void e._sendPacket(s)):void o(e,new n.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",i),r):void o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${l} is not one a broker may send`,i),r);e.log("handleAuth :: authentication exchange completed successfully")}}):o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${c}" sent in CONNECT`,i),r):o(e,new n.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",i),r)}},5244:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=r(2768),{promisify:{custom:a}}=r(9862),{streamReturningOperators:l,promiseReturningOperators:c}=r(4269),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(9157),f=r(9848),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=r(3513),{pipeline:p}=r(3616),{destroyer:g}=r(7302),b=r(6364),y=r(3425),_=r(6801),m=e.exports=r(8745).Stream;m.isDestroyed=_.isDestroyed,m.isDisturbed=_.isDisturbed,m.isErrored=_.isErrored,m.isReadable=_.isReadable,m.isWritable=_.isWritable,m.Readable=r(9214);for(const v of o(l)){const S=l[v];function E(...e){if(new.target)throw u();return m.Readable.from(s(S,this,e))}i(E,"name",{__proto__:null,value:S.name}),i(E,"length",{__proto__:null,value:S.length}),i(m.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}i(I,"name",{__proto__:null,value:k.name}),i(I,"length",{__proto__:null,value:k.length}),i(m.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}m.Writable=r(7602),m.Duplex=r(2648),m.Transform=r(5016),m.PassThrough=r(5258),m.pipeline=p;const{addAbortSignal:w}=r(5121);m.addAbortSignal=w,m.finished=b,m.destroy=g,m.compose=f,m.setDefaultHighWaterMark=h,m.getDefaultHighWaterMark=d,i(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),i(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),i(b,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},5258:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(2768);e.exports=o;const i=r(5016);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n(o.prototype,i.prototype),n(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},5267:(e,t,r)=>{"use strict";var n,i=r(2463).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(4257)),n(e,{readable:t,writable:i},function(e){if(e)return o(e);a=!0,o()});var l=!1;return function(t){if(!a&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(e){u||(u=e),e&&h.forEach(l),o||(h.forEach(l),f(u))})});return t.reduce(c)}},5341:(e,t,r)=>{"use strict";const n=r(7007);"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol.for("nodejs.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol.for("nodejs.asyncDispose"));const i="\0vrpc-handler",o="\0vrpc-callback";function s(e){return"function"==typeof e}function a(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function l(e){return!!e&&("object"==typeof e||"function"==typeof e)&&(s(e[Symbol.asyncDispose])||s(e[Symbol.dispose]))}function c(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}function u(e){if(Array.isArray(e))return e.map(u);if(e&&"object"==typeof e&&e.constructor===Object){const t={};for(const r of Object.keys(e).sort())t[r]=u(e[r]);return t}return e}function f(e){return JSON.stringify(u(e))}function h(e,t){return!("off"!==e&&"removeListener"!==e&&!/^off[A-Z]/.test(e))||!(t>=4)&&/^(unmonitor|unsignal|remove)[A-Z]/.test(e)}function d(e){return"on"===e?"off":"addListener"===e?"removeListener":/^on[A-Z]/.test(e)?`off${e.slice(2)}`:/^(monitor|signal)[A-Z]/.test(e)?`un${e}`:null}function p(e){return"string"==typeof e&&e.startsWith("__e__")}function g(e,t){if("string"!=typeof e)return!1;const r=`__e__${e}/`;return!!t.startsWith(r)&&t.slice(r.length).split("/").every(e=>e.length>0&&!/[+#]/.test(e))}class b{constructor({publish:e,emit:t}){this._publish=e,this._emit=t,this._contexts=new Map,this._held=new Map,this._byClient=new Map}static carriesEventIds(e){if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(p(e[t]))return!0;return!1}call({json:e,contextKey:t,contextName:r,target:l,func:u,args:d,isCallAll:b,speaks:y,makeCallback:_}){const m=e.s,w=[],v=new Array(d.length);for(let e=0;e<d.length;e++){const t=d[e];p(t)?(w.push(t),v[e]=i):"string"==typeof t&&t.startsWith("__f__")?v[e]=o:v[e]=t}for(const e of w)if(!g(m,e))throw new Error("A subscription id must name a topic under its sender's connection id");if(h(u,e.v))return this._withdrawByRemover(u,v,w,m,t),{value:!0,ids:[]};if(!s(l[u]))throw new Error(`Could not find function: ${u}`);if("once"===u||"prependOnceListener"===u){const t=y||(()=>!0),n=d.map((n,s)=>v[s]===o?_(n):v[s]!==i?n:(...i)=>{t()&&this._publish({a:b?[r,...i]:i,i:n,receiverVersion:e.v})});return{value:c(l[u].apply(l,n)),ids:[]}}const S=`${u}\0${f(v)}`;if(e.v>=4)for(const e of w){const r=this._subscriptionsOn(e,t).find(e=>e.reg.key!==S);if(r)throw new Error(`Subscription id already held here by ${r.reg.func} with other arguments: every target, function and arguments needs its own id`)}let E=this._contexts.get(t);E||(E=new Map,this._contexts.set(t,E));let A=E.get(S);if(A){const t=this._join(A,w,e,b);return 2===A.state&&(A.state=1),this._greet(A,t),{value:0===A.state?A.promise:A.r,ids:w}}const k=("on"===u||"addListener"===u)&&l[u]===n.prototype[u];A={contextKey:t,contextName:r,target:l,func:u,key:S,args:v.filter(e=>e!==i&&e!==o),event:"on"===u||"addListener"===u?d[0]:null,nodeEmitter:k,state:0,positions:[],r:void 0,promise:null,registration:null,events:0,bucketStart:Date.now(),bucketCount:0,rate:null};const I=y||(()=>!0);A.speaks=I;for(let e=0;e<w.length;e++)A.positions.push({subs:new Map,fanout:this._fanout(A,e,r,I)});E.set(S,A),this._join(A,w,e,b);let O=0;const R=d.map((e,t)=>v[t]===o?_(e):v[t]!==i?e:A.positions[O++].fanout);let T;A.unwrapped=R;try{T=l[u].apply(l,R)}catch(e){throw this._fail(A),e}return a(T)?(A.promise=Promise.resolve(T).then(e=>(this._settle(A,e),A.r),e=>{throw this._fail(A),e}),{value:A.promise,ids:w}):(this._settle(A,T),{value:A.r,ids:w})}unsubscribe(e,t){let r=0;for(const n of Array.isArray(e)?e:[e])p(n)?r+=this._withdraw(n,t):n&&"object"==typeof n&&p(n.id)&&"string"==typeof n.context&&(r+=this._withdraw(n.id,t,n.context));return r}withdrawClient(e){const t=this._byClient.get(e);if(t){for(const r of Array.from(t))this._withdraw(r,e);this._byClient.delete(e)}}withdrawEvent(e,t,r){const n=this._contexts.get(e);if(n)for(const e of Array.from(n.values()))if(!("on"!==e.func&&"addListener"!==e.func||null!=t&&e.event!==t))for(const t of this._subscriptionsOf(e))t.clientId===r&&this._remove(t)}list(e){const t=this._contexts.get(e);if(!t)return[];const r=Date.now();return Array.from(t.values()).map(e=>({function:e.func,args:e.args,state:["pending","live","silent","gone"][e.state],subscriptions:this._subscriptionsOf(e).map(e=>({label:void 0===e.label?null:e.label,callAll:e.isCallAll})),events:e.events,rate:b._rate(e,r)}))}end(e,t,r=[],n=null){const i=this._contexts.get(e);if(!i)return!1;const o=f(Array.isArray(r)?r:[r]);for(const e of i.values())if(e.func===t&&f(e.args)===o)return this._ended(e,{reason:"ended",by:n}),!0;return!1}forgetContext(e,{release:t=!0}={}){const r=this._contexts.get(e);if(r){this._contexts.delete(e);for(const e of r.values())this._unlink(e),(t||e.nodeEmitter)&&this._release(e)}}holds(e,t,r){return this._subscriptionsOn(t,e).some(e=>void 0===r||e.clientId===r)}_fanout(e,t,r,n){return(...i)=>{if(!(e.state>=2)&&n()){this._count(e);for(const n of e.positions[t].subs.values())this._publish({a:n.isCallAll?[r,...i]:i,i:n.id,receiverVersion:n.v})}}}_count(e){e.events++;const t=Date.now();t-e.bucketStart>=5e3&&(e.rate=1e3*e.bucketCount/(t-e.bucketStart),e.bucketStart=t,e.bucketCount=0),e.bucketCount++}static _rate(e,t){const r=t-e.bucketStart;return r>=5e3||null===e.rate?1e3*e.bucketCount/Math.max(r,1e3):e.rate}_join(e,t,r,n){const i=[],o=r.l&&"object"==typeof r.l?r.l:{};for(let s=0;s<t.length&&s<e.positions.length;s++){const a=t[s];if(t.indexOf(a)!==s)continue;const l=e.positions[s];let c=l.subs.get(a);if(!c){c={id:a,clientId:r.s,isCallAll:!!n,reg:e,position:l,contextKey:e.contextKey},l.subs.set(a,c);let t=this._held.get(a);t||(t=new Map,this._held.set(a,t)),t.set(b._holdKey(c),c);let o=this._byClient.get(r.s);o||(o=new Set,this._byClient.set(r.s,o)),o.add(a),i.push(c)}c.v="number"==typeof r.v?r.v:0,void 0!==o[a]&&(c.label=o[a])}return i}_greet(e,t){const{registration:r}=e;if(1===e.state&&r&&s(r.greet))for(const n of t){const t=t=>this._emit("greetFailed",{context:e.contextName,function:e.func,args:e.args,error:t}),i=e.positions.map(t=>t===n.position?this._direct(e,n):()=>{});try{const e=r.greet(...i);a(e)&&e.then(null,t)}catch(e){t(e)}}}_direct(e,t){return(...r)=>{e.state>=2||!e.speaks()||t.position.subs.get(t.id)===t&&this._publish({a:t.isCallAll?[e.contextName,...r]:r,i:t.id,receiverVersion:t.v})}}static _holdKey(e){return`${e.contextKey}\0${e.reg.key}`}_subscriptionsOn(e,t){const r=this._held.get(e);return r?Array.from(r.values()).filter(e=>e.contextKey===t):[]}_subscriptionsOf(e){const t=[];for(const r of e.positions)for(const e of r.subs.values())t.push(e);return t}_withdraw(e,t,r){const n=this._held.get(e);if(!n)return 0;let i=0;for(const e of Array.from(n.values()))void 0!==r&&e.contextKey!==r||e.clientId===t&&(this._remove(e),i++);return i}_withdrawByRemover(e,t,r,n,i){const o=function(e){return"off"===e||"removeListener"===e?["on","addListener"]:/^off[A-Z]/.test(e)?[`on${e.slice(3)}`]:/^un(monitor|signal)[A-Z]/.test(e)?[e.slice(2)]:null}(e),s=new Set((o||[]).map(e=>`${e}\0${f(t)}`));for(const e of r){const t=this._subscriptionsOn(e,i).filter(e=>e.clientId===n&&(null===o||o.includes(e.reg.func))),r=t.filter(e=>s.has(e.reg.key));for(const e of r.length>0?r:t)this._remove(e)}}_remove(e){this._forget(e);const{reg:t}=e;for(const e of t.positions)if(e.subs.size>0)return;this._lastOut(t)}_forget(e){e.position.subs.delete(e.id);const t=this._held.get(e.id),r=b._holdKey(e);if(t&&t.get(r)===e&&(t.delete(r),0===t.size)){this._held.delete(e.id);const t=this._byClient.get(e.clientId);t&&(t.delete(e.id),0===t.size&&this._byClient.delete(e.clientId))}}_lastOut(e){1===e.state&&(b._canRelease(e)?(this._unlink(e),this._release(e)):e.state=2)}_settle(e,t){const r=!e.nodeEmitter&&t!==e.target&&l(t);if(0!==e.state)return void(r&&(e.registration=t,this._release(e)));if(r){e.registration=t,e.r=!("value"in t)||c(t.value);const{ended:r}=t;a(r)&&r.then(t=>this._ended(e,{reason:"string"==typeof t&&t?t:"ended",by:"source"}),t=>this._ended(e,{reason:t&&t.message||String(t),by:"source",failed:!0}))}else e.r=c(t);e.state=1;const n=this._subscriptionsOf(e);0===n.length?this._lastOut(e):this._greet(e,n)}_fail(e){this._unlink(e)}_unlink(e){e.state=3;const t=this._contexts.get(e.contextKey);t&&t.get(e.key)===e&&(t.delete(e.key),0===t.size&&this._contexts.delete(e.contextKey));for(const t of this._subscriptionsOf(e))this._forget(t)}_ended(e,t){if(3===e.state)return;const r=this._subscriptionsOf(e);this._unlink(e),this._release(e);for(const n of r)n.v>=4&&this._publish({i:n.id,end:{...t,context:e.contextName}})}static _canRelease(e){const t=d(e.func);return!!e.registration||e.nodeEmitter||null!==t&&s(e.target[t])||s(e.target.removeListener)}_release(e){const t=t=>this._emit("releaseFailed",{context:e.contextName,function:e.func,args:e.args,error:t});try{const{registration:r,target:n}=e;if(r)if(e.registration=null,s(r[Symbol.asyncDispose])){const e=r[Symbol.asyncDispose]();a(e)&&e.then(null,t)}else r[Symbol.dispose]();else if(e.nodeEmitter)for(const{fanout:t}of e.positions)n.removeListener(e.event,t);else if(s(n[d(e.func)])){const r=n[d(e.func)](...e.unwrapped);a(r)&&r.then(null,t)}else if(s(n.removeListener))for(const{fanout:t}of e.positions)n.removeListener(e.event,t)}catch(e){t(e)}}}b.isRegistration=l,b.isRemover=h,b.canonical=f,b.sanitize=c,b.NOTICE_VERSION=4,e.exports=b},5345:e=>{"use strict";e.exports=URIError},5350:()=>{},5373:(e,t,r)=>{"use strict";var n=r(8636),i=r(2642),o=r(4765);e.exports={formats:o,parse:i,stringify:n}},5399:(e,t,r)=>{const n=e.exports,{Buffer:i}=r(8287);n.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"},n.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},n.requiredHeaderFlagsErrors={};for(const e in n.requiredHeaderFlags){const t=n.requiredHeaderFlags[e];n.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+n.types[e]+" packet"}n.codes={};for(const e in n.types){const t=n.types[e];n.codes[t]=e}n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=i.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=i.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=i.from([n.codes.connect<<n.CMD_SHIFT]),n.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},n.propertiesCodes={};for(const e in n.properties){const t=n.properties[e];n.propertiesCodes[t]=e}function o(e){return[0,1,2].map(t=>[0,1].map(r=>[0,1].map(o=>{const s=i.alloc(1);return s.writeUInt8(n.codes[e]<<n.CMD_SHIFT|(r?n.DUP_MASK:0)|t<<n.QOS_SHIFT|o,0,!0),s})))}n.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},n.PUBLISH_HEADER=o("publish"),n.SUBSCRIBE_HEADER=o("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=o("unsubscribe"),n.ACKS={unsuback:o("unsuback"),puback:o("puback"),pubcomp:o("pubcomp"),pubrel:o("pubrel"),pubrec:o("pubrec")},n.SUBACK_HEADER=i.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=i.from([3]),n.VERSION4=i.from([4]),n.VERSION5=i.from([5]),n.VERSION131=i.from([131]),n.VERSION132=i.from([132]),n.QOS=[0,1,2].map(e=>i.from([e])),n.EMPTY={pingreq:i.from([n.codes.pingreq<<4,0]),pingresp:i.from([n.codes.pingresp<<4,0]),disconnect:i.from([n.codes.disconnect<<4,0])},n.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},n.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},n.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",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"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},5568:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},5606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5670:(e,t,r)=>{"use strict";const n=r(8287),i=r(9584),o=r(2635);let s,a,l;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const c=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);s=wx.connectSocket({url:c,protocols:[r]}),a=function(){const e=new i.Transform;return e._write=(e,t,r)=>{s.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{s.close({success(){e()}})},e}(),l=new o.BufferedDuplex(t,a,s),l._destroy=(e,t)=>{s.close({success(){t&&t(e)}})};const u=l.destroy;return l.destroy=(e,t)=>(l.destroy=u,setTimeout(()=>{s.close({fail(){l._destroy(e,t)}})},0),l),s.onOpen(()=>{l.socketReady()}),s.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?n.Buffer.from(t):n.Buffer.from(t,"utf8"),a.push(t)}),s.onClose(()=>{l.emit("close"),l.end(),l.destroy()}),s.onError(e=>{const t=new Error(e.errMsg);l.destroy(t)}),l}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5767:(e,t,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(6556),a=r(5795),l=r(3628),c=s("Object.prototype.toString"),u=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,h=i(),d=s("String.prototype.slice"),p=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},g={__proto__:null};n(h,u&&a&&l?function(e){var t=new f[e];if(Symbol.toStringTag in t&&l){var r=l(t),n=a(r,Symbol.toStringTag);if(!n&&r){var i=l(r);n=a(i,Symbol.toStringTag)}g["$"+e]=o(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(g["$"+e]=o(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=d(c(e),8,-1);return p(h,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(g,function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}}),t}(e)}return a?function(e){var t=!1;return n(g,function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}}),t}(e):null}},5769:(e,t,r)=>{const n=r(5606),i=r(8287),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:d}=r(5980),p=r(577),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:y}}=r(2074),{destroyer:_}=r(1787),m=r(7323),w=r(2729),v=r(8601),{createDeferredPromise:S}=r(7797),E=r(1401),A=globalThis.Blob||i.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(4469);class R extends m{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,i,a,l,c,u=!!o(t),f=!!s(r);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&_(t,e),h(e)}),c._write=function(e,t,i){r.write(e,t)?i():n=i},c._final=function(e){r.end(),i=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(i){const e=i;i=null,e()}})),u&&(p(t,e=>{u=!1,e&&_(t,e),h(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,o){e||null===l||(e=new g),a=null,n=null,i=null,null===l?o(e):(l=o,_(r,e),_(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(h(t))return T({readable:w.fromWeb(t)});if(d(t))return T({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:r}=S();const i=new I,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:r}=S()),yield i}}(),{signal:o}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:i,final:o,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{_(t,e)});return t=new R({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&d(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return O(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new b(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5880:e=>{"use strict";e.exports=Math.pow},5980:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=r(4469),s=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),c=o("nodejs.stream.writable"),u=o("nodejs.stream.disturbed"),f=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function b(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function _(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!d(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!m(e)&&d(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!m(e)&&p(e)&&e.writable&&!w(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:m,kIsDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!m(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:b,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return b(e)||y(e)||_(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:k,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:_}},6171:(e,t,r)=>{const n=r(1072),i=r(9372),o=r(8665),s=r(3530),a=r(544),l=r(7007),{nanoid:c}=r(3561);class u extends l{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:i=c(8),broker:a="mqtts://broker.hivemq.com:8883",log:l="console",bestEffort:f=!0,version:h="",mqttClientId:d=null}={}){super(),this._validateDomain(n),this._validateAgent(i),this._username=e,this._password=t,this._token=r,this._agent=i,this._domain=n,this._broker=a,this._qos=f?0:1,this._version=h,this._mqttClientId=d||`va3${u._createHash(this._domain+this._agent)}`,"console"===l?(this._log=console,this._log.debug=()=>{}):this._log=l,this._baseTopic=`${this._domain}/${this._agent}`,o.onCallback(this._handleVrpcCallback.bind(this)),this._handleDisposeFailed=({instance:e,className:t,error:r})=>this._log.warn(r,`Dispose of deleted instance ${t}::${e} failed: ${r.message}`),o.on("disposeFailed",this._handleDisposeFailed),this._handleReleaseFailed=({context:e,error:t,...r})=>this._log.warn(t,`Release of registration ${e}::${r.function} failed: ${t&&t.message}`),o.on("releaseFailed",this._handleReleaseFailed),this._handleGreetFailed=({context:e,error:t,...r})=>this._log.warn(t,`Greeting of a subscriber to ${e}::${r.function} failed: ${t&&t.message}`),o.on("greetFailed",this._handleGreetFailed),this._isolatedInstances=new Map,this._watched=new Set,this._subscribeRetrier=new s({subscribe:(e,t)=>this._mqttSubscribe(e,t),log:this._log}),this._connectGeneration=0,this._serving=!1,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=c()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,reconnectOnConnackError:!0,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=i.connect(this._broker,this._options),this._backoff=new a(this._client),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){o.off("disposeFailed",this._handleDisposeFailed),o.off("releaseFailed",this._handleReleaseFailed),o.off("greetFailed",this._handleGreetFailed),this._subscribeRetrier.cancel();try{if(!this._client||!this._client.connected){if(this._client){const e=this._client;await new Promise(t=>e.end(!0,{},t))}return void this.emit("end")}const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});for(const e of this._getClasses())for(const t of["__classInfo__","__classInfoConcise__"])this._mqttPublish(`${this._baseTopic}/${e}/${t}`,null,{retain:!0})}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:4})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t,r){this._client.subscribe(e,{qos:this._qos,...t},(n,i)=>{const{refused:o,granted:a,error:l}=s.outcome(n,i);if(l)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${l.message}`);else{let r;const n=Array.isArray(e)?e:[e],i=o;i.length>0&&(r=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${i.length} topic(s): ${i}`),r.code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r),this.emit("error",r),this._subscribeRetrier.schedule(i,t)),this._subscribeRetrier.granted(a.map(e=>e.topic));const s=a.filter(e=>e.qos<this._qos);s.length>0&&(r=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`),r.code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r),this.emit("error",r)),0===a.length&&this._log.debug(`Already subscribed to topic '${e}'`)}r&&r()})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return o._getClassesArray()}_getInstances(e){return o._getInstancesArray(e)}_getMemberFunctions(e){return o._getMemberFunctionsArray(e)}_getStaticFunctions(e){return o._getStaticFunctionsArray(e)}_getMetaData(e){return o._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._serving?e():(this.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:i,a:o,end:s,receiverVersion:a}=e,l=r.startsWith("__e__")?r.slice(5):t;let c,f;c=s?{i:r,end:s,v:4}:void 0!==o?{a:o,i:r,v:4}:u._answer({r:n,e:i,i:r});try{f=u._stringifySafely(c)}catch(e){const t=r.startsWith("__e__")?"event":"callback";if(this._log.warn(`The arguments of ${"event"===t?"an":"a"} ${t} to ${l} cannot be encoded as JSON: ${e.message}`),!(a>=4))return;f=JSON.stringify({i:r,e:{message:`The arguments of this ${t} cannot be encoded as JSON: ${e.message}`},v:4})}try{this._log.debug(`Forwarding callback to: ${l} with payload:`,e),this._mqttPublish(l,f)}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${l} because of: ${e.message}`)}}static _stringifySafely(e){try{return JSON.stringify(e)}catch(t){if(void 0!==e.a||e.end)throw t;return JSON.stringify({e:{message:`The result cannot be encoded as JSON: ${t.message}`},i:e.i,v:e.v})}}_handleConnect(){this._log.info("[OK]"),this._subscribeRetrier.cancel();const e=++this._connectGeneration,t=[];try{const e=this._generateTopics();e.length>0&&t.push(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}for(const[e,{className:r}]of o._instances.entries())t.push(this._methodsTopic(r,e));let r=t.length;const n=()=>{if(e===this._connectGeneration){this._publishAgentInfoMessage();for(const e of this._getClasses())this._publishClassInfoMessage(e);this._serving=!0,this.emit("connect")}};if(0!==r)for(const e of t)this._mqttSubscribe(e,void 0,()=>{r-=1,0===r&&n()});else n()}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:4},{meta:r,...n}=t;try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0}),this._mqttPublish(`${this._baseTopic}/${e}/__classInfoConcise__`,JSON.stringify(n),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})});for(const t of["__unsubscribe__","__registrations__","__end__"])e.push(`${this._baseTopic}/+/__static__/${t}`);return e}_handleMessage(e,t){let r;try{r=JSON.parse(t.toString())}catch(t){return void this._log.warn(`Ignoring a message that is no JSON on: ${e}`)}try{this._log.debug(`Message arrived with topic: ${e} and payload:`,r);const t=e.split("/"),[,,n,i,s]=t;if(4===t.length&&"__clientInfo__"===t[3])return void(u._isObject(r)&&this._handleClientInfoMessage(e,r));if(5!==t.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);if(!u._isObject(r)||!this._isConnectionId(r.s))return void this._log.warn(`Ignoring a request without a valid sender on: ${e}`);r.c="__static__"===i?n:i,r.f=s;const a=Array.isArray(r.a)?r.a[0]:void 0,l=o._instances.get(a);if(o._call(r)&&this._watch(r.s),r.e)"__createIsolated__"!==s&&"__createShared__"!==s||this._log.warn(`Instantiation of ${n} failed: ${r.e.message}`);else switch(s){case"__createIsolated__":l||this._subscribeToMethodsOfNewInstance(n,r.r),this._registerIsolatedInstance(r.r,r.s);break;case"__createShared__":l||(this._subscribeToMethodsOfNewInstance(n,r.r),this._publishClassInfoMessage(n)),this._watch(r.s);break;case"__delete__":l&&this._forgetInstance(a,l)}this._mqttPublish(r.s,u._stringifySafely(u._answer(r)))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}static _answer({r:e,e:t,i:r}){return t?{e:t,i:r,v:4}:{r:e,i:r,v:4}}static _isObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}_isConnectionId(e){if("string"!=typeof e)return!1;const t=e.split("/");return 3===t.length&&t[0]===this._domain&&"__agentInfo__"!==t[2]&&t.every(e=>e.length>0&&!/[+#]/.test(e))}_watch(e){this._watched.has(e)||(this._watched.add(e),this._mqttSubscribe(`${e}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${e}`))}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){o._unregisterClient(r);const e=this._isolatedInstances.get(r);this._isolatedInstances.delete(r),e&&e.forEach(e=>{const t=o._instances.get(e),r={c:t&&t.className,f:"__delete__",a:[e],s:o.LOCAL_SENDER};o._call(r),r.r&&(this._unsubscribeMethodsOfDeletedInstance(t.className,e),this._log.debug(`Auto-deleted isolated instance: ${e}`))}),this._watched.delete(r),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):this._isolatedInstances.set(t,new Set([e])),this._watch(t)}_forgetInstance(e,{className:t,isIsolated:r,owner:n}){if(this._unsubscribeMethodsOfDeletedInstance(t,e),r){const t=this._isolatedInstances.get(n);t&&(t.delete(e),0===t.size&&this._isolatedInstances.delete(n))}else this._publishClassInfoMessage(t)}_methodsTopic(e,t){return`${this._baseTopic}/${e}/${t}/+`}_subscribeToMethodsOfNewInstance(e,t){const r=this._methodsTopic(e,t);this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=this._methodsTopic(e,t);this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this._serving=!1,this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=u},6172:(e,t,r)=>{const{Buffer:n}=r(8287),i={},o=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:i,generateCache:function(){for(let e=0;e<65536;e++)i[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const i=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),i.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),o?i.subarray(0,r):i.slice(0,r)},generate4ByteBuffer:function(e){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6188:e=>{"use strict";e.exports=Math.max},6269:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(4469);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:o}=r(2074).codes,s=r(7323),{getHighWaterMark:a}=r(2100);n(c.prototype,s.prototype),n(c,s);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new o("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},6357:(e,t,r)=>{"use strict";const{pipeline:n}=r(4867),i=r(7323),{destroyer:o}=r(1787),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:h}=r(5980),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=r(2074),b=r(577);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||h(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,_,m,w;const v=e[0],S=n(e,function(e){const t=m;m=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||h(S)||u(S));if(w=new i({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;b(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(_){const e=_;_=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(_=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===m||(e=new d),_=null,r=null,y=null,null===m?t(e):(m=t,s(S)&&o(S,e))},w}},6364:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:i,codes:o}=r(9157),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:c}=r(9862),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:d}=r(4947),{Promise:p,PromisePrototypeThen:g,SymbolDispose:b}=r(2768),{isClosed:y,isReadable:_,isReadableNodeStream:m,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:T,kIsClosedPromise:x}=r(6801);let P;const N=()=>{};function j(e,t,o){var d,p;if(2===arguments.length?(o=t,t=l):null==t?t=l:h(t,"options"),f(o,"callback"),u(t.signal,"options.signal"),o=c(o),w(e)||k(e))return function(e,t,o){let s=!1,a=N;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{P=P||r(9862).addAbortListener;const n=P(t.signal,a),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[x].promise,l,l),N}(e,t,o);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const j=null!==(d=t.readable)&&void 0!==d?d:m(e),M=null!==(p=t.writable)&&void 0!==p?p:A(e),C=e._writableState,L=e._readableState,D=()=>{e.writable||B()};let F=T(e)&&m(e)===j&&A(e)===M,$=I(e,!1);const B=()=>{$=!0,e.destroyed&&(F=!1),(!F||e.readable&&!j)&&(j&&!U||o.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(F=!1),(!F||e.writable&&!M)&&(M&&!$||o.call(e))},q=t=>{o.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?o.call(e,t):j&&!U&&m(e,!0)&&!v(e,!1)?o.call(e,new a):!M||$||I(e,!1)?void o.call(e):o.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?M&&!C&&(e.on("end",D),e.on("close",D)):(e.on("complete",B),F||e.on("abort",z),e.req?G():e.on("request",G)),F||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=C&&C.errorEmitted||null!=L&&L.errorEmitted?F||n.nextTick(H):(j||F&&!_(e)||!$&&!1!==E(e))&&(M||F&&!E(e)||!U&&!1!==_(e))?L&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{o=N,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",D),e.removeListener("close",D),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{P=P||r(9862).addAbortListener;const n=P(t.signal,s),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}}return K}e.exports=j,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p((r,i)=>{const o=j(e,t,e=>{n&&o(),e?i(e):r()})})}},6370:()=>{},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),i=r(3126),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),i=r(8452);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6585:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?s(l,c,i,"day"):c>=n?s(l,c,n,"hour"):c>=r?s(l,c,r,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6644:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6801:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=r(2768),s=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),c=o("nodejs.stream.writable"),u=o("nodejs.stream.disturbed"),f=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function b(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function _(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!d(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!m(e)&&d(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!m(e)&&p(e)&&e.writable&&!w(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:m,kIsDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!m(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:b,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return b(e)||y(e)||_(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:k,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:_}},6887:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.isReactNativeBrowser=t.isWebWorker=void 0;const i=()=>Boolean("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&"undefined"==typeof Deno),o=()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product,s="undefined"!=typeof window&&("undefined"!=typeof navigator&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&n?.versions?!Object.prototype.hasOwnProperty.call(n.versions,"electron"):void 0!==window.document)||i()||o();t.isWebWorker=i(),t.isReactNativeBrowser=o(),t.default=s},6891:(e,t,r)=>{"use strict";var n,i=r(2045);e.exports=k,k.ReadableState=A,r(7007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(1396),l=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(7199);o=u&&u.debuglog?u.debuglog("stream"):function(){};var f,h,d,p=r(1766),g=r(4347),b=r(6644).getHighWaterMark,y=r(2463).F,_=y.ERR_INVALID_ARG_TYPE,m=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(k,a);var S=g.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(e,t,i){n=n||r(8101),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3141).I),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function k(e){if(n=n||r(8101),!(this instanceof k))return new k(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function I(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)a.endEmitted?S(e,new v):O(e,a,t,!0);else if(a.ended)S(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):N(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,N(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),N(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=g.destroy,k.prototype._undestroy=g.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),I(this,e,t,!1,r)},k.prototype.unshift=function(e){return I(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){f||(f=r(3141).I);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var R=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(P,e))}function P(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function N(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(j,e,t))}function j(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function M(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function C(e){o("readable nexttick read 0"),e.read(0)}function L(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function $(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?$(this):x(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&$(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&$(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){S(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?g:l;function l(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",g),r.removeListener("data",f),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var u=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),g(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),g()}function p(){o("onfinish"),e.removeListener("close",d),g()}function g(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?x(this):n.reading||i.nextTick(C,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(M,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(M,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(L,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5034)),h(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===d&&(d=r(968)),d(k,e,t)})},6897:(e,t,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var u=s(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},6912:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(4959)),o=n(r(5228)),s=n(r(495)),a=n(r(1021)),l=n(r(4264)),c=r(4723);t.default=(e,t,r,n)=>{const{options:u}=e,f=u.properties?.maximumPacketSize,h=1+(e=>e<128?1:e<16384?2:e<2097152?3:4)(d=t.length)+d;var d;if(5===u.protocolVersion&&f&&f<h)return e.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",t.cmd,h,f),n?.discardParsedPackets(),e._cleanUp(!0),r(),e.emit("error",new c.ErrorWithReasonCode(`exceeding packets size ${t.cmd}: ${h} bytes, maximumPacketSize is ${f}`,149)),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,i.default)(e,t,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing();try{(0,a.default)(e,t)}finally{r()}break;case"pubrel":e.reschedulePing(),(0,l.default)(e,t,r);break;case"connack":try{(0,s.default)(e,t,n)}finally{r()}break;case"auth":e.reschedulePing();try{(0,o.default)(e,t,n)}finally{r()}break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},6968:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){p("SOCKS connection to %s:%d via %s",e,t,r);const i=new g;return async function(e,t,r,n,i={}){const o=i.lookup??(0,h.promisify)(f.lookup),[s,a]=function(e){const t=new URL(e);if(t.pathname||t.hash||t.search)throw b(new Error("bad SOCKS URL"));const[r,n]=function(e){switch(e){case"socks5h:":return[5,!0];case"socks4a:":return[4,!0];case"socks5:":return[5,!1];case"socks4:":return[4,!1];default:return[void 0,!1]}}(t.protocol);if(!r)throw b(new Error("bad SOCKS URL: invalid protocol"));const i=parseInt(t.port,10);if(Number.isNaN(i))throw b(new Error("bad SOCKS URL: invalid port"));return[{host:t.hostname,port:i,type:r},n]}(r);a||(p("resolving %s locally",e),e=(await o(e,{family:4===s.type?4:0})).address),p("establishing SOCKS%d connection to %s:%d via %s:%d",s.type,e,t,s.host,s.port);const l=new u.SocksClient({command:"connect",destination:{host:e,port:t},proxy:{...s},timeout:i.timeout});l.connect(),l.on("established",({socket:e})=>n._start(e)),l.on("error",e=>{p("SOCKS failed: %s",e),n.destroy(b(e))})}(e,t,r,i,n).catch(e=>{p("SOCKS failed: %s",e),i.destroy(e)}),i};const l=a(r(7833)),c=r(8310),u=r(9122),f=s(r(9288)),h=r(537),d=a(r(4148)),p=(0,l.default)("mqttjs:socks");class g extends c.Duplex{_flowing=!1;_socket;constructor(){super({autoDestroy:!1}),this.cork()}_start(e){p("proxy stream started"),(0,d.default)(!this._socket),this.destroyed?e.destroy(this.errored):(this._socket=e,this._flowing||e.pause(),e.on("data",this._onData),e.on("end",this._onEnd),e.on("error",this._onError),e.on("close",this._onClose),e.emit("connect"),this.uncork())}_write(e,t,r){(0,d.default)(this._socket),this._socket.write(e,r)}_read(e){this._flowing=!0,this._socket?.resume?.()}_destroy(e,t){this._socket?.destroy?.(e),t(e)}_onData=e=>{(0,d.default)(this._socket),this._flowing=this.push(e),this._flowing||this._socket.pause()};_onEnd=()=>{p("proxy stream received EOF"),this.push(null)};_onClose=()=>{p("proxy stream closed"),this.destroy()};_onError=e=>{p("proxy stream died with error %s",e),this.destroy(e)}}function b(e){try{return void 0===e.code&&(e.code="SOCKS"),e}catch{return e}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,i=r(3126),o=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&o&&o(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?i([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},7199:()=>{},7244:(e,t,r)=>{"use strict";var n=r(9092)(),i=r(6556)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},7302:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=r(9157),{Symbol:a}=r(2768),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(6801),h=a("kDestroy"),d=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,r){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(b,e,t):n.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function b(e,t){_(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function _(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(_,e,t):_(e,t))}function w(e){let t=!1;function r(r){if(t)return void m(e,null!=r?r:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,r):r?m(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(d)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(d,t),e.listenerCount(d)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,o=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,function(r){g(this,i(r,e),t)}),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}},7323:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=r(4469);e.exports=c;const a=r(2729),l=r(8601);s(c.prototype,a.prototype),s(c,a);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function h(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5769)),f(e,"body")}},7396:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),i=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},o.prototype.getBuffers=function(){return this._bufs},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,r,i){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);const o=!!e,s=this._offset(r),a=i-r;let l=a,c=o&&t||0,u=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-u)return o?this._bufs[s[0]].copy(e,t,u,u+l):this._bufs[s[0]].slice(u,u+l);o||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-u;if(!(l>r)){this._bufs[t].copy(e,c,u,u+l),c+=r;break}this._bufs[t].copy(e,c,u),c+=r,l-=r,u&&(u=0)}return e.length>c?e.slice(0,c):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){return this._attach(e,o.prototype._appendBuffer)},o.prototype.prepend=function(e){return this._attach(e,o.prototype._prependBuffer,!0)},o.prototype._attach=function(e,t,r){if(null==e)return this;if(e.buffer)t.call(this,n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){const[n,i]=r?[e.length-1,-1]:[0,1];for(let o=n;o>=0&&o<e.length;o+=i)this._attach(e[o],t,r)}else if(this._isBufferList(e)){const[n,i]=r?[e._bufs.length-1,-1]:[0,1];for(let o=n;o>=0&&o<e._bufs.length;o+=i)this._attach(e._bufs[o],t,r)}else"number"==typeof e&&(e=e.toString()),t.call(this,n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},o.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"==typeof t&&(r=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=n.from([e]):"string"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const i=this._offset(t);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)(function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},7419:(e,t,r)=>{"use strict";var n=r(2861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7487:(e,t,r)=>{"use strict";var n=r(2861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,f=l>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(l(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7602:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=r(2768);e.exports=M,M.WritableState=N;const{EventEmitter:d}=r(7007),p=r(8745).Stream,{Buffer:g}=r(8287),b=r(7302),{addAbortSignal:y}=r(5121),{getHighWaterMark:_,getDefaultHighWaterMark:m}=r(3513),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(9157).codes,{errorOrDestroy:T}=b;function x(){}c(M.prototype,p.prototype),c(M,p);const P=f("kOnFinished");function N(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?_(this,e,"writableHighWaterMark",n):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=F.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,j(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function M(e){const t=this instanceof r(2648);if(!t&&!s(M,this))return new M(e);this._writableState=new N(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),b.construct(this,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!g.isEncoding(r))throw new R(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=x)}if(null===t)throw new I;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,r),r="buffer");else if(t instanceof g)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return o.ending?s=new O:o.destroyed&&(s=new A("write")),s?(n.nextTick(i,s),T(e,s,!0),s):(o.pendingcb++,function(e,t,r,n,i){const o=t.objectMode?1:r.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==x&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,r,i))}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),U(t),T(e,r)}function F(e,t){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(D,e,r,t,o):D(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&W(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick($,r.afterWriteTickInfo)):B(e,r,1,o))):T(e,new S)}function $({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?x:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),j(t)}else{do{const{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t,r){q(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)T(e,null!=i?i:S());else if(r=!0,t.pendingcb--,i){const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}N.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(M,h,{__proto__:null,value:function(e){return!!s(this,e)||this===M&&e&&e._writableState instanceof N}}),M.prototype.pipe=function(){T(this,new E)},M.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},M.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},M.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},M.prototype._writev=null,M.prototype.end=function(e,t,r){const i=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof o&&(s=r)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new k("end"):i.destroyed&&(s=new A("end")):(i.ending=!0,V(this,i,!0),i.ended=!0)),"function"==typeof r&&(s||i.finished?n.nextTick(r,s):i[P].push(r)),this},l(M.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const H=b.destroy;let G;function K(){return void 0===G&&(G={}),G}M.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[P].length)&&n.nextTick(U,r),H.call(this,e,t),this},M.prototype._undestroy=b.undestroy,M.prototype._destroy=function(e,t){t(e)},M.prototype[d.captureRejectionSymbol]=function(e){this.destroy(e)},M.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},M.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},7653:(e,t,r)=>{"use strict";var n=r(8452),i=r(487),o=r(9211),s=r(9394),a=r(6576),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},7712:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(2074),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(1580),h=r(4469).Symbol("kWeak"),d=r(4469).Symbol("kResistStopPropagation"),{finished:p}=r(577),g=r(6357),{addAbortSignalNoValidate:b}=r(982),{isWritable:y,isNodeStream:_}=r(5980),{deprecate:m}=r(7797),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:T}=r(4469),x=T("kEmpty"),P=T("kEof");function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=S(t.highWaterMark)),u(n,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=n,async function*(){const o=r(7797).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:o};let u,f,h=!1,d=0;function p(){h=!0,g()}function g(){d-=1,b()}function b(){f&&!h&&d<n&&a.length<i&&(f(),f=null)}!async function(){try{for await(let t of s){if(h)return;if(o.aborted)throw new l;try{if(t=e(t,c),t===x)continue;t=O(t)}catch(e){t=I(e)}d+=1,R(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||d>=n)&&await new k(e=>{f=e})}a.push(P)}catch(e){const t=I(e);R(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===P)return;if(o.aborted)throw new l;e!==x&&(yield e),a.shift(),b()}await new k(e=>{u=e})}}finally{h=!0,f&&(f(),f=null)}}.call(this)}async function j(e,t=void 0){for await(const r of M.call(this,e,t))return!0;return!1}function M(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return N.call(this,async function(t,r){return await e(t,r)?t:x},t)}class C extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:m(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:M,flatMap:function(e,t){const r=N.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:N,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),_(e)&&!y(e))throw new i("stream",e,"must be writable");const r=g(this,e);return null!=t&&t.signal&&b(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await j.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const r of N.call(this,async function(t,r){return await e(t,r),x},t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[h]:this,[d]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let g=!1;try{for await(const n of this){var b;if(g=!0,null!=r&&null!==(b=r.signal)&&void 0!==b&&b.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!g&&!s)throw new C}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:j,find:async function(e,t){for await(const r of M.call(this,e,t))return r}}},7720:(e,t,r)=>{"use strict";var n=r(4765),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=1024;e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],s=i.obj[i.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<a.length;u+=l){for(var f=a.length>=l?a.slice(u,u+l):a,h=[],d=0;d<f.length;++d){var p=f.charCodeAt(d);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===n.RFC1738&&(40===p||41===p)?h[h.length]=f.charAt(d):p<128?h[h.length]=s[p]:p<2048?h[h.length]=s[192|p>>6]+s[128|63&p]:p<55296||p>=57344?h[h.length]=s[224|p>>12]+s[128|p>>6&63]+s[128|63&p]:(d+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(d)),h[h.length]=s[240|p>>18]+s[128|p>>12&63]+s[128|p>>6&63]+s[128|63&p])}c+=h.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return o(t)&&!o(r)&&(s=a(t,n)),o(t)&&o(r)?(r.forEach(function(r,o){if(i.call(t,o)){var s=t[o];s&&"object"==typeof s&&r&&"object"==typeof r?t[o]=e(s,r,n):t.push(r)}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var s=r[o];return i.call(t,o)?t[o]=e(t[o],s,n):t[o]=s,t},s)}}},7732:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const a=r(9993),l=s(r(6887)),c={set:a.setInterval,clear:a.clearInterval},u={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};t.default=e=>{switch(e){case"native":return u;case"worker":return c;default:return!l.default||l.isWebWorker||l.isReactNativeBrowser?u:c}}},7797:(e,t,r)=>{"use strict";const n=r(8287),{format:i,inspect:o}=r(2858),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(2074),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(4469),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||n.Blob,p=void 0!==d?function(e){return e instanceof d}:function(e){return!1},g=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:i,inspect:o,types:{isAsyncFunction:e=>e instanceof h,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return g(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{g(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7829:(e,t,r)=>{"use strict";const n=r(9037),i=r(3942),o=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=o,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},7833:(e,t,r)=>{var n=r(2045);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9584),i={objectMode:!0},o={clean:!0};t.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...o,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(i),t=[];let r=!1,o=0;return this._inflights.forEach((e,r)=>{t.push(e)}),e._read=()=>{!r&&o<t.length?e.push(t[o++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){const r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){const r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},8101:(e,t,r)=>{"use strict";var n=r(2045),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var o=r(6891),s=r(1999);r(6698)(u,o);for(var a=i(s.prototype),l=0;l<a.length;l++){var c=a[l];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},8184:(e,t,r)=>{"use strict";var n=r(6556),i=r(9721)(/^\s*(?:function)?\*/),o=r(9092)(),s=r(3628),a=n("Object.prototype.toString"),l=n("Function.prototype.toString"),c=r(4233);e.exports=function(e){if("function"!=typeof e)return!1;if(i(l(e)))return!0;if(!o)return"[object GeneratorFunction]"===a(e);if(!s)return!1;var t=c();return t&&s(e)===t.prototype}},8203:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.streamBuilder=t.browserStreamBuilder=void 0;const i=r(8287),o=n(r(1591)),s=n(r(7833)),a=r(9584),l=n(r(6887)),c=r(2635),u=(0,s.default)("mqttjs:ws"),f=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function h(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){const t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),l.default||e.forceNativeWebSocket||"wss"!==e.protocol||f.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}t.streamBuilder=(e,t)=>{u("streamBuilder");const r=d(t);r.hostname=r.hostname||r.host||"localhost";const n=h(r,e),i=function(e,t,r){u("createWebSocket"),u(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";let i;return u(`creating new Websocket for url: ${t} and protocol: ${n}`),i=r.createWebsocket?r.createWebsocket(t,[n],r):new o.default(t,[n],r.wsOptions),i}(0,n,r),s=o.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy()}),s},t.browserStreamBuilder=(e,t)=>{let r;u("browserStreamBuilder");const n=function(e){const t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t),o=n.browserBufferSize||524288,s=t.browserBufferTimeout||1e3,l=!t.objectMode,f=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=h(t,e);let i;return i=t.createWebsocket?t.createWebsocket(n,[r],t):new WebSocket(n,[r]),i.binaryType="arraybuffer",i}(e,t),p=function(e){const t=new a.Transform({objectMode:e.objectMode});return t._write=function e(t,r,n){if(f.bufferedAmount>o)return void setTimeout(e,s,t,r,n);l&&"string"==typeof t&&(t=i.Buffer.from(t,"utf8"));try{f.send(t)}catch(e){return n(e)}n()},t._flush=function(e){f.close(),e()},t}(t);t.objectMode||(p._writev=c.writev.bind(p)),p.on("close",()=>{f.close()});const g=void 0!==f.addEventListener;function b(){u("WebSocket onOpen"),r instanceof c.BufferedDuplex&&r.socketReady()}function y(e){u("WebSocket onClose",e),r.end(),r.destroy()}function _(e){u("WebSocket onError",e);const t=new Error("WebSocket error");t.event=e,r.destroy(t)}async function m(e){if(!p||!p.readable||!p.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):t instanceof Blob?i.Buffer.from(await new Response(t).arrayBuffer()):i.Buffer.from(t,"utf8"),p.push(t)}return f.readyState===f.OPEN?(r=p,r.socket=f):(r=new c.BufferedDuplex(t,p,f),g?f.addEventListener("open",b):f.onopen=b),g?(f.addEventListener("close",y),f.addEventListener("error",_),f.addEventListener("message",m)):(f.onclose=y,f.onerror=_,f.onmessage=m),r}},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function _(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return K(G(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):b.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==u[e]){o=c[e],s=u[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return _(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return _(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function j(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function M(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function C(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||j(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X(function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=X(function(e,t=0){return C(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);j(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||j(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X(function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=X(function(e,t=0){return C(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const $={};function B(e,t,r){$[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8310:(e,t,r)=>{e.exports=i;var n=r(7007).EventEmitter;function i(){n.call(this)}r(6698)(i,n),i.Readable=r(6891),i.Writable=r(1999),i.Duplex=r(8101),i.Transform=r(9083),i.PassThrough=r(3681),i.finished=r(4257),i.pipeline=r(5267),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",l));var s=!1;function a(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},8389:function(e,t){!function(e){"use strict";var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=1073741824,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s}(t)},8403:(e,t,r)=>{"use strict";var n=r(1189),i=r(1333)(),o=r(6556),s=r(9612),a=o("Array.prototype.push"),l=o("Object.prototype.propertyIsEnumerable"),c=i?s.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=s(e);if(1===arguments.length)return r;for(var o=1;o<arguments.length;++o){var u=s(arguments[o]),f=n(u),h=i&&(s.getOwnPropertySymbols||c);if(h)for(var d=h(u),p=0;p<d.length;++p){var g=d[p];l(u,g)&&a(f,g)}for(var b=0;b<f.length;++b){var y=f[b];if(l(u,y)){var _=u[y];r[y]=_}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)c(e,o[a],t[o[a]],r[o[a]])};u.supportsDescriptors=!!l,e.exports=u},8577:(e,t,r)=>{var n=r(2045);const i=r(1072),{nanoid:o}=r(3561),s=r(9372),a=r(7007),l=r(3530),c=r(544),u=r(2732),f=/^(Promise\.?<\s*)?Registration\s*>?$/,h=new WeakSet;class d extends a{constructor({token:e,password:t,username:r,domain:n,agent:i="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:c=12e3,log:u="console",bestEffort:f=!0,mqttClientId:h=null,identity:d=null,keepalive:p=30,requiresSchema:g=!1,tls:b=null}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(i.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(d&&d.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=h){if("string"!=typeof h||0===h.length)throw new Error("The mqttClientId must be a non-empty string");if(h.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=i,this._domain=n,this._broker=s,this._timeout=c,this._identity=d,this._keepalive=p,this._qos=this._qos=f?0:1,this._requiresSchema=g,this._instance=o(8),this._mqttClientId=h||this._createMqttClientId(),this._tls=b,this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=o(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._ownIsolated=new Map,this._subscriptionTopics=new WeakMap,this._subscriptionCount=0,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,this._redeclare=new Set,this._pendingWithdrawals=new Map,this._inboxReady=!1,this._waiting=new Set,this._subscriberLabels=new WeakMap,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u,this._subscribeRetrier=new l({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log})}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}static _tlsOptions(e){if(!e)return{rejectUnauthorized:!1};const t={rejectUnauthorized:!1!==e.rejectUnauthorized};return e.ca&&(t.ca=e.ca),t}async connect({keepTrying:e=!1}={}){if(this._client&&this._client.connected)return;if(e&&this._client&&!h.has(this._client))return this._awaitConnect(this._client,{keepTrying:e});const{username:t,password:r}=this._credentials(),n={username:t,password:r,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,...d._tlsOptions(this._tls),connectTimeout:this._timeout,reconnectOnConnackError:!0,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===t&&delete n.username,void 0===r&&delete n.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,n),this._backoff=new c(this._client),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this._ownIsolated.clear(),this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.on("close",()=>{this._loseAnswers(()=>!0,"this client lost its connection")}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this._inboxReady=!1;for(const e of Object.values(this._cachedSubscriptions))this._redeclare.add(e.agent);this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._inboxReady=!0;for(const e of Array.from(this._redeclare))this._redeclareTo(e);for(const e of Array.from(this._pendingWithdrawals.keys()))this._flushWithdrawals(e);this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t,r)=>{if(0!==t.length)try{const n=e.split("/"),[i,o,s,a]=n;if(i!==this._domain)return void this._log.warn(`Received message from foreign domain: ${i}`);if("__agentInfo__"===s){const{status:e,hostname:n,version:s,v:a}=JSON.parse(t.toString());this._createIfNotExist(o),this._agents[o].status=e,this._agents[o].hostname=n,this._agents[o].version=s,this._agents[o].v=a,"offline"===e?(this._loseAnswers(e=>e.second&&e.agent===o,"the agent went offline"),this._loseAgent(o,a)):(r.retain||this._loseAnswers(e=>e.second&&e.agent===o,"the agent connected anew"),this._redeclareTo(o),this._flushWithdrawals(o)),this.emit("agent",{domain:i,agent:o,status:e,hostname:n,version:s})}else if("__classInfo__"===a||"__classInfoConcise__"===a){const e=JSON.parse(t.toString());this._createIfNotExist(o);const r=this._agents[o].classes[s],n=e.instances||[],a=r?r.instances:[],l=a.filter(e=>!n.includes(e)),c=n.filter(e=>!a.includes(e));this._agents[o].classes[s]=e;const{className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p}=e;0!==l.length&&(this.emit("instanceGone",l,{domain:i,agent:o,className:u}),l.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:o,className:u}))),0!==c.length&&this.emit("instanceNew",c,{domain:i,agent:o,className:u}),this.emit("class",{domain:i,agent:o,className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p||{}})}else{const{i:e,a:r,e:n,r:i,u:o,end:s}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:i,u:o,end:s})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),this._awaitConnect(this._client,{keepTrying:e})}_awaitConnect(e,{keepTrying:t}){return new Promise((r,n)=>{const i=setTimeout(()=>{const r=new Error(`Connection trial timed out (> ${this._timeout} ms)`);if(t)return e.removeListener("connect",o),void n(r);d._endMqtt(e,!0,{},()=>n(r))},this._timeout),o=()=>{clearTimeout(i),r()};e.once("connect",o)})}updateCredentials({username:e,password:t,token:r}={}){if(void 0!==e&&(this._username=e),void 0!==t&&(this._password=t),void 0!==r&&(this._token=r),!this._client||h.has(this._client))return;const n=this._credentials();for(const e of["username","password"])void 0===n[e]?delete this._client.options[e]:this._client.options[e]=n[e];this._backoff.hurry()}_credentials(){let e=this._username,t=this._password;return this._token&&(e=e||this._generateUserName(),t=this._token),{username:e,password:t}}static _endMqtt(e,t,r,n){h.add(e),e.end(t,r,n)}async create({className:e,instance:t=o(8),args:r=[],agent:n=this._agent,cacheProxy:i=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},l=await this._getProxy(n,e,a);return s&&this._ownIsolated.set(`${n}/${e}/${t}`,{agent:n,className:e,instance:t}),t&&i&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:l}),l}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:i}=await this._getInstanceData(e,t);return this._createProxy(n,i,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),i={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},o=`${this._domain}/${r}/${n}/__static__/__delete__`;this._mqttPublish(o,JSON.stringify(i)),delete this._proxies[`${r}/${n}/${e}`];const s=await this._handleAgentAnswer(i,r);return!0===s&&this._ownIsolated.delete(`${r}/${n}/${e}`),!0===s&&this._forgetInstance({agent:r,className:n,instance:e}),s}_forgetInstance({agent:e,className:t,instance:r}){const n=this._agents[e]&&this._agents[e].classes[t];if(!n||!Array.isArray(n.instances))return;if(!n.instances.includes(r))return;n.instances=n.instances.filter(e=>e!==r);const i=this._domain;this.emit("instanceGone",[r],{domain:i,agent:e,className:t}),this._clearCachedSubscriptions({lostInstance:r,agent:e,className:t})}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const i=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!i)return;const o={c:e,f:t,a:i,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},s=`${this._domain}/${n}/${e}/__static__/${t}`;return this._declare(o,s),await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(o)),this._handleAgentAnswer(o,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent,instances:i}={}){if(!this._isConnected())throw new Error("Client is not connected");if(void 0!==i&&!u.isSelection(i))throw new Error(`Invalid instances: ${JSON.stringify(i)} (a name pattern, or a list of names and patterns)`);const o=void 0===i||u.selectsAll(i)?void 0:i;if(Array.isArray(n)||n.includes("*"))return this._callAllAgents({className:e,functionName:t,args:r,agents:n,selection:o});const s={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};let a="__callAll__";if(void 0!==o){if(await this._waitUntilClassIsOnline(n,e),!this._selectsInstances(n,e))return this._callSelected({agent:n,className:e,functionName:t,args:r,selection:o});a="__callMatching__"}const l=`${this._domain}/${n}/${e}/__static__/${a}`,c=await this._wrapArguments({agent:n,className:e,functionName:t,args:r,isCallAll:!0,selection:o});return c?(s.a=void 0===o?[t,...c]:[o,t,...c],this._declare(s,l),await this._waitUntilClassIsOnline(n,e),this._mqttPublish(l,JSON.stringify(s)),this._handleAgentAnswer(s,n)):void 0}async _callAllAgents({className:e,functionName:t,args:r,agents:n,selection:i}){const o=Array.isArray(n)?n:this.getAvailableAgents().filter(t=>this._agents[t].classes[e]&&u.matches(n,t));return(await Promise.all(o.map(n=>this.callAll({className:e,functionName:t,args:r,agent:n,instances:i}).then(e=>(e||[]).map(e=>({agent:n,...e})),t=>{const r={message:t.message},o=this.getAvailableInstances({className:e,agent:n}).filter(e=>void 0===i||u.selects(i,e));return o.length>0?o.map(e=>({agent:n,id:e,err:r})):[{agent:n,err:r}]})))).flat()}_selectsInstances(e,t){const r=this._agents[e]&&this._agents[e].classes[t];return!!r&&r.staticFunctions.some(e=>"__callMatching__"===this._stripSignature(e))}async _callSelected({agent:e,className:t,functionName:r,args:n,selection:i}){if(n.some(e=>this._isFunction(e)||this._isEmitter(e)))throw new Error(`Agent ${e} does not select instances for callbacks and events (its class info lists no __callMatching__): update it, or call without instances`);const o=this.getAvailableInstances({className:t,agent:e}).filter(e=>u.selects(i,e));return Promise.all(o.map(async i=>{try{const o=await this.getInstance(i,{agent:e,className:t});return{id:i,val:await o[r](...n)}}catch(e){return{id:i,err:{message:e.message}}}}))}async unsubscribe(e,{instance:t}={}){const r=Object.values(this._cachedSubscriptions);let n;if("string"==typeof e||Array.isArray(e))n=(Array.isArray(e)?e:[e]).map(e=>this._cachedSubscriptions[e.startsWith("__e__")?e.slice(5):e]).filter(Boolean);else if(this._isFunction(e))n=r.filter(t=>t.callback===e);else{if(!this._isEmitter(e))throw new Error("unsubscribe expects a subscription id, a callback or an { emitter, event } contract");{const t=this._emitterCallback(e,{readOnly:!0});n=t?r.filter(e=>e.callback===t):[]}}const i=[];if(null!=t&&(i.push(...n.filter(e=>e.callAll)),n=n.filter(e=>!e.callAll&&e.instance===t)),0===n.length&&0===i.length)return!1;n.forEach(e=>this._dropSubscription(e)),i.forEach(e=>e.withdrawn.add(t));const o=new Map,s=(e,t,r)=>{o.has(e)||o.set(e,[]),o.get(e).push({sub:t,context:r})};for(const e of n)s(e.agent,e);for(const e of i)s(e.agent,e,t);const a=[];for(const[e,t]of o)a.push(this._withdrawAt(e,t));return await Promise.allSettled(a),!0}_withdrawAt(e,t){const r=this._agents[e];if(!this._isConnected()||!r||"online"!==r.status){const r=this._pendingWithdrawals.get(e)||[];return r.push(...t),this._pendingWithdrawals.set(e,r),Promise.resolve()}return r.v>=4?this._sendUnsubscribe(e,t):Promise.allSettled(t.filter(({context:e})=>void 0===e).map(({sub:e})=>this._sendLegacyRemoval(e)))}_flushWithdrawals(e){const t=this._pendingWithdrawals.get(e),r=this._agents[e];t&&this._isConnected()&&r&&"online"===r.status&&(this._pendingWithdrawals.delete(e),this._withdrawAt(e,t))}_loseAgent(e,t){if(!(t>=4))return this._redeclare.delete(e),void this._clearCachedSubscriptions({lostAgent:e});this._redeclare.add(e);for(const t of Object.values(this._cachedSubscriptions))t.agent!==e||t.lost||(t.lost=!0,t.confirmed=!1,this.emit("lost",t.id,"agentOffline",this._subscriptionInfo(t)))}getSubscriptions({callback:e}={}){return e&&this._isEmitter(e)&&!(e=this._emitterCallback(e,{readOnly:!0}))?[]:Object.values(this._cachedSubscriptions).filter(t=>!e||t.callback===e).map(e=>({id:e.id,...this._subscriptionInfo(e),confirmed:e.confirmed,lost:e.lost}))}setSubscriberLabel(e,t){this._isEmitter(e)&&(e=this._emitterCallback(e)),this._subscriberLabels.set(e,t)}async getRegistrations({className:e,instance:t,agent:r=this._agent}={}){return this._callProtocol({className:e,instance:t,agent:r},"__registrations__",[])}async endRegistration({className:e,instance:t,agent:r=this._agent,functionName:n,args:i=[],by:o=null}={}){return this._callProtocol({className:e,instance:t,agent:r},"__end__",[n,i,o])}async _callProtocol({className:e,instance:t,agent:r},n,i){if(!this._isConnected())throw new Error("Client is not connected");if(t&&(!r||"*"===r||!e)){const n=await this._getInstanceData(t,{agent:r,className:e});r=n.agent,e=n.className}if(!r||"*"===r)throw new Error("Agent must be specified");if(await this._waitUntilClassIsOnline(r,e),!(this._agents[r].v>=4))throw new Error(`Agent "${r}" does not speak protocol 4`);const o={c:t||e,f:n,a:i,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},s=`${this._domain}/${r}/${e}/${t||"__static__"}/${n}`;return this._mqttPublish(s,JSON.stringify(o)),this._handleAgentAnswer(o,r)}async _sendUnsubscribe(e,t){const r=t[0].sub.className,n={c:r,f:"__unsubscribe__",a:t.map(({sub:e,context:t})=>void 0===t?e.id:{id:e.id,context:t}),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},i=`${this._domain}/${e}/${r}/__static__/__unsubscribe__`;this._mqttPublish(i,JSON.stringify(n));try{await this._handleAgentAnswer(n,e)}catch(e){this._log.debug(`Withdrawing subscriptions failed: ${e.message}`)}}async _sendLegacyRemoval(e){if(e.callAll||!e.instance)return;let t,r;if("on"===e.functionName||"addListener"===e.functionName)t="removeListener",r=[e.event,e.id];else{const n=e.functionName.replace(/^on(?=[A-Z])/,"off"),i=this._agents[e.agent]&&this._agents[e.agent].classes[e.className],o=i?i.memberFunctions.map(this._stripSignature):[];if(n===e.functionName||!o.includes(n))return;if(!e.declaration)return;t=n,r=e.declaration.a}const n={c:e.instance,f:t,a:r,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},i=`${this._domain}/${e.agent}/${e.className}/${e.instance}/${t}`;this._mqttPublish(i,JSON.stringify(n));try{await this._handleAgentAnswer(n,e.agent)}catch(e){this._log.debug(`Removing a subscription failed: ${e.message}`)}}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){if(this._token=e,this._agent=t,this._client){const e=this._client;await new Promise(t=>d._endMqtt(e,!1,{},t))}return this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r)for(const r of["__classInfo__","__classInfoConcise__"]){const n=`${this._domain}/${e}/${t}/${r}`;this._mqttPublish(n,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:4})),this._loseAnswers(()=>!0,"the client ended"),this._eventEmitter.removeAllListeners(),this.removeAllListeners(),this._cachedSubscriptions={},this._redeclare.clear(),this._pendingWithdrawals.clear();const e=this._client;return this._client=null,new Promise(t=>d._endMqtt(e,!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_generateUserName(){return`${this._domain}:client@${i.hostname()}-${i.platform()}-js`}_createMqttClientId(){const e=i.arch()+i.homedir()+i.hostname()+JSON.stringify(i.networkInterfaces())+i.platform()+i.release()+i.totalmem()+i.type(),t=d._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${i.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_isRevivable(e){return e===this._client&&!h.has(e)}_mqttPublish(e,t,r){const n=this._client;n.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&this._isRevivable(n)&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),n.disconnecting=!1,n.reconnect()))})}async _mqttSubscribe(e,t){const r=this._client;return new Promise((n,i)=>{r.subscribe(e,{qos:this._qos,...t},(o,s)=>{const{refused:a,granted:c,error:u}=l.outcome(o,s);if(u)if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${u.message}`),"client disconnecting"===u.message&&this._isRevivable(r)){const e=`Failed to subscribe, because: ${u.message}`;this._log.error(e),this.emit("error",u),this._log.info("Forcing reconnect now..."),r.disconnecting=!1,r.reconnect(),i(new Error(e))}else i(u);else{let r;const i=Array.isArray(e)?e:[e],o=a;o.length>0&&(r=new Error(`Could not subscribe all ${i.length} topic(s) but got error qos=128 on following ${o.length} topic(s): ${o}`),r.code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r.message),this.emit("error",r),this._subscribeRetrier.schedule(o,t)),this._subscribeRetrier.granted(c.map(e=>e.topic));const s=c.filter(e=>e.qos<this._qos);s.length>0&&(r=new Error(`Could not subscribe all ${i.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`),r.code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r.message),this.emit("error",r)),0===c.length&&0===a.length&&this._log.debug(`Already subscribed to: ${e}`),n()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i}=r,o=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(o,JSON.stringify(r)),new Promise((r,o)=>{const s=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}"`,a=setTimeout(()=>{l(),o(new Error(`${s} timed out (> ${this._timeout} ms)`))},this._timeout),l=this._awaitAnswer(i,{agent:e,lose:e=>{clearTimeout(a),o(new Error(`${s} lost its answer: ${e}`))}},({e:i,r:s})=>{if(clearTimeout(a),i){const{message:r,cause:s}=d._prepareError(i);o(new Error(`[vrpc ${e}-${t}-${n}]: ${r}`,{cause:s}))}else{const n=this._createProxy(e,t,s);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let i=null;const o=()=>{this._hasClassOnline(e,t)&&(i&&clearTimeout(i),this.removeListener("class",o),this.removeListener("agent",o),r())};i=setTimeout(()=>{this.removeListener("class",o),this.removeListener("agent",o),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",o),this.on("agent",o)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,i=`${this._instance}-${this._proxyId++}`,o={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:i};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{o[s]="removeAllListeners"!==s?async(...o)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:s,args:o});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._declare(t,`${n}/${s}`),this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async i=>{if(!i)throw new Error("VRPC does not support removing all listeners");Object.values(this._cachedSubscriptions).filter(n=>n.agent===e&&n.className===t&&n.instance===r&&n.event===i).forEach(e=>this._dropSubscription(e));try{const t={c:r,f:s,a:[i],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(o.vrpcOn=async(o,...s)=>{if(!a.has(o))throw new Error("Bad magic");const l=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:"vrpcOn",args:[o,...s]});if(l)try{const t={c:r,f:o,a:l.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._declare(t,`${n}/${o}`),this._mqttPublish(`${n}/${o}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${o}" because: ${e.message}`)}},o.vrpcOff=async n=>{const i=Object.values(this._cachedSubscriptions).filter(i=>i.agent===e&&i.className===t&&i.instance===r&&i.functionName===n).map(e=>e.id);return 0!==i.length&&this.unsubscribe(i)}),o}async _handleAgentAnswer({i:e,c:t,f:r,a:n},i){return new Promise((o,s)=>{const a=`Function call "${t}::${r}()" on agent "${i}"`,l=setTimeout(()=>{f(),s(new Error(`${a} timed out (> ${this._timeout} ms)`))},this._timeout),c=e=>{clearTimeout(l),s(new Error(`${a} lost its answer: ${e}`))},u=()=>{const e=this._agents[i];e&&e.v>=4&&this._confirmSubscriptions(n)},f=this._awaitAnswer(e,{agent:i,lose:c},e=>{if(clearTimeout(l),e.e){const{message:n,cause:o}=d._prepareError(e.e);s(new Error(`[vrpc ${i}-${t}-${r}]: ${n}`,{cause:o}))}else{const n=e.r;"string"==typeof n&&"__p__"===n.substring(0,5)?this._awaitAnswer(n,{agent:i,lose:c,second:!0},e=>{if(e.e){const{message:n,cause:o}=d._prepareError(e.e);s(new Error(`[vrpc ${i}-${t}-${r}]: ${n}`,{cause:o}))}else u(),o(e.r)}):(u(),o(n))}})})}_awaitAnswer(e,{agent:t,lose:r,second:n=!1},i){const o={agent:t,lose:r,second:n},s=e=>{this._waiting.delete(o),i(e)};return o.forget=()=>{this._waiting.delete(o),this._eventEmitter.removeListener(e,s)},this._waiting.add(o),this._eventEmitter.once(e,s),o.forget}_loseAnswers(e,t){for(const r of Array.from(this._waiting))e(r)&&(r.forget(),r.lose(t))}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const i=n=>(o,{agent:s,className:a})=>{if(o.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",i),r({agent:s,className:a,instance:e})}},o=setTimeout(()=>{this.removeListener("instanceNew",i(o));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",i(o))})}_isEventFunction(e,t,r){const n=this._agents[e]&&this._agents[e].classes&&this._agents[e].classes[t],i=n&&n.meta&&n.meta[r],o=i&&i.ret&&i.ret.type;return!("string"!=typeof o||!f.test(o.trim()))||!!/^on[A-Z]/.test(r)||/^(notify|monitor|signal)/.test(r)}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:i,args:o,isCallAll:s=!1,selection:a}){const l=[],c=this._isEventFunction(e,t,i),u=/^(off|remove|unmonitor|unsignal)/.test(i),f=("off"===i||"removeListener"===i)&&"string"==typeof o[0];for(const[h,d]of o.entries()){const p=this._isEmitter(d);if(this._isFunction(d)||p){const g=!c&&(f&&1===h||u),b=p?this._emitterCallback(d,{readOnly:g}):d;if(!g&&(p||"vrpcOn"===i||("on"===i||"addListener"===i)&&1===h&&"string"==typeof o[0]||c)){const n="string"==typeof o[0]?o[0]:i,c="vrpcOn"===i,u=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:b,functionName:c?o[0]:i,args:c?o.slice(1):o,position:c?h-1:h,isCallAll:s,selection:a});l.push(u);continue}if(g){const n=b?this._offRemoteEvent({agent:e,className:t,instance:r,isCallAll:s,selection:a,functionName:i,args:o,position:h,callback:b}):[];if(n.length>0){const t=this._agents[e];if(t&&t.v>=4)return await this._withdrawAt(e,n.map(e=>({sub:e}))),null;l.push(n[0].id);continue}if("off"===i||"removeListener"===i)return null;if(p){l.push(null);continue}}const y=`__f__${n||`${e}-${t}`}-${i}-${h}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;l.push(y),this._eventEmitter.once(y,({a:n,e:o})=>{o?this.emit("undelivered",y,o,{agent:e,className:t,instance:r,functionName:i}):b.apply(null,n)});continue}l.push(d)}return l}_emitterCallback({emitter:e,event:t},{readOnly:r=!1}={}){let n=this._emitterListener.get(e);if(n&&n.has(t))return n.get(t);if(r)return null;const i=(...r)=>e.emit(t,...r);return n||(n=new Map,this._emitterListener.set(e,n)),n.set(t,i),i}_subscriptionKey(e,t,r){const n="addListener"===e?"on":e,i=t.map((e,t)=>t===r?"\0vrpc-self":this._isFunction(e)||this._isEmitter(e)?"\0vrpc-callback":e);return`${n}\0${d._canonical(i)}`}static _canonical(e){const t=e=>{if(Array.isArray(e))return e.map(t);if(e&&"object"==typeof e&&e.constructor===Object){const r={};for(const n of Object.keys(e).sort())r[n]=t(e[n]);return r}return e};return JSON.stringify(t(e))}static _twinOf(e){return"off"===e||"removeListener"===e?"on":e.replace(/^(off|un)(?=[A-Za-z])/,e=>"off"===e?"on":"")}static _identity({agent:e,className:t,instance:r,isCallAll:n,selection:i,key:o}){const s=[e,t,r||null,!!n,o];return JSON.stringify(void 0===i?s:[...s,i])}_subscriptionTopic(e,t,{readOnly:r=!1}={}){let n=this._subscriptionTopics.get(e);if(!n){if(r)return null;n=new Map,this._subscriptionTopics.set(e,n)}let i=n.get(t);return i||r||(i=`${this._vrpcConnectionId}/s${(this._subscriptionCount++).toString(36)}`,n.set(t,i)),i||null}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:i,functionName:o,args:s,position:a,isCallAll:l=!1,selection:c}){const u=d._identity({agent:e,className:t,instance:r,isCallAll:l,selection:c,key:this._subscriptionKey(o,s,a)}),f=this._subscriptionTopic(i,u),h=`__e__${f}`;if(this._cachedSubscriptions[f])return h;const p={id:h,identity:u,agent:e,className:t,instance:r,event:n,functionName:o,callAll:l,selection:c,callback:i,handler:null,declaration:null,confirmed:!1,lost:!1,withdrawn:new Set};return p.handler=({a:e,end:t,e:r})=>{t?this._handleEnded(f,t):r?this.emit("undelivered",h,r,this._subscriptionInfo(p)):p.withdrawn.size>0&&Array.isArray(e)&&p.withdrawn.has(e[0])||i.apply(null,e)},this._eventEmitter.on(h,p.handler),this._cachedSubscriptions[f]=p,h}_offRemoteEvent({agent:e,className:t,instance:r,isCallAll:n,selection:i,functionName:o,args:s,position:a,callback:l}){const c=d._twinOf(o),u=this._subscriptionTopic(l,d._identity({agent:e,className:t,instance:r,isCallAll:n,selection:i,key:this._subscriptionKey(c,s,a)}),{readOnly:!0});let f=u&&this._cachedSubscriptions[u]?[this._cachedSubscriptions[u]]:[];if(0===f.length){const o=Object.values(this._cachedSubscriptions).filter(o=>o.callback===l&&o.agent===e&&o.className===t&&o.instance===r&&o.callAll===!!n&&JSON.stringify(o.selection)===JSON.stringify(i)),s=o.filter(e=>("addListener"===e.functionName?"on":e.functionName)===c);f=s.length>0?s:o}return f.forEach(e=>this._dropSubscription(e)),f}_dropSubscription(e,{forget:t=!0}={}){this._eventEmitter.removeListener(e.id,e.handler);const r=e.id.slice(5);if(this._cachedSubscriptions[r]===e&&delete this._cachedSubscriptions[r],t){const t=this._subscriptionTopics.get(e.callback);t&&t.get(e.identity)===r&&t.delete(e.identity)}}_declare(e,t){const r={};let n=!1;for(const i of e.a){if("string"!=typeof i||!i.startsWith("__e__"))continue;const o=this._cachedSubscriptions[i.slice(5)];if(!o)continue;o.declaration={topic:t,c:e.c,f:e.f,a:e.a},o.withdrawn.clear();const s=this._subscriberLabels.get(o.callback);void 0!==s&&(r[i]=s,n=!0)}if(n){e.l=r;for(const e of Object.keys(r)){const t=this._cachedSubscriptions[e.slice(5)];t&&t.declaration&&(t.declaration.l=r)}}}_confirmSubscriptions(e){if(Array.isArray(e))for(const t of e){const e="string"==typeof t&&t.startsWith("__e__")&&this._cachedSubscriptions[t.slice(5)];e&&(e.confirmed=!0)}}_redeclareTo(e){if(!this._inboxReady||!this._redeclare.has(e))return;const t=this._agents[e];if(!t||"online"!==t.status)return;if(this._redeclare.delete(e),!(t.v>=4))return;const r=new Map;for(const t of Object.values(this._cachedSubscriptions)){if(t.agent!==e||!t.declaration)continue;const{topic:n,a:i}=t.declaration,o=`${n}\0${JSON.stringify(i)}`;r.has(o)||r.set(o,{declaration:t.declaration,subs:[]}),r.get(o).subs.push(t)}for(const{declaration:t,subs:n}of r.values()){const{topic:r,c:i,f:o,a:s,l:a}=t,l={c:i,f:o,a:s,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};a&&(l.l=a),this._mqttPublish(r,JSON.stringify(l)),this._handleAgentAnswer(l,e).then(()=>{const t=[];for(const e of n)if(this._cachedSubscriptions[e.id.slice(5)]===e){e.lost&&(e.lost=!1,this.emit("healed",e.id,this._subscriptionInfo(e)));for(const r of e.withdrawn)t.push({sub:e,context:r})}if(t.length>0)return this._sendUnsubscribe(e,t)},e=>{for(const t of n)this._cachedSubscriptions[t.id.slice(5)]===t&&(this._dropSubscription(t,{forget:!1}),this.emit("lost",t.id,e.message,this._subscriptionInfo(t)))})}}_subscriptionInfo(e){return{agent:e.agent,className:e.className,instance:e.instance,functionName:e.functionName,event:e.event,callAll:e.callAll,...void 0===e.selection?{}:{instances:e.selection}}}_handleEnded(e,t){const r=this._cachedSubscriptions[e];if(!r)return;const n={...this._subscriptionInfo(r),context:t.context,failed:!!t.failed};r.callAll||this._dropSubscription(r),this.emit("ended",r.id,t.reason,t.by,n)}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){const i=Object.values(this._cachedSubscriptions).filter(i=>void 0!==e?i.agent===e:i.instance===t&&i.agent===r&&i.className===n),o=void 0!==e?"agentOffline":"instanceGone";i.forEach(e=>{this._log.debug(`Clearing subscription for obsolete topic: ${e.id}`),this._dropSubscription(e,{forget:!1}),this.emit("lost",e.id,o,this._subscriptionInfo(e))})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._findOwnIsolated(e,t);if(r)return r;const n=this._getInstanceFromCache(e,t);if(!n){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return n}_findOwnIsolated(e,{agent:t,className:r}={}){const n=Array.from(this._ownIsolated.values()).filter(n=>!(n.instance!==e||t&&"*"!==t&&n.agent!==t||r&&n.className!==r));return 1===n.length?{agent:n[0].agent,className:n[0].className}:null}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:i}=r[n];if(i&&i.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:i}=this._agents[r];if(n&&"offline"!==i)for(const i in n){if(t.className&&i!==t.className)continue;const{instances:o}=n[i];if(o&&o.includes(e))return{agent:r,className:i,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=d},8601:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=r(4469);e.exports=M,M.WritableState=N;const{EventEmitter:d}=r(7007),p=r(4474).Stream,{Buffer:g}=r(8287),b=r(1787),{addAbortSignal:y}=r(982),{getHighWaterMark:_,getDefaultHighWaterMark:m}=r(2100),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(2074).codes,{errorOrDestroy:T}=b;function x(){}c(M.prototype,p.prototype),c(M,p);const P=f("kOnFinished");function N(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?_(this,e,"writableHighWaterMark",n):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=F.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,j(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function j(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function M(e){const t=this instanceof r(7323);if(!t&&!s(M,this))return new M(e);this._writableState=new N(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),b.construct(this,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function C(e,t,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!g.isEncoding(r))throw new R(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=x)}if(null===t)throw new I;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,r),r="buffer");else if(t instanceof g)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return o.ending?s=new O:o.destroyed&&(s=new A("write")),s?(n.nextTick(i,s),T(e,s,!0),s):(o.pendingcb++,function(e,t,r,n,i){const o=t.objectMode?1:r.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==x&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,r,i))}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),U(t),T(e,r)}function F(e,t){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(D,e,r,t,o):D(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&W(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick($,r.afterWriteTickInfo)):B(e,r,1,o))):T(e,new S)}function $({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}j(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?x:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),j(t)}else{do{const{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?j(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t,r){q(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)T(e,null!=i?i:S());else if(r=!0,t.pendingcb--,i){const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}N.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(M,h,{__proto__:null,value:function(e){return!!s(this,e)||this===M&&e&&e._writableState instanceof N}}),M.prototype.pipe=function(){T(this,new E)},M.prototype.write=function(e,t,r){return!0===C(this,e,t,r)},M.prototype.cork=function(){this._writableState.corked++},M.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},M.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},M.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},M.prototype._writev=null,M.prototype.end=function(e,t,r){const i=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=C(this,e,t);r instanceof o&&(s=r)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new k("end"):i.destroyed&&(s=new A("end")):(i.ending=!0,V(this,i,!0),i.ended=!0)),"function"==typeof r&&(s||i.finished?n.nextTick(r,s):i[P].push(r)),this},l(M.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const H=b.destroy;let G;function K(){return void 0===G&&(G={}),G}M.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[P].length)&&n.nextTick(U,r),H.call(this,e,t),this},M.prototype._undestroy=b.undestroy,M.prototype._destroy=function(e,t){t(e)},M.prototype[d.captureRejectionSymbol]=function(e){this.destroy(e)},M.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},M.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8636:(e,t,r)=>{"use strict";var n=r(920),i=r(7720),o=r(4765),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,h=o.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},g=function e(t,r,o,s,a,c,f,h,g,b,y,_,m,w,v,S,E,A){for(var k,I=t,O=A,R=0,T=!1;void 0!==(O=O.get(p))&&!T;){var x=O.get(t);if(R+=1,void 0!==x){if(x===R)throw new RangeError("Cyclic object value");T=!0}void 0===O.get(p)&&(R=0)}if("function"==typeof b?I=b(r,I):I instanceof Date?I=m(I):"comma"===o&&l(I)&&(I=i.maybeMap(I,function(e){return e instanceof Date?m(e):e})),null===I){if(c)return g&&!S?g(r,d.encoder,E,"key",w):r;I=""}if("string"==typeof(k=I)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||i.isBuffer(I))return g?[v(S?r:g(r,d.encoder,E,"key",w))+"="+v(g(I,d.encoder,E,"value",w))]:[v(r)+"="+v(String(I))];var P,N=[];if(void 0===I)return N;if("comma"===o&&l(I))S&&g&&(I=i.maybeMap(I,g)),P=[{value:I.length>0?I.join(",")||null:void 0}];else if(l(b))P=b;else{var j=Object.keys(I);P=y?j.sort(y):j}var M=h?String(r).replace(/\./g,"%2E"):String(r),C=s&&l(I)&&1===I.length?M+"[]":M;if(a&&l(I)&&0===I.length)return C+"[]";for(var L=0;L<P.length;++L){var D=P[L],F="object"==typeof D&&D&&void 0!==D.value?D.value:I[D];if(!f||null!==F){var $=_&&h?String(D).replace(/\./g,"%2E"):String(D),B=l(I)?"function"==typeof o?o(C,$):C:C+(_?"."+$:"["+$+"]");A.set(t,R);var U=n();U.set(p,A),u(N,e(F,B,o,s,a,c,f,h,"comma"===o&&S&&l(I)?null:g,b,y,_,m,w,v,S,E,U))}}return N};e.exports=function(e,t){var r,i=e,c=function(e){if(!e)return d;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==e.format){if(!s.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,i=o.formatters[r],c=d.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":d.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||d.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:d.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:c,format:r,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof c.filter?i=(0,c.filter)("",i):l(c.filter)&&(r=c.filter);var f=[];if("object"!=typeof i||null===i)return"";var h=a[c.arrayFormat],p="comma"===h&&c.commaRoundTrip;r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var b=n(),y=0;y<r.length;++y){var _=r[y],m=i[_];c.skipNulls&&null===m||u(f,g(m,_,h,p,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,b))}var w=f.join(c.delimiter),v=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8665:(e,t,r)=>{const n=r(5350),i=r(7007),{nanoid:o}=r(3561),s=r(5341),a=r(2732);"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol.for("nodejs.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol.for("nodejs.asyncDispose"));const l="__global__",c="vrpc";class u{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let i=u._extractStaticFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),i.push("__createIsolated__"),i.push("__createShared__"),i.push("__callAll__"),i.push("__callMatching__"),i.push("__delete__");let o=u._extractMemberFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),u._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:i,memberFunctions:o,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[c]||(window[c]={}),window[c][t]=e;const r=u._functionRegistry.get(l),n=r?[...r.staticFunctions,t]:[t];u._functionRegistry.set(l,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let i=u._extractMemberFunctions(e);n&&(i=i.filter(e=>!e.startsWith("_"))),u._functionRegistry.has(t)||u._functionRegistry.set(t,{memberFunctions:i,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),u._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=o(8),args:r=[],isIsolated:n=!1}={}){const i={c:e,a:[t,...r]},s=n?u._handleCreateIsolated(i):u._handleCreateShared(i);if(i.e)throw new Error(i.e);return s}static delete(e){if("string"==typeof e)return u._delete(e);if("object"==typeof e){for(const[t,r]of u._instances)if(r.instance===e)return u._delete(t);return!1}}static getInstance(e){const t=u._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return u._getClassesArray()}static getAvailableInstances(e){return u._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return u._call(t),JSON.stringify(t)}static onCallback(e){u._callback=e}static on(e,t){u._emitter.on(e,t)}static once(e,t){u._emitter.once(e,t)}static off(e,t){u._emitter.off(e,t)}static removeAllListeners(e){u._emitter.removeAllListeners(e)}static _call(e){u._mustTrackClient=!1,delete e.r,delete e.e;try{if(void 0===e.a&&(e.a=[]),!Array.isArray(e.a))throw new Error("The arguments of a request must be an array");u._dispatch(e)}catch(t){e.e=u._error(t)}return u._mustTrackClient}static _dispatch(e){switch(e.f){case"__createIsolated__":u._handleCreateIsolated(e);break;case"__createShared__":u._handleCreateShared(e);break;case"__callAll__":u._handleCallAll(e);break;case"__callMatching__":u._handleCallMatching(e);break;case"__delete__":u._handleDelete(e);break;case"__unsubscribe__":u._handleUnsubscribe(e);break;case"__registrations__":u._handleRegistrations(e);break;case"__end__":u._handleEnd(e);break;default:u._handleCall(e)}}static _error(e){if(e&&"object"==typeof e&&"message"in e){const t={message:String(e.message)};return void 0!==e.cause&&(t.cause=e.cause),t}return{message:String(e)}}static _isPublished(e,t,r){const n=u._functionRegistry.get(e);return!!n&&(r?n.staticFunctions:n.memberFunctions).includes(t)}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==u.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _assertInstanceName(e){if("string"!=typeof e||0===e.length||/[/+#*]/.test(e)||"__static__"===e)throw new Error(`Invalid instance name: ${JSON.stringify(e)}`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...i]=e.a;u._assertInstanceName(n);const o=u._instances.get(n);if(o){if(!o.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return u._assertOwner(o,e,n),e.r=n,o.instance}t=u._create(r,n,...i),u._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),u._emitter.emit("create",{args:i,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=u._error(t)}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...i]=e.a;u._assertInstanceName(n);const o=u._instances.get(n);if(o&&o.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);t=u._create(r,n,...i),u._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,u._emitter.emit("create",{args:i,className:r,isIsolated:!1,instance:n})}catch(t){e.e=u._error(t)}return t}static _handleCallAll(e){const[t,...r]=e.a;u._callAll(e,t,r,()=>!0)}static _handleCallMatching(e){const[t,r,...n]=e.a;a.isSelection(t)?u._callAll(e,r,n,e=>a.selects(t,e)):e.e={message:`Invalid selection: ${JSON.stringify(t)} (a pattern or a list of them)`}}static _callAll(e,t,r,n){try{const i=[],o=s.carriesEventIds(r);if(!(o&&s.isRemover(t,e.v)||u._isPublished(e.c,t,!1)))throw new Error(`Could not find function: ${t}`);const a={...e,a:[t,...r]};for(const[s,{className:l,instance:c,isIsolated:f}]of u._instances)if(l===e.c&&!f&&n(s))try{let n;if(o)n=u._subscribe(e,{contextKey:s,contextName:s,target:c,func:t,args:r,isCallAll:!0}).value;else{const e=u._unwrapArguments(a,s);n=c[t].apply(c,e.slice(1)),n=u.sanitizeEventListenerReturnValues(n)}i.push(u._isPromise(n)?n.then(e=>({id:s,val:e}),e=>({id:s,err:u._error(e)})):{id:s,val:n})}catch(e){i.push({id:s,err:u._error(e)})}u._handlePromise(e,Promise.allSettled(i).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=u._error(t)}}static sanitizeEventListenerReturnValues(e){return s.sanitize(e)}static _contextKey(e,t){return t?`\0${e}`:e}static _isStaticContext(e){return u._functionRegistry.has(e)}static _subscribe(e,{contextKey:t,contextName:r,target:n,func:i,args:o,isCallAll:s=!1}){const a=u._registrations.call({json:e,contextKey:t,contextName:r,target:n,func:i,args:o,isCallAll:s,speaks:u._speaksFor(r),makeCallback:t=>u._generateCallback({clientId:e.s,isCallAll:s,instanceId:r,eventId:t,receiverVersion:e.v})});return a.ids.length>0&&(u._mustTrackClient=!0),a}static _handleUnsubscribe(e){u._registrations.unsubscribe(e.a||[],e.s),e.r=!0}static _handleRegistrations(e){try{const t=u._isStaticContext(e.c);t||u._assertOwner(u._instances.get(e.c),e,e.c),e.r=u._registrations.list(u._contextKey(e.c,t))}catch(t){e.e=u._error(t)}}static _handleEnd(e){try{const t=u._isStaticContext(e.c);t||u._assertOwner(u._instances.get(e.c),e,e.c);const[r,n=[],i=null]=e.a||[];e.r=u._registrations.end(u._contextKey(e.c,t),r,n,i)}catch(t){e.e=u._error(t)}}static _handleDelete(e){try{const t=e.a[0],r=u._instances.get(t);if(r&&r.className!==e.c&&e.s!==u.LOCAL_SENDER)throw new Error(`Instance '${t}' is not of class '${e.c}'`);u._assertOwner(r,e,t),u._emitter.emit("beforeDelete",{instance:t,className:e.c});const{ended:n,disposed:i}=u._end(t);u._emitter.emit("delete",{instance:t,className:e.c}),i&&e.s!==u.LOCAL_SENDER?u._handlePromise(e,i.then(()=>n)):e.r=n}catch(t){e.e=u._error(t)}}static _handleCall(e){try{u._assertOwner(u._instances.get(e.c),e,e.c)}catch(t){return void(e.e=u._error(t))}if("removeAllListeners"===e.f){const t=u._isStaticContext(e.c);return u._registrations.withdrawEvent(u._contextKey(e.c,t),e.a[0],e.s),void(e.r=!0)}if(!u._functionRegistry.has(e.c)&&!u._instances.has(e.c))throw new Error(`Could not find context: ${e.c}`);if(e.c===l){if(!u._isPublished(l,e.f,!0))throw new Error(`Could not find function: ${e.f}`);try{const t=u._unwrapArguments(e),r=window[c][e.f].apply(null,t);u._isPromise(r)?u._handlePromise(e,r):e.r=r}catch(t){e.e=u._error(t)}return}const t=u._functionRegistry.get(e.c),r=void 0!==t;let n,i=e.c;if(r)n=t.Klass;else{const t=u._instances.get(e.c);if(void 0===t)throw new Error(`Could not find context: ${e.c}`);n=t.instance,i=t.className}const o=s.carriesEventIds(e.a);if(!(o&&s.isRemover(e.f,e.v)||u._isPublished(i,e.f,r)))throw new Error(`Could not find function: ${e.f}`);if(o){try{const{value:t}=u._subscribe(e,{contextKey:u._contextKey(e.c,r),contextName:e.c,target:n,func:e.f,args:e.a});u._isPromise(t)?u._handlePromise(e,t):e.r=t}catch(t){e.e=u._error(t)}return}const a=u._unwrapArguments(e);if("off"!==e.f&&"removeListener"!==e.f||"function"==typeof a[1]){if(!u._isFunction(n[e.f]))throw new Error(`Could not find function: ${e.f}`);try{let t=r?n[e.f].apply(null,a):n[e.f].apply(n,a);r||(t=u.sanitizeEventListenerReturnValues(t)),u._isPromise(t)?u._handlePromise(e,t):e.r=t}catch(t){e.e=u._error(t)}}else e.r=!0}static _create(e,t,...r){const n=u._instances.get(t);if(n)return n.instance;const{Klass:i,withNew:o,schema:s}=u._getClassEntry(e);return null!==s&&u._validate(s,...r),o?new i(...r):i(...r)}static _delete(e){return u._end(e).ended}static _end(e){const t=u._instances.get(e);if(!t)return{ended:!1,disposed:null};u._instances.delete(e);const{instance:r}=t;return u._registrations.forgetContext(e,{release:!(u._isFunction(r[Symbol.asyncDispose])||u._isFunction(r[Symbol.dispose]))}),{ended:!0,disposed:u._dispose(e,t)}}static _dispose(e,{instance:t,className:r}){const n=t=>u._emitter.emit("disposeFailed",{instance:e,className:r,error:t});let i,o;try{u._isFunction(t[Symbol.asyncDispose])?i=t[Symbol.asyncDispose]():u._isFunction(t[Symbol.dispose])&&(i=t[Symbol.dispose]())}catch(e){return n(e),null}if(!u._isPromise(i))return null;const s=new Promise(e=>{o=setTimeout(()=>{n(new Error(`dispose did not settle within ${u.DISPOSE_TIMEOUT} ms`)),e()},u.DISPOSE_TIMEOUT)}),a=i.then(()=>{},e=>n(e));return Promise.race([a,s]).then(()=>clearTimeout(o))}static _unregisterClient(e){u._registrations.withdrawClient(e)}static _validate(e,t){if("function"==typeof n){if(u._ajv||(u._ajv=new n({useDefaults:!0})),!u._ajv.validate(e,t))throw new Error(u._ajv.errorsText())}else u._warnedNoSchemas||(u._warnedNoSchemas=!0,console.warn("vrpc: schema validation is not available in the browser build, constructor arguments are not checked"))}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,i=n?t:e.c,o=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const t of o)"string"==typeof t&&t.startsWith("__f__")?a.push(u._generateCallback({clientId:r,isCallAll:n,instanceId:i,eventId:t,receiverVersion:e.v})):a.push(t);return a}static _speaksFor(e){const t=u._instances.get(e);if(!t)return()=>!0;const{instance:r}=t;return()=>{const t=u._instances.get(e);return void 0!==t&&t.instance===r}}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n,receiverVersion:i}){const o=u._speaksFor(r);return(...s)=>{if(!o())return;const a=n?[r,...s]:[...s];u._callback({a,s:t,i:e,receiverVersion:i})}}static _handlePromise(e,t){const r=u._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${u._promiseNonce}-${r}`,{s:i}=e;e.r=n,t.then(e=>u._callback({s:i,i:n,r:e}),e=>u._callback({s:i,i:n,e:u._error(e)}))}static _getClassEntry(e){const t=u._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];const n=e instanceof i||!!e.prototype&&e.prototype instanceof i,o=(e,t)=>t===i.prototype?e.filter(e=>u._emitterPublic.has(e)):n?e.filter(e=>"emit"!==e):e;do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!u._blackList.has(e)&&u._isFunction(t.prototype[e]));r=[...r,...o(e,t.prototype)]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!u._blackList.has(e)&&u._isFunction(t[e]));r=[...r,...o(e,t)]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{t!==i&&(r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})]),t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(u._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return u._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=u._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=u._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=u._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}u._functionRegistry=new Map,u._instances=new Map,u._emitter=new i,u._correlationId=0,u._promiseNonce=o(8),u._registrations=new s({publish:e=>u._callback(e),emit:(e,t)=>u._emitter.emit(e,t)}),u.DISPOSE_TIMEOUT=1e4,u._emitterPublic=new Set(["on","addListener","off","removeListener","once","removeAllListeners"]),u._blackList=new Set(["constructor","caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),u.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=u},8745:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(2768),{EventEmitter:o}=r(7007);function s(e){o.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},8835:(e,t,r)=>{"use strict";var n=r(9655);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(5373);function _(e,t,r){if(e&&"object"==typeof e&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var _=e=l.join(s);if(_=_.trim(),!r&&1===e.split("#").length){var m=a.exec(_);if(m)return this.path=_,this.href=_,this.pathname=m[1],m[2]?(this.search=m[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(_);if(w){var v=(w=w[0]).toLowerCase();this.protocol=v,_=_.substr(w.length)}if(r||w||_.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===_.substr(0,2);!S||w&&g[w]||(_=_.substr(2),this.slashes=!0)}if(!g[w]&&(S||w&&!b[w])){for(var E,A,k=-1,I=0;I<f.length;I++)-1!==(O=_.indexOf(f[I]))&&(-1===k||O<k)&&(k=O);for(-1!==(A=-1===k?_.lastIndexOf("@"):_.lastIndexOf("@",k))&&(E=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(E)),k=-1,I=0;I<u.length;I++){var O;-1!==(O=_.indexOf(u[I]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=_.length),this.host=_.slice(0,k),_=_.slice(k),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var T=this.hostname.split(/\./),x=(I=0,T.length);I<x;I++){var P=T[I];if(P&&!P.match(h)){for(var N="",j=0,M=P.length;j<M;j++)P.charCodeAt(j)>127?N+="x":N+=P[j];if(!N.match(h)){var C=T.slice(0,I),L=T.slice(I+1),D=P.match(d);D&&(C.push(D[1]),L.unshift(D[2])),L.length&&(_="/"+L.join(".")+_),this.hostname=C.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+F,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!p[v])for(I=0,x=c.length;I<x;I++){var B=c[I];if(-1!==_.indexOf(B)){var U=encodeURIComponent(B);U===B&&(U=escape(B)),_=_.split(B).join(U)}}var W=_.indexOf("#");-1!==W&&(this.hash=_.substr(W),_=_.slice(0,W));var q=_.indexOf("?");if(-1!==q?(this.search=_.substr(q),this.query=_.substr(q+1),t&&(this.query=y.parse(this.query)),_=_.slice(0,q)):t&&(this.search="",this.query={}),_&&(this.pathname=_),b[v]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var V=this.search||"";this.path=F+V}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var h=u[f];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",y=r.search||"";r.path=p+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=m||_||r.host&&e.pathname,v=w,S=r.pathname&&r.pathname.split("/")||[],E=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===S[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=d;else if(d.length)S||(S=[]),S.pop(),S=S.concat(d),r.search=e.search,r.query=e.query;else if(null!=e.search)return E&&(r.host=S.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,I=0,O=S.length;O>=0;O--)"."===(A=S[O])?S.splice(O,1):".."===A?(S.splice(O,1),I++):I&&(S.splice(O,1),I--);if(!w&&!v)for(;I--;I)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var R,T=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(r.hostname=T?"":S.length?S.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),(w=w||r.host&&S.length)&&!T&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=_(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i},8859:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,m=String.prototype.replace,w=String.prototype.toUpperCase,v=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,k=Array.prototype.slice,I=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,x="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,j=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function M(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-I(-e):I(e);if(n!==e){var i=String(n),o=_.call(t,i.length+1);return m.call(i,r,"$&_")+"."+m.call(m.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(t,r,"$&_")}var C=r(2634),L=C.custom,D=z(L)?L:null,F={__proto__:null,double:'"',single:"'"},$={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,i=F[n];return i+e+i}function U(e){return m.call(String(e),/"/g,"&quot;")}function W(e){return!P||!("object"==typeof e&&(P in e||void 0!==e[P]))}function q(e){return"[object Array]"===K(e)&&W(e)}function V(e){return"[object RegExp]"===K(e)&&W(e)}function z(e){if(x)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,a){var l=n||{};if(G(l,"quoteStyle")&&!G(F,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!G(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?M(t,S):S}if("bigint"==typeof t){var I=String(t)+"n";return w?M(t,I):I}var R=void 0===l.depth?5:l.depth;if(void 0===i&&(i=0),i>=R&&R>0&&"object"==typeof t)return q(t)?"[Array]":"[Object]";var L,$=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(l,i);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(a=k.call(a)).push(r),n){var o={depth:l.depth};return G(l,"quoteStyle")&&(o.quoteStyle=l.quoteStyle),e(t,o,i+1,a)}return e(t,l,i+1,a)}if("function"==typeof t&&!V(t)){var Y=function(e){if(e.name)return e.name;var t=y.call(b.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ne=re(t,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ne.length>0?" { "+A.call(ne,", ")+" }":"")}if(z(t)){var ie=x?m.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||x?ie:X(ie)}if((L=t)&&"object"==typeof L&&("undefined"!=typeof HTMLElement&&L instanceof HTMLElement||"string"==typeof L.nodeName&&"function"==typeof L.getAttribute)){for(var oe="<"+v.call(String(t.nodeName)),se=t.attributes||[],ae=0;ae<se.length;ae++)oe+=" "+se[ae].name+"="+B(U(se[ae].value),"double",l);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+"</"+v.call(String(t.nodeName))+">"}if(q(t)){if(0===t.length)return"[]";var le=re(t,H);return $&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,$)+"]":"[ "+A.call(le,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&W(e)}(t)){var ce=re(t,H);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===ce.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(ce,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+H(t.cause),ce),", ")+" }"}if("object"==typeof t&&g){if(D&&"function"==typeof t[D]&&C)return C(t,{depth:R-i});if("symbol"!==g&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return s&&s.call(t,function(e,r){ue.push(H(r,t,!0)+" => "+H(e,t))}),ee("Map",o.call(t),ue,$)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var fe=[];return u&&u.call(t,function(e){fe.push(H(e,t))}),ee("Set",c.call(t),fe,$)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===K(e)&&W(e)}(t))return X(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return X(H(O.call(t)));if(function(e){return"[object Boolean]"===K(e)&&W(e)}(t))return X(p.call(t));if(function(e){return"[object String]"===K(e)&&W(e)}(t))return X(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&W(e)}(t)&&!V(t)){var he=re(t,H),de=j?j(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",ge=!de&&P&&Object(t)===t&&P in t?_.call(K(t),8,-1):pe?"Object":"",be=(de||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ge||pe?"["+A.call(E.call([],ge||[],pe||[]),": ")+"] ":"");return 0===he.length?be+"{}":$?be+"{"+te(he,$)+"}":be+"{ "+A.call(he,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return H.call(e,t)}function K(e){return g.call(e)}function Q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(_.call(e,0,t.maxStringLength),t)+n}var i=$[t.quoteStyle||"single"];return i.lastIndex=0,B(m.call(m.call(e,i,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):A.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=q(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=G(e,i)?t(e[i],e):""}var o,s="function"==typeof R?R(e):[];if(x){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)G(e,l)&&(r&&String(Number(l))===l&&l<e.length||x&&o["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof R)for(var c=0;c<s.length;c++)N.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)h.push(String(g));if(n&&e.length>0)for(var b=0;b<e.length;++b)h.push(String(b));else for(var y in e)p&&"prototype"===y||!i.call(e,y)||h.push(String(y));if(l)for(var _=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),m=0;m<u.length;++m)_&&"constructor"===u[m]||!i.call(e,u[m])||h.push(u[m]);return h}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9032:(e,t,r)=>{"use strict";var n=r(7244),i=r(8184),o=r(5767),s=r(5680);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function _(e){return"[object Set]"===u(e)}function m(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===u(e)}function A(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},_.working="undefined"!=typeof Set&&_(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(_.working?_(e):e instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(m.working?m(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),t.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==k&&(void 0===I.working&&(I.working=I(new k)),I.working?I(e):e instanceof k)}function R(e){return b(e,f)}function T(e){return b(e,h)}function x(e){return b(e,d)}function P(e){return l&&b(e,p)}function N(e){return c&&b(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=R,t.isStringObject=T,t.isBooleanObject=x,t.isBigIntObject=P,t.isSymbolObject=N,t.isBoxedPrimitive=function(e){return R(e)||T(e)||x(e)||P(e)||N(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9037:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=r(4469),{promisify:{custom:a}}=r(7797),{streamReturningOperators:l,promiseReturningOperators:c}=r(7712),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(2074),f=r(6357),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=r(2100),{pipeline:p}=r(4867),{destroyer:g}=r(1787),b=r(577),y=r(3942),_=r(5980),m=e.exports=r(4474).Stream;m.isDestroyed=_.isDestroyed,m.isDisturbed=_.isDisturbed,m.isErrored=_.isErrored,m.isReadable=_.isReadable,m.isWritable=_.isWritable,m.Readable=r(2729);for(const v of o(l)){const S=l[v];function E(...e){if(new.target)throw u();return m.Readable.from(s(S,this,e))}i(E,"name",{__proto__:null,value:S.name}),i(E,"length",{__proto__:null,value:S.length}),i(m.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}i(I,"name",{__proto__:null,value:k.name}),i(I,"length",{__proto__:null,value:k.length}),i(m.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}m.Writable=r(8601),m.Duplex=r(7323),m.Transform=r(6269),m.PassThrough=r(519),m.pipeline=p;const{addAbortSignal:w}=r(982);m.addAbortSignal=w,m.finished=b,m.destroy=g,m.compose=f,m.setDefaultHighWaterMark=h,m.getDefaultHighWaterMark=d,i(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),i(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),i(b,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},9075:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=r(2768),{Buffer:a}=r(8287),{inspect:l}=r(9862);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,i=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(o(t,a,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}o(t,a,r-e),e-=a.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},9083:(e,t,r)=>{"use strict";e.exports=u;var n=r(2463).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(8101);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,r){h(e,t,r)})}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9096:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o=new Set,s="object"==typeof n&&n?n:{},a=(e,t,r,n)=>{"function"==typeof s.emitWarning?s.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let l=globalThis.AbortController,c=globalThis.AbortSignal;if(void 0===l){c=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new c;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==s.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,a("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),f=e=>u(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?h:null:null;class h extends Array{constructor(e){super(e),this.fill(0)}}class d{heap;length;static#e=!1;static create(e){const t=f(e);if(!t)return[];d.#e=!0;const r=new d(e,t);return d.#e=!1,r}constructor(e,t){if(!d.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class p{#t;#r;#n;#i;#o;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#f;#h;#d;#p;#g;#b;#y;#_;#m;#w;#v;#S;#E;static unsafeExposeInternals(e){return{starts:e.#m,ttls:e.#w,sizes:e.#_,keyMap:e.#c,keyList:e.#u,valList:e.#f,next:e.#h,prev:e.#d,get head(){return e.#p},get tail(){return e.#g},free:e.#b,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,r,n,i)=>e.#k(t,r,n,i),moveToTail:t=>e.#I(t),indexes:t=>e.#O(t),rindexes:t=>e.#R(t),isStale:t=>e.#T(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#s}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:c,dispose:h,disposeAfter:g,noDisposeOnSet:b,noUpdateTTL:y,maxSize:_=0,maxEntrySize:m=0,sizeCalculation:w,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:O}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const R=t?f(t):Array;if(!R)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=_,this.maxEntrySize=m||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#s=S,void 0!==v&&"function"!=typeof v)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=v,this.#S=!!v,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#h=new R(t),this.#d=new R(t),this.#p=0,this.#g=0,this.#b=d.create(t),this.#a=0,this.#l=0,"function"==typeof h&&(this.#n=h),"function"==typeof g?(this.#i=g,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#v=!!this.#n,this.#E=!!this.#i,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#r&&!u(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#x()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=u(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!o.has(e))(e)&&(o.add(e),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,p))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){const e=new h(this.#t),t=new h(this.#t);this.#w=e,this.#m=t,this.#N=(r,n,o=i.now())=>{if(t[r]=0!==n?o:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout(()=>{this.#T(r)&&this.#j(this.#u[r],"expire")},n+1);e.unref&&e.unref()}},this.#M=r=>{t[r]=0!==e[r]?i.now():0},this.#C=(i,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const l=i.now-a;i.remainingTTL=s-l}};let r=0;const n=()=>{const e=i.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{const o=this.#c.get(i);if(void 0===o)return 0;const s=e[o],a=t[o];return s&&a?s-((r||n())-a):1/0},this.#T=i=>{const o=t[i],s=e[i];return!!s&&!!o&&(r||n())-o>s}}#M=()=>{};#C=()=>{};#N=()=>{};#T=()=>!1;#x(){const e=new h(this.#t);this.#l=0,this.#_=e,this.#L=t=>{this.#l-=e[t],e[t]=0},this.#D=(e,t,r,n)=>{if(this.#A(t))return 0;if(!u(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!u(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#F=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#l>r;)this.#$(!0)}this.#l+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#L=e=>{};#F=(e,t,r)=>{};#D=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#g;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#p);)t=this.#d[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#g);)t=this.#h[t]}#B(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#O())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*rentries(){for(const e of this.#R())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*keys(){for(const e of this.#O()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#R()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*values(){for(const e of this.#O())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}*rvalues(){for(const e of this.#R())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#O()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(const r of this.#O()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}rforEach(e,t=this){for(const r of this.#R()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(const t of this.#R({allowStale:!0}))this.#T(t)&&(this.#j(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const r=this.#f[t],n=this.#A(r)?r.__staleWhileFetching:r;if(void 0===n)return;const o={value:n};if(this.#w&&this.#m){const e=this.#w[t],r=this.#m[t];if(e&&r){const t=e-(i.now()-r);o.ttl=t,o.start=Date.now()}}return this.#_&&(o.size=this.#_[t]),o}dump(){const e=[];for(const t of this.#O({allowStale:!0})){const r=this.#u[t],n=this.#f[t],o=this.#A(n)?n.__staleWhileFetching:n;if(void 0===o||void 0===r)continue;const s={value:o};if(this.#w&&this.#m){s.ttl=this.#w[t];const e=i.now()-this.#m[t];s.start=Math.floor(Date.now()-e)}this.#_&&(s.size=this.#_[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=i.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#D(e,t,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#j(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#g:0!==this.#b.length?this.#b.pop():this.#a===this.#t?this.#$(!1):this.#a,this.#u[u]=e,this.#f[u]=t,this.#c.set(e,u),this.#h[this.#g]=u,this.#d[u]=this.#g,this.#g=u,this.#a++,this.#F(u,c,a),a&&(a.set="add"),l=!1;else{this.#I(u);const r=this.#f[u];if(t!==r){if(this.#S&&this.#A(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||o||(this.#v&&this.#n?.(t,e,"set"),this.#E&&this.#y?.push([t,e,"set"]))}else o||(this.#v&&this.#n?.(r,e,"set"),this.#E&&this.#y?.push([r,e,"set"]));if(this.#L(u),this.#F(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#A(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#w||this.#P(),this.#w&&(l||this.#N(u,n,i),a&&this.#C(a,u)),!o&&this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#f[this.#p];if(this.#$(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#$(e){const t=this.#p,r=this.#u[t],n=this.#f[t];return this.#S&&this.#A(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(n,r,"evict"),this.#E&&this.#y?.push([n,r,"evict"])),this.#L(t),e&&(this.#u[t]=void 0,this.#f[t]=void 0,this.#b.push(t)),1===this.#a?(this.#p=this.#g=0,this.#b.length=0):this.#p=this.#h[t],this.#c.delete(r),this.#a--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#c.get(e);if(void 0!==i){const e=this.#f[i];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(i))return r&&this.#M(i),n&&(n.has="hit",this.#C(n,i)),!0;n&&(n.has="stale",this.#C(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#c.get(e);if(void 0===n||!r&&this.#T(n))return;const i=this.#f[n];return this.#A(i)?i.__staleWhileFetching:i}#k(e,t,r,n){const i=void 0===t?void 0:this.#f[t];if(this.#A(i))return i;const o=new l,{signal:s}=r;s?.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!i)return u(o.signal.reason);const c=f;return this.#f[t]===f&&(void 0===n?c.__staleWhileFetching?this.#f[t]=c.__staleWhileFetching:this.#j(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=f;if(this.#f[t]===f&&(l&&void 0!==c.__staleWhileFetching?s||(this.#f[t]=c.__staleWhileFetching):this.#j(e,"fetch")),a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};r.status&&(r.status.fetchDispatched=!0);const f=new Promise((t,n)=>{const s=this.#o?.(e,i,a);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),n),o.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})}).then(c,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),h=Object.assign(f,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#c.get(e)):this.#f[t]=h,h}#A(e){if(!this.#S)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:b,signal:y}=t;if(!this.#S)return b&&(b.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:b});const _={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:h,status:b,signal:y};let m=this.#c.get(e);if(void 0===m){b&&(b.fetch="miss");const t=this.#k(e,m,_,p);return t.__returned=t}{const t=this.#f[m];if(this.#A(t)){const e=r&&void 0!==t.__staleWhileFetching;return b&&(b.fetch="inflight",e&&(b.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const i=this.#T(m);if(!g&&!i)return b&&(b.fetch="hit"),this.#I(m),n&&this.#M(m),b&&this.#C(b,m),t;const o=this.#k(e,m,_,p),s=void 0!==o.__staleWhileFetching&&r;return b&&(b.fetch=i?"stale":"refresh",s&&i&&(b.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#s;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=t,s=this.get(e,o);if(!i&&void 0!==s)return s;const a=r(e,s,{options:o,context:n});return this.set(e,a,o),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#f[s],a=this.#A(t);return o&&this.#C(o,s),this.#T(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#j(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#M(s),t))}o&&(o.get="miss")}#U(e,t){this.#d[t]=e,this.#h[e]=t}#I(e){e!==this.#g&&(e===this.#p?this.#p=this.#h[e]:this.#U(this.#d[e],this.#h[e]),this.#U(this.#g,e),this.#g=e)}delete(e){return this.#j(e,"delete")}#j(e,t){let r=!1;if(0!==this.#a){const n=this.#c.get(e);if(void 0!==n)if(r=!0,1===this.#a)this.#W(t);else{this.#L(n);const r=this.#f[n];if(this.#A(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(r,e,t),this.#E&&this.#y?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#f[n]=void 0,n===this.#g)this.#g=this.#d[n];else if(n===this.#p)this.#p=this.#h[n];else{const e=this.#d[n];this.#h[e]=this.#h[n];const t=this.#h[n];this.#d[t]=this.#d[n]}this.#a--,this.#b.push(n)}}if(this.#E&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#W("delete")}#W(e){for(const t of this.#R({allowStale:!0})){const r=this.#f[t];if(this.#A(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#v&&this.#n?.(r,n,e),this.#E&&this.#y?.push([r,n,e])}}if(this.#c.clear(),this.#f.fill(void 0),this.#u.fill(void 0),this.#w&&this.#m&&(this.#w.fill(0),this.#m.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#g=0,this.#b.length=0,this.#l=0,this.#a=0,this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}}}t.LRUCache=p},9122:()=>{},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),o="";for(var s in i)o+=s;return e!==o}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9157:(e,t,r)=>{"use strict";const{format:n,inspect:i}=r(1077),{AggregateError:o}=r(2768),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return f(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?o.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),d("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),d("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=h(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=h(n)),n+="n"}else n=i(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},9209:(e,t,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9214:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:p,Symbol:g}=r(2768);e.exports=G,G.ReadableState=H;const{EventEmitter:b}=r(7007),{Stream:y,prependListener:_}=r(8745),{Buffer:m}=r(8287),{addAbortSignal:w}=r(5121),v=r(6364);let S=r(9862).debuglog("stream",e=>{S=e});const E=r(9075),A=r(7302),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(3513),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:x,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:j}=r(9157),{validateObject:M}=r(4947),C=g("kPaused"),{StringDecoder:L}=r(7419),D=r(2070);u(G.prototype,y.prototype),u(G,y);const F=()=>{},{errorOrDestroy:$}=A,B=1,U=16,W=32,q=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[C]=null,e&&!1===e.emitClose&&(this.state&=~q),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(2648);this._readableState=new H(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const i=e._readableState;let o;if(0===(i.state&B)&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=m.from(t,r).toString(i.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new R("chunk",["string","Buffer","Uint8Array"],t))),o)$(e,o);else if(null===t)i.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,i);else if(0!==(i.state&B)||t&&t.length>0)if(n)if(4&i.state)$(e,new N);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)$(e,new P);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else n||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),64&t.state&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[C]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function oe(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=F;function i(t){this===e?(n(),n=F):n=t}e.on("readable",i);const o=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=F});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(i)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),o()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[d]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new j,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[C]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new x("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,i=!!(64&t.state);if(S("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,S("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,S("reading, ended or constructing",i);else if(i){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){$(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),S("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===n.stdout||e===n.stderr?g:s;function s(){S("onend"),e.end()}let a;i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",function t(n,o){S("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,S("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(S("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(S("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?$(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",p),g()}function p(){S("onfinish"),e.removeListener("close",d),g()}function g(){S("unpipe"),r.unpipe(e)}return r.on("data",u),_(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():i.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=i(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){const r=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S("on readable",i.length,i.reading),i.length?Y(this):i.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[C]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[C]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{$(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return oe(this)},G.prototype.iterator=function(e){return void 0!==e&&M(e,"options"),oe(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[C]},set(e){this[C]=!!e}}}),G._fromList=se,G.from=function(e,t){return D(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},9288:()=>{},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=r(0,i.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(o=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var t=i.apply(this,n(s,arguments));return Object(t)===t?t:this}return i.apply(e,n(s,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,o.prototype=new u,u.prototype=null}return o}},9372:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const l=s(r(1676));t.default=l,a(r(1676),t)},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9584:(e,t,r)=>{"use strict";const n=r(5244),i=r(3425),o=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=o,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},9597:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(u,r);var s,a,l,c=(a=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=o(a);if(l){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function u(r,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),o=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),o.code=e,o}return s=u,Object.defineProperty(s,"prototype",{writable:!1}),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,i){var o,a,l,c,f;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var h=("number"!=typeof f&&(f=0),f+1>(c=e).length||-1===c.indexOf(".",f)?"argument":"property");l='The "'.concat(e,'" ').concat(h," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(537));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=l},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;l.call(h)===l.call(document.all)&&(f=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},9612:e=>{"use strict";e.exports=Object},9655:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var o,s=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function p(e){throw new RangeError(f[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(u,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function _(e){return g(e,function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)}).join("")}function m(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=a)e=h(e/35);return h(n+36*e/(e+38))}function S(e){var t,r,n,i,o,l,c,u,f,d,g=[],b=e.length,y=0,w=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&p("not-basic"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<b;){for(o=y,l=1,c=a;i>=b&&p("invalid-input"),((u=m(e.charCodeAt(i++)))>=a||u>h((s-y)/l))&&p("overflow"),y+=u*l,!(u<(f=c<=S?1:c>=S+26?26:c-S));c+=a)l>h(s/(d=a-f))&&p("overflow"),l*=d;S=v(y-o,t=g.length+1,0==o),h(y/t)>s-w&&p("overflow"),w+=h(y/t),y%=t,g.splice(y++,0,w)}return _(g)}function E(e){var t,r,n,i,o,l,c,u,f,g,b,_,m,S,E,A=[];for(_=(e=y(e)).length,t=128,r=0,o=72,l=0;l<_;++l)(b=e[l])<128&&A.push(d(b));for(n=i=A.length,i&&A.push("-");n<_;){for(c=s,l=0;l<_;++l)(b=e[l])>=t&&b<c&&(c=b);for(c-t>h((s-r)/(m=n+1))&&p("overflow"),r+=(c-t)*m,t=c,l=0;l<_;++l)if((b=e[l])<t&&++r>s&&p("overflow"),b==t){for(u=r,f=a;!(u<(g=f<=o?1:f>=o+26?26:f-o));f+=a)E=u-g,S=a-g,A.push(d(w(g+E%S,0))),u=h(E/S);A.push(d(w(u,0))),o=v(r,m,n==i),r=0,++n}++r,++t}return A.join("")}o={version:"1.4.1",ucs2:{decode:y,encode:_},decode:S,encode:E,toASCII:function(e){return b(e,function(e){return c.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return b(e,function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},9675:e=>{"use strict";e.exports=TypeError},9721:(e,t,r)=>{"use strict";var n=r(6556),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);e.exports=function(e){if(!i(e))throw new s("`regex` must be a RegExp");return function(t){return null!==o(e,t)}}},9777:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=a(r(1278)),c=r(9584),u=a(r(3885)),f=a(r(7833)),h=s(r(128)),d=a(r(7969)),p=a(r(6912)),g=r(1021),b=a(r(579)),y=a(r(2639)),_=r(4723),m=r(4152),w=a(r(3175)),v=s(r(6887)),S=globalThis.setImmediate||((...e)=>{const t=e.shift();(0,_.nextTick)(()=>{t(...e)})}),E=65535,A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"};class k extends m.TypedEventEmitter{static VERSION=_.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in A)void 0===this.options[e]?this.options[e]=A[e]:this.options[e]=t[e];this.log=this.options.log||(0,f.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",k.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:k.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(l.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new b.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new d.default,this.incomingStore=t.incomingStore||new d.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=E;const r=t.properties?.receiveMaximum;void 0!==r&&(Number.isInteger(r)&&r>=1&&r<=E?this._receiveMaximum=r:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",r,E,E)),this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(t.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:e}=this,t=()=>{const r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,t,r){return!!this._incomingQoS2Ids.has(e)||(5===this.options.protocolVersion&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),r?.discardParsedPackets(),r&&!r.isCurrent()||this._cleanUp(!0),t(),this.emit("error",new _.ErrorWithReasonCode(`${g.ReasonCodes[147]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,147)),!1):(this._incomingQoS2Ids.add(e),!0))}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(0!==this._incomingQoS2Ids.size){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(const e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){const e=new c.Writable,t=l.default.parser(this.options);let r=null;const n=[],i={discardParsedPackets:()=>{n.length=0},isCurrent:()=>this._currentPump===i};this._currentPump=i,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});const o=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==i&&(this.log("work :: pump superseded, dropping %d queued packets",n.length),n.length=0);const e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,s,i);else{this.log("work :: no packets in queue");const e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},s=()=>{if(n.length)(0,_.nextTick)(o);else{const e=r;r=null,e&&e()}};e._write=(e,n,i)=>{r=i,this.log("writable stream :: parsing buffer"),t.parse(e),o()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(void 0!==a.properties?.receiveMaximum&&(a.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(a.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=a.properties?.authenticationMethod,this._writePacket(a),t.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){const e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};const{qos:o,retain:s,dup:a,properties:l,cbStorePut:c}=r;if(this._checkDisconnecting(n))return this;const u=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const u={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(u.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[u.messageId]={volatile:!1,cmd:"publish",cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,i)=>{this.publish(e,t,r,(e,t)=>{e?i(e):n(t)})})}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));const s=h.validateTopics(o);if(null!==s)return S(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};const{properties:l}=t,c=[],u=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){const t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),c.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),u(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),u(t,e[t])}),!c.length)return r(null,[]),this;const f=(e,t)=>{const r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){const r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}const i=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cmd:"subscribe",cb:(r,i)=>{if(r)return void n(new _.ErrorWithSubackPacket(r.message,i));const{granted:o}=i;if(o.length!==e.length)return n(new _.ErrorWithSubackPacket(`Protocol error: suback granted ${o.length} reason code(s) for ${e.length} subscription(s)`,i)),void this._cleanUp(!0);for(let t=0;t<o.length;t+=1)e[t].qos=o[t];t(i)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),i},d=()=>{const e=this.options.subscribeBatchSize??c.length,t=[];for(let r=0;r<c.length;r+=e){const n=c.slice(r,r+e),i=this._nextId();if(null===i)return this.log("No messageId left"),!1;t.push(f(n,i))}return Promise.all(t).then(e=>{r(null,c,e.at(-1))}).catch(e=>{r(e,c,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!d())&&this._storeProcessingQueue.push({invoke:d,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;const n=h.validateTopics(e);if(null!==n)return S(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const i=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cmd:"unsubscribe",cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),r&&"function"==typeof r||(r=this.noop);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,_.nextTick)(n)},t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");const t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),S(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||this.reconnecting||(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);const r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");const r=l.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;const i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,u.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,e=>{if(e)return t&&t(e);r()})):t&&t(new Error("No connection to broker"))}get serverProperties(){return this._serverProperties}get keepalive(){const e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,!this.options.clean&&(this.options.protocolVersion<4||!0===e.sessionPresent)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});const o=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cmd:e.cmd,cb(e,r){t&&t(e,r),o()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",o)};r.on("end",()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}}t.default=k},9844:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function i(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const t=[],r=[],n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(s(Array.from(e),t))),n.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let o=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const l={};t.push(a),r.push(l);for(const s in a){const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(o=n.get(c.constructor)))l[s]=o(c,e);else if(ArrayBuffer.isView(c))l[s]=i(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const l={};t.push(a),r.push(l);for(const s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(o=n.get(c.constructor)))l[s]=o(c,e);else if(ArrayBuffer.isView(c))l[s]=i(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l};function s(e,s){const a=Object.keys(e),l=new Array(a.length);for(let c=0;c<a.length;c++){const u=a[c],f=e[u];if("object"!=typeof f||null===f)l[u]=f;else if(f.constructor!==Object&&(o=n.get(f.constructor)))l[u]=o(f,s);else if(ArrayBuffer.isView(f))l[u]=i(f);else{const e=t.indexOf(f);l[u]=-1!==e?r[e]:s(f)}}return l}}(e);const t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(n(Array.from(e),t))),t.set(Set,(e,t)=>new Set(n(Array.from(e),t))),e.constructorHandlers)for(const r of e.constructorHandlers)t.set(r[0],r[1]);let r=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){if(!1===Object.hasOwnProperty.call(o,n))continue;const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s};function n(e,n){const o=Object.keys(e),s=new Array(o.length);for(let a=0;a<o.length;a++){const l=o[a],c=e[l];"object"!=typeof c||null===c?s[l]=c:c.constructor!==Object&&(r=t.get(c.constructor))?s[l]=r(c,n):ArrayBuffer.isView(c)?s[l]=i(c):s[l]=n(c)}return s}}},9848:(e,t,r)=>{"use strict";const{pipeline:n}=r(3616),i=r(2648),{destroyer:o}=r(7302),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:h}=r(6801),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=r(9157),b=r(6364);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||h(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,_,m,w;const v=e[0],S=n(e,function(e){const t=m;m=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||h(S)||u(S));if(w=new i({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;b(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(_){const e=_;_=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(_=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===m||(e=new d),_=null,r=null,y=null,null===m?t(e):(m=t,s(S)&&o(S,e))},w}},9862:(e,t,r)=>{"use strict";const n=r(8287),{format:i,inspect:o}=r(1077),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(9157),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(2768),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||n.Blob,p=void 0!==d?function(e){return e instanceof d}:function(e){return!1},g=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:i,inspect:o,types:{isAsyncFunction:e=>e instanceof h,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return g(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{g(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},9868:(e,t,r)=>{"use strict";const n=r(7829).Duplex,i=r(6698),o=r(7396);function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}o._init.call(this,e),n.call(this)}i(s,n),Object.assign(s.prototype,o.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof o||s.isBufferList(e)},s.isBufferList=o.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=o},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);e.exports=o.call(n,i)},9993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearInterval:()=>_,clearTimeout:()=>m,setInterval:()=>w,setTimeout:()=>v});var n=r(8389);const i=(c=new WeakMap,o=e=>{if(c.has(e))return c.get(e);const t=new Map;return c.set(e,t),t},l=new WeakMap,s=e=>({...e,connect:({call:e})=>async()=>{const{port1:t,port2:r}=new MessageChannel,n=await e("connect",{port:t},[t]);return l.set(r,n),r},disconnect:({call:e})=>async t=>{const r=l.get(t);if(void 0===r)throw new Error("The given port is not connected.");await e("disconnect",{portId:r})},isSupported:({call:e})=>()=>e("isSupported")}),a=n.generateUniqueNumber,e=>{const t=s(e);return e=>{const r=o(e);e.addEventListener("message",({data:e})=>{const{id:t}=e;if(null!==t&&r.has(t)){const{reject:n,resolve:i}=r.get(t);r.delete(t),void 0===e.error?i(e.result):n(new Error(e.error.message))}}),(e=>"function"==typeof e.start)(e)&&e.start();const n=(t,n=null,i=[])=>new Promise((o,s)=>{const l=a(r);r.set(l,{reject:s,resolve:o}),null===n?e.postMessage({id:l,method:t},i):e.postMessage({id:l,method:t,params:n},i)}),i=(t,r,n=[])=>{e.postMessage({id:null,method:t,params:r},n)};let s={};for(const[e,r]of Object.entries(t))s={...s,[e]:r({call:n,notify:i})};return{...s}}});var o,s,a,l,c;const u=new Map([[0,null]]),f=new Map([[0,null]]),h=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(u),d=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(f),p=((e,t)=>r=>(n,i=0,...o)=>{const s=Symbol(),a=e(t);t.set(a,s);const l=()=>r(i,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(n(...o),t.get(a)===s&&l())});return l(),a})(n.generateUniqueNumber,u),g=((e,t)=>r=>(n,i=0,...o)=>{const s=Symbol(),a=e(t);return t.set(a,s),r(i,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(t.delete(a),n(...o))}),a})(n.generateUniqueNumber,f),b=i({clearInterval:({call:e})=>h(t=>e("clear",{timerId:t,timerType:"interval"})),clearTimeout:({call:e})=>d(t=>e("clear",{timerId:t,timerType:"timeout"})),setInterval:({call:e})=>p((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})),setTimeout:({call:e})=>g((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"}))}),y=(()=>{let e=null;return()=>{if(null!==e)return e;const t=new Blob(['(()=>{var e={455(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o(\'The handler of the method called "\'.concat(t,\'" returned an unexpected result.\'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o(\'The requested method called "\'.concat(e,\'" is not supported.\'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o(\'The handler of the method called "\'.concat(t,\'" returned no required result.\'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,()=>{n(),t.close(),u.delete(o)}),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o(\'The specified parameter called "portId" with the given value "\'.concat(e,\'" does not identify a port connected to this worker.\'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},m=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise(t=>{e.set(a,[r(n,u,i,e,t,a),t])})},f=new Map,h=d(globalThis.clearTimeout,f),p=new Map,w=d(globalThis.clearTimeout,p),v=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=m(f,performance,globalThis.setTimeout,v),T=m(p,performance,globalThis.setTimeout,v);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):w(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return e=(e=>{const t=new Worker(e);return b(t)})(r),setTimeout(()=>URL.revokeObjectURL(r)),e}})(),_=e=>y().clearInterval(e),m=e=>y().clearTimeout(e),w=(...e)=>y().setInterval(...e),v=(...e)=>y().setTimeout(...e)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1860)})());
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.vrpc=t():e.vrpc=t()}(self,()=>(()=>{var e={41:(e,t,r)=>{"use strict";var n=r(655),i=r(8068),o=r(9675),s=r(5795);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new o("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new o("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new o("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new o("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new o("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new o("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,c=arguments.length>5?arguments[5]:null,u=arguments.length>6&&arguments[6],f=!!s&&s(e,t);if(n)n(e,t,{configurable:null===c&&f?f.configurable:!c,enumerable:null===a&&f?f.enumerable:!a,value:r,writable:null===l&&f?f.writable:!l});else{if(!u&&(a||l||c))throw new i("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");e[t]=r}}},76:e=>{"use strict";e.exports=Function.prototype.call},128:(e,t)=>{"use strict";function r(e){const t=e.split("/");for(let e=0;e<t.length;e++)if("+"!==t[e]){if("#"===t[e])return e===t.length-1;if(-1!==t[e].indexOf("+")||-1!==t[e].indexOf("#"))return!1}return!0}Object.defineProperty(t,"__esModule",{value:!0}),t.validateTopic=r,t.validateTopics=function(e){if(0===e.length)return"empty_topic_list";for(let t=0;t<e.length;t++)if(!r(e[t]))return e[t];return null}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,l=(1<<a)-1,c=l>>1,u=-7,f=r?i-1:0,h=r?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-u)-1,d>>=-u,u+=a;u>0;o=256*o+e[t+f],f+=h,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=n;u>0;s=256*s+e[t+f],f+=h,u-=8);if(0===o)o=1-c;else{if(o===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=c}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,l,c=8*o-i-1,u=(1<<c)-1,f=u>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(s++,l/=2),s+f>=u?(a=0,s=u):s+f>=1?(a=(t*l-1)*Math.pow(2,i),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+d]=255&s,d+=p,s/=256,c-=8);e[r+d-p]|=128*g}},397:(e,t,r)=>{"use strict";const n=r(8287),i=r(9584),o=r(2635);let s,a,l,c=!1;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const u=function(e,t){const r="alis"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);return s=t.my,s.connectSocket({url:u,protocols:r}),a=function(){const e=new i.Transform;return e._write=(e,t,r)=>{s.sendSocketMessage({data:e.buffer,success(){r()},fail(){r(new Error)}})},e._flush=e=>{s.closeSocket({success(){e()}})},e}(),l=new o.BufferedDuplex(t,a,s),c||(c=!0,s.onSocketOpen(()=>{l.socketReady()}),s.onSocketMessage(e=>{if("string"==typeof e.data){const t=n.Buffer.from(e.data,"base64");a.push(t)}else{const t=new FileReader;t.addEventListener("load",()=>{t.result instanceof ArrayBuffer?a.push(n.Buffer.from(t.result)):a.push(n.Buffer.from(t.result,"utf-8"))}),t.readAsArrayBuffer(e.data)}}),s.onSocketClose(()=>{l.end(),l.destroy()}),s.onSocketError(e=>{l.destroy(e)})),l}},414:e=>{"use strict";e.exports=Math.round},453:(e,t,r)=>{"use strict";var n,i=r(9612),o=r(9383),s=r(1237),a=r(9290),l=r(9538),c=r(8068),u=r(9675),f=r(5345),h=r(1514),d=r(8968),p=r(6188),g=r(8002),b=r(5880),y=r(414),_=r(3093),m=Function,w=function(e){try{return m('"use strict"; return ('+e+").constructor;")()}catch(e){}},v=r(5795),S=r(655),E=function(){throw new u},A=v?function(){try{return E}catch(e){try{return v(arguments,"callee").get}catch(e){return E}}}():E,k=r(4039)(),I=r(3628),O=r(1064),R=r(8648),T=r(1002),x=r(76),P={},N="undefined"!=typeof Uint8Array&&I?I(Uint8Array):n,C={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":k&&I?I([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":P,"%AsyncGenerator%":P,"%AsyncGeneratorFunction%":P,"%AsyncIteratorPrototype%":P,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":o,"%eval%":eval,"%EvalError%":s,"%Float16Array%":"undefined"==typeof Float16Array?n:Float16Array,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":m,"%GeneratorFunction%":P,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":k&&I?I(I([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&k&&I?I((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":i,"%Object.getOwnPropertyDescriptor%":v,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":a,"%ReferenceError%":l,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&k&&I?I((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":k&&I?I(""[Symbol.iterator]()):n,"%Symbol%":k?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":A,"%TypedArray%":N,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":f,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet,"%Function.prototype.call%":x,"%Function.prototype.apply%":T,"%Object.defineProperty%":S,"%Object.getPrototypeOf%":O,"%Math.abs%":h,"%Math.floor%":d,"%Math.max%":p,"%Math.min%":g,"%Math.pow%":b,"%Math.round%":y,"%Math.sign%":_,"%Reflect.getPrototypeOf%":R};if(I)try{null.error}catch(e){var j=I(I(e));C["%Error.prototype%"]=j}var M=function e(t){var r;if("%AsyncFunction%"===t)r=w("async function () {}");else if("%GeneratorFunction%"===t)r=w("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=w("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&I&&(r=I(i.prototype))}return C[t]=r,r},L={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},D=r(6743),F=r(9957),$=D.call(x,Array.prototype.concat),B=D.call(T,Array.prototype.splice),U=D.call(x,String.prototype.replace),W=D.call(x,String.prototype.slice),q=D.call(x,RegExp.prototype.exec),V=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,z=/\\(\\)?/g,H=function(e,t){var r,n=e;if(F(L,n)&&(n="%"+(r=L[n])[0]+"%"),F(C,n)){var i=C[n];if(i===P&&(i=M(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===q(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=function(e){var t=W(e,0,1),r=W(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return U(e,V,function(e,t,r,i){n[n.length]=r?U(i,z,"$1"):t||e}),n}(e),n=r.length>0?r[0]:"",i=H("%"+n+"%",t),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],B(r,$([0,1],l)));for(var f=1,h=!0;f<r.length;f+=1){var d=r[f],p=W(d,0,1),g=W(d,-1);if(('"'===p||"'"===p||"`"===p||'"'===g||"'"===g||"`"===g)&&p!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==d&&h||(a=!0),F(C,o="%"+(n+="."+d)+"%"))s=C[o];else if(null!=s){if(!(d in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(v&&f+1>=r.length){var b=v(s,d);s=(h=!!b)&&"get"in b&&!("originalValue"in b.get)?b.get:s[d]}else h=F(s,d),s=s[d];h&&!a&&(C[o]=s)}}return s}},487:(e,t,r)=>{"use strict";var n=r(6897),i=r(655),o=r(3126),s=r(2205);e.exports=function(e){var t=o(arguments),r=e.length-(arguments.length-1);return n(t,1+(r>0?r:0),!0)},i?i(e.exports,"apply",{value:s}):e.exports.apply=s},495:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(1021),o=n(r(3497)),s=r(4723);t.default=(e,t,r)=>{e.log("_handleConnack");const{options:n}=e,a=5===n.protocolVersion?t.reasonCode:t.returnCode;if(e.connackReceived){const t=new s.ErrorWithReasonCode("Protocol error: duplicate CONNACK on the same network connection",130);return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",t)}if(e.connackReceived=!0,clearTimeout(e.connackTimer),delete e.topicAliasSend,e._serverProperties=t.properties,t.properties&&t.properties.topicAliasMaximum){if(t.properties.topicAliasMaximum>65535)return r?.discardParsedPackets(),e._cleanUp(!0),void e.emit("error",new Error("topicAliasMaximum from broker is out of range"));t.properties.topicAliasMaximum>0&&(e.topicAliasSend=new o.default(t.properties.topicAliasMaximum))}if(0===a)e.reconnecting=!1,e._onConnect(t);else if(a>0){e.log("_handleConnack :: connection refused with reason code %d",a);const t=new s.ErrorWithReasonCode(`Connection refused: ${i.ReasonCodes[a]}`,a);r?.discardParsedPackets(),e.reconnectSuppressed=!0,e._cleanUp(!0);try{e.emit("error",t)}finally{n.reconnectOnConnackError&&(e.reconnectSuppressed=!1,e._setupReconnect())}}}},507:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(9675),a=n("%Map%",!0),l=i("Map.prototype.get",!0),c=i("Map.prototype.set",!0),u=i("Map.prototype.has",!0),f=i("Map.prototype.delete",!0),h=i("Map.prototype.size",!0);e.exports=!!a&&function(){var e,t={assert:function(e){if(!t.has(e))throw new s("Side channel does not contain "+o(e))},delete:function(t){if(e){var r=f(e,t);return 0===h(e)&&(e=void 0),r}return!1},get:function(t){if(e)return l(e,t)},has:function(t){return!!e&&u(e,t)},set:function(t,r){e||(e=new a),c(e,t,r)}};return t}},519:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(4469);e.exports=o;const i=r(6269);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n(o.prototype,i.prototype),n(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},537:(e,t,r)=>{var n=r(2045),i=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},o=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(c(arguments[r]));return t.join(" ")}r=1;for(var n=arguments,i=n.length,s=String(e).replace(o,function(e){if("%%"===e)return"%";if(r>=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<i;a=n[++r])y(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},t.deprecate=function(e,r){if(void 0!==n&&!0===n.noDeprecation)return e;if(void 0===n)return function(){return t.deprecate(e,r).apply(this,arguments)};var i=!1;return function(){if(!i){if(n.throwDeprecation)throw new Error(r);n.traceDeprecation?console.trace(r):console.error(r),i=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if(n.env.NODE_DEBUG){var l=n.env.NODE_DEBUG;l=l.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),a=new RegExp("^"+l+"$","i")}function c(e,r){var n={seen:[],stylize:f};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),b(r)?n.showHidden=r:r&&t._extend(n,r),w(n.showHidden)&&(n.showHidden=!1),w(n.depth)&&(n.depth=2),w(n.colors)&&(n.colors=!1),w(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),h(n,e,n.depth)}function u(e,t){var r=c.styles[t];return r?"["+c.colors[r][0]+"m"+e+"["+c.colors[r][1]+"m":e}function f(e,t){return e}function h(e,r,n){if(e.customInspect&&r&&k(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=h(e,i,n)),i}var o=function(e,t){if(w(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return _(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),A(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return d(r);if(0===s.length){if(k(r)){var l=r.name?": "+r.name:"";return e.stylize("[Function"+l+"]","special")}if(v(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(E(r))return e.stylize(Date.prototype.toString.call(r),"date");if(A(r))return d(r)}var c,u="",f=!1,S=["{","}"];return g(r)&&(f=!0,S=["[","]"]),k(r)&&(u=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(u=" "+RegExp.prototype.toString.call(r)),E(r)&&(u=" "+Date.prototype.toUTCString.call(r)),A(r)&&(u=" "+d(r)),0!==s.length||f&&0!=r.length?n<0?v(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=f?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)T(t,String(s))?o.push(p(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(p(e,t,r,n,i,!0))}),o}(e,r,n,a,s):s.map(function(t){return p(e,r,n,a,t,f)}),e.seen.pop(),function(e,t,r){return e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,u,S)):S[0]+u+S[1]}function d(e){return"["+Error.prototype.toString.call(e)+"]"}function p(e,t,r,n,i,o){var s,a,l;if((l=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=l.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):l.set&&(a=e.stylize("[Setter]","special")),T(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(l.value)<0?(a=y(r)?h(e,l.value,null):h(e,l.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").slice(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),w(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function g(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function y(e){return null===e}function _(e){return"number"==typeof e}function m(e){return"string"==typeof e}function w(e){return void 0===e}function v(e){return S(e)&&"[object RegExp]"===I(e)}function S(e){return"object"==typeof e&&null!==e}function E(e){return S(e)&&"[object Date]"===I(e)}function A(e){return S(e)&&("[object Error]"===I(e)||e instanceof Error)}function k(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function O(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(e=e.toUpperCase(),!s[e])if(a.test(e)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(9032),t.isArray=g,t.isBoolean=b,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=_,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=w,t.isRegExp=v,t.types.isRegExp=v,t.isObject=S,t.isDate=E,t.types.isDate=E,t.isError=A,t.types.isNativeError=A,t.isFunction=k,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(1135);var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function T(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[O((e=new Date).getHours()),O(e.getMinutes()),O(e.getSeconds())].join(":"),[e.getDate(),R[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(6698),t._extend=function(e,t){if(!t||!S(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var x="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function P(e,t){if(!e){var r=new Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(x&&e[x]){var t;if("function"!=typeof(t=e[x]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),x&&Object.defineProperty(t,x,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,i(e))},t.promisify.custom=x,t.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var i=t.pop();if("function"!=typeof i)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return i.apply(o,arguments)};e.apply(this,t).then(function(e){n.nextTick(s.bind(null,null,e))},function(e){n.nextTick(P.bind(null,e,s))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,i(e)),t}},544:e=>{const t=/^Connection refused/;class r{constructor(e,{max:t=3e4}={}){this._client=e,this._base=e.options.reconnectPeriod,this._max=Math.max(t,this._base),this._next=this._base,e.on("error",e=>{r.isRefusal(e)&&this._slowDown()}),e.on("connect",()=>this._restore())}static isRefusal(e){return!!e&&"number"==typeof e.code&&t.test(e.message||"")}get period(){return this._client.options.reconnectPeriod}hurry(){this._restore();const e=this._client;e.connected||e.disconnecting||!e.reconnecting||"function"==typeof e._clearReconnect&&(e._clearReconnect(),e._setupReconnect())}_slowDown(){const e=this._client;e.options.reconnectPeriod=this._next,this._next=Math.min(2*this._next,this._max),"function"==typeof e._clearReconnect&&e._clearReconnect()}_restore(){this._next=this._base,this._client.options.reconnectPeriod=this._base}}e.exports=r},576:e=>{e.exports=class{constructor(){this.cmd=null,this.retain=!1,this.qos=0,this.dup=!1,this.length=-1,this.topic=null,this.payload=null}}},577:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:i,codes:o}=r(2074),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:c}=r(7797),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:d}=r(1580),{Promise:p,PromisePrototypeThen:g,SymbolDispose:b}=r(4469),{isClosed:y,isReadable:_,isReadableNodeStream:m,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:T,kIsClosedPromise:x}=r(5980);let P;const N=()=>{};function C(e,t,o){var d,p;if(2===arguments.length?(o=t,t=l):null==t?t=l:h(t,"options"),f(o,"callback"),u(t.signal,"options.signal"),o=c(o),w(e)||k(e))return function(e,t,o){let s=!1,a=N;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{P=P||r(7797).addAbortListener;const n=P(t.signal,a),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[x].promise,l,l),N}(e,t,o);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const C=null!==(d=t.readable)&&void 0!==d?d:m(e),j=null!==(p=t.writable)&&void 0!==p?p:A(e),M=e._writableState,L=e._readableState,D=()=>{e.writable||B()};let F=T(e)&&m(e)===C&&A(e)===j,$=I(e,!1);const B=()=>{$=!0,e.destroyed&&(F=!1),(!F||e.readable&&!C)&&(C&&!U||o.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(F=!1),(!F||e.writable&&!j)&&(j&&!$||o.call(e))},q=t=>{o.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?o.call(e,t):C&&!U&&m(e,!0)&&!v(e,!1)?o.call(e,new a):!j||$||I(e,!1)?void o.call(e):o.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!M&&(e.on("end",D),e.on("close",D)):(e.on("complete",B),F||e.on("abort",z),e.req?G():e.on("request",G)),F||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=M&&M.errorEmitted||null!=L&&L.errorEmitted?F||n.nextTick(H):(C||F&&!_(e)||!$&&!1!==E(e))&&(j||F&&!E(e)||!U&&!1!==_(e))?L&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{o=N,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",D),e.removeListener("close",D),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{P=P||r(7797).addAbortListener;const n=P(t.signal,s),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}}return K}e.exports=C,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p((r,i)=>{const o=C(e,t,e=>{n&&o(),e?i(e):r()})})}},579:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{nextId;constructor(){this.nextId=Math.max(1,Math.floor(65535*Math.random()))}allocate(){const e=this.nextId++;return 65536===this.nextId&&(this.nextId=1),e}getLastAllocated(){return 1===this.nextId?65535:this.nextId-1}register(e){return!0}deallocate(e){}clear(){}}},592:(e,t,r)=>{"use strict";var n=r(655),i=function(){return!!n};i.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=i},655:e=>{"use strict";var t=Object.defineProperty||!1;if(t)try{t({},"a",{value:1})}catch(e){t=!1}e.exports=t},736:(e,t,r)=>{e.exports=function(e){function t(e){let r,i,o,s=null;function a(...e){if(!a.enabled)return;const n=a,i=Number(new Date),o=i-(r||i);n.diff=o,n.prev=r,n.curr=i,r=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let s=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(r,i)=>{if("%%"===r)return"%";s++;const o=t.formatters[i];if("function"==typeof o){const t=e[s];r=o.call(n,t),e.splice(s,1),s--}return r}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return a.namespace=e,a.useColors=t.useColors(),a.color=t.selectColor(e),a.extend=n,a.destroy=t.destroy,Object.defineProperty(a,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==s?s:(i!==t.namespaces&&(i=t.namespaces,o=t.enabled(e)),o),set:e=>{s=e}}),"function"==typeof t.init&&t.init(a),a}function n(e,r){const n=t(this.namespace+(void 0===r?":":r)+e);return n.log=this.log,n}function i(e,t){let r=0,n=0,i=-1,o=0;for(;r<e.length;)if(n<t.length&&(t[n]===e[r]||"*"===t[n]))"*"===t[n]?(i=n,o=r,n++):(r++,n++);else{if(-1===i)return!1;n=i+1,o++,r=o}for(;n<t.length&&"*"===t[n];)n++;return n===t.length}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names,...t.skips.map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){t.save(e),t.namespaces=e,t.names=[],t.skips=[];const r=("string"==typeof e?e:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(const e of r)"-"===e[0]?t.skips.push(e.slice(1)):t.names.push(e)},t.enabled=function(e){for(const r of t.skips)if(i(e,r))return!1;for(const r of t.names)if(i(e,r))return!0;return!1},t.humanize=r(6585),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(r=>{t[r]=e[r]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let r=0;for(let t=0;t<e.length;t++)r=(r<<5)-r+e.charCodeAt(t),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},778:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(1428)),o=n(r(7833)),s=n(r(6968)),a=(0,o.default)("mqttjs:tcp");t.default=(e,t)=>{if(t.port=t.port||1883,t.hostname=t.hostname||t.host||"localhost",t.socksProxy)return(0,s.default)(t.hostname,t.port,t.socksProxy,{timeout:t.socksTimeout});const{port:r,path:n}=t,o=t.hostname;return a("port %d and host %s",r,o),i.default.createConnection({port:r,host:o,path:n})}},920:(e,t,r)=>{"use strict";var n=r(9675),i=r(8859),o=r(4803),s=r(507),a=r(2271)||s||o;e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new n("Side channel does not contain "+i(e))},delete:function(t){return!!e&&e.delete(t)},get:function(t){return e&&e.get(t)},has:function(t){return!!e&&e.has(t)},set:function(t,r){e||(e=a()),e.set(t,r)}};return t}},968:e=>{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},982:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(4469),{AbortError:i,codes:o}=r(2074),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(5980),c=r(577),{ERR_INVALID_ARG_TYPE:u}=o;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{f=f||r(7797).addAbortListener;const i=f(e,o);c(t,i[n])}return t}},1002:e=>{"use strict";e.exports=Function.prototype.apply},1021:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=void 0;const n=r(4723);t.ReasonCodes={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"};const i={publish:["puback","pubrec","pubcomp"],pubrel:["pubcomp"],subscribe:["suback"],unsubscribe:["unsuback"]};t.default=(e,r)=>{const{messageId:o}=r,s=r.cmd;let a=null;const l=e.outgoing[o],c=l?l.cb:null;let u=null;if(c){if(!i[l.cmd]?.includes(s))return e.log("_handleAck :: %s does not answer the pending %s on message id %d. Ignoring.",s,l.cmd,o),void e.emit("error",new Error(`Protocol error: ${s} does not answer the ${l.cmd} pending on message id ${o}`));switch(e.log("_handleAck :: packet type",s),s){case"pubcomp":case"puback":{const i=r.reasonCode;i&&i>0&&16!==i?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[i]}`,i),e._removeOutgoingAndStoreMessage(o,()=>{c(u,r)})):e._removeOutgoingAndStoreMessage(o,c);break}case"pubrec":{a={cmd:"pubrel",qos:2,messageId:o};const i=r.reasonCode;i&&i>0&&16!==i?(u=new n.ErrorWithReasonCode(`Publish error: ${t.ReasonCodes[i]}`,i),e._removeOutgoingAndStoreMessage(o,()=>{c(u,r)})):e._sendPacket(a);break}case"suback":{delete e.outgoing[o],e.messageIdProvider.deallocate(o);const n=r.granted;for(let r=0;r<n.length;r++){const i=n[r];if(128&i){u=new Error(`Subscribe error: ${t.ReasonCodes[i]}`),u.code=i;const r=e.messageIdToTopic[o];r&&r.forEach(t=>{delete e._resubscribeTopics[t]})}}delete e.messageIdToTopic[o],e._invokeStoreProcessingQueue(),c(u,r);break}case"unsuback":delete e.outgoing[o],e.messageIdProvider.deallocate(o),e._invokeStoreProcessingQueue(),c(null,r);break;default:e.emit("error",new Error("unrecognized packet type"))}e.disconnecting&&0===Object.keys(e.outgoing).length&&e.emit("outgoingEmpty")}else e.log("_handleAck :: Server sent an ack in error. Ignoring.")}},1064:(e,t,r)=>{"use strict";var n=r(9612);e.exports=n.getPrototypeOf||null},1072:(e,t)=>{t.endianness=function(){return"LE"},t.hostname=function(){return"undefined"!=typeof location?location.hostname:""},t.loadavg=function(){return[]},t.uptime=function(){return 0},t.freemem=function(){return Number.MAX_VALUE},t.totalmem=function(){return Number.MAX_VALUE},t.cpus=function(){return[]},t.type=function(){return"Browser"},t.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},t.networkInterfaces=t.getNetworkInterfaces=function(){return{}},t.arch=function(){return"javascript"},t.platform=function(){return"browser"},t.tmpdir=t.tmpDir=function(){return"/tmp"},t.EOL="\n",t.homedir=function(){return"/"}},1077:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}},1093:e=>{"use strict";var t=Object.prototype.toString;e.exports=function(e){var r=t.call(e),n="[object Arguments]"===r;return n||(n="[object Array]"!==r&&null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Function]"===t.call(e.callee)),n}},1135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},1189:(e,t,r)=>{"use strict";var n=Array.prototype.slice,i=r(1093),o=Object.keys,s=o?function(e){return o(e)}:r(8875),a=Object.keys;s.shim=function(){if(Object.keys){var e=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);e||(Object.keys=function(e){return i(e)?a(n.call(e)):a(e)})}else Object.keys=s;return Object.keys||s},e.exports=s},1237:e=>{"use strict";e.exports=EvalError},1278:(e,t,r)=>{t.parser=r(3079).parser,t.generate=r(2535),t.writeToStream=r(3132)},1333:e=>{"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(var n in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},1396:(e,t,r)=>{e.exports=r(7007).EventEmitter},1401:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=r(4469),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(2074).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const h=new e({objectMode:!0,highWaterMark:1,...r});let d=!1;return h._read=function(){d||(d=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new c;if(h.push(t))continue;d=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},h}},1428:()=>{},1514:e=>{"use strict";e.exports=Math.abs},1580:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:b}=r(4469),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(2074),{normalizeEncoding:E}=r(7797),{isAsyncFunction:A,isArrayBufferView:k}=r(7797).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),x=y((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new v(t,`>= ${n} && <= ${i}`,e)});function P(e,t){if("string"!=typeof e)throw new m(t,"string",e)}const N=y((e,t,r)=>{if(!i(r,e)){const n=o(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function C(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function j(e,t,r){return null!=e&&h(e,t)?e[t]:r}const M=y((e,t,r=null)=>{const i=j(r,"allowArray",!1),o=j(r,"allowFunction",!1);if(!j(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)}),L=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)}),D=y((e,t,r=0)=>{if(!n(e))throw new m(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),F=y((e,t="buffer")=>{if(!k(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}),$=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new m(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!d(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===d(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return x(e,t),e},validateArray:D,validateStringArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)P(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)C(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++){const n=e[r],i=`${t}[${r}]`;if(null==n)throw new m(i,"AbortSignal",n);$(n,i)}},validateBoolean:C,validateBuffer:F,validateDictionary:L,validateEncoding:function(e,t){const r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:T,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:M,validateOneOf:N,validatePlainFunction:U,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===b(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new _(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(P(e,t),void 0===I[e]){if(void 0!==I[g(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:P,validateUint32:x,validateUndefined:W,validateUnion:function(e,t,r){if(!i(r,e))throw new m(t,`('${o(r,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const i=e[n];V(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},1591:e=>{"use strict";e.exports=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},1676:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)},l=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ReasonCodes=t.KeepaliveManager=t.UniqueMessageIdProvider=t.DefaultMessageIdProvider=t.Store=t.MqttClient=t.connectAsync=t.connect=t.Client=void 0;const c=l(r(9777));t.MqttClient=c.default;const u=l(r(579));t.DefaultMessageIdProvider=u.default;const f=l(r(2099));t.UniqueMessageIdProvider=f.default;const h=l(r(7969));t.Store=h.default;const d=s(r(2793));t.connect=d.default,Object.defineProperty(t,"connectAsync",{enumerable:!0,get:function(){return d.connectAsync}});const p=l(r(3175));t.KeepaliveManager=p.default,t.Client=c.default,a(r(9777),t),a(r(4723),t),a(r(128),t);var g=r(1021);Object.defineProperty(t,"ReasonCodes",{enumerable:!0,get:function(){return g.ReasonCodes}})},1766:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return(t=a(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}var l=r(8287).Buffer,c=r(3779).inspect,u=c&&c.custom||"inspect";function f(e,t,r){l.prototype.copy.call(e,t,r)}e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return l.alloc(0);for(var t=l.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0===(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=l.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0===(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return c(this,i(i({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1787:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=r(2074),{Symbol:a}=r(4469),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(5980),h=a("kDestroy"),d=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,r){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(b,e,t):n.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function b(e,t){_(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function _(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(_,e,t):_(e,t))}function w(e){let t=!1;function r(r){if(t)return void m(e,null!=r?r:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,r):r?m(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(d)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(d,t),e.listenerCount(d)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,o=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,function(r){g(this,i(r,e),t)}),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}},1860:(e,t,r)=>{"use strict";e.exports={VrpcClient:r(8577),VrpcAgent:r(6171),VrpcAdapter:r(8665)}},1999:(e,t,r)=>{"use strict";var n,i=r(2045);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t){var r=e.entry;for(e.entry=null;r;){var n=r.callback;t.pendingcb--,n(undefined),r=r.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=k,k.WritableState=A;var s,a={deprecate:r(4643)},l=r(1396),c=r(8287).Buffer,u=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},f=r(4347),h=r(6644).getHighWaterMark,d=r(2463).F,p=d.ERR_INVALID_ARG_TYPE,g=d.ERR_METHOD_NOT_IMPLEMENTED,b=d.ERR_MULTIPLE_CALLBACK,y=d.ERR_STREAM_CANNOT_PIPE,_=d.ERR_STREAM_DESTROYED,m=d.ERR_STREAM_NULL_VALUES,w=d.ERR_STREAM_WRITE_AFTER_END,v=d.ERR_UNKNOWN_ENCODING,S=f.errorOrDestroy;function E(){}function A(e,t,s){n=n||r(8101),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new b;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(P,e,t),e._writableState.errorEmitted=!0,S(e,n)):(o(n),e._writableState.errorEmitted=!0,S(e,n),P(e,t))}(e,r,n,t,o);else{var s=T(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||R(e,r),n?i.nextTick(O,e,r,s,o):O(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function k(e){var t=this instanceof(n=n||r(8101));if(!t&&!s.call(k,this))return new k(e);this._writableState=new A(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function I(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),P(e,t)}function R(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,l=!0;r;)i[a]=r,r.isBuf||(l=!1),r=r.next,a+=1;i.allBuffers=l,I(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,f=r.callback;if(I(e,t,!1,t.objectMode?1:c.length,c,u,f),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function T(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function x(e,t){e._final(function(r){t.pendingcb--,r&&S(e,r),t.prefinished=!0,e.emit("prefinish"),P(e,t)})}function P(e,t){var r=T(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(x,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(6698)(k,l),A.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(A.prototype,"buffer",{get:a.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===k&&e&&e._writableState instanceof A}})):s=function(e){return e instanceof this},k.prototype.pipe=function(){S(this,new y)},k.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof u);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=E),o.ending?function(e,t){var r=new w;S(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new m:"string"==typeof r||t.objectMode||(o=new p("chunk",["string","Buffer"],r)),!o||(S(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var l=t.length<t.highWaterMark;if(l||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else I(e,t,!1,a,n,i,o);return l}(this,o,a,e,t,r)),s},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||R(this,e))},k.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new v(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new g("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,P(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=f.destroy,k.prototype._undestroy=f.undestroy,k.prototype._destroy=function(e,t){t(e)}},2045:(e,t,r)=>{"use strict";const n=r(5606);n.nextTick=function(e,...t){queueMicrotask(()=>e(...t))},e.exports=n},2070:(e,t,r)=>{"use strict";const n=r(5606),{PromisePrototypeThen:i,SymbolAsyncIterator:o,SymbolIterator:s}=r(2768),{Buffer:a}=r(8287),{ERR_INVALID_ARG_TYPE:l,ERR_STREAM_NULL_VALUES:c}=r(9157).codes;e.exports=function(e,t,r){let u,f;if("string"==typeof t||t instanceof a)return new e({objectMode:!0,...r,read(){this.push(t),this.push(null)}});if(t&&t[o])f=!0,u=t[o]();else{if(!t||!t[s])throw new l("iterable",["Iterable"],t);f=!1,u=t[s]()}const h=new e({objectMode:!0,highWaterMark:1,...r});let d=!1;return h._read=function(){d||(d=!0,async function(){for(;;){try{const{value:e,done:t}=f?await u.next():u.next();if(t)h.push(null);else{const t=e&&"function"==typeof e.then?await e:e;if(null===t)throw d=!1,new c;if(h.push(t))continue;d=!1}}catch(e){h.destroy(e)}break}}())},h._destroy=function(e,t){i(async function(e){const t=null!=e,r="function"==typeof u.throw;if(t&&r){const{value:t,done:r}=await u.throw(e);if(await t,r)return}if("function"==typeof u.return){const{value:e}=await u.return();await e}}(e),()=>n.nextTick(t,e),r=>n.nextTick(t,r||e))},h}},2074:(e,t,r)=>{"use strict";const{format:n,inspect:i}=r(2858),{AggregateError:o}=r(4469),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return f(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?o.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),d("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),d("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=h(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=h(n)),n+="n"}else n=i(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},2099:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4807);t.default=class{numberAllocator;lastId;constructor(){this.numberAllocator=new n.NumberAllocator(1,65535)}allocate(){return this.lastId=this.numberAllocator.alloc(),this.lastId}getLastAllocated(){return this.lastId}register(e){return this.numberAllocator.use(e)}deallocate(e){this.numberAllocator.free(e)}clear(){this.numberAllocator.clear()}}},2100:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(4469),{validateInteger:o}=r(1580),{ERR_INVALID_ARG_VALUE:s}=r(2074).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,o){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=a){if(!i(a)||a<0)throw new s(o?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?l=t:a=t}}},2205:(e,t,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(3144);e.exports=function(){return o(n,i,arguments)}},2271:(e,t,r)=>{"use strict";var n=r(453),i=r(6556),o=r(8859),s=r(507),a=r(9675),l=n("%WeakMap%",!0),c=i("WeakMap.prototype.get",!0),u=i("WeakMap.prototype.set",!0),f=i("WeakMap.prototype.has",!0),h=i("WeakMap.prototype.delete",!0);e.exports=l?function(){var e,t,r={assert:function(e){if(!r.has(e))throw new a("Side channel does not contain "+o(e))},delete:function(r){if(l&&r&&("object"==typeof r||"function"==typeof r)){if(e)return h(e,r)}else if(s&&t)return t.delete(r);return!1},get:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?c(e,r):t&&t.get(r)},has:function(r){return l&&r&&("object"==typeof r||"function"==typeof r)&&e?f(e,r):!!t&&t.has(r)},set:function(r,n){l&&r&&("object"==typeof r||"function"==typeof r)?(e||(e=new l),u(e,r,n)):s&&(t||(t=s()),t.set(r,n))}};return r}:s},2299:(e,t,r)=>{"use strict";function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,c=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){c=!0,i=e}finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(c)throw i}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}var s=void 0!==/a/g.flags,a=function(e){var t=[];return e.forEach(function(e){return t.push(e)}),t},l=function(e){var t=[];return e.forEach(function(e,r){return t.push([r,e])}),t},c=Object.is?Object.is:r(7653),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},f=Number.isNaN?Number.isNaN:r(4133);function h(e){return e.call.bind(e)}var d=h(Object.prototype.hasOwnProperty),p=h(Object.prototype.propertyIsEnumerable),g=h(Object.prototype.toString),b=r(537).types,y=b.isAnyArrayBuffer,_=b.isArrayBufferView,m=b.isDate,w=b.isMap,v=b.isRegExp,S=b.isSet,E=b.isNativeError,A=b.isBoxedPrimitive,k=b.isNumberObject,I=b.isStringObject,O=b.isBooleanObject,R=b.isBigIntObject,T=b.isSymbolObject,x=b.isFloat32Array,P=b.isFloat64Array;function N(e){if(0===e.length||e.length>10)return!0;for(var t=0;t<e.length;t++){var r=e.charCodeAt(t);if(r<48||r>57)return!0}return 10===e.length&&e>=Math.pow(2,32)}function C(e){return Object.keys(e).filter(N).concat(u(e).filter(Object.prototype.propertyIsEnumerable.bind(e)))}function j(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function M(e,t,r,n){if(e===t)return 0!==e||!r||c(e,t);if(r){if("object"!==o(e))return"number"==typeof e&&f(e)&&f(t);if("object"!==o(t)||null===e||null===t)return!1;if(Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1}else{if(null===e||"object"!==o(e))return(null===t||"object"!==o(t))&&e==t;if(null===t||"object"!==o(t))return!1}var i,a,l,u,h=g(e);if(h!==g(t))return!1;if(Array.isArray(e)){if(e.length!==t.length)return!1;var d=C(e),p=C(t);return d.length===p.length&&D(e,t,r,n,1,d)}if("[object Object]"===h&&(!w(e)&&w(t)||!S(e)&&S(t)))return!1;if(m(e)){if(!m(t)||Date.prototype.getTime.call(e)!==Date.prototype.getTime.call(t))return!1}else if(v(e)){if(!v(t)||(l=e,u=t,!(s?l.source===u.source&&l.flags===u.flags:RegExp.prototype.toString.call(l)===RegExp.prototype.toString.call(u))))return!1}else if(E(e)||e instanceof Error){if(e.message!==t.message||e.name!==t.name)return!1}else{if(_(e)){if(r||!x(e)&&!P(e)){if(!function(e,t){return e.byteLength===t.byteLength&&0===j(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}(e,t))return!1}else if(!function(e,t){if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(e,t))return!1;var b=C(e),N=C(t);return b.length===N.length&&D(e,t,r,n,0,b)}if(S(e))return!(!S(t)||e.size!==t.size)&&D(e,t,r,n,2);if(w(e))return!(!w(t)||e.size!==t.size)&&D(e,t,r,n,3);if(y(e)){if(a=t,(i=e).byteLength!==a.byteLength||0!==j(new Uint8Array(i),new Uint8Array(a)))return!1}else if(A(e)&&!function(e,t){return k(e)?k(t)&&c(Number.prototype.valueOf.call(e),Number.prototype.valueOf.call(t)):I(e)?I(t)&&String.prototype.valueOf.call(e)===String.prototype.valueOf.call(t):O(e)?O(t)&&Boolean.prototype.valueOf.call(e)===Boolean.prototype.valueOf.call(t):R(e)?R(t)&&BigInt.prototype.valueOf.call(e)===BigInt.prototype.valueOf.call(t):T(t)&&Symbol.prototype.valueOf.call(e)===Symbol.prototype.valueOf.call(t)}(e,t))return!1}return D(e,t,r,n,0)}function L(e,t){return t.filter(function(t){return p(e,t)})}function D(e,t,r,i,s,c){if(5===arguments.length){c=Object.keys(e);var f=Object.keys(t);if(c.length!==f.length)return!1}for(var h=0;h<c.length;h++)if(!d(t,c[h]))return!1;if(r&&5===arguments.length){var g=u(e);if(0!==g.length){var b=0;for(h=0;h<g.length;h++){var y=g[h];if(p(e,y)){if(!p(t,y))return!1;c.push(y),b++}else if(p(t,y))return!1}var _=u(t);if(g.length!==_.length&&L(t,_).length!==b)return!1}else{var m=u(t);if(0!==m.length&&0!==L(t,m).length)return!1}}if(0===c.length&&(0===s||1===s&&0===e.length||0===e.size))return!0;if(void 0===i)i={val1:new Map,val2:new Map,position:0};else{var w=i.val1.get(e);if(void 0!==w){var v=i.val2.get(t);if(void 0!==v)return w===v}i.position++}i.val1.set(e,i.position),i.val2.set(t,i.position);var S=function(e,t,r,i,s,c){var u=0;if(2===c){if(!function(e,t,r,n){for(var i=null,s=a(e),l=0;l<s.length;l++){var c=s[l];if("object"===o(c)&&null!==c)null===i&&(i=new Set),i.add(c);else if(!t.has(c)){if(r)return!1;if(!B(e,t,c))return!1;null===i&&(i=new Set),i.add(c)}}if(null!==i){for(var u=a(t),f=0;f<u.length;f++){var h=u[f];if("object"===o(h)&&null!==h){if(!F(i,h,r,n))return!1}else if(!r&&!e.has(h)&&!F(i,h,r,n))return!1}return 0===i.size}return!0}(e,t,r,s))return!1}else if(3===c){if(!function(e,t,r,i){for(var s=null,a=l(e),c=0;c<a.length;c++){var u=n(a[c],2),f=u[0],h=u[1];if("object"===o(f)&&null!==f)null===s&&(s=new Set),s.add(f);else{var d=t.get(f);if(void 0===d&&!t.has(f)||!M(h,d,r,i)){if(r)return!1;if(!U(e,t,f,h,i))return!1;null===s&&(s=new Set),s.add(f)}}}if(null!==s){for(var p=l(t),g=0;g<p.length;g++){var b=n(p[g],2),y=b[0],_=b[1];if("object"===o(y)&&null!==y){if(!W(s,e,y,_,r,i))return!1}else if(!(r||e.has(y)&&M(e.get(y),_,!1,i)||W(s,e,y,_,!1,i)))return!1}return 0===s.size}return!0}(e,t,r,s))return!1}else if(1===c)for(;u<e.length;u++){if(!d(e,u)){if(d(t,u))return!1;for(var f=Object.keys(e);u<f.length;u++){var h=f[u];if(!d(t,h)||!M(e[h],t[h],r,s))return!1}return f.length===Object.keys(t).length}if(!d(t,u)||!M(e[u],t[u],r,s))return!1}for(u=0;u<i.length;u++){var p=i[u];if(!M(e[p],t[p],r,s))return!1}return!0}(e,t,r,c,i,s);return i.val1.delete(e),i.val2.delete(t),S}function F(e,t,r,n){for(var i=a(e),o=0;o<i.length;o++){var s=i[o];if(M(t,s,r,n))return e.delete(s),!0}return!1}function $(e){switch(o(e)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":e=+e;case"number":if(f(e))return!1}return!0}function B(e,t,r){var n=$(r);return null!=n?n:t.has(n)&&!e.has(n)}function U(e,t,r,n,i){var o=$(r);if(null!=o)return o;var s=t.get(o);return!(void 0===s&&!t.has(o)||!M(n,s,!1,i))&&!e.has(o)&&M(n,s,!1,i)}function W(e,t,r,n,i,o){for(var s=a(e),l=0;l<s.length;l++){var c=s[l];if(M(r,c,i,o)&&M(n,t.get(c),i,o))return e.delete(c),!0}return!1}e.exports={isDeepEqual:function(e,t){return M(e,t,!1)},isDeepStrictEqual:function(e,t){return M(e,t,!0)}}},2463:e=>{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){var i,o,s,a,l;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof l&&(l=0),l+1>(a=e).length||-1===a.indexOf(".",l)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},2464:(e,t,r)=>{"use strict";var n=r(8452),i=r(6642);e.exports=function(){var e=i();return n(Number,{isNaN:e},{isNaN:function(){return Number.isNaN!==e}}),e}},2535:(e,t,r)=>{const n=r(3132),{EventEmitter:i}=r(7007),{Buffer:o}=r(8287);class s extends i{constructor(){super(),this._array=new Array(20),this._i=0}write(e){return this._array[this._i++]=e,!0}concat(){let e=0;const t=new Array(this._array.length),r=this._array;let n,i=0;for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?t[n]=r[n].length:t[n]=o.byteLength(r[n]),e+=t[n];const s=o.allocUnsafe(e);for(n=0;n<r.length&&void 0!==r[n];n++)"string"!=typeof r[n]?(r[n].copy(s,i),i+=t[n]):(s.write(r[n],i),i+=t[n]);return s}destroy(e){e&&this.emit("error",e)}}e.exports=function(e,t){const r=new s;return n(e,r,t),r.concat()}},2634:()=>{},2635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BufferedDuplex=void 0,t.writev=o;const n=r(9584),i=r(8287);function o(e,t){const r=new Array(e.length);for(let t=0;t<e.length;t++)"string"==typeof e[t].chunk?r[t]=i.Buffer.from(e[t].chunk,"utf8"):r[t]=e[t].chunk;this._write(i.Buffer.concat(r),"binary",t)}class s extends n.Duplex{socket;proxy;isSocketOpen;writeQueue;constructor(e,t,r){super({objectMode:!0}),this.proxy=t,this.socket=r,this.writeQueue=[],e.objectMode||(this._writev=o.bind(this)),this.isSocketOpen=!1,this.proxy.on("data",e=>{!this.destroyed&&this.readable&&this.push(e)})}_read(e){this.proxy.read(e)}_write(e,t,r){this.isSocketOpen?this.writeToProxy(e,t,r):this.writeQueue.push({chunk:e,encoding:t,cb:r})}_final(e){this.writeQueue=[],this.proxy.end(e)}_destroy(e,t){this.writeQueue=[],this.proxy.destroy(),t(e)}socketReady(){this.emit("connect"),this.isSocketOpen=!0,this.processWriteQueue()}writeToProxy(e,t,r){!1===this.proxy.write(e,t)?this.proxy.once("drain",r):r()}processWriteQueue(){for(;this.writeQueue.length>0;){const{chunk:e,encoding:t,cb:r}=this.writeQueue.shift();this.writeToProxy(e,t,r)}}}t.BufferedDuplex=s},2639:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=class{aliasToTopic;max;length;constructor(e){this.aliasToTopic={},this.max=e}put(e,t){return!(0===t||t>this.max||(this.aliasToTopic[t]=e,this.length=Object.keys(this.aliasToTopic).length,0))}getTopicByAlias(e){return this.aliasToTopic[e]}clear(){this.aliasToTopic={}}}},2642:(e,t,r)=>{"use strict";var n=r(7720),i=Object.prototype.hasOwnProperty,o=Array.isArray,s={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:n.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},a=function(e){return e.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})},l=function(e,t,r){if(e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1)return e.split(",");if(t.throwOnLimitExceeded&&r>=t.arrayLimit)throw new RangeError("Array limit exceeded. Only "+t.arrayLimit+" element"+(1===t.arrayLimit?"":"s")+" allowed in an array.");return e},c=function(e,t,r,o){if(e){var s=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,c=r.depth>0&&/(\[[^[\]]*])/.exec(s),u=c?s.slice(0,c.index):s,f=[];if(u){if(!r.plainObjects&&i.call(Object.prototype,u)&&!r.allowPrototypes)return;f.push(u)}for(var h=0;r.depth>0&&null!==(c=a.exec(s))&&h<r.depth;){if(h+=1,!r.plainObjects&&i.call(Object.prototype,c[1].slice(1,-1))&&!r.allowPrototypes)return;f.push(c[1])}if(c){if(!0===r.strictDepth)throw new RangeError("Input depth exceeded depth option of "+r.depth+" and strictDepth is true");f.push("["+s.slice(c.index)+"]")}return function(e,t,r,i){var o=0;if(e.length>0&&"[]"===e[e.length-1]){var s=e.slice(0,-1).join("");o=Array.isArray(t)&&t[s]?t[s].length:0}for(var a=i?t:l(t,r,o),c=e.length-1;c>=0;--c){var u,f=e[c];if("[]"===f&&r.parseArrays)u=r.allowEmptyArrays&&(""===a||r.strictNullHandling&&null===a)?[]:n.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var h="["===f.charAt(0)&&"]"===f.charAt(f.length-1)?f.slice(1,-1):f,d=r.decodeDotInKeys?h.replace(/%2E/g,"."):h,p=parseInt(d,10);r.parseArrays||""!==d?!isNaN(p)&&f!==d&&String(p)===d&&p>=0&&r.parseArrays&&p<=r.arrayLimit?(u=[])[p]=a:"__proto__"!==d&&(u[d]=a):u={0:a}}a=u}return a}(f,t,r,o)}};e.exports=function(e,t){var r=function(e){if(!e)return s;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw new TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(void 0!==e.throwOnLimitExceeded&&"boolean"!=typeof e.throwOnLimitExceeded)throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var t=void 0===e.charset?s.charset:e.charset,r=void 0===e.duplicates?s.duplicates:e.duplicates;if("combine"!==r&&"first"!==r&&"last"!==r)throw new TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||s.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:s.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:s.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:s.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:s.arrayLimit,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:s.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:s.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:s.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:s.decoder,delimiter:"string"==typeof e.delimiter||n.isRegExp(e.delimiter)?e.delimiter:s.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:s.depth,duplicates:r,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:s.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:s.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:s.plainObjects,strictDepth:"boolean"==typeof e.strictDepth?!!e.strictDepth:s.strictDepth,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:s.strictNullHandling,throwOnLimitExceeded:"boolean"==typeof e.throwOnLimitExceeded&&e.throwOnLimitExceeded}}(t);if(""===e||null==e)return r.plainObjects?{__proto__:null}:{};for(var u="string"==typeof e?function(e,t){var r={__proto__:null},c=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;c=c.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,f=c.split(t.delimiter,t.throwOnLimitExceeded?u+1:u);if(t.throwOnLimitExceeded&&f.length>u)throw new RangeError("Parameter limit exceeded. Only "+u+" parameter"+(1===u?"":"s")+" allowed.");var h,d=-1,p=t.charset;if(t.charsetSentinel)for(h=0;h<f.length;++h)0===f[h].indexOf("utf8=")&&("utf8=%E2%9C%93"===f[h]?p="utf-8":"utf8=%26%2310003%3B"===f[h]&&(p="iso-8859-1"),d=h,h=f.length);for(h=0;h<f.length;++h)if(h!==d){var g,b,y=f[h],_=y.indexOf("]="),m=-1===_?y.indexOf("="):_+1;-1===m?(g=t.decoder(y,s.decoder,p,"key"),b=t.strictNullHandling?null:""):(g=t.decoder(y.slice(0,m),s.decoder,p,"key"),b=n.maybeMap(l(y.slice(m+1),t,o(r[g])?r[g].length:0),function(e){return t.decoder(e,s.decoder,p,"value")})),b&&t.interpretNumericEntities&&"iso-8859-1"===p&&(b=a(String(b))),y.indexOf("[]=")>-1&&(b=o(b)?[b]:b);var w=i.call(r,g);w&&"combine"===t.duplicates?r[g]=n.combine(r[g],b):w&&"last"!==t.duplicates||(r[g]=b)}return r}(e,r):e,f=r.plainObjects?{__proto__:null}:{},h=Object.keys(u),d=0;d<h.length;++d){var p=h[d],g=c(p,u[p],r,"string"==typeof e);f=n.merge(f,g,r)}return!0===r.allowSparse?f:n.compact(f)}},2648:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=r(2768);e.exports=c;const a=r(9214),l=r(7602);s(c.prototype,a.prototype),s(c,a);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function h(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5224)),f(e,"body")}},2682:(e,t,r)=>{"use strict";var n=r(9600),i=Object.prototype.toString,o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){if(!n(t))throw new TypeError("iterator must be a function");var s,a;arguments.length>=3&&(s=r),a=e,"[object Array]"===i.call(a)?function(e,t,r){for(var n=0,i=e.length;n<i;n++)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,r){for(var n=0,i=e.length;n<i;n++)null==r?t(e.charAt(n),n,e):t.call(r,e.charAt(n),n,e)}(e,t,s):function(e,t,r){for(var n in e)o.call(e,n)&&(null==r?t(e[n],n,e):t.call(r,e[n],n,e))}(e,t,s)}},2729:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:p,Symbol:g}=r(4469);e.exports=G,G.ReadableState=H;const{EventEmitter:b}=r(7007),{Stream:y,prependListener:_}=r(4474),{Buffer:m}=r(8287),{addAbortSignal:w}=r(982),v=r(577);let S=r(7797).debuglog("stream",e=>{S=e});const E=r(3158),A=r(1787),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(2100),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:x,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:C}=r(2074),{validateObject:j}=r(1580),M=g("kPaused"),{StringDecoder:L}=r(7487),D=r(1401);u(G.prototype,y.prototype),u(G,y);const F=()=>{},{errorOrDestroy:$}=A,B=1,U=16,W=32,q=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,e&&!1===e.emitClose&&(this.state&=~q),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(7323);this._readableState=new H(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const i=e._readableState;let o;if(0===(i.state&B)&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=m.from(t,r).toString(i.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new R("chunk",["string","Buffer","Uint8Array"],t))),o)$(e,o);else if(null===t)i.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,i);else if(0!==(i.state&B)||t&&t.length>0)if(n)if(4&i.state)$(e,new N);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)$(e,new P);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else n||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),64&t.state&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[M]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function oe(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=F;function i(t){this===e?(n(),n=F):n=t}e.on("readable",i);const o=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=F});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(i)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),o()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[d]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new C,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[M]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new x("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,i=!!(64&t.state);if(S("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,S("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,S("reading, ended or constructing",i);else if(i){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){$(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),S("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===n.stdout||e===n.stderr?g:s;function s(){S("onend"),e.end()}let a;i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",function t(n,o){S("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,S("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(S("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(S("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?$(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",p),g()}function p(){S("onfinish"),e.removeListener("close",d),g()}function g(){S("unpipe"),r.unpipe(e)}return r.on("data",u),_(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():i.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=i(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){const r=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S("on readable",i.length,i.reading),i.length?Y(this):i.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[M]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{$(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return oe(this)},G.prototype.iterator=function(e){return void 0!==e&&j(e,"options"),oe(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[M]},set(e){this[M]=!!e}}}),G._fromList=se,G.from=function(e,t){return D(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},2732:e=>{"use strict";function t(e,t){let r=0,n=0,i=-1,o=0;for(;n<t.length;)if(r<e.length&&"*"===e[r])i=r++,o=n;else if(r<e.length&&e[r]===t[n])r++,n++;else{if(-1===i)return!1;r=i+1,n=++o}for(;r<e.length&&"*"===e[r];)r++;return r===e.length}e.exports={matches:t,isSelection:function(e){const t=e=>"string"==typeof e&&e.length>0;return Array.isArray(e)?e.length>0&&e.every(t):t(e)},selects:function(e,r){return Array.isArray(e)?e.some(e=>t(e,r)):t(e,r)},selectsAll:function(e){return Array.isArray(e)?e.includes("*"):"*"===e}}},2768:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:t,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},2793:function(e,t,r){"use strict";var n=r(2045),i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.connectAsync=function(e,t,r=!0){return new Promise((n,i)=>{const o=f(e,t),s={connect:e=>{a(),n(o)},end:()=>{a(),n(o)},error:e=>{a(),o.end(),i(e)}};function a(){Object.keys(s).forEach(e=>{o.off(e,s[e])})}!1===r&&(s.close=()=>{s.error(new Error("Couldn't connect to server"))}),Object.keys(s).forEach(e=>{o.on(e,s[e])})})};const o=i(r(7833)),s=i(r(8835)),a=i(r(9777)),l=i(r(6887));"function"!=typeof n?.nextTick&&(n.nextTick=setImmediate);const c=(0,o.default)("mqttjs");let u=null;function f(e,t){if(c("connecting to an MQTT broker..."),"object"!=typeof e||t||(t=e,e=""),t=t||{},e&&"string"==typeof e){const r=s.default.parse(e,!0),n={},i=!r.protocol&&!r.hostname&&r.path?.startsWith("/")&&(l.default||t.forceNativeWebSocket);if(null!=r.port&&(n.port=Number(r.port)),n.host=r.hostname,n.query=r.query,n.auth=r.auth,n.protocol=r.protocol,n.path=r.path,!(t={...n,...t}).protocol&&!i)throw new Error("Missing protocol");t.protocol=(t.protocol||("undefined"!=typeof location?"https:"===location.protocol?"wss":"ws":"undefined"!=typeof document&&"https:"===new URL(document.URL).protocol?"wss":"ws")).replace(/:$/,"")}if(t.unixSocket=t.unixSocket||t.protocol?.includes("+unix"),t.unixSocket?t.protocol=t.protocol.replace("+unix",""):t.protocol?.startsWith("ws")||t.protocol?.startsWith("wx")||delete t.path,function(e){let t;if(e.auth)if(t=e.auth.match(/^(.+):(.+)$/),t){const[,r,n]=t;e.username=r,e.password=n}else e.username=e.auth}(t),t.query&&"string"==typeof t.query.clientId&&(t.clientId=t.query.clientId),l.default||t.unixSocket?t.socksProxy=void 0:void 0===t.socksProxy&&void 0!==n&&(t.socksProxy=n.env.MQTTJS_SOCKS_PROXY),t.cert&&t.key){if(!t.protocol)throw new Error("Missing secure protocol key");if(-1===["mqtts","wss","wxs","alis"].indexOf(t.protocol))switch(t.protocol){case"mqtt":t.protocol="mqtts";break;case"ws":t.protocol="wss";break;case"wx":t.protocol="wxs";break;case"ali":t.protocol="alis";break;default:throw new Error(`Unknown protocol for secure connection: "${t.protocol}"!`)}}if(u||(u={},l.default||t.forceNativeWebSocket?(u.ws=r(8203).browserStreamBuilder,u.wss=r(8203).browserStreamBuilder,u.wx=r(5670).A,u.wxs=r(5670).A,u.ali=r(397).A,u.alis=r(397).A):(u.ws=r(8203).streamBuilder,u.wss=r(8203).streamBuilder,u.mqtt=r(778).default,u.tcp=r(778).default,u.ssl=r(3936).default,u.tls=u.ssl,u.mqtts=r(3936).default)),!u[t.protocol]){const e=-1!==["mqtts","wss"].indexOf(t.protocol);t.protocol=["mqtt","mqtts","ws","wss","wx","wxs","ali","alis"].filter((t,r)=>(!e||r%2!=0)&&"function"==typeof u[t])[0]}if(!1===t.clean&&!t.clientId)throw new Error("Missing clientId for unclean clients");t.protocol&&(t.defaultProtocol=t.protocol);const i=new a.default(function(e){return t.servers&&(e._reconnectCount&&e._reconnectCount!==t.servers.length||(e._reconnectCount=0),t.host=t.servers[e._reconnectCount].host,t.port=t.servers[e._reconnectCount].port,t.protocol=t.servers[e._reconnectCount].protocol?t.servers[e._reconnectCount].protocol:t.defaultProtocol,t.hostname=t.host,e._reconnectCount++),c("calling streambuilder for",t.protocol),u[t.protocol](e,t)},t);return i.on("error",()=>{}),i}t.default=f},2858:e=>{"use strict";e.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){const n=t.shift();return"f"===r?n.toFixed(6):"j"===r?JSON.stringify(n):"s"===r&&"object"==typeof n?`${n.constructor!==Object?n.constructor.name:""} {}`.trim():n.toString()}),inspect(e){switch(typeof e){case"string":if(e.includes("'")){if(!e.includes('"'))return`"${e}"`;if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}}}},2860:e=>{"use strict";e.exports={version:"5.16.0"}},2861:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},3003:e=>{"use strict";e.exports=function(e){return e!=e}},3079:(e,t,r)=>{const n=r(9868),{EventEmitter:i}=r(7007),o=r(576),s=r(5399),a=r(7833)("mqtt-packet:parser");class l extends i{constructor(){super(),this.parser=this.constructor.parser}static parser(e){return this instanceof l?(this.settings=e||{},this._states=["_parseHeader","_parseLength","_parsePayload","_newPacket"],this._resetState(),this):(new l).parser(e)}_resetState(){a("_resetState: resetting packet, error, _list, and _stateCounter"),this.packet=new o,this.error=null,this._list=n(),this._stateCounter=0}parse(e){for(this.error&&this._resetState(),this._list.append(e),a("parse: current state: %s",this._states[this._stateCounter]);(-1!==this.packet.length||this._list.length>0)&&this[this._states[this._stateCounter]]()&&!this.error;)this._stateCounter++,a("parse: state complete. _stateCounter is now: %d",this._stateCounter),a("parse: packet.length: %d, buffer list length: %d",this.packet.length,this._list.length),this._stateCounter>=this._states.length&&(this._stateCounter=0);return a("parse: exited while loop. packet: %d, buffer list length: %d",this.packet.length,this._list.length),this._list.length}_parseHeader(){const e=this._list.readUInt8(0),t=e>>s.CMD_SHIFT;this.packet.cmd=s.types[t];const r=15&e,n=s.requiredHeaderFlags[t];return null!=n&&r!==n?this._emitError(new Error(s.requiredHeaderFlagsErrors[t])):(this.packet.retain=0!==(e&s.RETAIN_MASK),this.packet.qos=e>>s.QOS_SHIFT&s.QOS_MASK,this.packet.qos>2?this._emitError(new Error("Packet must not have both QoS bits set to 1")):(this.packet.dup=0!==(e&s.DUP_MASK),a("_parseHeader: packet: %o",this.packet),this._list.consume(1),!0))}_parseLength(){const e=this._parseVarByteNum(!0);return e&&(this.packet.length=e.value,this._list.consume(e.bytes)),a("_parseLength %d",e.value),!!e}_parsePayload(){a("_parsePayload: payload %O",this._list);let e=!1;if(0===this.packet.length||this._list.length>=this.packet.length){switch(this._pos=0,this.packet.cmd){case"connect":this._parseConnect();break;case"connack":this._parseConnack();break;case"publish":this._parsePublish();break;case"puback":case"pubrec":case"pubrel":case"pubcomp":this._parseConfirmation();break;case"subscribe":this._parseSubscribe();break;case"suback":this._parseSuback();break;case"unsubscribe":this._parseUnsubscribe();break;case"unsuback":this._parseUnsuback();break;case"pingreq":case"pingresp":break;case"disconnect":this._parseDisconnect();break;case"auth":this._parseAuth();break;default:this._emitError(new Error("Not supported"))}e=!0}return a("_parsePayload complete result: %s",e),e}_parseConnect(){let e,t,r,n;a("_parseConnect");const i={},o=this.packet,l=this._parseString();if(null===l)return this._emitError(new Error("Cannot parse protocolId"));if("MQTT"!==l&&"MQIsdp"!==l)return this._emitError(new Error("Invalid protocolId"));if(o.protocolId=l,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(o.protocolVersion=this._list.readUInt8(this._pos),o.protocolVersion>=128&&(o.bridgeMode=!0,o.protocolVersion=o.protocolVersion-128),3!==o.protocolVersion&&4!==o.protocolVersion&&5!==o.protocolVersion)return this._emitError(new Error("Invalid protocol version"));if(this._pos++,this._pos>=this._list.length)return this._emitError(new Error("Packet too short"));if(1&this._list.readUInt8(this._pos))return this._emitError(new Error("Connect flag bit 0 must be 0, but got 1"));i.username=this._list.readUInt8(this._pos)&s.USERNAME_MASK,i.password=this._list.readUInt8(this._pos)&s.PASSWORD_MASK,i.will=this._list.readUInt8(this._pos)&s.WILL_FLAG_MASK;const c=!!(this._list.readUInt8(this._pos)&s.WILL_RETAIN_MASK),u=(this._list.readUInt8(this._pos)&s.WILL_QOS_MASK)>>s.WILL_QOS_SHIFT;if(i.will)o.will={},o.will.retain=c,o.will.qos=u;else{if(c)return this._emitError(new Error("Will Retain Flag must be set to zero when Will Flag is set to 0"));if(u)return this._emitError(new Error("Will QoS must be set to zero when Will Flag is set to 0"))}if(o.clean=0!==(this._list.readUInt8(this._pos)&s.CLEAN_SESSION_MASK),this._pos++,o.keepalive=this._parseNum(),-1===o.keepalive)return this._emitError(new Error("Packet too short"));if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.properties=e)}const f=this._parseString();if(null===f)return this._emitError(new Error("Packet too short"));if(o.clientId=f,a("_parseConnect: packet.clientId: %s",o.clientId),i.will){if(5===o.protocolVersion){const e=this._parseProperties();Object.getOwnPropertyNames(e).length&&(o.will.properties=e)}if(e=this._parseString(),null===e)return this._emitError(new Error("Cannot parse will topic"));if(o.will.topic=e,a("_parseConnect: packet.will.topic: %s",o.will.topic),t=this._parseBuffer(),null===t)return this._emitError(new Error("Cannot parse will payload"));o.will.payload=t,a("_parseConnect: packet.will.paylaod: %s",o.will.payload)}if(i.username){if(n=this._parseString(),null===n)return this._emitError(new Error("Cannot parse username"));o.username=n,a("_parseConnect: packet.username: %s",o.username)}if(i.password){if(r=this._parseBuffer(),null===r)return this._emitError(new Error("Cannot parse password"));o.password=r}return this.settings=o,a("_parseConnect: complete"),o}_parseConnack(){a("_parseConnack");const e=this.packet;if(this._list.length<1)return null;const t=this._list.readUInt8(this._pos++);if(t>1)return this._emitError(new Error("Invalid connack flags, bits 7-1 must be set to 0"));if(e.sessionPresent=!!(t&s.SESSIONPRESENT_MASK),5===this.settings.protocolVersion)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(-1===e.returnCode||-1===e.reasonCode)return this._emitError(new Error("Cannot parse return code"));if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}a("_parseConnack: complete")}_parsePublish(){a("_parsePublish");const e=this.packet;if(e.topic=this._parseString(),null===e.topic)return this._emitError(new Error("Cannot parse topic"));if(!(e.qos>0)||this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}e.payload=this._list.slice(this._pos,e.length),a("_parsePublish: payload from buffer list: %o",e.payload)}}_parseSubscribe(){a("_parseSubscribe");const e=this.packet;let t,r,n,i,o,l,c;if(e.subscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed subscribe, no payload specified"));for(;this._pos<e.length;){if(t=this._parseString(),null===t)return this._emitError(new Error("Cannot parse topic"));if(this._pos>=e.length)return this._emitError(new Error("Malformed Subscribe Payload"));if(r=this._parseByte(),5===this.settings.protocolVersion){if(192&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-6 must be 0"))}else if(252&r)return this._emitError(new Error("Invalid subscribe topic flag bits, bits 7-2 must be 0"));if(n=r&s.SUBSCRIBE_OPTIONS_QOS_MASK,n>2)return this._emitError(new Error("Invalid subscribe QoS, must be <= 2"));if(l=0!==(r>>s.SUBSCRIBE_OPTIONS_NL_SHIFT&s.SUBSCRIBE_OPTIONS_NL_MASK),o=0!==(r>>s.SUBSCRIBE_OPTIONS_RAP_SHIFT&s.SUBSCRIBE_OPTIONS_RAP_MASK),i=r>>s.SUBSCRIBE_OPTIONS_RH_SHIFT&s.SUBSCRIBE_OPTIONS_RH_MASK,i>2)return this._emitError(new Error("Invalid retain handling, must be <= 2"));c={topic:t,qos:n},5===this.settings.protocolVersion?(c.nl=l,c.rap=o,c.rh=i):this.settings.bridgeMode&&(c.rh=0,c.rap=!0,c.nl=!0),a("_parseSubscribe: push subscription `%s` to subscription",c),e.subscriptions.push(c)}}}_parseSuback(){a("_parseSuback");const e=this.packet;if(this.packet.granted=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed suback, no payload specified"));for(;this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(5===this.settings.protocolVersion){if(!s.MQTT5_SUBACK_CODES[e])return this._emitError(new Error("Invalid suback code"))}else if(e>2&&128!==e)return this._emitError(new Error("Invalid suback QoS, must be 0, 1, 2 or 128"));this.packet.granted.push(e)}}}_parseUnsubscribe(){a("_parseUnsubscribe");const e=this.packet;if(e.unsubscriptions=[],this._parseMessageId()){if(5===this.settings.protocolVersion){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}if(e.length<=0)return this._emitError(new Error("Malformed unsubscribe, no payload specified"));for(;this._pos<e.length;){const t=this._parseString();if(null===t)return this._emitError(new Error("Cannot parse topic"));a("_parseUnsubscribe: push topic `%s` to unsubscriptions",t),e.unsubscriptions.push(t)}}}_parseUnsuback(){a("_parseUnsuback");const e=this.packet;if(!this._parseMessageId())return this._emitError(new Error("Cannot parse messageId"));if((3===this.settings.protocolVersion||4===this.settings.protocolVersion)&&2!==e.length)return this._emitError(new Error("Malformed unsuback, payload length must be 2"));if(e.length<=0)return this._emitError(new Error("Malformed unsuback, no payload specified"));if(5===this.settings.protocolVersion){const t=this._parseProperties();for(Object.getOwnPropertyNames(t).length&&(e.properties=t),e.granted=[];this._pos<this.packet.length;){const e=this._list.readUInt8(this._pos++);if(!s.MQTT5_UNSUBACK_CODES[e])return this._emitError(new Error("Invalid unsuback code"));this.packet.granted.push(e)}}}_parseConfirmation(){a("_parseConfirmation: packet.cmd: `%s`",this.packet.cmd);const e=this.packet;if(this._parseMessageId(),5===this.settings.protocolVersion){if(e.length>2){switch(e.reasonCode=this._parseByte(),this.packet.cmd){case"puback":case"pubrec":if(!s.MQTT5_PUBACK_PUBREC_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"));break;case"pubrel":case"pubcomp":if(!s.MQTT5_PUBREL_PUBCOMP_CODES[e.reasonCode])return this._emitError(new Error("Invalid "+this.packet.cmd+" reason code"))}a("_parseConfirmation: packet.reasonCode `%d`",e.reasonCode)}else e.reasonCode=0;if(e.length>3){const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}}return!0}_parseDisconnect(){const e=this.packet;if(a("_parseDisconnect"),5===this.settings.protocolVersion){this._list.length>0?(e.reasonCode=this._parseByte(),s.MQTT5_DISCONNECT_CODES[e.reasonCode]||this._emitError(new Error("Invalid disconnect reason code"))):e.reasonCode=0;const t=this._parseProperties();Object.getOwnPropertyNames(t).length&&(e.properties=t)}return a("_parseDisconnect result: true"),!0}_parseAuth(){a("_parseAuth");const e=this.packet;if(5!==this.settings.protocolVersion)return this._emitError(new Error("Not supported auth packet for this version MQTT"));if(e.reasonCode=this._parseByte(),!s.MQTT5_AUTH_CODES[e.reasonCode])return this._emitError(new Error("Invalid auth reason code"));const t=this._parseProperties();return Object.getOwnPropertyNames(t).length&&(e.properties=t),a("_parseAuth: result: true"),!0}_parseMessageId(){const e=this.packet;return e.messageId=this._parseNum(),null===e.messageId?(this._emitError(new Error("Cannot parse messageId")),!1):(a("_parseMessageId: packet.messageId %d",e.messageId),!0)}_parseString(e){const t=this._parseNum(),r=t+this._pos;if(-1===t||r>this._list.length||r>this.packet.length)return null;const n=this._list.toString("utf8",this._pos,r);return this._pos+=t,a("_parseString: result: %s",n),n}_parseStringPair(){return a("_parseStringPair"),{name:this._parseString(),value:this._parseString()}}_parseBuffer(){const e=this._parseNum(),t=e+this._pos;if(-1===e||t>this._list.length||t>this.packet.length)return null;const r=this._list.slice(this._pos,t);return this._pos+=e,a("_parseBuffer: result: %o",r),r}_parseNum(){if(this._list.length-this._pos<2)return-1;const e=this._list.readUInt16BE(this._pos);return this._pos+=2,a("_parseNum: result: %s",e),e}_parse4ByteNum(){if(this._list.length-this._pos<4)return-1;const e=this._list.readUInt32BE(this._pos);return this._pos+=4,a("_parse4ByteNum: result: %s",e),e}_parseVarByteNum(e){a("_parseVarByteNum");let t,r=0,n=1,i=0,o=!1;const l=this._pos?this._pos:0;for(;r<4&&l+r<this._list.length;){if(t=this._list.readUInt8(l+r++),i+=n*(t&s.VARBYTEINT_MASK),n*=128,0===(t&s.VARBYTEINT_FIN_MASK)){o=!0;break}if(this._list.length<=r)break}return!o&&4===r&&this._list.length>=r&&this._emitError(new Error("Invalid variable byte integer")),l&&(this._pos+=r),o=!!o&&(e?{bytes:r,value:i}:i),a("_parseVarByteNum: result: %o",o),o}_parseByte(){let e;return this._pos<this._list.length&&(e=this._list.readUInt8(this._pos),this._pos++),a("_parseByte: result: %o",e),e}_parseByType(e){switch(a("_parseByType: type: %s",e),e){case"byte":return 0!==this._parseByte();case"int8":return this._parseByte();case"int16":return this._parseNum();case"int32":return this._parse4ByteNum();case"var":return this._parseVarByteNum();case"string":return this._parseString();case"pair":return this._parseStringPair();case"binary":return this._parseBuffer()}}_parseProperties(){a("_parseProperties");const e=this._parseVarByteNum(),t=this._pos+e,r={};for(;this._pos<t;){const e=this._parseByte();if(!e)return this._emitError(new Error("Cannot parse property code type")),!1;const t=s.propertiesCodes[e];if(!t)return this._emitError(new Error("Unknown property")),!1;if("userProperties"===t){r[t]||(r[t]=Object.create(null));const e=this._parseByType(s.propertiesTypes[t]);if(r[t][e.name])if(Array.isArray(r[t][e.name]))r[t][e.name].push(e.value);else{const n=r[t][e.name];r[t][e.name]=[n],r[t][e.name].push(e.value)}else r[t][e.name]=e.value;continue}r[t]?(Array.isArray(r[t])||(r[t]=[r[t]]),r[t].push(this._parseByType(s.propertiesTypes[t]))):r[t]=this._parseByType(s.propertiesTypes[t])}return r}_newPacket(){return a("_newPacket"),this.packet&&(this._list.consume(this.packet.length),a("_newPacket: parser emit packet: packet.cmd: %s, packet.payload: %s, packet.length: %d",this.packet.cmd,this.packet.payload,this.packet.length),this.emit("packet",this.packet)),a("_newPacket: new packet"),this.packet=new o,this._pos=0,!0}_emitError(e){a("_emitError",e),this.error=e,this.emit("error",e)}}e.exports=l},3093:(e,t,r)=>{"use strict";var n=r(4459);e.exports=function(e){return n(e)||0===e?e:e<0?-1:1}},3126:(e,t,r)=>{"use strict";var n=r(6743),i=r(9675),o=r(76),s=r(3144);e.exports=function(e){if(e.length<1||"function"!=typeof e[0])throw new i("a function is required");return s(n,o,e)}},3132:(e,t,r)=>{const n=r(5399),{Buffer:i}=r(8287),o=i.allocUnsafe(0),s=i.from([0]),a=r(6172),l=r(3225).nextTick,c=r(7833)("mqtt-packet:writeToStream"),u=a.cache,f=a.generateNumber,h=a.generateCache,d=a.genBufVariableByteInt,p=a.generate4ByteBuffer;let g=E,b=!0;function y(e,t,r){switch(c("generate called"),t.cork&&(t.cork(),l(_,t)),b&&(b=!1,h()),c("generate: packet.cmd: %s",e.cmd),e.cmd){case"connect":return function(e,t){const r=e||{},o=r.protocolId||"MQTT";let s=r.protocolVersion||4;const a=r.will;let l=r.clean;const c=r.keepalive||0,u=r.clientId||"",f=r.username,h=r.password,d=r.properties;void 0===l&&(l=!0);let p,b,y=0;if(!o||"string"!=typeof o&&!i.isBuffer(o))return t.destroy(new Error("Invalid protocolId")),!1;if(y+=o.length+2,3!==s&&4!==s&&5!==s)return t.destroy(new Error("Invalid protocol version")),!1;if(y+=1,("string"==typeof u||i.isBuffer(u))&&(u||s>=4)&&(u||l))y+=i.byteLength(u)+2;else{if(s<4)return t.destroy(new Error("clientId must be supplied before 3.1.1")),!1;if(1*l==0)return t.destroy(new Error("clientId must be given if cleanSession set to 0")),!1}if("number"!=typeof c||c<0||c>65535||c%1!=0)return t.destroy(new Error("Invalid keepalive")),!1;if(y+=2,y+=1,5===s){if(p=I(t,d),!p)return!1;y+=p.length}if(a){if("object"!=typeof a)return t.destroy(new Error("Invalid will")),!1;if(!a.topic||"string"!=typeof a.topic)return t.destroy(new Error("Invalid will topic")),!1;if(y+=i.byteLength(a.topic)+2,y+=2,a.payload){if(!(a.payload.length>=0))return t.destroy(new Error("Invalid will payload")),!1;"string"==typeof a.payload?y+=i.byteLength(a.payload):y+=a.payload.length}if(b={},5===s){if(b=I(t,a.properties),!b)return!1;y+=b.length}}let _=!1;if(null!=f){if(!P(f))return t.destroy(new Error("Invalid username")),!1;_=!0,y+=i.byteLength(f)+2}if(null!=h){if(!_)return t.destroy(new Error("Username is required to use password")),!1;if(!P(h))return t.destroy(new Error("Invalid password")),!1;y+=x(h)+2}t.write(n.CONNECT_HEADER),w(t,y),k(t,o),r.bridgeMode&&(s+=128),t.write(131===s?n.VERSION131:132===s?n.VERSION132:4===s?n.VERSION4:5===s?n.VERSION5:n.VERSION3);let m=0;return m|=null!=f?n.USERNAME_MASK:0,m|=null!=h?n.PASSWORD_MASK:0,m|=a&&a.retain?n.WILL_RETAIN_MASK:0,m|=a&&a.qos?a.qos<<n.WILL_QOS_SHIFT:0,m|=a?n.WILL_FLAG_MASK:0,m|=l?n.CLEAN_SESSION_MASK:0,t.write(i.from([m])),g(t,c),5===s&&p.write(),k(t,u),a&&(5===s&&b.write(),v(t,a.topic),k(t,a.payload)),null!=f&&k(t,f),null!=h&&k(t,h),!0}(e,t);case"connack":return function(e,t,r){const o=r?r.protocolVersion:4,a=e||{},l=5===o?a.reasonCode:a.returnCode,c=a.properties;let u=2;if("number"!=typeof l)return t.destroy(new Error("Invalid return code")),!1;let f=null;if(5===o){if(f=I(t,c),!f)return!1;u+=f.length}return t.write(n.CONNACK_HEADER),w(t,u),t.write(a.sessionPresent?n.SESSIONPRESENT_HEADER:s),t.write(i.from([l])),null!=f&&f.write(),!0}(e,t,r);case"publish":return function(e,t,r){c("publish: packet: %o",e);const s=r?r.protocolVersion:4,a=e||{},l=a.qos||0,u=a.retain?n.RETAIN_MASK:0,f=a.topic,h=a.payload||o,d=a.messageId,p=a.properties;let b=0;if("string"==typeof f)b+=i.byteLength(f)+2;else{if(!i.isBuffer(f))return t.destroy(new Error("Invalid topic")),!1;b+=f.length+2}if(i.isBuffer(h)?b+=h.length:b+=i.byteLength(h),l&&"number"!=typeof d)return t.destroy(new Error("Invalid messageId")),!1;l&&(b+=2);let y=null;if(5===s){if(y=I(t,p),!y)return!1;b+=y.length}return t.write(n.PUBLISH_HEADER[l][a.dup?1:0][u?1:0]),w(t,b),g(t,x(f)),t.write(f),l>0&&g(t,d),null!=y&&y.write(),c("publish: payload: %o",h),t.write(h)}(e,t,r);case"puback":case"pubrec":case"pubrel":case"pubcomp":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.cmd||"puback",l=s.messageId,c=s.dup&&"pubrel"===a?n.DUP_MASK:0;let u=0;const f=s.reasonCode,h=s.properties;let d=5===o?3:2;if("pubrel"===a&&(u=1),"number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;let p=null;if(5===o&&"object"==typeof h){if(p=O(t,h,r,d),!p)return!1;d+=p.length}return t.write(n.ACKS[a][u][c][0]),3===d&&(d+=0!==f?1:-1),w(t,d),g(t,l),5===o&&2!==d&&t.write(i.from([f])),null!==p?p.write():4===d&&t.write(i.from([0])),!0}(e,t,r);case"subscribe":return function(e,t,r){c("subscribe: packet: ");const o=r?r.protocolVersion:4,s=e||{},a=s.dup?n.DUP_MASK:0,l=s.messageId,u=s.subscriptions,f=s.properties;let h=0;if("number"!=typeof l)return t.destroy(new Error("Invalid messageId")),!1;h+=2;let d=null;if(5===o){if(d=I(t,f),!d)return!1;h+=d.length}if("object"!=typeof u||!u.length)return t.destroy(new Error("Invalid subscriptions")),!1;for(let e=0;e<u.length;e+=1){const r=u[e].topic,n=u[e].qos;if("string"!=typeof r)return t.destroy(new Error("Invalid subscriptions - invalid topic")),!1;if("number"!=typeof n)return t.destroy(new Error("Invalid subscriptions - invalid qos")),!1;if(5===o){if("boolean"!=typeof(u[e].nl||!1))return t.destroy(new Error("Invalid subscriptions - invalid No Local")),!1;if("boolean"!=typeof(u[e].rap||!1))return t.destroy(new Error("Invalid subscriptions - invalid Retain as Published")),!1;const r=u[e].rh||0;if("number"!=typeof r||r>2)return t.destroy(new Error("Invalid subscriptions - invalid Retain Handling")),!1}h+=i.byteLength(r)+2+1}c("subscribe: writing to stream: %o",n.SUBSCRIBE_HEADER),t.write(n.SUBSCRIBE_HEADER[1][a?1:0][0]),w(t,h),g(t,l),null!==d&&d.write();let p=!0;for(const e of u){const r=e.topic,s=e.qos,a=+e.nl,l=+e.rap,c=e.rh;let u;v(t,r),u=n.SUBSCRIBE_OPTIONS_QOS[s],5===o&&(u|=a?n.SUBSCRIBE_OPTIONS_NL:0,u|=l?n.SUBSCRIBE_OPTIONS_RAP:0,u|=c?n.SUBSCRIBE_OPTIONS_RH[c]:0),p=t.write(i.from([u]))}return p}(e,t,r);case"suback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.granted,c=s.properties;let u=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(u+=2,"object"!=typeof l||!l.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<l.length;e+=1){if("number"!=typeof l[e])return t.destroy(new Error("Invalid qos vector")),!1;u+=1}let f=null;if(5===o){if(f=O(t,c,r,u),!f)return!1;u+=f.length}return t.write(n.SUBACK_HEADER),w(t,u),g(t,a),null!==f&&f.write(),t.write(i.from(l))}(e,t,r);case"unsubscribe":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.unsubscriptions,u=s.properties;let f=0;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(f+=2,"object"!=typeof c||!c.length)return t.destroy(new Error("Invalid unsubscriptions")),!1;for(let e=0;e<c.length;e+=1){if("string"!=typeof c[e])return t.destroy(new Error("Invalid unsubscriptions")),!1;f+=i.byteLength(c[e])+2}let h=null;if(5===o){if(h=I(t,u),!h)return!1;f+=h.length}t.write(n.UNSUBSCRIBE_HEADER[1][l?1:0][0]),w(t,f),g(t,a),null!==h&&h.write();let d=!0;for(let e=0;e<c.length;e++)d=v(t,c[e]);return d}(e,t,r);case"unsuback":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.messageId,l=s.dup?n.DUP_MASK:0,c=s.granted,u=s.properties,f=s.cmd;let h=2;if("number"!=typeof a)return t.destroy(new Error("Invalid messageId")),!1;if(5===o){if("object"!=typeof c||!c.length)return t.destroy(new Error("Invalid qos vector")),!1;for(let e=0;e<c.length;e+=1){if("number"!=typeof c[e])return t.destroy(new Error("Invalid qos vector")),!1;h+=1}}let d=null;if(5===o){if(d=O(t,u,r,h),!d)return!1;h+=d.length}return t.write(n.ACKS[f][0][l][0]),w(t,h),g(t,a),null!==d&&d.write(),5===o&&t.write(i.from(c)),!0}(e,t,r);case"pingreq":case"pingresp":return function(e,t){return t.write(n.EMPTY[e.cmd])}(e,t);case"disconnect":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===o?1:0,u=null;if(5===o){if(u=O(t,l,r,c),!u)return!1;c+=u.length}return t.write(i.from([n.codes.disconnect<<4])),w(t,c),5===o&&t.write(i.from([a])),null!==u&&u.write(),!0}(e,t,r);case"auth":return function(e,t,r){const o=r?r.protocolVersion:4,s=e||{},a=s.reasonCode,l=s.properties;let c=5===o?1:0;5!==o&&t.destroy(new Error("Invalid mqtt version for auth packet"));const u=O(t,l,r,c);return!!u&&(c+=u.length,t.write(i.from([n.codes.auth<<4])),w(t,c),t.write(i.from([a])),null!==u&&u.write(),!0)}(e,t,r);default:return t.destroy(new Error("Unknown command")),!1}}function _(e){e.uncork()}Object.defineProperty(y,"cacheNumbers",{get:()=>g===E,set(e){e?(u&&0!==Object.keys(u).length||(b=!0),g=E):(b=!1,g=A)}});const m={};function w(e,t){if(t>n.VARBYTEINT_MAX)return e.destroy(new Error(`Invalid variable byte integer: ${t}`)),!1;let r=m[t];return r||(r=d(t),t<16384&&(m[t]=r)),c("writeVarByteInt: writing to stream: %o",r),e.write(r)}function v(e,t){const r=i.byteLength(t);return g(e,r),c("writeString: %s",t),e.write(t,"utf8")}function S(e,t,r){v(e,t),v(e,r)}function E(e,t){return c("writeNumberCached: number: %d",t),c("writeNumberCached: %o",u[t]),e.write(u[t])}function A(e,t){const r=f(t);return c("writeNumberGenerated: %o",r),e.write(r)}function k(e,t){"string"==typeof t?v(e,t):t?(g(e,t.length),e.write(t)):g(e,0)}function I(e,t){if("object"!=typeof t||null!=t.length)return{length:1,write(){T(e,{},0)}};let r=0;function o(t,r){let o=0;switch(n.propertiesTypes[t]){case"byte":if("boolean"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"int8":if("number"!=typeof r||r<0||r>255)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=2;break;case"binary":if(r&&null===r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(r)+2;break;case"int16":if("number"!=typeof r||r<0||r>65535)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=3;break;case"int32":if("number"!=typeof r||r<0||r>4294967295)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=5;break;case"var":if("number"!=typeof r||r<0||r>268435455)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=1+i.byteLength(d(r));break;case"string":if("string"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=3+i.byteLength(r.toString());break;case"pair":if("object"!=typeof r)return e.destroy(new Error(`Invalid ${t}: ${r}`)),!1;o+=Object.getOwnPropertyNames(r).reduce((e,t)=>{const n=r[t];return Array.isArray(n)?e+=n.reduce((e,r)=>e+(3+i.byteLength(t.toString())+2+i.byteLength(r.toString())),0):e+=3+i.byteLength(t.toString())+2+i.byteLength(r[t].toString()),e},0);break;default:return e.destroy(new Error(`Invalid property ${t}: ${r}`)),!1}return o}if(t)for(const e in t){let n=0,i=0;const s=t[e];if(void 0!==s){if(Array.isArray(s))for(let t=0;t<s.length;t++){if(i=o(e,s[t]),!i)return!1;n+=i}else{if(i=o(e,s),!i)return!1;n=i}if(!n)return!1;r+=n}}return{length:i.byteLength(d(r))+r,write(){T(e,t,r)}}}function O(e,t,r,n){const i=["reasonString","userProperties"],o=r&&r.properties&&r.properties.maximumPacketSize?r.properties.maximumPacketSize:0;let s=I(e,t);if(o)for(;n+s.length>o;){const r=i.shift();if(!r||!t[r])return!1;delete t[r],s=I(e,t)}return s}function R(e,t,r){switch(n.propertiesTypes[t]){case"byte":e.write(i.from([n.properties[t]])),e.write(i.from([+r]));break;case"int8":e.write(i.from([n.properties[t]])),e.write(i.from([r]));break;case"binary":e.write(i.from([n.properties[t]])),k(e,r);break;case"int16":e.write(i.from([n.properties[t]])),g(e,r);break;case"int32":e.write(i.from([n.properties[t]])),function(e,t){const r=p(t);c("write4ByteNumber: %o",r),e.write(r)}(e,r);break;case"var":e.write(i.from([n.properties[t]])),w(e,r);break;case"string":e.write(i.from([n.properties[t]])),v(e,r);break;case"pair":Object.getOwnPropertyNames(r).forEach(o=>{const s=r[o];Array.isArray(s)?s.forEach(r=>{e.write(i.from([n.properties[t]])),S(e,o.toString(),r.toString())}):(e.write(i.from([n.properties[t]])),S(e,o.toString(),s.toString()))});break;default:return e.destroy(new Error(`Invalid property ${t} value: ${r}`)),!1}}function T(e,t,r){w(e,r);for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&null!=t[r]){const n=t[r];if(Array.isArray(n))for(let t=0;t<n.length;t++)R(e,r,n[t]);else R(e,r,n)}}function x(e){return e?e instanceof i?e.length:i.byteLength(e):0}function P(e){return"string"==typeof e||e instanceof i}e.exports=y},3141:(e,t,r)=>{"use strict";var n=r(5003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3144:(e,t,r)=>{"use strict";var n=r(6743),i=r(1002),o=r(76),s=r(7119);e.exports=s||n.call(o,i)},3158:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=r(4469),{Buffer:a}=r(8287),{inspect:l}=r(7797);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,i=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(o(t,a,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}o(t,a,r-e),e-=a.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},3175:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(7732));t.default=class{_keepalive;timerId;timer;destroyed=!1;counter;client;_keepaliveTimeoutTimestamp;_intervalEvery;get keepaliveTimeoutTimestamp(){return this._keepaliveTimeoutTimestamp}get intervalEvery(){return this._intervalEvery}get keepalive(){return this._keepalive}constructor(e,t){this.client=e,this.timer="object"==typeof t&&"set"in t&&"clear"in t?t:(0,i.default)(t),this.setKeepalive(e.keepalive)}clear(){this.timerId&&(this.timer.clear(this.timerId),this.timerId=null)}setKeepalive(e){if(e*=1e3,isNaN(e)||e<=0||e>2147483647)throw new Error(`Keepalive value must be an integer between 0 and 2147483647. Provided value is ${e}`);this._keepalive=e,this.reschedule(),this.client.log(`KeepaliveManager: set keepalive to ${e}ms`)}destroy(){this.clear(),this.destroyed=!0}reschedule(){if(this.destroyed)return;this.clear(),this.counter=0;const e=Math.ceil(1.5*this._keepalive);this._keepaliveTimeoutTimestamp=Date.now()+e,this._intervalEvery=Math.ceil(this._keepalive/2),this.timerId=this.timer.set(()=>{this.destroyed||(this.counter+=1,2===this.counter?this.client.sendPing():this.counter>2&&this.client.onKeepaliveTimeout())},this._intervalEvery)}}},3225:(e,t,r)=>{"use strict";var n=r(2045);void 0===n||!n.version||0===n.version.indexOf("v0.")||0===n.version.indexOf("v1.")&&0!==n.version.indexOf("v1.8.")?e.exports={nextTick:function(e,t,r,i){if("function"!=typeof e)throw new TypeError('"callback" argument must be a function');var o,s,a=arguments.length;switch(a){case 0:case 1:return n.nextTick(e);case 2:return n.nextTick(function(){e.call(null,t)});case 3:return n.nextTick(function(){e.call(null,t,r)});case 4:return n.nextTick(function(){e.call(null,t,r,i)});default:for(o=new Array(a-1),s=0;s<o.length;)o[s++]=arguments[s];return n.nextTick(function(){e.apply(null,o)})}}}:e.exports=n},3425:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(2768),{isIterable:o,isNodeStream:s,isWebStream:a}=r(6801),{pipelineImpl:l}=r(3616),{finished:c}=r(6364);r(5244),e.exports={finished:c,pipeline:function(...e){return new i((t,r)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!o(u)&&!a(u)){const t=n(e);i=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:i,end:c})})}}},3497:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9096),i=r(4807);t.default=class{aliasToTopic;topicToAlias;max;numberAllocator;length;constructor(e){e>0&&(this.aliasToTopic=new n.LRUCache({max:e}),this.topicToAlias={},this.numberAllocator=new i.NumberAllocator(1,e),this.max=e,this.length=0)}put(e,t){if(0===t||t>this.max)return!1;const r=this.aliasToTopic.get(t);return r&&delete this.topicToAlias[r],this.aliasToTopic.set(t,e),this.topicToAlias[e]=t,this.numberAllocator.use(t),this.length=this.aliasToTopic.size,!0}getTopicByAlias(e){return this.aliasToTopic.get(e)}getAliasByTopic(e){const t=this.topicToAlias[e];return void 0!==t&&this.aliasToTopic.get(t),t}clear(){this.aliasToTopic.clear(),this.topicToAlias={},this.numberAllocator.clear(),this.length=0}getLruAlias(){return this.numberAllocator.firstVacant()||[...this.aliasToTopic.keys()][this.aliasToTopic.size-1]}}},3513:(e,t,r)=>{"use strict";const{MathFloor:n,NumberIsInteger:i}=r(2768),{validateInteger:o}=r(4947),{ERR_INVALID_ARG_VALUE:s}=r(9157).codes;let a=16384,l=16;function c(e){return e?l:a}e.exports={getHighWaterMark:function(e,t,r,o){const a=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,o,r);if(null!=a){if(!i(a)||a<0)throw new s(o?`options.${r}`:"options.highWaterMark",a);return n(a)}return c(e.objectMode)},getDefaultHighWaterMark:c,setDefaultHighWaterMark:function(e,t){o(t,"value",0),e?l=t:a=t}}},3530:e=>{e.exports=class{constructor({subscribe:e,log:t,initialDelayMs:r=1e3,maxDelayMs:n=3e4}){this._subscribe=e,this._log=t,this._initialDelayMs=r,this._maxDelayMs=n,this._pending=new Map,this._inFlight=new Set,this._timer=null,this._attempt=0}get pending(){const e=[];for(const t of this._pending.values())e.push(...t.topics);return e}get nextDelayMs(){return Math.min(this._initialDelayMs*2**this._attempt,this._maxDelayMs)}schedule(e,t={}){if(!e||0===e.length)return;for(const t of e)this._inFlight.delete(t);const r=JSON.stringify(t),n=this._pending.get(r)||{options:t,topics:new Set};for(const t of e)n.topics.add(t);if(this._pending.set(r,n),this._timer)return;const i=this.nextDelayMs;this._log&&this._log.warn(`Retrying ${this.pending.length} refused subscription(s) in ${i} ms: ${this.pending}`),this._timer=setTimeout(()=>this._fire(),i)}granted(e){for(const t of e)this._inFlight.delete(t);for(const t of this._pending.values())for(const r of e)t.topics.delete(r);for(const[e,t]of this._pending)0===t.topics.size&&this._pending.delete(e);0!==this._pending.size||0!==this._inFlight.size||this._timer||(this._attempt=0)}cancel(){clearTimeout(this._timer),this._timer=null,this._pending.clear(),this._inFlight.clear(),this._attempt=0}static outcome(e,t){const r=Array.isArray(t)?t:[],n=e&&e.packet&&Array.isArray(e.packet.granted)?e.packet.granted:null;if(n){const e=[],t=[];return r.forEach(({topic:r},i)=>{128&n[i]?e.push(r):t.push({topic:r,qos:n[i]})}),{refused:e,granted:t,error:null}}return e?{refused:[],granted:[],error:e}:{refused:r.filter(e=>128===e.qos).map(e=>e.topic),granted:r.filter(e=>128!==e.qos),error:null}}_fire(){this._timer=null,this._attempt+=1;const e=Array.from(this._pending.values());this._pending.clear();for(const{topics:t}of e)for(const e of t)this._inFlight.add(e);for(const{options:t,topics:r}of e)try{this._subscribe(Array.from(r),t)}catch(e){this._log&&this._log.warn(`Retrying subscription failed: ${e.message}`),this.schedule(Array.from(r),t)}}}},3561:(e,t,r)=>{"use strict";r.r(t),r.d(t,{customAlphabet:()=>s,customRandom:()=>o,nanoid:()=>a,random:()=>i,urlAlphabet:()=>n});let n="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",i=e=>crypto.getRandomValues(new Uint8Array(e)),o=(e,t,r)=>{let n=(2<<Math.log(e.length-1)/Math.LN2)-1,i=-~(1.6*n*t/e.length);return(o=t)=>{let s="";for(;;){let t=r(i),a=0|i;for(;a--;)if(s+=e[t[a]&n]||"",s.length===o)return s}}},s=(e,t=21)=>o(e,t,i),a=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+((t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_"),"")},3616:(e,t,r)=>{const n=r(5606),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:a}=r(2768),l=r(6364),{once:c}=r(9862),u=r(7302),f=r(2648),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=r(9157),{validateFunction:m,validateAbortSignal:w}=r(4947),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(6801),T=globalThis.AbortController||r(5568).AbortController;let x,P,N;function C(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function j(e){if(v(e))return e;if(E(e))return async function*(e){P||(P=r(9214)),yield*P.prototype[s].call(e)}(e);throw new d("val",["Readable","Iterable","AsyncIterable"],e)}async function M(e,t,r,{end:n}){let i,s=null;const a=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},c=()=>new o((e,t)=>{i?t(i):s=()=>{i?t(i):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function L(e,t,r,{end:n}){k(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function D(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const s=new T,l=s.signal,c=null==o?void 0:o.signal,u=[];function h(){B(new _)}let b,y,m;w(c,"options.signal"),N=N||r(9862).addAbortListener,c&&(b=N(c,h));const R=[];let P,D=0;function $(e){B(e,0===--D)}function B(e,r){var i;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(i=b)||void 0===i||i[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,m))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==o?void 0:o.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=C(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&$(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if(P=z({signal:l}),!v(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if(P=k(P)?j(null===(W=P)||void 0===W?void 0:W.readable):j(P),P=z(P,{signal:l}),H){if(!v(P,!0))throw new p("AsyncIterable",`transform[${V-1}]`,P)}else{var q;x||(x=r(5258));const X=new x({objectMode:!0}),Z=null===(q=P)||void 0===q?void 0:q.then;if("function"==typeof Z)D++,Z.call(P,e=>{m=e,null!=e&&X.write(e),K&&X.end(),n.nextTick($)},e=>{X.destroy(e),n.nextTick($,e)});else if(v(P,!0))D++,M(P,X,$,{end:K});else{if(!O(P)&&!k(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,M(re,X,$,{end:K})}}P=X;const{destroy:ee,cleanup:te}=C(P,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E(P)){D+=2;const ne=F(P,z,$,{end:K});S(z)&&Q&&u.push(ne)}else if(k(P)||O(P)){const ie=P.readable||P;D++,M(ie,z,$,{end:K})}else{if(!v(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,M(P,z,$,{end:K})}P=z}else if(I(z)){if(E(P))D++,L(j(P),z,$,{end:K});else if(O(P)||v(P))D++,L(P,z,$,{end:K});else{if(!k(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,L(P.readable,z,$,{end:K})}P=z}else P=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(h),P}function F(e,t,r,{end:i}){let o=!1;if(t.on("close",()=>{o||r(new y)}),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:D,pipeline:function(...e){return D(e,c(function(e){return m(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},3628:(e,t,r)=>{"use strict";var n=r(8648),i=r(1064),o=r(7176);e.exports=n?function(e){return n(e)}:i?function(e){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new TypeError("getProto: not an object");return i(e)}:o?function(e){return o(e)}:null},3681:(e,t,r)=>{"use strict";e.exports=i;var n=r(9083);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(6698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},3779:()=>{},3885:(e,t,r)=>{"use strict";e.exports=r(9844)()},3918:(e,t,r)=>{"use strict";var n=r(2045);function i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?i(Object(r),!0).forEach(function(t){var n,i,o;n=e,i=t,o=r[t],(i=a(i))in n?Object.defineProperty(n,i,{value:o,enumerable:!0,configurable:!0,writable:!0}):n[i]=o}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):i(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e){if("object"!==g(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==g(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===g(t)?t:String(t)}function l(e,t){if(t&&("object"===g(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e){var t="function"==typeof Map?new Map:void 0;return u=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return f(e,arguments,p(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},u(e)}function f(e,t,r){return f=h()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&d(i,r.prototype),i},f.apply(null,arguments)}function h(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function p(e){return p=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},p(e)}function g(e){return g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},g(e)}var b=r(537).inspect,y=r(9597).codes.ERR_INVALID_ARG_TYPE;function _(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}var m="",w="",v="",S="",E={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function A(e){var t=Object.keys(e),r=Object.create(Object.getPrototypeOf(e));return t.forEach(function(t){r[t]=e[t]}),Object.defineProperty(r,"message",{value:e.message}),r}function k(e){return b(e,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}var I=function(e,t){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(I,e);var r,i,a,u,f=(r=I,i=h(),function(){var e,t=p(r);if(i){var n=p(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return l(this,e)});function I(e){var t;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,I),"object"!==g(e)||null===e)throw new y("options","Object",e);var r=e.message,i=e.operator,o=e.stackStartFn,s=e.actual,a=e.expected,u=Error.stackTraceLimit;if(Error.stackTraceLimit=0,null!=r)t=f.call(this,String(r));else if(n.stderr&&n.stderr.isTTY&&(n.stderr&&n.stderr.getColorDepth&&1!==n.stderr.getColorDepth()?(m="",w="",S="",v=""):(m="",w="",S="",v="")),"object"===g(s)&&null!==s&&"object"===g(a)&&null!==a&&"stack"in s&&s instanceof Error&&"stack"in a&&a instanceof Error&&(s=A(s),a=A(a)),"deepStrictEqual"===i||"strictEqual"===i)t=f.call(this,function(e,t,r){var i="",o="",s=0,a="",l=!1,c=k(e),u=c.split("\n"),f=k(t).split("\n"),h=0,d="";if("strictEqual"===r&&"object"===g(e)&&"object"===g(t)&&null!==e&&null!==t&&(r="strictEqualObject"),1===u.length&&1===f.length&&u[0]!==f[0]){var p=u[0].length+f[0].length;if(p<=10){if(!("object"===g(e)&&null!==e||"object"===g(t)&&null!==t||0===e&&0===t))return"".concat(E[r],"\n\n")+"".concat(u[0]," !== ").concat(f[0],"\n")}else if("strictEqualObject"!==r&&p<(n.stderr&&n.stderr.isTTY?n.stderr.columns:80)){for(;u[0][h]===f[0][h];)h++;h>2&&(d="\n ".concat(function(e,t){if(t=Math.floor(t),0==e.length||0==t)return"";var r=e.length*t;for(t=Math.floor(Math.log(t)/Math.log(2));t;)e+=e,t--;return e+e.substring(0,r-e.length)}(" ",h),"^"),h=0)}}for(var b=u[u.length-1],y=f[f.length-1];b===y&&(h++<2?a="\n ".concat(b).concat(a):i=b,u.pop(),f.pop(),0!==u.length&&0!==f.length);)b=u[u.length-1],y=f[f.length-1];var A=Math.max(u.length,f.length);if(0===A){var I=c.split("\n");if(I.length>30)for(I[26]="".concat(m,"...").concat(S);I.length>27;)I.pop();return"".concat(E.notIdentical,"\n\n").concat(I.join("\n"),"\n")}h>3&&(a="\n".concat(m,"...").concat(S).concat(a),l=!0),""!==i&&(a="\n ".concat(i).concat(a),i="");var O=0,R=E[r]+"\n".concat(w,"+ actual").concat(S," ").concat(v,"- expected").concat(S),T=" ".concat(m,"...").concat(S," Lines skipped");for(h=0;h<A;h++){var x=h-s;if(u.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(f[h-2]),O++),o+="\n ".concat(f[h-1]),O++),s=h,i+="\n".concat(v,"-").concat(S," ").concat(f[h]),O++;else if(f.length<h+1)x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(u[h-2]),O++),o+="\n ".concat(u[h-1]),O++),s=h,o+="\n".concat(w,"+").concat(S," ").concat(u[h]),O++;else{var P=f[h],N=u[h],C=N!==P&&(!_(N,",")||N.slice(0,-1)!==P);C&&_(P,",")&&P.slice(0,-1)===N&&(C=!1,N+=","),C?(x>1&&h>2&&(x>4?(o+="\n".concat(m,"...").concat(S),l=!0):x>3&&(o+="\n ".concat(u[h-2]),O++),o+="\n ".concat(u[h-1]),O++),s=h,o+="\n".concat(w,"+").concat(S," ").concat(N),i+="\n".concat(v,"-").concat(S," ").concat(P),O+=2):(o+=i,i="",1!==x&&0!==h||(o+="\n ".concat(N),O++))}if(O>20&&h<A-2)return"".concat(R).concat(T,"\n").concat(o,"\n").concat(m,"...").concat(S).concat(i,"\n")+"".concat(m,"...").concat(S)}return"".concat(R).concat(l?T:"","\n").concat(o).concat(i).concat(a).concat(d)}(s,a,i));else if("notDeepStrictEqual"===i||"notStrictEqual"===i){var h=E[i],d=k(s).split("\n");if("notStrictEqual"===i&&"object"===g(s)&&null!==s&&(h=E.notStrictEqualObject),d.length>30)for(d[26]="".concat(m,"...").concat(S);d.length>27;)d.pop();t=1===d.length?f.call(this,"".concat(h," ").concat(d[0])):f.call(this,"".concat(h,"\n\n").concat(d.join("\n"),"\n"))}else{var p=k(s),b="",O=E[i];"notDeepEqual"===i||"notEqual"===i?(p="".concat(E[i],"\n\n").concat(p)).length>1024&&(p="".concat(p.slice(0,1021),"...")):(b="".concat(k(a)),p.length>512&&(p="".concat(p.slice(0,509),"...")),b.length>512&&(b="".concat(b.slice(0,509),"...")),"deepEqual"===i||"equal"===i?p="".concat(O,"\n\n").concat(p,"\n\nshould equal\n\n"):b=" ".concat(i," ").concat(b)),t=f.call(this,"".concat(p).concat(b))}return Error.stackTraceLimit=u,t.generatedMessage=!r,Object.defineProperty(c(t),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),t.code="ERR_ASSERTION",t.actual=s,t.expected=a,t.operator=i,Error.captureStackTrace&&Error.captureStackTrace(c(t),o),t.stack,t.name="AssertionError",l(t)}return a=I,(u=[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:t,value:function(e,t){return b(this,o(o({},t),{},{customInspect:!1,depth:0}))}}])&&s(a.prototype,u),Object.defineProperty(a,"prototype",{writable:!1}),I}(u(Error),b.custom);e.exports=I},3936:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6370),o=n(r(1428)),s=n(r(7833)),a=n(r(6968)),l=(0,s.default)("mqttjs:tls");t.default=(e,t)=>{t.port=t.port||8883,t.host=t.hostname||t.host||"localhost",0!==o.default.isIP(t.host)||t.servername||(t.servername=t.host),t.rejectUnauthorized=!1!==t.rejectUnauthorized,delete t.path,l("port %d host %s rejectUnauthorized %b",t.port,t.host,t.rejectUnauthorized);const r=function(e){const{host:t,port:r,socksProxy:n,...o}=e;if(void 0!==n){const s=(0,a.default)(t,r,n,{timeout:e.socksTimeout});return(0,i.connect)({...o,socket:s})}return(0,i.connect)(e)}(t);function n(n){t.rejectUnauthorized&&e.emit("error",n),r.end()}return r.on("secureConnect",()=>{t.rejectUnauthorized&&!r.authorized?r.emit("error",new Error("TLS not authorized")):r.removeListener("error",n)}),r.on("error",n),r}},3942:(e,t,r)=>{"use strict";const{ArrayPrototypePop:n,Promise:i}=r(4469),{isIterable:o,isNodeStream:s,isWebStream:a}=r(5980),{pipelineImpl:l}=r(4867),{finished:c}=r(577);r(9037),e.exports={finished:c,pipeline:function(...e){return new i((t,r)=>{let i,c;const u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!o(u)&&!a(u)){const t=n(e);i=t.signal,c=t.end}l(e,(e,n)=>{e?r(e):t(n)},{signal:i,end:c})})}}},4035:(e,t,r)=>{"use strict";var n,i=r(6556),o=r(9092)(),s=r(9957),a=r(5795);if(o){var l=i("RegExp.prototype.exec"),c={},u=function(){throw c},f={toString:u,valueOf:u};"symbol"==typeof Symbol.toPrimitive&&(f[Symbol.toPrimitive]=u),n=function(e){if(!e||"object"!=typeof e)return!1;var t=a(e,"lastIndex");if(!t||!s(t,"value"))return!1;try{l(e,f)}catch(e){return e===c}}}else{var h=i("Object.prototype.toString");n=function(e){return!(!e||"object"!=typeof e&&"function"!=typeof e)&&"[object RegExp]"===h(e)}}e.exports=n},4039:(e,t,r)=>{"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(1333);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},4133:(e,t,r)=>{"use strict";var n=r(487),i=r(8452),o=r(3003),s=r(6642),a=r(2464),l=n(s(),Number);i(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},4148:(e,t,r)=>{"use strict";var n=r(2045);function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function s(e,t,r){return t&&o(e.prototype,t),r&&o(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e){var t=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!==i(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===i(t)?t:String(t)}var l,c,u=r(9597).codes,f=u.ERR_AMBIGUOUS_ARGUMENT,h=u.ERR_INVALID_ARG_TYPE,d=u.ERR_INVALID_ARG_VALUE,p=u.ERR_INVALID_RETURN_VALUE,g=u.ERR_MISSING_ARGS,b=r(3918),y=r(537).inspect,_=r(537).types,m=_.isPromise,w=_.isRegExp,v=r(9133)(),S=r(9394)(),E=r(8075)("RegExp.prototype.test");function A(){var e=r(2299);l=e.isDeepEqual,c=e.isDeepStrictEqual}new Map;var k=!1,I=e.exports=x,O={};function R(e){if(e.message instanceof Error)throw e.message;throw new b(e)}function T(e,t,r,n){if(!r){var i=!1;if(0===t)i=!0,n="No value argument passed to `assert.ok()`";else if(n instanceof Error)throw n;var o=new b({actual:r,expected:!0,message:n,operator:"==",stackStartFn:e});throw o.generatedMessage=i,o}}function x(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[x,t.length].concat(t))}I.fail=function e(t,r,i,o,s){var a,l=arguments.length;if(0===l?a="Failed":1===l?(i=t,t=void 0):(!1===k&&(k=!0,(n.emitWarning?n.emitWarning:console.warn.bind(console))("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")),2===l&&(o="!=")),i instanceof Error)throw i;var c={actual:t,expected:r,operator:void 0===o?"fail":o,stackStartFn:s||e};void 0!==i&&(c.message=i);var u=new b(c);throw a&&(u.message=a,u.generatedMessage=!0),u},I.AssertionError=b,I.ok=x,I.equal=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");t!=r&&R({actual:t,expected:r,message:n,operator:"==",stackStartFn:e})},I.notEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");t==r&&R({actual:t,expected:r,message:n,operator:"!=",stackStartFn:e})},I.deepEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),l(t,r)||R({actual:t,expected:r,message:n,operator:"deepEqual",stackStartFn:e})},I.notDeepEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),l(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepEqual",stackStartFn:e})},I.deepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),c(t,r)||R({actual:t,expected:r,message:n,operator:"deepStrictEqual",stackStartFn:e})},I.notDeepStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");void 0===l&&A(),c(t,r)&&R({actual:t,expected:r,message:n,operator:"notDeepStrictEqual",stackStartFn:e})},I.strictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");S(t,r)||R({actual:t,expected:r,message:n,operator:"strictEqual",stackStartFn:e})},I.notStrictEqual=function e(t,r,n){if(arguments.length<2)throw new g("actual","expected");S(t,r)&&R({actual:t,expected:r,message:n,operator:"notStrictEqual",stackStartFn:e})};var P=s(function e(t,r,n){var i=this;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),r.forEach(function(e){e in t&&(void 0!==n&&"string"==typeof n[e]&&w(t[e])&&E(t[e],n[e])?i[e]=n[e]:i[e]=t[e])})});function N(e,t,r,n){if("function"!=typeof t){if(w(t))return E(t,e);if(2===arguments.length)throw new h("expected",["Function","RegExp"],t);if("object"!==i(e)||null===e){var o=new b({actual:e,expected:t,message:r,operator:"deepStrictEqual",stackStartFn:n});throw o.operator=n.name,o}var s=Object.keys(t);if(t instanceof Error)s.push("name","message");else if(0===s.length)throw new d("error",t,"may not be an empty object");return void 0===l&&A(),s.forEach(function(i){"string"==typeof e[i]&&w(t[i])&&E(t[i],e[i])||function(e,t,r,n,i,o){if(!(r in e)||!c(e[r],t[r])){if(!n){var s=new P(e,i),a=new P(t,i,e),l=new b({actual:s,expected:a,operator:"deepStrictEqual",stackStartFn:o});throw l.actual=e,l.expected=t,l.operator=o.name,l}R({actual:e,expected:t,message:n,operator:o.name,stackStartFn:o})}}(e,t,i,r,s,n)}),!0}return void 0!==t.prototype&&e instanceof t||!Error.isPrototypeOf(t)&&!0===t.call({},e)}function C(e){if("function"!=typeof e)throw new h("fn","Function",e);try{e()}catch(e){return e}return O}function j(e){return m(e)||null!==e&&"object"===i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function M(e){return Promise.resolve().then(function(){var t;if("function"==typeof e){if(!j(t=e()))throw new p("instance of Promise","promiseFn",t)}else{if(!j(e))throw new h("promiseFn",["Function","Promise"],e);t=e}return Promise.resolve().then(function(){return t}).then(function(){return O}).catch(function(e){return e})})}function L(e,t,r,n){if("string"==typeof r){if(4===arguments.length)throw new h("error",["Object","Error","Function","RegExp"],r);if("object"===i(t)&&null!==t){if(t.message===r)throw new f("error/message",'The error message "'.concat(t.message,'" is identical to the message.'))}else if(t===r)throw new f("error/message",'The error "'.concat(t,'" is identical to the message.'));n=r,r=void 0}else if(null!=r&&"object"!==i(r)&&"function"!=typeof r)throw new h("error",["Object","Error","Function","RegExp"],r);if(t===O){var o="";r&&r.name&&(o+=" (".concat(r.name,")")),o+=n?": ".concat(n):".";var s="rejects"===e.name?"rejection":"exception";R({actual:void 0,expected:r,operator:e.name,message:"Missing expected ".concat(s).concat(o),stackStartFn:e})}if(r&&!N(t,r,n,e))throw t}function D(e,t,r,n){if(t!==O){if("string"==typeof r&&(n=r,r=void 0),!r||N(t,r)){var i=n?": ".concat(n):".",o="doesNotReject"===e.name?"rejection":"exception";R({actual:t,expected:r,operator:e.name,message:"Got unwanted ".concat(o).concat(i,"\n")+'Actual message: "'.concat(t&&t.message,'"'),stackStartFn:e})}throw t}}function F(e,t,r,n,o){if(!w(t))throw new h("regexp","RegExp",t);var s="match"===o;if("string"!=typeof e||E(t,e)!==s){if(r instanceof Error)throw r;var a=!r;r=r||("string"!=typeof e?'The "string" argument must be of type string. Received type '+"".concat(i(e)," (").concat(y(e),")"):(s?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(y(t),". Input:\n\n").concat(y(e),"\n"));var l=new b({actual:e,expected:t,message:r,operator:o,stackStartFn:n});throw l.generatedMessage=a,l}}function $(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];T.apply(void 0,[$,t.length].concat(t))}I.throws=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];L.apply(void 0,[e,C(t)].concat(n))},I.rejects=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return M(t).then(function(t){return L.apply(void 0,[e,t].concat(n))})},I.doesNotThrow=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];D.apply(void 0,[e,C(t)].concat(n))},I.doesNotReject=function e(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];return M(t).then(function(t){return D.apply(void 0,[e,t].concat(n))})},I.ifError=function e(t){if(null!=t){var r="ifError got unwanted exception: ";"object"===i(t)&&"string"==typeof t.message?0===t.message.length&&t.constructor?r+=t.constructor.name:r+=t.message:r+=y(t);var n=new b({actual:t,expected:null,operator:"ifError",message:r,stackStartFn:e}),o=t.stack;if("string"==typeof o){var s=o.split("\n");s.shift();for(var a=n.stack.split("\n"),l=0;l<s.length;l++){var c=a.indexOf(s[l]);if(-1!==c){a=a.slice(0,c);break}}n.stack="".concat(a.join("\n"),"\n").concat(s.join("\n"))}throw n}},I.match=function e(t,r,n){F(t,r,n,e,"match")},I.doesNotMatch=function e(t,r,n){F(t,r,n,e,"doesNotMatch")},I.strict=v($,I,{equal:I.strictEqual,deepEqual:I.deepStrictEqual,notEqual:I.notStrictEqual,notDeepEqual:I.notDeepStrictEqual}),I.strict.strict=I.strict},4152:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TypedEventEmitter=void 0;const i=n(r(7007)),o=r(4723);class s{}t.TypedEventEmitter=s,(0,o.applyMixin)(s,i.default)},4233:e=>{"use strict";const t=function*(){}.constructor;e.exports=()=>t},4257:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}(o||i);var s=r.readable||!1!==r.readable&&t.readable,a=r.writable||!1!==r.writable&&t.writable,l=function(){t.writable||u()},c=t._writableState&&t._writableState.finished,u=function(){a=!1,c=!0,s||o.call(t)},f=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,f=!0,a||o.call(t)},d=function(e){o.call(t,e)},p=function(){var e;return s&&!f?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!c?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",u)};return function(e){return e.setHeader&&"function"==typeof e.abort}(t)?(t.on("complete",u),t.on("abort",p),t.req?g():t.on("request",g)):a&&!t._writableState&&(t.on("end",l),t.on("close",l)),t.on("end",h),t.on("finish",u),!1!==r.error&&t.on("error",d),t.on("close",p),function(){t.removeListener("complete",u),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",u),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",u),t.removeListener("end",h),t.removeListener("error",d),t.removeListener("close",p)}}},4264:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=(e,t,r)=>{e.log("handling pubrel packet");const n=void 0!==r?r:e.noop,{messageId:i}=t,o={cmd:"pubcomp",messageId:i};e.incomingStore.get(t,(t,r)=>{t?e._sendPacket(o,n):(e.emit("message",r.topic,r.payload,r),e.handleMessage(r,t=>{if(t)return n(t);e.incomingStore.del(r,e.noop),e._releaseIncomingQoS2Publish(i),e._sendPacket(o,n)}))})}},4269:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(9157),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(4947),h=r(2768).Symbol("kWeak"),d=r(2768).Symbol("kResistStopPropagation"),{finished:p}=r(6364),g=r(9848),{addAbortSignalNoValidate:b}=r(5121),{isWritable:y,isNodeStream:_}=r(6801),{deprecate:m}=r(9862),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:T}=r(2768),x=T("kEmpty"),P=T("kEof");function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=S(t.highWaterMark)),u(n,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=n,async function*(){const o=r(9862).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:o};let u,f,h=!1,d=0;function p(){h=!0,g()}function g(){d-=1,b()}function b(){f&&!h&&d<n&&a.length<i&&(f(),f=null)}!async function(){try{for await(let t of s){if(h)return;if(o.aborted)throw new l;try{if(t=e(t,c),t===x)continue;t=O(t)}catch(e){t=I(e)}d+=1,R(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||d>=n)&&await new k(e=>{f=e})}a.push(P)}catch(e){const t=I(e);R(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===P)return;if(o.aborted)throw new l;e!==x&&(yield e),a.shift(),b()}await new k(e=>{u=e})}}finally{h=!0,f&&(f(),f=null)}}.call(this)}async function C(e,t=void 0){for await(const r of j.call(this,e,t))return!0;return!1}function j(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return N.call(this,async function(t,r){return await e(t,r)?t:x},t)}class M extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:m(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:j,flatMap:function(e,t){const r=N.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:N,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),_(e)&&!y(e))throw new i("stream",e,"must be writable");const r=g(this,e);return null!=t&&t.signal&&b(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await C.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const r of N.call(this,async function(t,r){return await e(t,r),x},t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[h]:this,[d]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let g=!1;try{for await(const n of this){var b;if(g=!0,null!=r&&null!==(b=r.signal)&&void 0!==b&&b.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!g&&!s)throw new M}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:C,find:async function(e,t){for await(const r of j.call(this,e,t))return r}}},4347:(e,t,r)=>{"use strict";var n=r(2045);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,l=this._writableState&&this._writableState.destroyed;return a||l?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)}),this)},undestroy:function(){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)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},4459:e=>{"use strict";e.exports=Number.isNaN||function(e){return e!=e}},4469:e=>{"use strict";class t extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError("Expected input to be an Array, got "+typeof e);let t="";for(let r=0;r<e.length;r++)t+=` ${e[r].stack}\n`;super(t),this.name="AggregateError",this.errors=e}}e.exports={AggregateError:t,ArrayIsArray:e=>Array.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.trim(),Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}},4474:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(4469),{EventEmitter:o}=r(7007);function s(e){o.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},4643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},4723:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.MQTTJS_VERSION=t.nextTick=t.ErrorWithSubackPacket=t.ErrorWithReasonCode=void 0,t.applyMixin=function(e,t,r=!1){const n=[t];for(;;){const e=n[0],t=Object.getPrototypeOf(e);if(!t?.prototype)break;n.unshift(t)}for(const t of n)for(const n of Object.getOwnPropertyNames(t.prototype))(r||"constructor"!==n)&&Object.defineProperty(e.prototype,n,Object.getOwnPropertyDescriptor(t.prototype,n)??Object.create(null))};class i extends Error{code;constructor(e,t){super(e),this.code=t,Object.setPrototypeOf(this,i.prototype),Object.getPrototypeOf(this).name="ErrorWithReasonCode"}}t.ErrorWithReasonCode=i;class o extends Error{packet;constructor(e,t){super(e),this.packet=t,Object.setPrototypeOf(this,o.prototype),Object.getPrototypeOf(this).name="ErrorWithSubackPacket"}}t.ErrorWithSubackPacket=o,t.nextTick="function"==typeof n?.nextTick?n.nextTick:e=>{setTimeout(e,0)},t.MQTTJS_VERSION=r(2860).version},4765:e=>{"use strict";var t=String.prototype.replace,r=/%20/g,n="RFC3986";e.exports={default:n,formatters:{RFC1738:function(e){return t.call(e,r,"+")},RFC3986:function(e){return String(e)}},RFC1738:"RFC1738",RFC3986:n}},4803:(e,t,r)=>{"use strict";var n=r(8859),i=r(9675),o=function(e,t,r){for(var n,i=e;null!=(n=i.next);i=n)if(n.key===t)return i.next=n.next,r||(n.next=e.next,e.next=n),n};e.exports=function(){var e,t={assert:function(e){if(!t.has(e))throw new i("Side channel does not contain "+n(e))},delete:function(t){var r=e&&e.next,n=function(e,t){if(e)return o(e,t,!0)}(e,t);return n&&r&&r===n&&(e=void 0),!!n},get:function(t){return function(e,t){if(e){var r=o(e,t);return r&&r.value}}(e,t)},has:function(t){return function(e,t){return!!e&&!!o(e,t)}(e,t)},set:function(t,r){e||(e={next:void 0}),function(e,t,r){var n=o(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}}(e,t,r)}};return t}},4807:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NumberAllocator=void 0,t.NumberAllocator=class{used;min;max;lowWaterMark;constructor(e,t){this.min=e,this.max=t,this.used=new Set,this.lowWaterMark=e}firstVacant(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return e;return null}alloc(){if(this.used.size===this.max-this.min+1)return null;for(let e=this.lowWaterMark;e<=this.max;e++)if(!this.used.has(e))return this.used.add(e),this.lowWaterMark=e+1,e;return null}use(e){return!(e<this.min||e>this.max||this.used.has(e)||(this.used.add(e),0))}free(e){e<this.min||e>this.max||(this.used.delete(e),e<this.lowWaterMark&&(this.lowWaterMark=e))}clear(){this.used.clear(),this.lowWaterMark=this.min}}},4867:(e,t,r)=>{const n=r(5606),{ArrayIsArray:i,Promise:o,SymbolAsyncIterator:s,SymbolDispose:a}=r(4469),l=r(577),{once:c}=r(7797),u=r(1787),f=r(7323),{aggregateTwoErrors:h,codes:{ERR_INVALID_ARG_TYPE:d,ERR_INVALID_RETURN_VALUE:p,ERR_MISSING_ARGS:g,ERR_STREAM_DESTROYED:b,ERR_STREAM_PREMATURE_CLOSE:y},AbortError:_}=r(2074),{validateFunction:m,validateAbortSignal:w}=r(1580),{isIterable:v,isReadable:S,isReadableNodeStream:E,isNodeStream:A,isTransformStream:k,isWebStream:I,isReadableStream:O,isReadableFinished:R}=r(5980),T=globalThis.AbortController||r(5568).AbortController;let x,P,N;function C(e,t,r){let n=!1;return e.on("close",()=>{n=!0}),{destroy:t=>{n||(n=!0,u.destroyer(e,t||new b("pipe")))},cleanup:l(e,{readable:t,writable:r},e=>{n=!e})}}function j(e){if(v(e))return e;if(E(e))return async function*(e){P||(P=r(2729)),yield*P.prototype[s].call(e)}(e);throw new d("val",["Readable","Iterable","AsyncIterable"],e)}async function M(e,t,r,{end:n}){let i,s=null;const a=e=>{if(e&&(i=e),s){const e=s;s=null,e()}},c=()=>new o((e,t)=>{i?t(i):s=()=>{i?t(i):e()}});t.on("drain",a);const u=l(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(const r of e)t.write(r)||await c();n&&(t.end(),await c()),r()}catch(e){r(i!==e?h(i,e):e)}finally{u(),t.off("drain",a)}}async function L(e,t,r,{end:n}){k(t)&&(t=t.writable);const i=t.getWriter();try{for await(const t of e)await i.ready,i.write(t).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(e){try{await i.abort(e),r(e)}catch(e){r(e)}}}function D(e,t,o){if(1===e.length&&i(e[0])&&(e=e[0]),e.length<2)throw new g("streams");const s=new T,l=s.signal,c=null==o?void 0:o.signal,u=[];function h(){B(new _)}let b,y,m;w(c,"options.signal"),N=N||r(7797).addAbortListener,c&&(b=N(c,h));const R=[];let P,D=0;function $(e){B(e,0===--D)}function B(e,r){var i;if(!e||y&&"ERR_STREAM_PREMATURE_CLOSE"!==y.code||(y=e),y||r){for(;R.length;)R.shift()(y);null===(i=b)||void 0===i||i[a](),s.abort(),r&&(y||u.forEach(e=>e()),n.nextTick(t,y,m))}}for(let V=0;V<e.length;V++){const z=e[V],H=V<e.length-1,G=V>0,K=H||!1!==(null==o?void 0:o.end),Q=V===e.length-1;if(A(z)){if(K){const{destroy:J,cleanup:Y}=C(z,H,G);R.push(J),S(z)&&Q&&u.push(Y)}function U(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&$(e)}z.on("error",U),S(z)&&Q&&u.push(()=>{z.removeListener("error",U)})}if(0===V)if("function"==typeof z){if(P=z({signal:l}),!v(P))throw new p("Iterable, AsyncIterable or Stream","source",P)}else P=v(z)||E(z)||k(z)?z:f.from(z);else if("function"==typeof z){var W;if(P=k(P)?j(null===(W=P)||void 0===W?void 0:W.readable):j(P),P=z(P,{signal:l}),H){if(!v(P,!0))throw new p("AsyncIterable",`transform[${V-1}]`,P)}else{var q;x||(x=r(519));const X=new x({objectMode:!0}),Z=null===(q=P)||void 0===q?void 0:q.then;if("function"==typeof Z)D++,Z.call(P,e=>{m=e,null!=e&&X.write(e),K&&X.end(),n.nextTick($)},e=>{X.destroy(e),n.nextTick($,e)});else if(v(P,!0))D++,M(P,X,$,{end:K});else{if(!O(P)&&!k(P))throw new p("AsyncIterable or Promise","destination",P);{const re=P.readable||P;D++,M(re,X,$,{end:K})}}P=X;const{destroy:ee,cleanup:te}=C(P,!1,!0);R.push(ee),Q&&u.push(te)}}else if(A(z)){if(E(P)){D+=2;const ne=F(P,z,$,{end:K});S(z)&&Q&&u.push(ne)}else if(k(P)||O(P)){const ie=P.readable||P;D++,M(ie,z,$,{end:K})}else{if(!v(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,M(P,z,$,{end:K})}P=z}else if(I(z)){if(E(P))D++,L(j(P),z,$,{end:K});else if(O(P)||v(P))D++,L(P,z,$,{end:K});else{if(!k(P))throw new d("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],P);D++,L(P.readable,z,$,{end:K})}P=z}else P=f.from(z)}return(null!=l&&l.aborted||null!=c&&c.aborted)&&n.nextTick(h),P}function F(e,t,r,{end:i}){let o=!1;if(t.on("close",()=>{o||r(new y)}),e.pipe(t,{end:!1}),i){function s(){o=!0,t.end()}R(e)?n.nextTick(s):e.once("end",s)}else r();return l(e,{readable:!0,writable:!1},t=>{const n=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&n&&n.ended&&!n.errored&&!n.errorEmitted?e.once("end",r).once("error",r):r(t)}),l(t,{readable:!1,writable:!0},r)}e.exports={pipelineImpl:D,pipeline:function(...e){return D(e,c(function(e){return m(e[e.length-1],"streams[stream.length - 1]"),e.pop()}(e)))}}},4947:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ArrayPrototypeIncludes:i,ArrayPrototypeJoin:o,ArrayPrototypeMap:s,NumberIsInteger:a,NumberIsNaN:l,NumberMAX_SAFE_INTEGER:c,NumberMIN_SAFE_INTEGER:u,NumberParseInt:f,ObjectPrototypeHasOwnProperty:h,RegExpPrototypeExec:d,String:p,StringPrototypeToUpperCase:g,StringPrototypeTrim:b}=r(2768),{hideStackFrames:y,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:m,ERR_INVALID_ARG_VALUE:w,ERR_OUT_OF_RANGE:v,ERR_UNKNOWN_SIGNAL:S}}=r(9157),{normalizeEncoding:E}=r(9862),{isAsyncFunction:A,isArrayBufferView:k}=r(9862).types,I={},O=/^[0-7]+$/,R=y((e,t,r=u,n=c)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),T=y((e,t,r=-2147483648,n=2147483647)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);if(e<r||e>n)throw new v(t,`>= ${r} && <= ${n}`,e)}),x=y((e,t,r=!1)=>{if("number"!=typeof e)throw new m(t,"number",e);if(!a(e))throw new v(t,"an integer",e);const n=r?1:0,i=4294967295;if(e<n||e>i)throw new v(t,`>= ${n} && <= ${i}`,e)});function P(e,t){if("string"!=typeof e)throw new m(t,"string",e)}const N=y((e,t,r)=>{if(!i(r,e)){const n=o(s(r,e=>"string"==typeof e?`'${e}'`:p(e)),", ");throw new w(t,e,"must be one of: "+n)}});function C(e,t){if("boolean"!=typeof e)throw new m(t,"boolean",e)}function j(e,t,r){return null!=e&&h(e,t)?e[t]:r}const M=y((e,t,r=null)=>{const i=j(r,"allowArray",!1),o=j(r,"allowFunction",!1);if(!j(r,"nullable",!1)&&null===e||!i&&n(e)||"object"!=typeof e&&(!o||"function"!=typeof e))throw new m(t,"Object",e)}),L=y((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new m(t,"a dictionary",e)}),D=y((e,t,r=0)=>{if(!n(e))throw new m(t,"Array",e);if(e.length<r)throw new w(t,e,`must be longer than ${r}`)}),F=y((e,t="buffer")=>{if(!k(e))throw new m(t,["Buffer","TypedArray","DataView"],e)}),$=y((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new m(t,"AbortSignal",e)}),B=y((e,t)=>{if("function"!=typeof e)throw new m(t,"Function",e)}),U=y((e,t)=>{if("function"!=typeof e||A(e))throw new m(t,"Function",e)}),W=y((e,t)=>{if(void 0!==e)throw new m(t,"undefined",e)}),q=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function V(e,t){if(void 0===e||!d(q,e))throw new w(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}e.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(void 0===e&&(e=r),"string"==typeof e){if(null===d(O,e))throw new w(t,e,"must be a 32-bit unsigned integer or an octal string");e=f(e,8)}return x(e,t),e},validateArray:D,validateStringArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)P(e[r],`${t}[${r}]`)},validateBooleanArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++)C(e[r],`${t}[${r}]`)},validateAbortSignalArray:function(e,t){D(e,t);for(let r=0;r<e.length;r++){const n=e[r],i=`${t}[${r}]`;if(null==n)throw new m(i,"AbortSignal",n);$(n,i)}},validateBoolean:C,validateBuffer:F,validateDictionary:L,validateEncoding:function(e,t){const r=E(t),n=e.length;if("hex"===r&&n%2!=0)throw new w("encoding",t,`is invalid for data of length ${n}`)},validateFunction:B,validateInt32:T,validateInteger:R,validateNumber:function(e,t,r=void 0,n){if("number"!=typeof e)throw new m(t,"number",e);if(null!=r&&e<r||null!=n&&e>n||(null!=r||null!=n)&&l(e))throw new v(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=n?" && ":""}${null!=n?`<= ${n}`:""}`,e)},validateObject:M,validateOneOf:N,validatePlainFunction:U,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===b(e).length||+e!==+e>>>0||e>65535||0===e&&!r)throw new _(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(P(e,t),void 0===I[e]){if(void 0!==I[g(e)])throw new S(e+" (signals must use all capital letters)");throw new S(e)}},validateString:P,validateUint32:x,validateUndefined:W,validateUnion:function(e,t,r){if(!i(r,e))throw new m(t,`('${o(r,"|")}')`,e)},validateAbortSignal:$,validateLinkHeaderValue:function(e){if("string"==typeof e)return V(e,"hints"),e;if(n(e)){const t=e.length;let r="";if(0===t)return r;for(let n=0;n<t;n++){const i=e[n];V(i,"hints"),r+=i,n!==t-1&&(r+=", ")}return r}throw new w("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}}},4959:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),i=[0,16,128,131,135,144,145,151,153],o=(e,t,r,i,o=148)=>{i?.discardParsedPackets(),i&&!i.isCurrent()||e._cleanUp(!0),r(),e.emit("error",new n.ErrorWithReasonCode(t,o))},s=(e,t,r)=>{r(),e.emit("error",t)};t.default=(e,t,r,n)=>{e.log("handlePublish: packet %o",t),r=void 0!==r?r:e.noop;let a=t.topic.toString();const l=t.payload,{qos:c}=t,{messageId:u}=t,{options:f}=e;if(5===e.options.protocolVersion){let i;if(t.properties&&(i=t.properties.topicAlias),void 0!==i){const t=e.topicAliasRecv;if(!t)return e.log("handlePublish :: received unexpected topic alias. alias: %d",i),void o(e,"Received a PUBLISH Topic Alias but no Topic Alias Maximum was advertised",r,n);if(0===a.length){if(!(i>0&&i<=65535))return e.log("handlePublish :: topic alias out of range. alias: %d",i),void o(e,`Received Topic Alias ${i} is outside the valid range 1-65535`,r,n);{const s=t.getTopicByAlias(i);if(!s)return e.log("handlePublish :: unregistered topic alias. alias: %d",i),void o(e,"Received unregistered Topic Alias",r,n,130);a=s,e.log("handlePublish :: topic complemented by alias. topic: %s - alias: %d",a,i)}}else{if(!t.put(a,i))return e.log("handlePublish :: topic alias outside the advertised maximum. alias: %d - max: %d",i,t.max),void o(e,`Received Topic Alias ${i} is outside the advertised Topic Alias Maximum range 1-${t.max}`,r,n);e.log("handlePublish :: registered topic: %s - alias: %d",a,i)}}}switch(e.log("handlePublish: qos %d",c),c){case 2:f.customHandleAcks(a,l,t,(o,a)=>{if("number"==typeof o&&(a=o,o=null),o)return s(e,o,r);if(-1===i.indexOf(a))return s(e,new Error("Wrong reason code for pubrec"),r);if(a)e._sendPacket({cmd:"pubrec",messageId:u,reasonCode:a},r);else{if(!e._trackIncomingQoS2Publish(u,r,n))return;e.incomingStore.put(t,()=>{e._sendPacket({cmd:"pubrec",messageId:u},r)})}});break;case 1:f.customHandleAcks(a,l,t,(n,o)=>("number"==typeof n&&(o=n,n=null),n?s(e,n,r):-1===i.indexOf(o)?s(e,new Error("Wrong reason code for puback"),r):(o||e.emit("message",a,l,t),void e.handleMessage(t,t=>{if(t)return r&&r(t);e._sendPacket({cmd:"puback",messageId:u,reasonCode:o},r)}))));break;case 0:e.emit("message",a,l,t),e.handleMessage(t,r);break;default:e.log("handlePublish: unknown QoS. Doing nothing.")}}},5003:(e,t,r)=>{var n=r(8287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},5016:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(2768);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:o}=r(9157).codes,s=r(2648),{getHighWaterMark:a}=r(3513);n(c.prototype,s.prototype),n(c,s);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new o("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},5034:(e,t,r)=>{"use strict";var n,i=r(2045);function o(e,t,r){return(t=function(e){var t=function(e){if("object"!=typeof e||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(4257),a=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),f=Symbol("lastPromise"),h=Symbol("handlePromise"),d=Symbol("stream");function p(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[d].read();null!==r&&(e[f]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function b(e){i.nextTick(g,e)}var y=Object.getPrototypeOf(function(){}),_=Object.setPrototypeOf((o(n={get stream(){return this[d]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(p(void 0,!0));if(this[d].destroyed)return new Promise(function(t,r){i.nextTick(function(){e[c]?r(e[c]):t(p(void 0,!0))})});var r,n=this[f];if(n)r=new Promise(function(e,t){return function(r,n){e.then(function(){t[u]?r(p(void 0,!0)):t[h](r,n)},n)}}(n,this));else{var o=this[d].read();if(null!==o)return Promise.resolve(p(o,!1));r=new Promise(this[h])}return this[f]=r,r}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var e=this;return new Promise(function(t,r){e[d].destroy(null,function(e){e?r(e):t(p(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(_,(o(t={},d,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,l,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,u,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[d].read();n?(r[f]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[f]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[a]=null,r[l]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[f]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[u]=!0}),e.on("readable",b.bind(null,r)),r}},5121:(e,t,r)=>{"use strict";const{SymbolDispose:n}=r(2768),{AbortError:i,codes:o}=r(9157),{isNodeStream:s,isWebStream:a,kControllerErrorFunction:l}=r(6801),c=r(6364),{ERR_INVALID_ARG_TYPE:u}=o;let f;e.exports.addAbortSignal=function(t,r){if((e=>{if("object"!=typeof e||!("aborted"in e))throw new u("signal","AbortSignal",e)})(t),!s(r)&&!a(r))throw new u("stream",["ReadableStream","WritableStream","Stream"],r);return e.exports.addAbortSignalNoValidate(t,r)},e.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;const o=s(t)?()=>{t.destroy(new i(void 0,{cause:e.reason}))}:()=>{t[l](new i(void 0,{cause:e.reason}))};if(e.aborted)o();else{f=f||r(9862).addAbortListener;const i=f(e,o);c(t,i[n])}return t}},5224:(e,t,r)=>{const n=r(5606),i=r(8287),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:d}=r(6801),p=r(6364),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:y}}=r(9157),{destroyer:_}=r(7302),m=r(2648),w=r(9214),v=r(7602),{createDeferredPromise:S}=r(9862),E=r(2070),A=globalThis.Blob||i.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(2768);class R extends m{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,i,a,l,c,u=!!o(t),f=!!s(r);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&_(t,e),h(e)}),c._write=function(e,t,i){r.write(e,t)?i():n=i},c._final=function(e){r.end(),i=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(i){const e=i;i=null,e()}})),u&&(p(t,e=>{u=!1,e&&_(t,e),h(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,o){e||null===l||(e=new g),a=null,n=null,i=null,null===l?o(e):(l=o,_(r,e),_(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(h(t))return T({readable:w.fromWeb(t)});if(d(t))return T({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:r}=S();const i=new I,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:r}=S()),yield i}}(),{signal:o}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:i,final:o,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{_(t,e)});return t=new R({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&d(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return O(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new b(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5228:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(4723),i=130,o=(e,t,r)=>{e.log("handleAuth :: %s",t.message),r?.discardParsedPackets(),r&&!r.isCurrent()||e._cleanUp(!0),e.emit("error",t)};t.default=(e,t,r)=>{const{options:s}=e,a=s.protocolVersion,l=5===a?t.reasonCode:t.returnCode;if(5!==a)return void o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packets are only supported in MQTT 5. Your version:${a}`,i),r);const c=e._authenticationMethod;c?t.properties?.authenticationMethod===c?e.handleAuth(t,(t,s)=>{if(t)o(e,t,r);else{if(0!==l)return 24===l?s?(e.reconnecting=!1,void e._sendPacket(s)):void o(e,new n.ErrorWithReasonCode("Protocol error: No auth packet to continue the authentication exchange",i),r):void o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet reason code ${l} is not one a broker may send`,i),r);e.log("handleAuth :: authentication exchange completed successfully")}}):o(e,new n.ErrorWithReasonCode(`Protocol error: Auth packet Authentication Method does not match the "${c}" sent in CONNECT`,i),r):o(e,new n.ErrorWithReasonCode("Protocol error: Auth packet received but enhanced authentication was not requested",i),r)}},5244:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=r(2768),{promisify:{custom:a}}=r(9862),{streamReturningOperators:l,promiseReturningOperators:c}=r(4269),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(9157),f=r(9848),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=r(3513),{pipeline:p}=r(3616),{destroyer:g}=r(7302),b=r(6364),y=r(3425),_=r(6801),m=e.exports=r(8745).Stream;m.isDestroyed=_.isDestroyed,m.isDisturbed=_.isDisturbed,m.isErrored=_.isErrored,m.isReadable=_.isReadable,m.isWritable=_.isWritable,m.Readable=r(9214);for(const v of o(l)){const S=l[v];function E(...e){if(new.target)throw u();return m.Readable.from(s(S,this,e))}i(E,"name",{__proto__:null,value:S.name}),i(E,"length",{__proto__:null,value:S.length}),i(m.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}i(I,"name",{__proto__:null,value:k.name}),i(I,"length",{__proto__:null,value:k.length}),i(m.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}m.Writable=r(7602),m.Duplex=r(2648),m.Transform=r(5016),m.PassThrough=r(5258),m.pipeline=p;const{addAbortSignal:w}=r(5121);m.addAbortSignal=w,m.finished=b,m.destroy=g,m.compose=f,m.setDefaultHighWaterMark=h,m.getDefaultHighWaterMark=d,i(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),i(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),i(b,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},5258:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n}=r(2768);e.exports=o;const i=r(5016);function o(e){if(!(this instanceof o))return new o(e);i.call(this,e)}n(o.prototype,i.prototype),n(o,i),o.prototype._transform=function(e,t,r){r(null,e)}},5267:(e,t,r)=>{"use strict";var n,i=r(2463).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function l(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];var u,f=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var h=t.map(function(e,i){var o=i<t.length-1;return function(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;e.on("close",function(){a=!0}),void 0===n&&(n=r(4257)),n(e,{readable:t,writable:i},function(e){if(e)return o(e);a=!0,o()});var l=!1;return function(t){if(!a&&!l)return l=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new s("pipe"))}}(e,o,i>0,function(e){u||(u=e),e&&h.forEach(l),o||(h.forEach(l),f(u))})});return t.reduce(c)}},5341:(e,t,r)=>{"use strict";const n=r(7007);"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol.for("nodejs.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol.for("nodejs.asyncDispose"));const i="\0vrpc-handler",o="\0vrpc-callback";function s(e){return"function"==typeof e}function a(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}function l(e){return!!e&&("object"==typeof e||"function"==typeof e)&&(s(e[Symbol.asyncDispose])||s(e[Symbol.dispose]))}function c(e){return!(!e||"object"!=typeof e||void 0===e._events||void 0===e._eventsCount)||e}function u(e){if(Array.isArray(e))return e.map(u);if(e&&"object"==typeof e&&e.constructor===Object){const t={};for(const r of Object.keys(e).sort())t[r]=u(e[r]);return t}return e}function f(e){return JSON.stringify(u(e))}function h(e,t){return!("off"!==e&&"removeListener"!==e&&!/^off[A-Z]/.test(e))||!(t>=4)&&/^(unmonitor|unsignal|remove)[A-Z]/.test(e)}function d(e){return"on"===e?"off":"addListener"===e?"removeListener":/^on[A-Z]/.test(e)?`off${e.slice(2)}`:/^(monitor|signal)[A-Z]/.test(e)?`un${e}`:null}function p(e){return"string"==typeof e&&e.startsWith("__e__")}function g(e,t){if("string"!=typeof e)return!1;const r=`__e__${e}/`;return!!t.startsWith(r)&&t.slice(r.length).split("/").every(e=>e.length>0&&!/[+#]/.test(e))}class b{constructor({publish:e,emit:t}){this._publish=e,this._emit=t,this._contexts=new Map,this._held=new Map,this._byClient=new Map}static carriesEventIds(e){if(!Array.isArray(e))return!1;for(let t=0;t<e.length;t++)if(p(e[t]))return!0;return!1}call({json:e,contextKey:t,contextName:r,target:l,func:u,args:d,isCallAll:b,speaks:y,makeCallback:_}){const m=e.s,w=[],v=new Array(d.length);for(let e=0;e<d.length;e++){const t=d[e];p(t)?(w.push(t),v[e]=i):"string"==typeof t&&t.startsWith("__f__")?v[e]=o:v[e]=t}for(const e of w)if(!g(m,e))throw new Error("A subscription id must name a topic under its sender's connection id");if(h(u,e.v))return this._withdrawByRemover(u,v,w,m,t),{value:!0,ids:[]};if(!s(l[u]))throw new Error(`Could not find function: ${u}`);if("once"===u||"prependOnceListener"===u){const t=y||(()=>!0),n=d.map((n,s)=>v[s]===o?_(n):v[s]!==i?n:(...i)=>{t()&&this._publish({a:b?[r,...i]:i,i:n,receiverVersion:e.v})});return{value:c(l[u].apply(l,n)),ids:[]}}const S=`${u}\0${f(v)}`;if(e.v>=4)for(const e of w){const r=this._subscriptionsOn(e,t).find(e=>e.reg.key!==S);if(r)throw new Error(`Subscription id already held here by ${r.reg.func} with other arguments: every target, function and arguments needs its own id`)}let E=this._contexts.get(t);E||(E=new Map,this._contexts.set(t,E));let A=E.get(S);if(A){const t=this._join(A,w,e,b);return 2===A.state&&(A.state=1),this._greet(A,t),{value:0===A.state?A.promise:A.r,ids:w}}const k=("on"===u||"addListener"===u)&&l[u]===n.prototype[u];A={contextKey:t,contextName:r,target:l,func:u,key:S,args:v.filter(e=>e!==i&&e!==o),event:"on"===u||"addListener"===u?d[0]:null,nodeEmitter:k,state:0,positions:[],r:void 0,promise:null,registration:null,events:0,bucketStart:Date.now(),bucketCount:0,rate:null};const I=y||(()=>!0);A.speaks=I;for(let e=0;e<w.length;e++)A.positions.push({subs:new Map,fanout:this._fanout(A,e,r,I)});E.set(S,A),this._join(A,w,e,b);let O=0;const R=d.map((e,t)=>v[t]===o?_(e):v[t]!==i?e:A.positions[O++].fanout);let T;A.unwrapped=R;try{T=l[u].apply(l,R)}catch(e){throw this._fail(A),e}return a(T)?(A.promise=Promise.resolve(T).then(e=>(this._settle(A,e),A.r),e=>{throw this._fail(A),e}),{value:A.promise,ids:w}):(this._settle(A,T),{value:A.r,ids:w})}unsubscribe(e,t){let r=0;for(const n of Array.isArray(e)?e:[e])p(n)?r+=this._withdraw(n,t):n&&"object"==typeof n&&p(n.id)&&"string"==typeof n.context&&(r+=this._withdraw(n.id,t,n.context));return r}withdrawClient(e){const t=this._byClient.get(e);if(t){for(const r of Array.from(t))this._withdraw(r,e);this._byClient.delete(e)}}withdrawEvent(e,t,r){const n=this._contexts.get(e);if(n)for(const e of Array.from(n.values()))if(!("on"!==e.func&&"addListener"!==e.func||null!=t&&e.event!==t))for(const t of this._subscriptionsOf(e))t.clientId===r&&this._remove(t)}list(e){const t=this._contexts.get(e);if(!t)return[];const r=Date.now();return Array.from(t.values()).map(e=>({function:e.func,args:e.args,state:["pending","live","silent","gone"][e.state],subscriptions:this._subscriptionsOf(e).map(e=>({label:void 0===e.label?null:e.label,callAll:e.isCallAll})),events:e.events,rate:b._rate(e,r)}))}end(e,t,r=[],n=null){const i=this._contexts.get(e);if(!i)return!1;const o=f(Array.isArray(r)?r:[r]);for(const e of i.values())if(e.func===t&&f(e.args)===o)return this._ended(e,{reason:"ended",by:n}),!0;return!1}forgetContext(e,{release:t=!0}={}){const r=this._contexts.get(e);if(r){this._contexts.delete(e);for(const e of r.values())this._unlink(e),(t||e.nodeEmitter)&&this._release(e)}}holds(e,t,r){return this._subscriptionsOn(t,e).some(e=>void 0===r||e.clientId===r)}_fanout(e,t,r,n){return(...i)=>{if(!(e.state>=2)&&n()){this._count(e);for(const n of e.positions[t].subs.values())this._publish({a:n.isCallAll?[r,...i]:i,i:n.id,receiverVersion:n.v})}}}_count(e){e.events++;const t=Date.now();t-e.bucketStart>=5e3&&(e.rate=1e3*e.bucketCount/(t-e.bucketStart),e.bucketStart=t,e.bucketCount=0),e.bucketCount++}static _rate(e,t){const r=t-e.bucketStart;return r>=5e3||null===e.rate?1e3*e.bucketCount/Math.max(r,1e3):e.rate}_join(e,t,r,n){const i=[],o=r.l&&"object"==typeof r.l?r.l:{};for(let s=0;s<t.length&&s<e.positions.length;s++){const a=t[s];if(t.indexOf(a)!==s)continue;const l=e.positions[s];let c=l.subs.get(a);if(!c){c={id:a,clientId:r.s,isCallAll:!!n,reg:e,position:l,contextKey:e.contextKey},l.subs.set(a,c);let t=this._held.get(a);t||(t=new Map,this._held.set(a,t)),t.set(b._holdKey(c),c);let o=this._byClient.get(r.s);o||(o=new Set,this._byClient.set(r.s,o)),o.add(a),i.push(c)}c.v="number"==typeof r.v?r.v:0,void 0!==o[a]&&(c.label=o[a])}return i}_greet(e,t){const{registration:r}=e;if(1===e.state&&r&&s(r.greet))for(const n of t){const t=t=>this._emit("greetFailed",{context:e.contextName,function:e.func,args:e.args,error:t}),i=e.positions.map(t=>t===n.position?this._direct(e,n):()=>{});try{const e=r.greet(...i);a(e)&&e.then(null,t)}catch(e){t(e)}}}_direct(e,t){return(...r)=>{e.state>=2||!e.speaks()||t.position.subs.get(t.id)===t&&this._publish({a:t.isCallAll?[e.contextName,...r]:r,i:t.id,receiverVersion:t.v})}}static _holdKey(e){return`${e.contextKey}\0${e.reg.key}`}_subscriptionsOn(e,t){const r=this._held.get(e);return r?Array.from(r.values()).filter(e=>e.contextKey===t):[]}_subscriptionsOf(e){const t=[];for(const r of e.positions)for(const e of r.subs.values())t.push(e);return t}_withdraw(e,t,r){const n=this._held.get(e);if(!n)return 0;let i=0;for(const e of Array.from(n.values()))void 0!==r&&e.contextKey!==r||e.clientId===t&&(this._remove(e),i++);return i}_withdrawByRemover(e,t,r,n,i){const o=function(e){return"off"===e||"removeListener"===e?["on","addListener"]:/^off[A-Z]/.test(e)?[`on${e.slice(3)}`]:/^un(monitor|signal)[A-Z]/.test(e)?[e.slice(2)]:null}(e),s=new Set((o||[]).map(e=>`${e}\0${f(t)}`));for(const e of r){const t=this._subscriptionsOn(e,i).filter(e=>e.clientId===n&&(null===o||o.includes(e.reg.func))),r=t.filter(e=>s.has(e.reg.key));for(const e of r.length>0?r:t)this._remove(e)}}_remove(e){this._forget(e);const{reg:t}=e;for(const e of t.positions)if(e.subs.size>0)return;this._lastOut(t)}_forget(e){e.position.subs.delete(e.id);const t=this._held.get(e.id),r=b._holdKey(e);if(t&&t.get(r)===e&&(t.delete(r),0===t.size)){this._held.delete(e.id);const t=this._byClient.get(e.clientId);t&&(t.delete(e.id),0===t.size&&this._byClient.delete(e.clientId))}}_lastOut(e){1===e.state&&(b._canRelease(e)?(this._unlink(e),this._release(e)):e.state=2)}_settle(e,t){const r=!e.nodeEmitter&&t!==e.target&&l(t);if(0!==e.state)return void(r&&(e.registration=t,this._release(e)));if(r){e.registration=t,e.r=!("value"in t)||c(t.value);const{ended:r}=t;a(r)&&r.then(t=>this._ended(e,{reason:"string"==typeof t&&t?t:"ended",by:"source"}),t=>this._ended(e,{reason:t&&t.message||String(t),by:"source",failed:!0}))}else e.r=c(t);e.state=1;const n=this._subscriptionsOf(e);0===n.length?this._lastOut(e):this._greet(e,n)}_fail(e){this._unlink(e)}_unlink(e){e.state=3;const t=this._contexts.get(e.contextKey);t&&t.get(e.key)===e&&(t.delete(e.key),0===t.size&&this._contexts.delete(e.contextKey));for(const t of this._subscriptionsOf(e))this._forget(t)}_ended(e,t){if(3===e.state)return;const r=this._subscriptionsOf(e);this._unlink(e),this._release(e);for(const n of r)n.v>=4&&this._publish({i:n.id,end:{...t,context:e.contextName}})}static _canRelease(e){const t=d(e.func);return!!e.registration||e.nodeEmitter||null!==t&&s(e.target[t])||s(e.target.removeListener)}_release(e){const t=t=>this._emit("releaseFailed",{context:e.contextName,function:e.func,args:e.args,error:t});try{const{registration:r,target:n}=e;if(r)if(e.registration=null,s(r[Symbol.asyncDispose])){const e=r[Symbol.asyncDispose]();a(e)&&e.then(null,t)}else r[Symbol.dispose]();else if(e.nodeEmitter)for(const{fanout:t}of e.positions)n.removeListener(e.event,t);else if(s(n[d(e.func)])){const r=n[d(e.func)](...e.unwrapped);a(r)&&r.then(null,t)}else if(s(n.removeListener))for(const{fanout:t}of e.positions)n.removeListener(e.event,t)}catch(e){t(e)}}}b.isRegistration=l,b.isRemover=h,b.canonical=f,b.sanitize=c,b.NOTICE_VERSION=4,e.exports=b},5345:e=>{"use strict";e.exports=URIError},5350:()=>{},5373:(e,t,r)=>{"use strict";var n=r(8636),i=r(2642),o=r(4765);e.exports={formats:o,parse:i,stringify:n}},5399:(e,t,r)=>{const n=e.exports,{Buffer:i}=r(8287);n.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"},n.requiredHeaderFlags={1:0,2:0,4:0,5:0,6:2,7:0,8:2,9:0,10:2,11:0,12:0,13:0,14:0,15:0},n.requiredHeaderFlagsErrors={};for(const e in n.requiredHeaderFlags){const t=n.requiredHeaderFlags[e];n.requiredHeaderFlagsErrors[e]="Invalid header flag bits, must be 0x"+t.toString(16)+" for "+n.types[e]+" packet"}n.codes={};for(const e in n.types){const t=n.types[e];n.codes[t]=e}n.CMD_SHIFT=4,n.CMD_MASK=240,n.DUP_MASK=8,n.QOS_MASK=3,n.QOS_SHIFT=1,n.RETAIN_MASK=1,n.VARBYTEINT_MASK=127,n.VARBYTEINT_FIN_MASK=128,n.VARBYTEINT_MAX=268435455,n.SESSIONPRESENT_MASK=1,n.SESSIONPRESENT_HEADER=i.from([n.SESSIONPRESENT_MASK]),n.CONNACK_HEADER=i.from([n.codes.connack<<n.CMD_SHIFT]),n.USERNAME_MASK=128,n.PASSWORD_MASK=64,n.WILL_RETAIN_MASK=32,n.WILL_QOS_MASK=24,n.WILL_QOS_SHIFT=3,n.WILL_FLAG_MASK=4,n.CLEAN_SESSION_MASK=2,n.CONNECT_HEADER=i.from([n.codes.connect<<n.CMD_SHIFT]),n.properties={sessionExpiryInterval:17,willDelayInterval:24,receiveMaximum:33,maximumPacketSize:39,topicAliasMaximum:34,requestResponseInformation:25,requestProblemInformation:23,userProperties:38,authenticationMethod:21,authenticationData:22,payloadFormatIndicator:1,messageExpiryInterval:2,contentType:3,responseTopic:8,correlationData:9,maximumQoS:36,retainAvailable:37,assignedClientIdentifier:18,reasonString:31,wildcardSubscriptionAvailable:40,subscriptionIdentifiersAvailable:41,sharedSubscriptionAvailable:42,serverKeepAlive:19,responseInformation:26,serverReference:28,topicAlias:35,subscriptionIdentifier:11},n.propertiesCodes={};for(const e in n.properties){const t=n.properties[e];n.propertiesCodes[t]=e}function o(e){return[0,1,2].map(t=>[0,1].map(r=>[0,1].map(o=>{const s=i.alloc(1);return s.writeUInt8(n.codes[e]<<n.CMD_SHIFT|(r?n.DUP_MASK:0)|t<<n.QOS_SHIFT|o,0,!0),s})))}n.propertiesTypes={sessionExpiryInterval:"int32",willDelayInterval:"int32",receiveMaximum:"int16",maximumPacketSize:"int32",topicAliasMaximum:"int16",requestResponseInformation:"byte",requestProblemInformation:"byte",userProperties:"pair",authenticationMethod:"string",authenticationData:"binary",payloadFormatIndicator:"byte",messageExpiryInterval:"int32",contentType:"string",responseTopic:"string",correlationData:"binary",maximumQoS:"int8",retainAvailable:"byte",assignedClientIdentifier:"string",reasonString:"string",wildcardSubscriptionAvailable:"byte",subscriptionIdentifiersAvailable:"byte",sharedSubscriptionAvailable:"byte",serverKeepAlive:"int16",responseInformation:"string",serverReference:"string",topicAlias:"int16",subscriptionIdentifier:"var"},n.PUBLISH_HEADER=o("publish"),n.SUBSCRIBE_HEADER=o("subscribe"),n.SUBSCRIBE_OPTIONS_QOS_MASK=3,n.SUBSCRIBE_OPTIONS_NL_MASK=1,n.SUBSCRIBE_OPTIONS_NL_SHIFT=2,n.SUBSCRIBE_OPTIONS_RAP_MASK=1,n.SUBSCRIBE_OPTIONS_RAP_SHIFT=3,n.SUBSCRIBE_OPTIONS_RH_MASK=3,n.SUBSCRIBE_OPTIONS_RH_SHIFT=4,n.SUBSCRIBE_OPTIONS_RH=[0,16,32],n.SUBSCRIBE_OPTIONS_NL=4,n.SUBSCRIBE_OPTIONS_RAP=8,n.SUBSCRIBE_OPTIONS_QOS=[0,1,2],n.UNSUBSCRIBE_HEADER=o("unsubscribe"),n.ACKS={unsuback:o("unsuback"),puback:o("puback"),pubcomp:o("pubcomp"),pubrel:o("pubrel"),pubrec:o("pubrec")},n.SUBACK_HEADER=i.from([n.codes.suback<<n.CMD_SHIFT]),n.VERSION3=i.from([3]),n.VERSION4=i.from([4]),n.VERSION5=i.from([5]),n.VERSION131=i.from([131]),n.VERSION132=i.from([132]),n.QOS=[0,1,2].map(e=>i.from([e])),n.EMPTY={pingreq:i.from([n.codes.pingreq<<4,0]),pingresp:i.from([n.codes.pingresp<<4,0]),disconnect:i.from([n.codes.disconnect<<4,0])},n.MQTT5_PUBACK_PUBREC_CODES={0:"Success",16:"No matching subscribers",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",144:"Topic Name invalid",145:"Packet identifier in use",151:"Quota exceeded",153:"Payload format invalid"},n.MQTT5_PUBREL_PUBCOMP_CODES={0:"Success",146:"Packet Identifier not found"},n.MQTT5_SUBACK_CODES={0:"Granted QoS 0",1:"Granted QoS 1",2:"Granted QoS 2",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use",151:"Quota exceeded",158:"Shared Subscriptions not supported",161:"Subscription Identifiers not supported",162:"Wildcard Subscriptions not supported"},n.MQTT5_UNSUBACK_CODES={0:"Success",17:"No subscription existed",128:"Unspecified error",131:"Implementation specific error",135:"Not authorized",143:"Topic Filter invalid",145:"Packet Identifier in use"},n.MQTT5_DISCONNECT_CODES={0:"Normal disconnection",4:"Disconnect with Will Message",128:"Unspecified error",129:"Malformed Packet",130:"Protocol Error",131:"Implementation specific error",135:"Not authorized",137:"Server busy",139:"Server shutting down",141:"Keep Alive timeout",142:"Session taken over",143:"Topic Filter invalid",144:"Topic Name invalid",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"},n.MQTT5_AUTH_CODES={0:"Success",24:"Continue authentication",25:"Re-authenticate"}},5568:e=>{"use strict";const{AbortController:t,AbortSignal:r}="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0;e.exports=t,e.exports.AbortSignal=r,e.exports.default=t},5606:e=>{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,l=[],c=!1,u=-1;function f(){c&&a&&(c=!1,a.length?l=a.concat(l):u=-1,l.length&&h())}function h(){if(!c){var e=s(f);c=!0;for(var t=l.length;t;){for(a=l,l=[];++u<t;)a&&a[u].run();u=-1,t=l.length}a=null,c=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===o||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function d(e,t){this.fun=e,this.array=t}function p(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new d(e,t)),1!==l.length||c||s(h)},d.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},5670:(e,t,r)=>{"use strict";const n=r(8287),i=r(9584),o=r(2635);let s,a,l;t.A=(e,t)=>{if(t.hostname=t.hostname||t.host,!t.hostname)throw new Error("Could not determine host. Specify host manually.");const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt";!function(e){e.hostname||(e.hostname="localhost"),e.path||(e.path="/"),e.wsOptions||(e.wsOptions={})}(t);const c=function(e,t){const r="wxs"===e.protocol?"wss":"ws";let n=`${r}://${e.hostname}${e.path}`;return e.port&&80!==e.port&&443!==e.port&&(n=`${r}://${e.hostname}:${e.port}${e.path}`),"function"==typeof e.transformWsUrl&&(n=e.transformWsUrl(n,e,t)),n}(t,e);s=wx.connectSocket({url:c,protocols:[r]}),a=function(){const e=new i.Transform;return e._write=(e,t,r)=>{s.send({data:e.buffer,success(){r()},fail(e){r(new Error(e))}})},e._flush=e=>{s.close({success(){e()}})},e}(),l=new o.BufferedDuplex(t,a,s),l._destroy=(e,t)=>{s.close({success(){t&&t(e)}})};const u=l.destroy;return l.destroy=(e,t)=>(l.destroy=u,setTimeout(()=>{s.close({fail(){l._destroy(e,t)}})},0),l),s.onOpen(()=>{l.socketReady()}),s.onMessage(e=>{let{data:t}=e;t=t instanceof ArrayBuffer?n.Buffer.from(t):n.Buffer.from(t,"utf8"),a.push(t)}),s.onClose(()=>{l.emit("close"),l.end(),l.destroy()}),s.onError(e=>{const t=new Error(e.errMsg);l.destroy(t)}),l}},5680:(e,t,r)=>{"use strict";var n=r(5767);e.exports=function(e){return!!n(e)}},5767:(e,t,r)=>{"use strict";var n=r(2682),i=r(9209),o=r(487),s=r(6556),a=r(5795),l=r(3628),c=s("Object.prototype.toString"),u=r(9092)(),f="undefined"==typeof globalThis?r.g:globalThis,h=i(),d=s("String.prototype.slice"),p=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return-1},g={__proto__:null};n(h,u&&a&&l?function(e){var t=new f[e];if(Symbol.toStringTag in t&&l){var r=l(t),n=a(r,Symbol.toStringTag);if(!n&&r){var i=l(r);n=a(i,Symbol.toStringTag)}g["$"+e]=o(n.get)}}:function(e){var t=new f[e],r=t.slice||t.set;r&&(g["$"+e]=o(r))}),e.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!u){var t=d(c(e),8,-1);return p(h,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(g,function(r,n){if(!t)try{r(e),t=d(n,1)}catch(e){}}),t}(e)}return a?function(e){var t=!1;return n(g,function(r,n){if(!t)try{"$"+r(e)===n&&(t=d(n,1))}catch(e){}}),t}(e):null}},5769:(e,t,r)=>{const n=r(5606),i=r(8287),{isReadable:o,isWritable:s,isIterable:a,isNodeStream:l,isReadableNodeStream:c,isWritableNodeStream:u,isDuplexNodeStream:f,isReadableStream:h,isWritableStream:d}=r(5980),p=r(577),{AbortError:g,codes:{ERR_INVALID_ARG_TYPE:b,ERR_INVALID_RETURN_VALUE:y}}=r(2074),{destroyer:_}=r(1787),m=r(7323),w=r(2729),v=r(8601),{createDeferredPromise:S}=r(7797),E=r(1401),A=globalThis.Blob||i.Blob,k=void 0!==A?function(e){return e instanceof A}:function(e){return!1},I=globalThis.AbortController||r(5568).AbortController,{FunctionPrototypeCall:O}=r(4469);class R extends m{constructor(e){super(e),!1===(null==e?void 0:e.readable)&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===(null==e?void 0:e.writable)&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function T(e){const t=e.readable&&"function"!=typeof e.readable.read?w.wrap(e.readable):e.readable,r=e.writable;let n,i,a,l,c,u=!!o(t),f=!!s(r);function h(e){const t=l;l=null,t?t(e):e&&c.destroy(e)}return c=new R({readableObjectMode:!(null==t||!t.readableObjectMode),writableObjectMode:!(null==r||!r.writableObjectMode),readable:u,writable:f}),f&&(p(r,e=>{f=!1,e&&_(t,e),h(e)}),c._write=function(e,t,i){r.write(e,t)?i():n=i},c._final=function(e){r.end(),i=e},r.on("drain",function(){if(n){const e=n;n=null,e()}}),r.on("finish",function(){if(i){const e=i;i=null,e()}})),u&&(p(t,e=>{u=!1,e&&_(t,e),h(e)}),t.on("readable",function(){if(a){const e=a;a=null,e()}}),t.on("end",function(){c.push(null)}),c._read=function(){for(;;){const e=t.read();if(null===e)return void(a=c._read);if(!c.push(e))return}}),c._destroy=function(e,o){e||null===l||(e=new g),a=null,n=null,i=null,null===l?o(e):(l=o,_(r,e),_(t,e))},c}e.exports=function e(t,r){if(f(t))return t;if(c(t))return T({readable:t});if(u(t))return T({writable:t});if(l(t))return T({writable:!1,readable:!1});if(h(t))return T({readable:w.fromWeb(t)});if(d(t))return T({writable:v.fromWeb(t)});if("function"==typeof t){const{value:e,write:i,final:o,destroy:s}=function(e){let{promise:t,resolve:r}=S();const i=new I,o=i.signal;return{value:e(async function*(){for(;;){const e=t;t=null;const{chunk:i,done:s,cb:a}=await e;if(n.nextTick(a),s)return;if(o.aborted)throw new g(void 0,{cause:o.reason});({promise:t,resolve:r}=S()),yield i}}(),{signal:o}),write(e,t,n){const i=r;r=null,i({chunk:e,done:!1,cb:n})},final(e){const t=r;r=null,t({done:!0,cb:e})},destroy(e,t){i.abort(),t(e)}}}(t);if(a(e))return E(R,e,{objectMode:!0,write:i,final:o,destroy:s});const l=null==e?void 0:e.then;if("function"==typeof l){let t;const r=O(l,e,e=>{if(null!=e)throw new y("nully","body",e)},e=>{_(t,e)});return t=new R({objectMode:!0,readable:!1,write:i,final(e){o(async()=>{try{await r,n.nextTick(e,null)}catch(t){n.nextTick(e,t)}})},destroy:s})}throw new y("Iterable, AsyncIterable or AsyncFunction",r,e)}if(k(t))return e(t.arrayBuffer());if(a(t))return E(R,t,{objectMode:!0,writable:!1});if(h(null==t?void 0:t.readable)&&d(null==t?void 0:t.writable))return R.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return T({readable:null!=t&&t.readable?c(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?u(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});const i=null==t?void 0:t.then;if("function"==typeof i){let e;return O(i,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{_(e,t)}),e=new R({objectMode:!0,writable:!1,read(){}})}throw new b(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}},5795:(e,t,r)=>{"use strict";var n=r(6549);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},5880:e=>{"use strict";e.exports=Math.pow},5980:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=r(4469),s=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),c=o("nodejs.stream.writable"),u=o("nodejs.stream.disturbed"),f=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function b(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function _(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!d(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!m(e)&&d(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!m(e)&&p(e)&&e.writable&&!w(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:m,kIsDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!m(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:b,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return b(e)||y(e)||_(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:k,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:_}},6171:(e,t,r)=>{const n=r(1072),i=r(9372),o=r(8665),s=r(3530),a=r(544),l=r(7007),{nanoid:c}=r(3561);class u extends l{constructor({username:e,password:t,token:r,domain:n="vrpc",agent:i=c(8),broker:a="mqtts://broker.hivemq.com:8883",log:l="console",bestEffort:f=!0,version:h="",mqttClientId:d=null}={}){super(),this._validateDomain(n),this._validateAgent(i),this._username=e,this._password=t,this._token=r,this._agent=i,this._domain=n,this._broker=a,this._qos=f?0:1,this._version=h,this._mqttClientId=d||`va3${u._createHash(this._domain+this._agent)}`,"console"===l?(this._log=console,this._log.debug=()=>{}):this._log=l,this._baseTopic=`${this._domain}/${this._agent}`,o.onCallback(this._handleVrpcCallback.bind(this)),this._handleDisposeFailed=({instance:e,className:t,error:r})=>this._log.warn(r,`Dispose of deleted instance ${t}::${e} failed: ${r.message}`),o.on("disposeFailed",this._handleDisposeFailed),this._handleReleaseFailed=({context:e,error:t,...r})=>this._log.warn(t,`Release of registration ${e}::${r.function} failed: ${t&&t.message}`),o.on("releaseFailed",this._handleReleaseFailed),this._handleGreetFailed=({context:e,error:t,...r})=>this._log.warn(t,`Greeting of a subscriber to ${e}::${r.function} failed: ${t&&t.message}`),o.on("greetFailed",this._handleGreetFailed),this._isolatedInstances=new Map,this._watched=new Set,this._subscribeRetrier=new s({subscribe:(e,t)=>this._mqttSubscribe(e,t),log:this._log}),this._connectGeneration=0,this._serving=!1,this.on("error",e=>{this._log.debug(`Encountered an error: ${e.message}`)})}async serve(){let e=this._username,t=this._password;return this._token?(e=`${this._domain}/${this._agent}`,t=this._token):this._password||(e=`${this._domain}/${this._agent}`,t=c()),this._options={username:e,password:t,keepalive:30,connectTimeout:1e4,reconnectOnConnackError:!0,clientId:this._mqttClientId,rejectUnauthorized:!1,will:{topic:`${this._baseTopic}/__agentInfo__`,payload:this._createAgentInfoPayload({status:"offline"}),qos:this._qos,retain:!0}},this._log.info(`Domain : ${this._domain}`),this._log.info(`Agent : ${this._agent}`),this._log.info(`Broker : ${this._broker}`),this._log.info("Connecting to MQTT server..."),this._client=i.connect(this._broker,this._options),this._backoff=new a(this._client),this._client.on("connect",this._handleConnect.bind(this)),this._client.on("reconnect",this._handleReconnect.bind(this)),this._client.on("error",this._handleError.bind(this)),this._client.on("message",this._handleMessage.bind(this)),this._client.on("close",this._handleClose.bind(this)),this._client.on("offline",this._handleOffline.bind(this)),this._client.on("end",this._handleEnd.bind(this)),this._ensureConnected()}async end({unregister:e=!1}={}){o.off("disposeFailed",this._handleDisposeFailed),o.off("releaseFailed",this._handleReleaseFailed),o.off("greetFailed",this._handleGreetFailed),this._subscribeRetrier.cancel();try{if(!this._client||!this._client.connected){if(this._client){const e=this._client;await new Promise(t=>e.end(!0,{},t))}return void this.emit("end")}const t=`${this._baseTopic}/__agentInfo__`;if(this._mqttPublish(t,this._createAgentInfoPayload({status:"offline"}),{retain:!0}),e){this._mqttPublish(t,null,{retain:!0});for(const e of this._getClasses())for(const t of["__classInfo__","__classInfoConcise__"])this._mqttPublish(`${this._baseTopic}/${e}/${t}`,null,{retain:!0})}await new Promise(e=>this._client.end(!1,{},e))}catch(e){this._log.error(e,`Problem during disconnecting agent: ${e.message}`)}}static _createHash(e,t=20){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_validateDomain(e){if(!e)throw new Error("The domain must be specified");if(e.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"')}_validateAgent(e){if(!e)throw new Error("The agent must be specified");if(e.match(/[+/#*]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#", "*"')}_createAgentInfoPayload({status:e}){return JSON.stringify({status:e,hostname:n.hostname(),version:this._version,v:4})}_mqttPublish(e,t,r){this._client.publish(e,t,{qos:this._qos,...r},e=>{e&&this._log.warn(`Could not publish MQTT message because: ${e.message}`)})}_mqttSubscribe(e,t,r){this._client.subscribe(e,{qos:this._qos,...t},(n,i)=>{const{refused:o,granted:a,error:l}=s.outcome(n,i);if(l)this._log.warn(`Could not subscribe to topic(s) '${e}', because: ${l.message}`);else{let r;const n=Array.isArray(e)?e:[e],i=o;i.length>0&&(r=new Error(`Could not subscribe all ${n.length} topic(s) but got error qos=128 on following ${i.length} topic(s): ${i}`),r.code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r),this.emit("error",r),this._subscribeRetrier.schedule(i,t)),this._subscribeRetrier.granted(a.map(e=>e.topic));const s=a.filter(e=>e.qos<this._qos);s.length>0&&(r=new Error(`Could not subscribe all ${n.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`),r.code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r),this.emit("error",r)),0===a.length&&this._log.debug(`Already subscribed to topic '${e}'`)}r&&r()})}_mqttUnsubscribe(e,t){this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`)})}_getClasses(){return o._getClassesArray()}_getInstances(e){return o._getInstancesArray(e)}_getMemberFunctions(e){return o._getMemberFunctionsArray(e)}_getStaticFunctions(e){return o._getStaticFunctionsArray(e)}_getMetaData(e){return o._getMetaData(e)}async _ensureConnected(){return new Promise(e=>{this._serving?e():(this.once("connect",e),this.once("end",e))})}_handleVrpcCallback(e){const{s:t,i:r,r:n,e:i,a:o,end:s,receiverVersion:a}=e,l=r.startsWith("__e__")?r.slice(5):t;let c,f;c=s?{i:r,end:s,v:4}:void 0!==o?{a:o,i:r,v:4}:u._answer({r:n,e:i,i:r});try{f=u._stringifySafely(c)}catch(e){const t=r.startsWith("__e__")?"event":"callback";if(this._log.warn(`The arguments of ${"event"===t?"an":"a"} ${t} to ${l} cannot be encoded as JSON: ${e.message}`),!(a>=4))return;f=JSON.stringify({i:r,e:{message:`The arguments of this ${t} cannot be encoded as JSON: ${e.message}`},v:4})}try{this._log.debug(`Forwarding callback to: ${l} with payload:`,e),this._mqttPublish(l,f)}catch(e){this._log.warn(e,`Problem publishing vrpc callback to ${l} because of: ${e.message}`)}}static _stringifySafely(e){try{return JSON.stringify(e)}catch(t){if(void 0!==e.a||e.end)throw t;return JSON.stringify({e:{message:`The result cannot be encoded as JSON: ${t.message}`},i:e.i,v:e.v})}}_handleConnect(){this._log.info("[OK]"),this._subscribeRetrier.cancel();const e=++this._connectGeneration,t=[];try{const e=this._generateTopics();e.length>0&&t.push(e)}catch(e){this._log.error(e,`Problem during initial topic subscription: ${e.message}`)}for(const[e,{className:r}]of o._instances.entries())t.push(this._methodsTopic(r,e));t.push(`${this._baseTopic}/+/__classInfoConcise__`);let r=t.length;const n=()=>{if(e===this._connectGeneration){this._publishAgentInfoMessage();for(const e of this._getClasses())this._publishClassInfoMessage(e);this._serving=!0,this.emit("connect")}};for(const e of t)this._mqttSubscribe(e,void 0,()=>{r-=1,0===r&&n()})}_publishAgentInfoMessage(){this._mqttPublish(`${this._baseTopic}/__agentInfo__`,this._createAgentInfoPayload({status:"online"}),{retain:!0})}_publishClassInfoMessage(e){const t={className:e,instances:this._getInstances(e),memberFunctions:this._getMemberFunctions(e),staticFunctions:this._getStaticFunctions(e),meta:this._getMetaData(e),v:4},{meta:r,...n}=t;try{this._mqttPublish(`${this._baseTopic}/${e}/__classInfo__`,JSON.stringify(t),{retain:!0}),this._mqttPublish(`${this._baseTopic}/${e}/__classInfoConcise__`,JSON.stringify(n),{retain:!0})}catch(e){this._log.error(e,`Problem during publishing class info: ${e.message}`)}}_generateTopics(){const e=[],t=this._getClasses();t.length>0?this._log.info(`Registering classes: ${t.join(", ")}`):this._log.warn("No classes are registered"),t.forEach(t=>{this._getStaticFunctions(t).forEach(r=>{e.push(`${this._baseTopic}/${t}/__static__/${r}`)})});for(const t of["__unsubscribe__","__registrations__","__end__"])e.push(`${this._baseTopic}/+/__static__/${t}`);return e}_sweepClassInfo(e,t,r){const n=`${this._baseTopic}/`;if(!e.startsWith(n))return!1;const i=e.slice(n.length).split("/");if(2!==i.length)return!1;const[o,s]=i;if("__classInfoConcise__"!==s&&"__classInfo__"!==s)return!1;if(!r||!r.retain||0===t.length)return!0;if(this._getClasses().includes(o))return!0;this._log.info(`Clearing the class info of ${o}, no longer offered`);for(const e of["__classInfo__","__classInfoConcise__"])this._mqttPublish(`${n}${o}/${e}`,null,{retain:!0});return!0}_handleMessage(e,t,r){if(this._sweepClassInfo(e,t,r))return;let n;try{n=JSON.parse(t.toString())}catch(t){return void this._log.warn(`Ignoring a message that is no JSON on: ${e}`)}try{this._log.debug(`Message arrived with topic: ${e} and payload:`,n);const t=e.split("/"),[,,r,i,s]=t;if(4===t.length&&"__clientInfo__"===t[3])return void(u._isObject(n)&&this._handleClientInfoMessage(e,n));if(5!==t.length)return void this._log.warn(`Ignoring message with invalid topic: ${e}`);if(!u._isObject(n)||!this._isConnectionId(n.s))return void this._log.warn(`Ignoring a request without a valid sender on: ${e}`);n.c="__static__"===i?r:i,n.f=s;const a=Array.isArray(n.a)?n.a[0]:void 0,l=o._instances.get(a);if(o._call(n)&&this._watch(n.s),n.e)"__createIsolated__"!==s&&"__createShared__"!==s||this._log.warn(`Instantiation of ${r} failed: ${n.e.message}`);else switch(s){case"__createIsolated__":l||this._subscribeToMethodsOfNewInstance(r,n.r),this._registerIsolatedInstance(n.r,n.s);break;case"__createShared__":l||(this._subscribeToMethodsOfNewInstance(r,n.r),this._publishClassInfoMessage(r)),this._watch(n.s);break;case"__delete__":l&&this._forgetInstance(a,l)}this._mqttPublish(n.s,u._stringifySafely(u._answer(n)))}catch(e){this._log.error(e,`Problem while handling incoming message: ${e.message}`)}}static _answer({r:e,e:t,i:r}){return t?{e:t,i:r,v:4}:{r:e,i:r,v:4}}static _isObject(e){return!!e&&"object"==typeof e&&!Array.isArray(e)}_isConnectionId(e){if("string"!=typeof e)return!1;const t=e.split("/");return 3===t.length&&t[0]===this._domain&&"__agentInfo__"!==t[2]&&t.every(e=>e.length>0&&!/[+#]/.test(e))}_watch(e){this._watched.has(e)||(this._watched.add(e),this._mqttSubscribe(`${e}/__clientInfo__`),this._log.debug(`Tracking lifetime of client: ${e}`))}_handleClientInfoMessage(e,t){const r=e.slice(0,-15);if("offline"===t.status){o._unregisterClient(r);const e=this._isolatedInstances.get(r);this._isolatedInstances.delete(r),e&&e.forEach(e=>{const t=o._instances.get(e),r={c:t&&t.className,f:"__delete__",a:[e],s:o.LOCAL_SENDER};o._call(r),r.r&&(this._unsubscribeMethodsOfDeletedInstance(t.className,e),this._log.debug(`Auto-deleted isolated instance: ${e}`))}),this._watched.delete(r),this._mqttUnsubscribe(`${r}/__clientInfo__`),this.emit("clientGone",r,{clientId:t.clientId})}}_registerIsolatedInstance(e,t){const r=this._isolatedInstances.get(t);r?r.add(e):this._isolatedInstances.set(t,new Set([e])),this._watch(t)}_forgetInstance(e,{className:t,isIsolated:r,owner:n}){if(this._unsubscribeMethodsOfDeletedInstance(t,e),r){const t=this._isolatedInstances.get(n);t&&(t.delete(e),0===t.size&&this._isolatedInstances.delete(n))}else this._publishClassInfoMessage(t)}_methodsTopic(e,t){return`${this._baseTopic}/${e}/${t}/+`}_subscribeToMethodsOfNewInstance(e,t){const r=this._methodsTopic(e,t);this._mqttSubscribe(r),this._log.debug(`Subscribed to new topic after instantiation: ${r}`)}_unsubscribeMethodsOfDeletedInstance(e,t){const r=this._methodsTopic(e,t);this._mqttUnsubscribe(r),this._log.debug(`Unsubscribed from topic after deletion: ${r}`)}_handleReconnect(){this._log.warn(`Reconnecting to ${this._broker}`),this.emit("reconnect")}_handleError(e){this.emit("error",e)}_handleClose(){this._serving=!1,this.emit("close")}_handleOffline(){this.emit("offline")}_handleEnd(){this.emit("end")}}e.exports=u},6172:(e,t,r)=>{const{Buffer:n}=r(8287),i={},o=n.isBuffer(n.from([1,2]).subarray(0,1));function s(e){const t=n.allocUnsafe(2);return t.writeUInt8(e>>8,0),t.writeUInt8(255&e,1),t}e.exports={cache:i,generateCache:function(){for(let e=0;e<65536;e++)i[e]=s(e)},generateNumber:s,genBufVariableByteInt:function(e){let t=0,r=0;const i=n.allocUnsafe(4);do{t=e%128|0,(e=e/128|0)>0&&(t|=128),i.writeUInt8(t,r++)}while(e>0&&r<4);return e>0&&(r=0),o?i.subarray(0,r):i.slice(0,r)},generate4ByteBuffer:function(e){const t=n.allocUnsafe(4);return t.writeUInt32BE(e,0),t}}},6188:e=>{"use strict";e.exports=Math.max},6269:(e,t,r)=>{"use strict";const{ObjectSetPrototypeOf:n,Symbol:i}=r(4469);e.exports=c;const{ERR_METHOD_NOT_IMPLEMENTED:o}=r(2074).codes,s=r(7323),{getHighWaterMark:a}=r(2100);n(c.prototype,s.prototype),n(c,s);const l=i("kCallback");function c(e){if(!(this instanceof c))return new c(e);const t=e?a(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),s.call(this,e),this._readableState.sync=!1,this[l]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function u(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{t?e?e(t):this.destroy(t):(null!=r&&this.push(r),this.push(null),e&&e())})}function f(){this._final!==u&&u.call(this)}c.prototype._final=u,c.prototype._transform=function(e,t,r){throw new o("_transform()")},c.prototype._write=function(e,t,r){const n=this._readableState,i=this._writableState,o=n.length;this._transform(e,t,(e,t)=>{e?r(e):(null!=t&&this.push(t),i.ended||o===n.length||n.length<n.highWaterMark?r():this[l]=r)})},c.prototype._read=function(){if(this[l]){const e=this[l];this[l]=null,e()}}},6357:(e,t,r)=>{"use strict";const{pipeline:n}=r(4867),i=r(7323),{destroyer:o}=r(1787),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:h}=r(5980),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=r(2074),b=r(577);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||h(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,_,m,w;const v=e[0],S=n(e,function(e){const t=m;m=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||h(S)||u(S));if(w=new i({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;b(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(_){const e=_;_=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(_=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===m||(e=new d),_=null,r=null,y=null,null===m?t(e):(m=t,s(S)&&o(S,e))},w}},6364:(e,t,r)=>{"use strict";const n=r(5606),{AbortError:i,codes:o}=r(9157),{ERR_INVALID_ARG_TYPE:s,ERR_STREAM_PREMATURE_CLOSE:a}=o,{kEmptyObject:l,once:c}=r(9862),{validateAbortSignal:u,validateFunction:f,validateObject:h,validateBoolean:d}=r(4947),{Promise:p,PromisePrototypeThen:g,SymbolDispose:b}=r(2768),{isClosed:y,isReadable:_,isReadableNodeStream:m,isReadableStream:w,isReadableFinished:v,isReadableErrored:S,isWritable:E,isWritableNodeStream:A,isWritableStream:k,isWritableFinished:I,isWritableErrored:O,isNodeStream:R,willEmitClose:T,kIsClosedPromise:x}=r(6801);let P;const N=()=>{};function C(e,t,o){var d,p;if(2===arguments.length?(o=t,t=l):null==t?t=l:h(t,"options"),f(o,"callback"),u(t.signal,"options.signal"),o=c(o),w(e)||k(e))return function(e,t,o){let s=!1,a=N;if(t.signal)if(a=()=>{s=!0,o.call(e,new i(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(a);else{P=P||r(9862).addAbortListener;const n=P(t.signal,a),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}const l=(...t)=>{s||n.nextTick(()=>o.apply(e,t))};return g(e[x].promise,l,l),N}(e,t,o);if(!R(e))throw new s("stream",["ReadableStream","WritableStream","Stream"],e);const C=null!==(d=t.readable)&&void 0!==d?d:m(e),j=null!==(p=t.writable)&&void 0!==p?p:A(e),M=e._writableState,L=e._readableState,D=()=>{e.writable||B()};let F=T(e)&&m(e)===C&&A(e)===j,$=I(e,!1);const B=()=>{$=!0,e.destroyed&&(F=!1),(!F||e.readable&&!C)&&(C&&!U||o.call(e))};let U=v(e,!1);const W=()=>{U=!0,e.destroyed&&(F=!1),(!F||e.writable&&!j)&&(j&&!$||o.call(e))},q=t=>{o.call(e,t)};let V=y(e);const z=()=>{V=!0;const t=O(e)||S(e);return t&&"boolean"!=typeof t?o.call(e,t):C&&!U&&m(e,!0)&&!v(e,!1)?o.call(e,new a):!j||$||I(e,!1)?void o.call(e):o.call(e,new a)},H=()=>{V=!0;const t=O(e)||S(e);if(t&&"boolean"!=typeof t)return o.call(e,t);o.call(e)},G=()=>{e.req.on("finish",B)};!function(e){return e.setHeader&&"function"==typeof e.abort}(e)?j&&!M&&(e.on("end",D),e.on("close",D)):(e.on("complete",B),F||e.on("abort",z),e.req?G():e.on("request",G)),F||"boolean"!=typeof e.aborted||e.on("aborted",z),e.on("end",W),e.on("finish",B),!1!==t.error&&e.on("error",q),e.on("close",z),V?n.nextTick(z):null!=M&&M.errorEmitted||null!=L&&L.errorEmitted?F||n.nextTick(H):(C||F&&!_(e)||!$&&!1!==E(e))&&(j||F&&!E(e)||!U&&!1!==_(e))?L&&e.req&&e.aborted&&n.nextTick(H):n.nextTick(H);const K=()=>{o=N,e.removeListener("aborted",z),e.removeListener("complete",B),e.removeListener("abort",z),e.removeListener("request",G),e.req&&e.req.removeListener("finish",B),e.removeListener("end",D),e.removeListener("close",D),e.removeListener("finish",B),e.removeListener("end",W),e.removeListener("error",q),e.removeListener("close",z)};if(t.signal&&!V){const s=()=>{const r=o;K(),r.call(e,new i(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(s);else{P=P||r(9862).addAbortListener;const n=P(t.signal,s),i=o;o=c((...t)=>{n[b](),i.apply(e,t)})}}return K}e.exports=C,e.exports.finished=function(e,t){var r;let n=!1;return null===t&&(t=l),null!==(r=t)&&void 0!==r&&r.cleanup&&(d(t.cleanup,"cleanup"),n=t.cleanup),new p((r,i)=>{const o=C(e,t,e=>{n&&o(),e?i(e):r()})})}},6370:()=>{},6549:e=>{"use strict";e.exports=Object.getOwnPropertyDescriptor},6556:(e,t,r)=>{"use strict";var n=r(453),i=r(3126),o=i([n("%String.prototype.indexOf%")]);e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i([r]):r}},6576:(e,t,r)=>{"use strict";var n=r(9394),i=r(8452);e.exports=function(){var e=n();return i(Object,{is:e},{is:function(){return Object.is!==e}}),e}},6578:e=>{"use strict";e.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]},6585:e=>{var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,a){a=a||{};var l,c,u=typeof e;if("string"===u&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(s){var a=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*a;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*i;case"hours":case"hour":case"hrs":case"hr":case"h":return a*n;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}}}(e);if("number"===u&&isFinite(e))return a.long?(l=e,(c=Math.abs(l))>=i?s(l,c,i,"day"):c>=n?s(l,c,n,"hour"):c>=r?s(l,c,r,"minute"):c>=t?s(l,c,t,"second"):l+" ms"):function(e){var o=Math.abs(e);return o>=i?Math.round(e/i)+"d":o>=n?Math.round(e/n)+"h":o>=r?Math.round(e/r)+"m":o>=t?Math.round(e/t)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},6642:(e,t,r)=>{"use strict";var n=r(3003);e.exports=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:n}},6644:(e,t,r)=>{"use strict";var n=r(2463).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},6698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},6743:(e,t,r)=>{"use strict";var n=r(9353);e.exports=Function.prototype.bind||n},6801:(e,t,r)=>{"use strict";const{SymbolAsyncIterator:n,SymbolIterator:i,SymbolFor:o}=r(2768),s=o("nodejs.stream.destroyed"),a=o("nodejs.stream.errored"),l=o("nodejs.stream.readable"),c=o("nodejs.stream.writable"),u=o("nodejs.stream.disturbed"),f=o("nodejs.webstream.isClosedPromise"),h=o("nodejs.webstream.controllerErrorFunction");function d(e,t=!1){var r;return!(!e||"function"!=typeof e.pipe||"function"!=typeof e.on||t&&("function"!=typeof e.pause||"function"!=typeof e.resume)||e._writableState&&!1===(null===(r=e._readableState)||void 0===r?void 0:r.readable)||e._writableState&&!e._readableState)}function p(e){var t;return!(!e||"function"!=typeof e.write||"function"!=typeof e.on||e._readableState&&!1===(null===(t=e._writableState)||void 0===t?void 0:t.writable))}function g(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function b(e){return!(!e||g(e)||"function"!=typeof e.pipeThrough||"function"!=typeof e.getReader||"function"!=typeof e.cancel)}function y(e){return!(!e||g(e)||"function"!=typeof e.getWriter||"function"!=typeof e.abort)}function _(e){return!(!e||g(e)||"object"!=typeof e.readable||"object"!=typeof e.writable)}function m(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!!(e.destroyed||e[s]||null!=n&&n.destroyed)}function w(e){if(!p(e))return null;if(!0===e.writableEnded)return!0;const t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function v(e,t){if(!d(e))return null;const r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function S(e){return e&&null!=e[l]?e[l]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!m(e)&&d(e)&&e.readable&&!v(e)}function E(e){return e&&null!=e[c]?e[c]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!m(e)&&p(e)&&e.writable&&!w(e)}function A(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function k(e){return"boolean"==typeof e._sent100&&A(e)}e.exports={isDestroyed:m,kIsDestroyed:s,isDisturbed:function(e){var t;return!(!e||!(null!==(t=e[u])&&void 0!==t?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,n,i,o,s,l,c,u,f;return!(!e||!(null!==(t=null!==(r=null!==(n=null!==(i=null!==(o=null!==(s=e[a])&&void 0!==s?s:e.readableErrored)&&void 0!==o?o:e.writableErrored)&&void 0!==i?i:null===(l=e._readableState)||void 0===l?void 0:l.errorEmitted)&&void 0!==n?n:null===(c=e._writableState)||void 0===c?void 0:c.errorEmitted)&&void 0!==r?r:null===(u=e._readableState)||void 0===u?void 0:u.errored)&&void 0!==t?t:null===(f=e._writableState)||void 0===f?void 0:f.errored))},kIsErrored:a,isReadable:S,kIsReadable:l,kIsClosedPromise:f,kControllerErrorFunction:h,kIsWritable:c,isClosed:function(e){if(!g(e))return null;if("boolean"==typeof e.closed)return e.closed;const t=e._writableState,r=e._readableState;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&A(e)?e._closed:null},isDuplexNodeStream:function(e){return!(!e||"function"!=typeof e.pipe||!e._readableState||"function"!=typeof e.on||"function"!=typeof e.write)},isFinished:function(e,t){return g(e)?!(!m(e)&&(!1!==(null==t?void 0:t.readable)&&S(e)||!1!==(null==t?void 0:t.writable)&&E(e))):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[n]:!1===t?"function"==typeof e[i]:"function"==typeof e[n]||"function"==typeof e[i])},isReadableNodeStream:d,isReadableStream:b,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;const t=e._readableState;return!(!t||t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:v,isReadableErrored:function(e){var t,r;return g(e)?e.readableErrored?e.readableErrored:null!==(t=null===(r=e._readableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isNodeStream:g,isWebStream:function(e){return b(e)||y(e)||_(e)},isWritable:E,isWritableNodeStream:p,isWritableStream:y,isWritableEnded:w,isWritableFinished:function(e,t){if(!p(e))return null;if(!0===e.writableFinished)return!0;const r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return g(e)?e.writableErrored?e.writableErrored:null!==(t=null===(r=e._writableState)||void 0===r?void 0:r.errored)&&void 0!==t?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&void 0===(null===(t=e.req)||void 0===t?void 0:t.upgradeOrConnect)},isServerResponse:k,willEmitClose:function(e){if(!g(e))return null;const t=e._writableState,r=e._readableState,n=t||r;return!n&&k(e)||!!(n&&n.autoDestroy&&n.emitClose&&!1===n.closed)},isTransformStream:_}},6887:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.isReactNativeBrowser=t.isWebWorker=void 0;const i=()=>Boolean("object"==typeof self&&self?.constructor?.name?.includes("WorkerGlobalScope")&&"undefined"==typeof Deno),o=()=>"undefined"!=typeof navigator&&"ReactNative"===navigator.product,s="undefined"!=typeof window&&("undefined"!=typeof navigator&&navigator.userAgent?.toLowerCase().indexOf(" electron/")>-1&&n?.versions?!Object.prototype.hasOwnProperty.call(n.versions,"electron"):void 0!==window.document)||i()||o();t.isWebWorker=i(),t.isReactNativeBrowser=o(),t.default=s},6891:(e,t,r)=>{"use strict";var n,i=r(2045);e.exports=k,k.ReadableState=A,r(7007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(1396),l=r(8287).Buffer,c=(void 0!==r.g?r.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){},u=r(7199);o=u&&u.debuglog?u.debuglog("stream"):function(){};var f,h,d,p=r(1766),g=r(4347),b=r(6644).getHighWaterMark,y=r(2463).F,_=y.ERR_INVALID_ARG_TYPE,m=y.ERR_STREAM_PUSH_AFTER_EOF,w=y.ERR_METHOD_NOT_IMPLEMENTED,v=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(6698)(k,a);var S=g.errorOrDestroy,E=["error","close","destroy","pause","resume"];function A(e,t,i){n=n||r(8101),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=b(this,e,"readableHighWaterMark",i),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3141).I),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function k(e){if(n=n||r(8101),!(this instanceof k))return new k(e);var t=this instanceof n;this._readableState=new A(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function I(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?x(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,P(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,l.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)S(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)a.endEmitted?S(e,new v):O(e,a,t,!0);else if(a.ended)S(e,new m);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?O(e,a,t,!1):N(e,a)):O(e,a,t,!1)}else n||(a.reading=!1,N(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function O(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&x(e)),N(e,t)}Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),k.prototype.destroy=g.destroy,k.prototype._undestroy=g.undestroy,k.prototype._destroy=function(e,t){t(e)},k.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=l.from(e,t),t=""),r=!0),I(this,e,t,!1,r)},k.prototype.unshift=function(e){return I(this,e,null,!0,!1)},k.prototype.isPaused=function(){return!1===this._readableState.flowing},k.prototype.setEncoding=function(e){f||(f=r(3141).I);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,i="";null!==n;)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var R=1073741824;function T(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=R?e=R:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function x(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(P,e))}function P(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function N(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(C,e,t))}function C(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(o("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function j(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){o("readable nexttick read 0"),e.read(0)}function L(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function F(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function $(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(B,t,e))}function B(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function U(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}k.prototype.read=function(e){o("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?$(this):x(this),null;if(0===(e=T(e,t))&&t.ended)return 0===t.length&&$(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&o("length less than watermark",i=!0),t.ended||t.reading?o("reading or ended",i=!1):i&&(o("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=T(r,t))),null===(n=e>0?F(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&$(this)),null!==n&&this.emit("data",n),n},k.prototype._read=function(e){S(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?g:l;function l(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",l),r.removeListener("end",g),r.removeListener("data",f),u=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())});var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,D(e))}}(r);e.on("drain",c);var u=!1;function f(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==U(n.pipes,e))&&!u&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),g(),e.removeListener("error",h),0===s(e,"error")&&S(e,t)}function d(){e.removeListener("finish",p),g()}function p(){o("onfinish"),e.removeListener("close",d),g()}function g(){o("unpipe"),r.unpipe(e)}return r.on("data",f),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=U(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},k.prototype.on=function(e,t){var r=a.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?x(this):n.reading||i.nextTick(M,this))),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(j,this),r},k.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(j,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(L,e,t))}(this,e)),e.paused=!1,this},k.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s<E.length;s++)e.on(E[s],this.emit.bind(this,E[s]));return this._read=function(t){o("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(k.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=r(5034)),h(this)}),Object.defineProperty(k.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(k.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(k.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),k._fromList=F,Object.defineProperty(k.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(k.from=function(e,t){return void 0===d&&(d=r(968)),d(k,e,t)})},6897:(e,t,r)=>{"use strict";var n=r(453),i=r(41),o=r(592)(),s=r(5795),a=r(9675),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new a("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new a("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,c=!0;if("length"in e&&s){var u=s(e,"length");u&&!u.configurable&&(n=!1),u&&!u.writable&&(c=!1)}return(n||c||!r)&&(o?i(e,"length",t,!0,!0):i(e,"length",t)),e}},6912:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const i=n(r(4959)),o=n(r(5228)),s=n(r(495)),a=n(r(1021)),l=n(r(4264)),c=r(4723);t.default=(e,t,r,n)=>{const{options:u}=e,f=u.properties?.maximumPacketSize,h=1+(e=>e<128?1:e<16384?2:e<2097152?3:4)(d=t.length)+d;var d;if(5===u.protocolVersion&&f&&f<h)return e.log("_handlePacket :: %s packet of %d bytes exceeds the advertised maximumPacketSize %d",t.cmd,h,f),n?.discardParsedPackets(),e._cleanUp(!0),r(),e.emit("error",new c.ErrorWithReasonCode(`exceeding packets size ${t.cmd}: ${h} bytes, maximumPacketSize is ${f}`,149)),e;switch(e.log("_handlePacket :: emitting packetreceive"),e.emit("packetreceive",t),t.cmd){case"publish":(0,i.default)(e,t,r,n);break;case"puback":case"pubrec":case"pubcomp":case"suback":case"unsuback":e.reschedulePing();try{(0,a.default)(e,t)}finally{r()}break;case"pubrel":e.reschedulePing(),(0,l.default)(e,t,r);break;case"connack":try{(0,s.default)(e,t,n)}finally{r()}break;case"auth":e.reschedulePing();try{(0,o.default)(e,t,n)}finally{r()}break;case"pingresp":e.log("_handlePacket :: received pingresp"),e.reschedulePing(!0),r();break;case"disconnect":e.emit("disconnect",t),r();break;default:e.log("_handlePacket :: unknown command"),r()}}},6968:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e,t,r,n){p("SOCKS connection to %s:%d via %s",e,t,r);const i=new g;return async function(e,t,r,n,i={}){const o=i.lookup??(0,h.promisify)(f.lookup),[s,a]=function(e){const t=new URL(e);if(t.pathname||t.hash||t.search)throw b(new Error("bad SOCKS URL"));const[r,n]=function(e){switch(e){case"socks5h:":return[5,!0];case"socks4a:":return[4,!0];case"socks5:":return[5,!1];case"socks4:":return[4,!1];default:return[void 0,!1]}}(t.protocol);if(!r)throw b(new Error("bad SOCKS URL: invalid protocol"));const i=parseInt(t.port,10);if(Number.isNaN(i))throw b(new Error("bad SOCKS URL: invalid port"));return[{host:t.hostname,port:i,type:r},n]}(r);a||(p("resolving %s locally",e),e=(await o(e,{family:4===s.type?4:0})).address),p("establishing SOCKS%d connection to %s:%d via %s:%d",s.type,e,t,s.host,s.port);const l=new u.SocksClient({command:"connect",destination:{host:e,port:t},proxy:{...s},timeout:i.timeout});l.connect(),l.on("established",({socket:e})=>n._start(e)),l.on("error",e=>{p("SOCKS failed: %s",e),n.destroy(b(e))})}(e,t,r,i,n).catch(e=>{p("SOCKS failed: %s",e),i.destroy(e)}),i};const l=a(r(7833)),c=r(8310),u=r(9122),f=s(r(9288)),h=r(537),d=a(r(4148)),p=(0,l.default)("mqttjs:socks");class g extends c.Duplex{_flowing=!1;_socket;constructor(){super({autoDestroy:!1}),this.cork()}_start(e){p("proxy stream started"),(0,d.default)(!this._socket),this.destroyed?e.destroy(this.errored):(this._socket=e,this._flowing||e.pause(),e.on("data",this._onData),e.on("end",this._onEnd),e.on("error",this._onError),e.on("close",this._onClose),e.emit("connect"),this.uncork())}_write(e,t,r){(0,d.default)(this._socket),this._socket.write(e,r)}_read(e){this._flowing=!0,this._socket?.resume?.()}_destroy(e,t){this._socket?.destroy?.(e),t(e)}_onData=e=>{(0,d.default)(this._socket),this._flowing=this.push(e),this._flowing||this._socket.pause()};_onEnd=()=>{p("proxy stream received EOF"),this.push(null)};_onClose=()=>{p("proxy stream closed"),this.destroy()};_onError=e=>{p("proxy stream died with error %s",e),this.destroy(e)}}function b(e){try{return void 0===e.code&&(e.code="SOCKS"),e}catch{return e}}},7007:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}g(e,t,o,{once:!0}),"error"!==t&&function(e,t){"function"==typeof e.on&&g(e,"error",t,{once:!0})}(e,i)})},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,o,s,c;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=l(e))>0&&s.length>i&&!s.warned){s.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=s.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=u.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}(i):p(i,i.length)}function d(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function p(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)})}}Object.defineProperty(o,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),o.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},o.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},o.prototype.getMaxListeners=function(){return l(this)},o.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var l=o[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else{var c=l.length,u=p(l,c);for(r=0;r<c;++r)n(u[r],this,t)}return!0},o.prototype.addListener=function(e,t){return c(this,e,t,!1)},o.prototype.on=o.prototype.addListener,o.prototype.prependListener=function(e,t){return c(this,e,t,!0)},o.prototype.once=function(e,t){return a(t),this.on(e,f(this,e,t)),this},o.prototype.prependOnceListener=function(e,t){return a(t),this.prependListener(e,f(this,e,t)),this},o.prototype.removeListener=function(e,t){var r,n,i,o,s;if(a(t),void 0===(n=this._events))return this;if(void 0===(r=n[e]))return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},o.prototype.off=o.prototype.removeListener,o.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return h(this,e,!0)},o.prototype.rawListeners=function(e){return h(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):d.call(e,t)},o.prototype.listenerCount=d,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},7119:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect&&Reflect.apply},7176:(e,t,r)=>{"use strict";var n,i=r(3126),o=r(5795);try{n=[].__proto__===Array.prototype}catch(e){if(!e||"object"!=typeof e||!("code"in e)||"ERR_PROTO_ACCESS"!==e.code)throw e}var s=!!n&&o&&o(Object.prototype,"__proto__"),a=Object,l=a.getPrototypeOf;e.exports=s&&"function"==typeof s.get?i([s.get]):"function"==typeof l&&function(e){return l(null==e?e:a(e))}},7199:()=>{},7244:(e,t,r)=>{"use strict";var n=r(9092)(),i=r(6556)("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===i(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==i(e)&&"callee"in e&&"[object Function]"===i(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,e.exports=a?o:s},7302:(e,t,r)=>{"use strict";const n=r(5606),{aggregateTwoErrors:i,codes:{ERR_MULTIPLE_CALLBACK:o},AbortError:s}=r(9157),{Symbol:a}=r(2768),{kIsDestroyed:l,isDestroyed:c,isFinished:u,isServerRequest:f}=r(6801),h=a("kDestroy"),d=a("kConstruct");function p(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function g(e,t,r){let i=!1;function o(t){if(i)return;i=!0;const o=e._readableState,s=e._writableState;p(t,s,o),s&&(s.closed=!0),o&&(o.closed=!0),"function"==typeof r&&r(t),t?n.nextTick(b,e,t):n.nextTick(y,e)}try{e._destroy(t||null,o)}catch(t){o(t)}}function b(e,t){_(e,t),y(e)}function y(e){const t=e._readableState,r=e._writableState;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function _(e,t){const r=e._readableState,n=e._writableState;null!=n&&n.errorEmitted||null!=r&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function m(e,t,r){const i=e._readableState,o=e._writableState;if(null!=o&&o.destroyed||null!=i&&i.destroyed)return this;null!=i&&i.autoDestroy||null!=o&&o.autoDestroy?e.destroy(t):t&&(t.stack,o&&!o.errored&&(o.errored=t),i&&!i.errored&&(i.errored=t),r?n.nextTick(_,e,t):_(e,t))}function w(e){let t=!1;function r(r){if(t)return void m(e,null!=r?r:new o);t=!0;const i=e._readableState,s=e._writableState,a=s||i;i&&(i.constructed=!0),s&&(s.constructed=!0),a.destroyed?e.emit(h,r):r?m(e,r,!0):n.nextTick(v,e)}try{e._construct(e=>{n.nextTick(r,e)})}catch(e){n.nextTick(r,e)}}function v(e){e.emit(d)}function S(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function E(e){e.emit("close")}function A(e,t){e.emit("error",t),n.nextTick(E,e)}e.exports={construct:function(e,t){if("function"!=typeof e._construct)return;const r=e._readableState,i=e._writableState;r&&(r.constructed=!1),i&&(i.constructed=!1),e.once(d,t),e.listenerCount(d)>1||n.nextTick(w,e)},destroyer:function(e,t){e&&!c(e)&&(t||u(e)||(t=new s),f(e)?(e.socket=null,e.destroy(t)):S(e)?e.abort():S(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?n.nextTick(A,e,t):n.nextTick(E,e),e.destroyed||(e[l]=!0))},destroy:function(e,t){const r=this._readableState,n=this._writableState,o=n||r;return null!=n&&n.destroyed||null!=r&&r.destroyed?("function"==typeof t&&t(),this):(p(e,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?g(this,e,t):this.once(h,function(r){g(this,i(r,e),t)}),this)},undestroy:function(){const e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:m}},7323:(e,t,r)=>{"use strict";const{ObjectDefineProperties:n,ObjectGetOwnPropertyDescriptor:i,ObjectKeys:o,ObjectSetPrototypeOf:s}=r(4469);e.exports=c;const a=r(2729),l=r(8601);s(c.prototype,a.prototype),s(c,a);{const e=o(l.prototype);for(let t=0;t<e.length;t++){const r=e[t];c.prototype[r]||(c.prototype[r]=l.prototype[r])}}function c(e){if(!(this instanceof c))return new c(e);a.call(this,e),l.call(this,e),e?(this.allowHalfOpen=!1!==e.allowHalfOpen,!1===e.readable&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),!1===e.writable&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}let u,f;function h(){return void 0===u&&(u={}),u}n(c.prototype,{writable:{__proto__:null,...i(l.prototype,"writable")},writableHighWaterMark:{__proto__:null,...i(l.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...i(l.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...i(l.prototype,"writableBuffer")},writableLength:{__proto__:null,...i(l.prototype,"writableLength")},writableFinished:{__proto__:null,...i(l.prototype,"writableFinished")},writableCorked:{__proto__:null,...i(l.prototype,"writableCorked")},writableEnded:{__proto__:null,...i(l.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...i(l.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}}),c.fromWeb=function(e,t){return h().newStreamDuplexFromReadableWritablePair(e,t)},c.toWeb=function(e){return h().newReadableWritablePairFromDuplex(e)},c.from=function(e){return f||(f=r(5769)),f(e,"body")}},7396:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),i=Symbol.for("BufferList");function o(e){if(!(this instanceof o))return new o(e);o._init.call(this,e)}o._init=function(e){Object.defineProperty(this,i,{value:!0}),this._bufs=[],this.length=0,e&&this.append(e)},o.prototype._new=function(e){return new o(e)},o.prototype._offset=function(e){if(0===e)return[0,0];let t=0;for(let r=0;r<this._bufs.length;r++){const n=t+this._bufs[r].length;if(e<n||r===this._bufs.length-1)return[r,e-t];t=n}},o.prototype._reverseOffset=function(e){const t=e[0];let r=e[1];for(let e=0;e<t;e++)r+=this._bufs[e].length;return r},o.prototype.getBuffers=function(){return this._bufs},o.prototype.get=function(e){if(e>this.length||e<0)return;const t=this._offset(e);return this._bufs[t[0]][t[1]]},o.prototype.slice=function(e,t){return"number"==typeof e&&e<0&&(e+=this.length),"number"==typeof t&&t<0&&(t+=this.length),this.copy(null,0,e,t)},o.prototype.copy=function(e,t,r,i){if(("number"!=typeof r||r<0)&&(r=0),("number"!=typeof i||i>this.length)&&(i=this.length),r>=this.length)return e||n.alloc(0);if(i<=0)return e||n.alloc(0);const o=!!e,s=this._offset(r),a=i-r;let l=a,c=o&&t||0,u=s[1];if(0===r&&i===this.length){if(!o)return 1===this._bufs.length?this._bufs[0]:n.concat(this._bufs,this.length);for(let t=0;t<this._bufs.length;t++)this._bufs[t].copy(e,c),c+=this._bufs[t].length;return e}if(l<=this._bufs[s[0]].length-u)return o?this._bufs[s[0]].copy(e,t,u,u+l):this._bufs[s[0]].slice(u,u+l);o||(e=n.allocUnsafe(a));for(let t=s[0];t<this._bufs.length;t++){const r=this._bufs[t].length-u;if(!(l>r)){this._bufs[t].copy(e,c,u,u+l),c+=r;break}this._bufs[t].copy(e,c,u),c+=r,l-=r,u&&(u=0)}return e.length>c?e.slice(0,c):e},o.prototype.shallowSlice=function(e,t){if(e=e||0,t="number"!=typeof t?this.length:t,e<0&&(e+=this.length),t<0&&(t+=this.length),e===t)return this._new();const r=this._offset(e),n=this._offset(t),i=this._bufs.slice(r[0],n[0]+1);return 0===n[1]?i.pop():i[i.length-1]=i[i.length-1].slice(0,n[1]),0!==r[1]&&(i[0]=i[0].slice(r[1])),this._new(i)},o.prototype.toString=function(e,t,r){return this.slice(t,r).toString(e)},o.prototype.consume=function(e){if(e=Math.trunc(e),Number.isNaN(e)||e<=0)return this;for(;this._bufs.length;){if(!(e>=this._bufs[0].length)){this._bufs[0]=this._bufs[0].slice(e),this.length-=e;break}e-=this._bufs[0].length,this.length-=this._bufs[0].length,this._bufs.shift()}return this},o.prototype.duplicate=function(){const e=this._new();for(let t=0;t<this._bufs.length;t++)e.append(this._bufs[t]);return e},o.prototype.append=function(e){return this._attach(e,o.prototype._appendBuffer)},o.prototype.prepend=function(e){return this._attach(e,o.prototype._prependBuffer,!0)},o.prototype._attach=function(e,t,r){if(null==e)return this;if(e.buffer)t.call(this,n.from(e.buffer,e.byteOffset,e.byteLength));else if(Array.isArray(e)){const[n,i]=r?[e.length-1,-1]:[0,1];for(let o=n;o>=0&&o<e.length;o+=i)this._attach(e[o],t,r)}else if(this._isBufferList(e)){const[n,i]=r?[e._bufs.length-1,-1]:[0,1];for(let o=n;o>=0&&o<e._bufs.length;o+=i)this._attach(e._bufs[o],t,r)}else"number"==typeof e&&(e=e.toString()),t.call(this,n.from(e));return this},o.prototype._appendBuffer=function(e){this._bufs.push(e),this.length+=e.length},o.prototype._prependBuffer=function(e){this._bufs.unshift(e),this.length+=e.length},o.prototype.indexOf=function(e,t,r){if(void 0===r&&"string"==typeof t&&(r=t,t=void 0),"function"==typeof e||Array.isArray(e))throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.');if("number"==typeof e?e=n.from([e]):"string"==typeof e?e=n.from(e,r):this._isBufferList(e)?e=e.slice():Array.isArray(e.buffer)?e=n.from(e.buffer,e.byteOffset,e.byteLength):n.isBuffer(e)||(e=n.from(e)),t=Number(t||0),isNaN(t)&&(t=0),t<0&&(t=this.length+t),t<0&&(t=0),0===e.length)return t>this.length?this.length:t;const i=this._offset(t);let o=i[0],s=i[1];for(;o<this._bufs.length;o++){const t=this._bufs[o];for(;s<t.length;)if(t.length-s>=e.length){const r=t.indexOf(e,s);if(-1!==r)return this._reverseOffset([o,r]);s=t.length-e.length+1}else{const t=this._reverseOffset([o,s]);if(this._match(t,e))return t;s++}s=0}return-1},o.prototype._match=function(e,t){if(this.length-e<t.length)return!1;for(let r=0;r<t.length;r++)if(this.get(e+r)!==t[r])return!1;return!0},function(){const e={readDoubleBE:8,readDoubleLE:8,readFloatBE:4,readFloatLE:4,readBigInt64BE:8,readBigInt64LE:8,readBigUInt64BE:8,readBigUInt64LE:8,readInt32BE:4,readInt32LE:4,readUInt32BE:4,readUInt32LE:4,readInt16BE:2,readInt16LE:2,readUInt16BE:2,readUInt16LE:2,readInt8:1,readUInt8:1,readIntBE:null,readIntLE:null,readUIntBE:null,readUIntLE:null};for(const t in e)(function(t){o.prototype[t]=null===e[t]?function(e,r){return this.slice(e,e+r)[t](0,r)}:function(r=0){return this.slice(r,r+e[t])[t](0)}})(t)}(),o.prototype._isBufferList=function(e){return e instanceof o||o.isBufferList(e)},o.isBufferList=function(e){return null!=e&&e[i]},e.exports=o},7419:(e,t,r)=>{"use strict";var n=r(2861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7487:(e,t,r)=>{"use strict";var n=r(2861).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=u,this.end=f,t=3;break;default:return this.write=h,void(this.end=d)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function u(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function f(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}t.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var r=function(e,t,r){var n=t.length-1;if(n<r)return 0;var i=s(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=s(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},7526:(e,t)=>{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],l=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,l)),u=0,f=l>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===l&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===l&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,l=n-i;a<l;a+=s)o.push(c(e,a,a+s>l?l:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function l(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function c(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(l(n));return i.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},7602:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=r(2768);e.exports=j,j.WritableState=N;const{EventEmitter:d}=r(7007),p=r(8745).Stream,{Buffer:g}=r(8287),b=r(7302),{addAbortSignal:y}=r(5121),{getHighWaterMark:_,getDefaultHighWaterMark:m}=r(3513),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(9157).codes,{errorOrDestroy:T}=b;function x(){}c(j.prototype,p.prototype),c(j,p);const P=f("kOnFinished");function N(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?_(this,e,"writableHighWaterMark",n):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=F.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function C(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function j(e){const t=this instanceof r(2648);if(!t&&!s(j,this))return new j(e);this._writableState=new N(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),b.construct(this,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function M(e,t,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!g.isEncoding(r))throw new R(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=x)}if(null===t)throw new I;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,r),r="buffer");else if(t instanceof g)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return o.ending?s=new O:o.destroyed&&(s=new A("write")),s?(n.nextTick(i,s),T(e,s,!0),s):(o.pendingcb++,function(e,t,r,n,i){const o=t.objectMode?1:r.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==x&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,r,i))}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),U(t),T(e,r)}function F(e,t){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(D,e,r,t,o):D(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&W(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick($,r.afterWriteTickInfo)):B(e,r,1,o))):T(e,new S)}function $({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}C(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?x:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),C(t)}else{do{const{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?C(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t,r){q(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)T(e,null!=i?i:S());else if(r=!0,t.pendingcb--,i){const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}N.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(j,h,{__proto__:null,value:function(e){return!!s(this,e)||this===j&&e&&e._writableState instanceof N}}),j.prototype.pipe=function(){T(this,new E)},j.prototype.write=function(e,t,r){return!0===M(this,e,t,r)},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},j.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},j.prototype._writev=null,j.prototype.end=function(e,t,r){const i=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=M(this,e,t);r instanceof o&&(s=r)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new k("end"):i.destroyed&&(s=new A("end")):(i.ending=!0,V(this,i,!0),i.ended=!0)),"function"==typeof r&&(s||i.finished?n.nextTick(r,s):i[P].push(r)),this},l(j.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const H=b.destroy;let G;function K(){return void 0===G&&(G={}),G}j.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[P].length)&&n.nextTick(U,r),H.call(this,e,t),this},j.prototype._undestroy=b.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype[d.captureRejectionSymbol]=function(e){this.destroy(e)},j.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},j.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},7653:(e,t,r)=>{"use strict";var n=r(8452),i=r(487),o=r(9211),s=r(9394),a=r(6576),l=i(s(),Object);n(l,{getPolyfill:s,implementation:o,shim:a}),e.exports=l},7712:(e,t,r)=>{"use strict";const n=globalThis.AbortController||r(5568).AbortController,{codes:{ERR_INVALID_ARG_VALUE:i,ERR_INVALID_ARG_TYPE:o,ERR_MISSING_ARGS:s,ERR_OUT_OF_RANGE:a},AbortError:l}=r(2074),{validateAbortSignal:c,validateInteger:u,validateObject:f}=r(1580),h=r(4469).Symbol("kWeak"),d=r(4469).Symbol("kResistStopPropagation"),{finished:p}=r(577),g=r(6357),{addAbortSignalNoValidate:b}=r(982),{isWritable:y,isNodeStream:_}=r(5980),{deprecate:m}=r(7797),{ArrayPrototypePush:w,Boolean:v,MathFloor:S,Number:E,NumberIsNaN:A,Promise:k,PromiseReject:I,PromiseResolve:O,PromisePrototypeThen:R,Symbol:T}=r(4469),x=T("kEmpty"),P=T("kEof");function N(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal");let n=1;null!=(null==t?void 0:t.concurrency)&&(n=S(t.concurrency));let i=n-1;return null!=(null==t?void 0:t.highWaterMark)&&(i=S(t.highWaterMark)),u(n,"options.concurrency",1),u(i,"options.highWaterMark",0),i+=n,async function*(){const o=r(7797).AbortSignalAny([null==t?void 0:t.signal].filter(v)),s=this,a=[],c={signal:o};let u,f,h=!1,d=0;function p(){h=!0,g()}function g(){d-=1,b()}function b(){f&&!h&&d<n&&a.length<i&&(f(),f=null)}!async function(){try{for await(let t of s){if(h)return;if(o.aborted)throw new l;try{if(t=e(t,c),t===x)continue;t=O(t)}catch(e){t=I(e)}d+=1,R(t,g,p),a.push(t),u&&(u(),u=null),!h&&(a.length>=i||d>=n)&&await new k(e=>{f=e})}a.push(P)}catch(e){const t=I(e);R(t,g,p),a.push(t)}finally{h=!0,u&&(u(),u=null)}}();try{for(;;){for(;a.length>0;){const e=await a[0];if(e===P)return;if(o.aborted)throw new l;e!==x&&(yield e),a.shift(),b()}await new k(e=>{u=e})}}finally{h=!0,f&&(f(),f=null)}}.call(this)}async function C(e,t=void 0){for await(const r of j.call(this,e,t))return!0;return!1}function j(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return N.call(this,async function(t,r){return await e(t,r)?t:x},t)}class M extends s{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}function L(e){if(e=E(e),A(e))return 0;if(e<0)throw new a("number",">= 0",e);return e}e.exports.streamReturningOperators={asIndexedPairs:m(function(e=void 0){return null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal"),async function*(){let t=0;for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l({cause:e.signal.reason});yield[t++,n]}}.call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;e--<=0&&(yield r)}}.call(this)},filter:j,flatMap:function(e,t){const r=N.call(this,e,t);return async function*(){for await(const e of r)yield*e}.call(this)},map:N,take:function(e,t=void 0){return null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),e=L(e),async function*(){var r;if(null!=t&&null!==(r=t.signal)&&void 0!==r&&r.aborted)throw new l;for await(const r of this){var n;if(null!=t&&null!==(n=t.signal)&&void 0!==n&&n.aborted)throw new l;if(e-- >0&&(yield r),e<=0)return}}.call(this)},compose:function(e,t){if(null!=t&&f(t,"options"),null!=(null==t?void 0:t.signal)&&c(t.signal,"options.signal"),_(e)&&!y(e))throw new i("stream",e,"must be writable");const r=g(this,e);return null!=t&&t.signal&&b(t.signal,r),r}},e.exports.promiseReturningOperators={every:async function(e,t=void 0){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);return!await C.call(this,async(...t)=>!await e(...t),t)},forEach:async function(e,t){if("function"!=typeof e)throw new o("fn",["Function","AsyncFunction"],e);for await(const r of N.call(this,async function(t,r){return await e(t,r),x},t));},reduce:async function(e,t,r){var i;if("function"!=typeof e)throw new o("reducer",["Function","AsyncFunction"],e);null!=r&&f(r,"options"),null!=(null==r?void 0:r.signal)&&c(r.signal,"options.signal");let s=arguments.length>1;if(null!=r&&null!==(i=r.signal)&&void 0!==i&&i.aborted){const e=new l(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await p(this.destroy(e)),e}const a=new n,u=a.signal;if(null!=r&&r.signal){const e={once:!0,[h]:this,[d]:!0};r.signal.addEventListener("abort",()=>a.abort(),e)}let g=!1;try{for await(const n of this){var b;if(g=!0,null!=r&&null!==(b=r.signal)&&void 0!==b&&b.aborted)throw new l;s?t=await e(t,n,{signal:u}):(t=n,s=!0)}if(!g&&!s)throw new M}finally{a.abort()}return t},toArray:async function(e){null!=e&&f(e,"options"),null!=(null==e?void 0:e.signal)&&c(e.signal,"options.signal");const t=[];for await(const n of this){var r;if(null!=e&&null!==(r=e.signal)&&void 0!==r&&r.aborted)throw new l(void 0,{cause:e.signal.reason});w(t,n)}return t},some:C,find:async function(e,t){for await(const r of j.call(this,e,t))return r}}},7720:(e,t,r)=>{"use strict";var n=r(4765),i=Object.prototype.hasOwnProperty,o=Array.isArray,s=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),a=function(e,t){for(var r=t&&t.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)void 0!==e[n]&&(r[n]=e[n]);return r},l=1024;e.exports={arrayToObject:a,assign:function(e,t){return Object.keys(t).reduce(function(e,r){return e[r]=t[r],e},e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],r=[],n=0;n<t.length;++n)for(var i=t[n],s=i.obj[i.prop],a=Object.keys(s),l=0;l<a.length;++l){var c=a[l],u=s[c];"object"==typeof u&&null!==u&&-1===r.indexOf(u)&&(t.push({obj:s,prop:c}),r.push(u))}return function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(o(r)){for(var n=[],i=0;i<r.length;++i)void 0!==r[i]&&n.push(r[i]);t.obj[t.prop]=n}}}(t),e},decode:function(e,t,r){var n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},encode:function(e,t,r,i,o){if(0===e.length)return e;var a=e;if("symbol"==typeof e?a=Symbol.prototype.toString.call(e):"string"!=typeof e&&(a=String(e)),"iso-8859-1"===r)return escape(a).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});for(var c="",u=0;u<a.length;u+=l){for(var f=a.length>=l?a.slice(u,u+l):a,h=[],d=0;d<f.length;++d){var p=f.charCodeAt(d);45===p||46===p||95===p||126===p||p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||o===n.RFC1738&&(40===p||41===p)?h[h.length]=f.charAt(d):p<128?h[h.length]=s[p]:p<2048?h[h.length]=s[192|p>>6]+s[128|63&p]:p<55296||p>=57344?h[h.length]=s[224|p>>12]+s[128|p>>6&63]+s[128|63&p]:(d+=1,p=65536+((1023&p)<<10|1023&f.charCodeAt(d)),h[h.length]=s[240|p>>18]+s[128|p>>12&63]+s[128|p>>6&63]+s[128|63&p])}c+=h.join("")}return c},isBuffer:function(e){return!(!e||"object"!=typeof e||!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e)))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(o(e)){for(var r=[],n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)},merge:function e(t,r,n){if(!r)return t;if("object"!=typeof r&&"function"!=typeof r){if(o(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!i.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);var s=t;return o(t)&&!o(r)&&(s=a(t,n)),o(t)&&o(r)?(r.forEach(function(r,o){if(i.call(t,o)){var s=t[o];s&&"object"==typeof s&&r&&"object"==typeof r?t[o]=e(s,r,n):t.push(r)}else t[o]=r}),t):Object.keys(r).reduce(function(t,o){var s=r[o];return i.call(t,o)?t[o]=e(t[o],s,n):t[o]=s,t},s)}}},7732:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t});Object.defineProperty(t,"__esModule",{value:!0});const a=r(9993),l=s(r(6887)),c={set:a.setInterval,clear:a.clearInterval},u={set:(e,t)=>setInterval(e,t),clear:e=>clearInterval(e)};t.default=e=>{switch(e){case"native":return u;case"worker":return c;default:return!l.default||l.isWebWorker||l.isReactNativeBrowser?u:c}}},7797:(e,t,r)=>{"use strict";const n=r(8287),{format:i,inspect:o}=r(2858),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(2074),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(4469),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||n.Blob,p=void 0!==d?function(e){return e instanceof d}:function(e){return!1},g=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:i,inspect:o,types:{isAsyncFunction:e=>e instanceof h,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return g(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{g(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},7829:(e,t,r)=>{"use strict";const n=r(9037),i=r(3942),o=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=o,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},7833:(e,t,r)=>{var n=r(2045);t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const r="color: "+this.color;t.splice(1,0,r,"color: inherit");let n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(n++,"%c"===e&&(i=n))}),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")||t.storage.getItem("DEBUG")}catch(e){}return!e&&void 0!==n&&"env"in n&&(e=n.env.DEBUG),e},t.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{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`."))}})(),t.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"],t.log=console.debug||console.log||(()=>{}),e.exports=r(736)(t);const{formatters:i}=e.exports;i.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}},7969:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(9584),i={objectMode:!0},o={clean:!0};t.default=class{options;_inflights;constructor(e){this.options=e||{},this.options={...o,...e},this._inflights=new Map}put(e,t){return this._inflights.set(e.messageId,e),t&&t(),this}createStream(){const e=new n.Readable(i),t=[];let r=!1,o=0;return this._inflights.forEach((e,r)=>{t.push(e)}),e._read=()=>{!r&&o<t.length?e.push(t[o++]):e.push(null)},e.destroy=t=>{if(!r)return r=!0,setTimeout(()=>{e.emit("close")},0),e},e}del(e,t){const r=this._inflights.get(e.messageId);return r?(this._inflights.delete(e.messageId),t(null,r)):t&&t(new Error("missing packet")),this}get(e,t){const r=this._inflights.get(e.messageId);return r?t(null,r):t&&t(new Error("missing packet")),this}close(e){this.options.clean&&(this._inflights=null),e&&e()}}},8002:e=>{"use strict";e.exports=Math.min},8068:e=>{"use strict";e.exports=SyntaxError},8075:(e,t,r)=>{"use strict";var n=r(453),i=r(487),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},8101:(e,t,r)=>{"use strict";var n=r(2045),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=u;var o=r(6891),s=r(1999);r(6698)(u,o);for(var a=i(s.prototype),l=0;l<a.length;l++){var c=a[l];u.prototype[c]||(u.prototype[c]=s.prototype[c])}function u(e){if(!(this instanceof u))return new u(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||n.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(u.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(u.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(u.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(u.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},8184:(e,t,r)=>{"use strict";var n=r(6556),i=r(9721)(/^\s*(?:function)?\*/),o=r(9092)(),s=r(3628),a=n("Object.prototype.toString"),l=n("Function.prototype.toString"),c=r(4233);e.exports=function(e){if("function"!=typeof e)return!1;if(i(l(e)))return!0;if(!o)return"[object GeneratorFunction]"===a(e);if(!s)return!1;var t=c();return t&&s(e)===t.prototype}},8203:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.streamBuilder=t.browserStreamBuilder=void 0;const i=r(8287),o=n(r(1591)),s=n(r(7833)),a=r(9584),l=n(r(6887)),c=r(2635),u=(0,s.default)("mqttjs:ws"),f=["rejectUnauthorized","ca","cert","key","pfx","passphrase"];function h(e,t){let r=`${e.protocol}://${e.hostname}:${e.port}${e.path}`;return"function"==typeof e.transformWsUrl&&(r=e.transformWsUrl(r,e,t)),r}function d(e){const t=e;return e.port||("wss"===e.protocol?t.port=443:t.port=80),e.path||(t.path="/"),e.wsOptions||(t.wsOptions={}),l.default||e.forceNativeWebSocket||"wss"!==e.protocol||f.forEach(r=>{Object.prototype.hasOwnProperty.call(e,r)&&!Object.prototype.hasOwnProperty.call(e.wsOptions,r)&&(t.wsOptions[r]=e[r])}),t}t.streamBuilder=(e,t)=>{u("streamBuilder");const r=d(t);r.hostname=r.hostname||r.host||"localhost";const n=h(r,e),i=function(e,t,r){u("createWebSocket"),u(`protocol: ${r.protocolId} ${r.protocolVersion}`);const n="MQIsdp"===r.protocolId&&3===r.protocolVersion?"mqttv3.1":"mqtt";let i;return u(`creating new Websocket for url: ${t} and protocol: ${n}`),i=r.createWebsocket?r.createWebsocket(t,[n],r):new o.default(t,[n],r.wsOptions),i}(0,n,r),s=o.default.createWebSocketStream(i,r.wsOptions);return s.url=n,i.on("close",()=>{s.destroy()}),s},t.browserStreamBuilder=(e,t)=>{let r;u("browserStreamBuilder");const n=function(e){const t=d(e);if(t.hostname||(t.hostname=t.host),!t.hostname){if("undefined"==typeof document)throw new Error("Could not determine host. Specify host manually.");const e=new URL(document.URL);t.hostname=e.hostname,t.port||(t.port=Number(e.port))}return void 0===t.objectMode&&(t.objectMode=!(!0===t.binary||void 0===t.binary)),t}(t),o=n.browserBufferSize||524288,s=t.browserBufferTimeout||1e3,l=!t.objectMode,f=function(e,t){const r="MQIsdp"===t.protocolId&&3===t.protocolVersion?"mqttv3.1":"mqtt",n=h(t,e);let i;return i=t.createWebsocket?t.createWebsocket(n,[r],t):new WebSocket(n,[r]),i.binaryType="arraybuffer",i}(e,t),p=function(e){const t=new a.Transform({objectMode:e.objectMode});return t._write=function e(t,r,n){if(f.bufferedAmount>o)return void setTimeout(e,s,t,r,n);l&&"string"==typeof t&&(t=i.Buffer.from(t,"utf8"));try{f.send(t)}catch(e){return n(e)}n()},t._flush=function(e){f.close(),e()},t}(t);t.objectMode||(p._writev=c.writev.bind(p)),p.on("close",()=>{f.close()});const g=void 0!==f.addEventListener;function b(){u("WebSocket onOpen"),r instanceof c.BufferedDuplex&&r.socketReady()}function y(e){u("WebSocket onClose",e),r.end(),r.destroy()}function _(e){u("WebSocket onError",e);const t=new Error("WebSocket error");t.event=e,r.destroy(t)}async function m(e){if(!p||!p.readable||!p.writable)return;let{data:t}=e;t=t instanceof ArrayBuffer?i.Buffer.from(t):t instanceof Blob?i.Buffer.from(await new Response(t).arrayBuffer()):i.Buffer.from(t,"utf8"),p.push(t)}return f.readyState===f.OPEN?(r=p,r.socket=f):(r=new c.BufferedDuplex(t,p,f),g?f.addEventListener("open",b):f.onopen=b),g?(f.addEventListener("close",y),f.addEventListener("error",_),f.addEventListener("message",m)):(f.onclose=y,f.onerror=_,f.onmessage=m),r}},8287:(e,t,r)=>{"use strict";const n=r(7526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=function(e){return+e!=e&&(e=0),l.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return f(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|g(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(Q(e,Uint8Array)){const t=new Uint8Array(e);return d(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Q(e,ArrayBuffer)||e&&Q(e.buffer,ArrayBuffer))return d(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(Q(e,SharedArrayBuffer)||e&&Q(e.buffer,SharedArrayBuffer)))return d(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);const i=function(e){if(l.isBuffer(e)){const t=0|p(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||J(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e){return u(e),a(e<0?0:0|p(e))}function h(e){const t=e.length<0?0:0|p(e.length),r=a(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function d(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function p(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function g(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Q(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return H(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:H(e).length;t=(""+t).toLowerCase(),i=!0}}function b(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return x(this,t,r);case"utf8":case"utf-8":return I(this,t,r);case"ascii":return R(this,t,r);case"latin1":case"binary":return T(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function _(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:m(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):m(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(e,t,r,n,i){let o,s=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===l)return n*s}else-1!==n&&(o-=o-n),n=-1}else for(r+l>a&&(r=a-l),o=r;o>=0;o--){let r=!0;for(let n=0;n<l;n++)if(c(e,o+n)!==c(t,n)){r=!1;break}if(r)return o}return-1}function w(e,t,r,n){r=Number(r)||0;const i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s<n;++s){const n=parseInt(t.substr(2*s,2),16);if(J(n))return s;e[r+s]=n}return s}function v(e,t,r,n){return K(H(t,e.length-r),e,r,n)}function S(e,t,r,n){return K(function(e){const t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function E(e,t,r,n){return K(G(t),e,r,n)}function A(e,t,r,n){return K(function(e,t){let r,n,i;const o=[];for(let s=0;s<e.length&&!((t-=2)<0);++s)r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function k(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function I(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i<r;){const t=e[i];let o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,l;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(l=(31&t)<<6|63&r,l>127&&(o=l));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(l=(15&t)<<12|(63&r)<<6|63&n,l>2047&&(l<55296||l>57343)&&(o=l));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,l>65535&&l<1114112&&(o=l))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=function(){try{const e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),l.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return function(e,t,r){return u(e),e<=0?a(e):void 0!==t?"string"==typeof r?a(e).fill(t,r):a(e).fill(t):a(e)}(e,t,r)},l.allocUnsafe=function(e){return f(e)},l.allocUnsafeSlow=function(e){return f(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),Q(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);let r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;const n=l.allocUnsafe(t);let i=0;for(r=0;r<e.length;++r){let t=e[r];if(Q(t,Uint8Array))i+t.length>n.length?(l.isBuffer(t)||(t=l.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!l.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},l.byteLength=g,l.prototype._isBuffer=!0,l.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)y(this,t,t+1);return this},l.prototype.swap32=function(){const e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)y(this,t,t+3),y(this,t+1,t+2);return this},l.prototype.swap64=function(){const e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)y(this,t,t+7),y(this,t+1,t+6),y(this,t+2,t+5),y(this,t+3,t+4);return this},l.prototype.toString=function(){const e=this.length;return 0===e?"":0===arguments.length?I(this,0,e):b.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if(Q(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),u=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==u[e]){o=c[e],s=u[e];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return _(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return _(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return w(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return S(this,e,t,r);case"base64":return E(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const O=4096;function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function x(e,t,r){const n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=Y[e[n]];return i}function P(e,t,r){const n=e.slice(t,r);let i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function N(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function C(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function j(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function M(e,t,r,n,i){W(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function L(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function F(e,t,r,n,o){return t=+t,r>>>=0,o||L(e,0,r,8),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||N(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readBigUInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<<BigInt(32))}),l.prototype.readBigUInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||N(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||N(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||N(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readBigInt64LE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+this[++e]*2**24)}),l.prototype.readBigInt64BE=X(function(e){q(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+65536*this[++e]+256*this[++e]+r)}),l.prototype.readFloatLE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||N(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||N(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||C(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigUInt64LE=X(function(e,t=0){return j(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=X(function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);C(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||C(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeBigInt64LE=X(function(e,t=0){return j(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=X(function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeFloatLE=function(e,t,r){return D(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return D(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return F(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return F(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);const i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){const t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;let i;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{const o=l.isBuffer(e)?e:l.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};const $={};function B(e,t,r){$[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function U(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function W(e,t,r,n,i,o){if(e>r||e<t){const n="bigint"==typeof t?"n":"";let i;throw i=o>3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new $.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){q(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function q(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw q(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}B("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),B("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),B("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=U(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=U(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n},RangeError);const z=/[^+/0-9A-Za-z-_]/g;function H(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function Q(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Z:e}function Z(){throw new Error("BigInt not supported")}},8310:(e,t,r)=>{e.exports=i;var n=r(7007).EventEmitter;function i(){n.call(this)}r(6698)(i,n),i.Readable=r(6891),i.Writable=r(1999),i.Duplex=r(8101),i.Transform=r(9083),i.PassThrough=r(3681),i.finished=r(4257),i.pipeline=r(5267),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",l));var s=!1;function a(){s||(s=!0,e.end())}function l(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",l),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",u),r.removeListener("close",u),e.removeListener("close",u)}return r.on("error",c),e.on("error",c),r.on("end",u),r.on("close",u),e.on("close",u),e.emit("pipe",r),e}},8389:function(e,t){!function(e){"use strict";var t,r=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,n=536870912,i=1073741824,o=new WeakMap,s=function(e,t){return function(o){var s=t.get(o),a=void 0===s?o.size:s<i?s+1:0;if(!o.has(a))return e(o,a);if(o.size<n){for(;o.has(a);)a=Math.floor(Math.random()*i);return e(o,a)}if(o.size>r)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;o.has(a);)a=Math.floor(Math.random()*r);return e(o,a)}}((t=o,function(e,r){return t.set(e,r),r}),o),a=function(e){return function(t){var r=e(t);return t.add(r),r}}(s);e.addUniqueNumber=a,e.generateUniqueNumber=s}(t)},8403:(e,t,r)=>{"use strict";var n=r(1189),i=r(1333)(),o=r(6556),s=r(9612),a=o("Array.prototype.push"),l=o("Object.prototype.propertyIsEnumerable"),c=i?s.getOwnPropertySymbols:null;e.exports=function(e,t){if(null==e)throw new TypeError("target must be an object");var r=s(e);if(1===arguments.length)return r;for(var o=1;o<arguments.length;++o){var u=s(arguments[o]),f=n(u),h=i&&(s.getOwnPropertySymbols||c);if(h)for(var d=h(u),p=0;p<d.length;++p){var g=d[p];l(u,g)&&a(f,g)}for(var b=0;b<f.length;++b){var y=f[b];if(l(u,y)){var _=u[y];r[y]=_}}}return r}},8452:(e,t,r)=>{"use strict";var n=r(1189),i="function"==typeof Symbol&&"symbol"==typeof Symbol("foo"),o=Object.prototype.toString,s=Array.prototype.concat,a=r(41),l=r(592)(),c=function(e,t,r,n){if(t in e)if(!0===n){if(e[t]===r)return}else if("function"!=typeof(i=n)||"[object Function]"!==o.call(i)||!n())return;var i;l?a(e,t,r,!0):a(e,t,r)},u=function(e,t){var r=arguments.length>2?arguments[2]:{},o=n(t);i&&(o=s.call(o,Object.getOwnPropertySymbols(t)));for(var a=0;a<o.length;a+=1)c(e,o[a],t[o[a]],r[o[a]])};u.supportsDescriptors=!!l,e.exports=u},8577:(e,t,r)=>{var n=r(2045);const i=r(1072),{nanoid:o}=r(3561),s=r(9372),a=r(7007),l=r(3530),c=r(544),u=r(2732),f=/^(Promise\.?<\s*)?Registration\s*>?$/,h=new WeakSet;class d extends a{constructor({token:e,password:t,username:r,domain:n,agent:i="*",broker:s="mqtts://broker.hivemq.com:8883",timeout:c=12e3,log:u="console",bestEffort:f=!0,mqttClientId:h=null,identity:d=null,keepalive:p=30,requiresSchema:g=!1,tls:b=null}={}){if(super(),!n)throw new Error("The domain must be specified");if(n.match(/[+/#*]/))throw new Error('The domain must NOT contain any of those characters: "+", "/", "#", "*"');if(i.match(/[+/#]/))throw new Error('The agent must NOT contain any of those characters: "+", "/", "#"');if(d&&d.match(/[+/#$]/))throw new Error('The identity must NOT contain any of those characters: "+", "/", "#", "$"');if(null!=h){if("string"!=typeof h||0===h.length)throw new Error("The mqttClientId must be a non-empty string");if(h.match(/[+/#]/))throw new Error('The mqttClientId must NOT contain any of those characters: "+", "/", "#"')}this._token=e,this._username=r,this._password=t,this._agent=i,this._domain=n,this._broker=s,this._timeout=c,this._identity=d,this._keepalive=p,this._qos=this._qos=f?0:1,this._requiresSchema=g,this._instance=o(8),this._mqttClientId=h||this._createMqttClientId(),this._tls=b,this._vrpcClientId=this._createVrpcClientId(),this._connectionSecret=o(16),this._vrpcConnectionId=this._createVrpcConnectionId(),this._agents={},this._eventEmitter=new a,this._invokeId=0,this._proxyId=0,this._client=null,this._cachedSubscriptions={},this._proxies={},this._ownIsolated=new Map,this._subscriptionTopics=new WeakMap,this._subscriptionCount=0,this._emitterListener=new WeakMap,this._pendingSubscriptions=new Map,this._pendingUnsubscriptions=new Map,this._redeclare=new Set,this._pendingWithdrawals=new Map,this._inboxReady=!1,this._waiting=new Set,this._subscriberLabels=new WeakMap,"console"===u?(this._log=console,this._log.debug=()=>{}):this._log=u,this._subscribeRetrier=new l({subscribe:(e,t)=>this._mqttSubscribe(e,t).catch(()=>{}),log:this._log})}getClientId(){return this._vrpcClientId}getConnectionId(){return this._vrpcConnectionId}static _tlsOptions(e){if(!e)return{rejectUnauthorized:!1};const t={rejectUnauthorized:!1!==e.rejectUnauthorized};return e.ca&&(t.ca=e.ca),t}async connect({keepTrying:e=!1}={}){if(this._client&&this._client.connected)return;if(e&&this._client&&!h.has(this._client))return this._awaitConnect(this._client,{keepTrying:e});const{username:t,password:r}=this._credentials(),n={username:t,password:r,clean:!0,keepalive:this._keepalive,clientId:this._mqttClientId,...d._tlsOptions(this._tls),connectTimeout:this._timeout,reconnectOnConnackError:!0,will:{topic:`${this._vrpcConnectionId}/__clientInfo__`,payload:JSON.stringify({status:"offline",clientId:this._vrpcClientId})}};return void 0===t&&delete n.username,void 0===r&&delete n.password,this.on("error",e=>{this._log.debug(`Encountered MQTT error: ${e.message}`)}),this._client=s.connect(this._broker,n),this._backoff=new c(this._client),this._client.on("offline",()=>{this._log.warn("MQTT client went offline."),this._agents={},this._proxies={},this._ownIsolated.clear(),this.emit("offline")}),this._client.on("reconnect",()=>{this._log.info("MQTT client is attempting to reconnect..."),this.emit("reconnect")}),this._client.on("error",e=>{this.emit("error",e)}),this._client.on("close",()=>{this._loseAnswers(()=>!0,"this client lost its connection")}),this._client.stream.on("error",e=>{this.emit("error",e)}),this._client.on("connect",async()=>{this._inboxReady=!1;for(const e of Object.values(this._cachedSubscriptions))this._redeclare.add(e.agent);this.emit("connect"),this._subscribeRetrier.cancel();try{const e="*"===this._agent?"+":this._agent;await this._mqttSubscribe(`${this._domain}/${e}/__agentInfo__`),this._requiresSchema?await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfo__`):await this._mqttSubscribe(`${this._domain}/${e}/+/__classInfoConcise__`),await this._mqttSubscribe(`${this._vrpcConnectionId}/#`),this._inboxReady=!0;for(const e of Array.from(this._redeclare))this._redeclareTo(e);for(const e of Array.from(this._pendingWithdrawals.keys()))this._flushWithdrawals(e);this._log.debug("Restoring event subscriptions after reconnect...");const t=[];for(const e of Object.keys(this._cachedSubscriptions))t.push(this._mqttSubscribe(e));await Promise.allSettled(t)}catch(e){this._log.error(`Encountered issue while setting up subscriptions after connect: ${e.message}`)}}),this._client.on("message",(e,t,r)=>{if(0!==t.length)try{const n=e.split("/"),[i,o,s,a]=n;if(i!==this._domain)return void this._log.warn(`Received message from foreign domain: ${i}`);if("__agentInfo__"===s){const{status:e,hostname:n,version:s,v:a}=JSON.parse(t.toString());this._createIfNotExist(o),this._agents[o].status=e,this._agents[o].hostname=n,this._agents[o].version=s,this._agents[o].v=a,"offline"===e?(this._loseAnswers(e=>e.second&&e.agent===o,"the agent went offline"),this._loseAgent(o,a)):(r.retain||this._loseAnswers(e=>e.second&&e.agent===o,"the agent connected anew"),this._redeclareTo(o),this._flushWithdrawals(o)),this.emit("agent",{domain:i,agent:o,status:e,hostname:n,version:s})}else if("__classInfo__"===a||"__classInfoConcise__"===a){const e=JSON.parse(t.toString());this._createIfNotExist(o);const r=this._agents[o].classes[s],n=e.instances||[],a=r?r.instances:[],l=a.filter(e=>!n.includes(e)),c=n.filter(e=>!a.includes(e));this._agents[o].classes[s]=e;const{className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p}=e;0!==l.length&&(this.emit("instanceGone",l,{domain:i,agent:o,className:u}),l.forEach(e=>this._clearCachedSubscriptions({lostInstance:e,agent:o,className:u}))),0!==c.length&&this.emit("instanceNew",c,{domain:i,agent:o,className:u}),this.emit("class",{domain:i,agent:o,className:u,instances:f,memberFunctions:h,staticFunctions:d,meta:p||{}})}else{const{i:e,a:r,e:n,r:i,u:o,end:s}=JSON.parse(t.toString());this._eventEmitter.emit(e,{a:r,e:n,r:i,u:o,end:s})}}catch(t){this._log.error(`Could not parse MQTT message on topic "${e}": ${t.message}`)}}),this._awaitConnect(this._client,{keepTrying:e})}_awaitConnect(e,{keepTrying:t}){return new Promise((r,n)=>{const i=setTimeout(()=>{const r=new Error(`Connection trial timed out (> ${this._timeout} ms)`);if(t)return e.removeListener("connect",o),void n(r);d._endMqtt(e,!0,{},()=>n(r))},this._timeout),o=()=>{clearTimeout(i),r()};e.once("connect",o)})}updateCredentials({username:e,password:t,token:r}={}){if(void 0!==e&&(this._username=e),void 0!==t&&(this._password=t),void 0!==r&&(this._token=r),!this._client||h.has(this._client))return;const n=this._credentials();for(const e of["username","password"])void 0===n[e]?delete this._client.options[e]:this._client.options[e]=n[e];this._backoff.hurry()}_credentials(){let e=this._username,t=this._password;return this._token&&(e=e||this._generateUserName(),t=this._token),{username:e,password:t}}static _endMqtt(e,t,r,n){h.add(e),e.end(t,r,n)}async create({className:e,instance:t=o(8),args:r=[],agent:n=this._agent,cacheProxy:i=!1,isIsolated:s=!1}={}){if(!this._isConnected())throw new Error("Client is not connected");if("*"===n)throw new Error("Agent must be specified");const a={c:e,f:s?"__createIsolated__":"__createShared__",a:[t,...r],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},l=await this._getProxy(n,e,a);return s&&this._ownIsolated.set(`${n}/${e}/${t}`,{agent:n,className:e,instance:t}),t&&i&&(this._proxies[`${n}/${e}/${t}`]={agent:n,className:e,instance:t,proxy:l}),l}async getInstance(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const r=this._cachedProxy(e,t);if(r)return r;const{agent:n,className:i}=await this._getInstanceData(e,t);return this._createProxy(n,i,e)}async delete(e,t={}){if(!this._isConnected())throw new Error("Client is not connected");const{agent:r,className:n}=await this._getInstanceData(e,t),i={c:n,f:"__delete__",a:[e],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},o=`${this._domain}/${r}/${n}/__static__/__delete__`;this._mqttPublish(o,JSON.stringify(i)),delete this._proxies[`${r}/${n}/${e}`];const s=await this._handleAgentAnswer(i,r);return!0===s&&this._ownIsolated.delete(`${r}/${n}/${e}`),!0===s&&this._forgetInstance({agent:r,className:n,instance:e}),s}_forgetInstance({agent:e,className:t,instance:r}){const n=this._agents[e]&&this._agents[e].classes[t];if(!n||!Array.isArray(n.instances))return;if(!n.instances.includes(r))return;n.instances=n.instances.filter(e=>e!==r);const i=this._domain;this.emit("instanceGone",[r],{domain:i,agent:e,className:t}),this._clearCachedSubscriptions({lostInstance:r,agent:e,className:t})}async callStatic({className:e,functionName:t,args:r=[],agent:n=this._agent}={}){if(!this._isConnected())throw new Error("Client is not connected");const i=await this._wrapArguments({agent:n,className:e,functionName:t,args:r});if(!i)return;const o={c:e,f:t,a:i,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},s=`${this._domain}/${n}/${e}/__static__/${t}`;return this._declare(o,s),await this._waitUntilClassIsOnline(n,e),this._mqttPublish(s,JSON.stringify(o)),this._handleAgentAnswer(o,n)}async callAll({className:e,functionName:t,args:r=[],agent:n=this._agent,instances:i}={}){if(!this._isConnected())throw new Error("Client is not connected");if(void 0!==i&&!u.isSelection(i))throw new Error(`Invalid instances: ${JSON.stringify(i)} (a name pattern, or a list of names and patterns)`);const o=void 0===i||u.selectsAll(i)?void 0:i;if(Array.isArray(n)||n.includes("*"))return this._callAllAgents({className:e,functionName:t,args:r,agents:n,selection:o});const s={c:e,f:t,a:[],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};let a="__callAll__";if(void 0!==o){if(await this._waitUntilClassIsOnline(n,e),!this._selectsInstances(n,e))return this._callSelected({agent:n,className:e,functionName:t,args:r,selection:o});a="__callMatching__"}const l=`${this._domain}/${n}/${e}/__static__/${a}`,c=await this._wrapArguments({agent:n,className:e,functionName:t,args:r,isCallAll:!0,selection:o});return c?(s.a=void 0===o?[t,...c]:[o,t,...c],this._declare(s,l),await this._waitUntilClassIsOnline(n,e),this._mqttPublish(l,JSON.stringify(s)),this._handleAgentAnswer(s,n)):void 0}async _callAllAgents({className:e,functionName:t,args:r,agents:n,selection:i}){const o=Array.isArray(n)?n:this.getAvailableAgents().filter(t=>this._agents[t].classes[e]&&u.matches(n,t));return(await Promise.all(o.map(n=>this.callAll({className:e,functionName:t,args:r,agent:n,instances:i}).then(e=>(e||[]).map(e=>({agent:n,...e})),t=>{const r={message:t.message},o=this.getAvailableInstances({className:e,agent:n}).filter(e=>void 0===i||u.selects(i,e));return o.length>0?o.map(e=>({agent:n,id:e,err:r})):[{agent:n,err:r}]})))).flat()}_selectsInstances(e,t){const r=this._agents[e]&&this._agents[e].classes[t];return!!r&&r.staticFunctions.some(e=>"__callMatching__"===this._stripSignature(e))}async _callSelected({agent:e,className:t,functionName:r,args:n,selection:i}){if(n.some(e=>this._isFunction(e)||this._isEmitter(e)))throw new Error(`Agent ${e} does not select instances for callbacks and events (its class info lists no __callMatching__): update it, or call without instances`);const o=this.getAvailableInstances({className:t,agent:e}).filter(e=>u.selects(i,e));return Promise.all(o.map(async i=>{try{const o=await this.getInstance(i,{agent:e,className:t});return{id:i,val:await o[r](...n)}}catch(e){return{id:i,err:{message:e.message}}}}))}async unsubscribe(e,{instance:t}={}){const r=Object.values(this._cachedSubscriptions);let n;if("string"==typeof e||Array.isArray(e))n=(Array.isArray(e)?e:[e]).map(e=>this._cachedSubscriptions[e.startsWith("__e__")?e.slice(5):e]).filter(Boolean);else if(this._isFunction(e))n=r.filter(t=>t.callback===e);else{if(!this._isEmitter(e))throw new Error("unsubscribe expects a subscription id, a callback or an { emitter, event } contract");{const t=this._emitterCallback(e,{readOnly:!0});n=t?r.filter(e=>e.callback===t):[]}}const i=[];if(null!=t&&(i.push(...n.filter(e=>e.callAll)),n=n.filter(e=>!e.callAll&&e.instance===t)),0===n.length&&0===i.length)return!1;n.forEach(e=>this._dropSubscription(e)),i.forEach(e=>e.withdrawn.add(t));const o=new Map,s=(e,t,r)=>{o.has(e)||o.set(e,[]),o.get(e).push({sub:t,context:r})};for(const e of n)s(e.agent,e);for(const e of i)s(e.agent,e,t);const a=[];for(const[e,t]of o)a.push(this._withdrawAt(e,t));return await Promise.allSettled(a),!0}_withdrawAt(e,t){const r=this._agents[e];if(!this._isConnected()||!r||"online"!==r.status){const r=this._pendingWithdrawals.get(e)||[];return r.push(...t),this._pendingWithdrawals.set(e,r),Promise.resolve()}return r.v>=4?this._sendUnsubscribe(e,t):Promise.allSettled(t.filter(({context:e})=>void 0===e).map(({sub:e})=>this._sendLegacyRemoval(e)))}_flushWithdrawals(e){const t=this._pendingWithdrawals.get(e),r=this._agents[e];t&&this._isConnected()&&r&&"online"===r.status&&(this._pendingWithdrawals.delete(e),this._withdrawAt(e,t))}_loseAgent(e,t){if(!(t>=4))return this._redeclare.delete(e),void this._clearCachedSubscriptions({lostAgent:e});this._redeclare.add(e);for(const t of Object.values(this._cachedSubscriptions))t.agent!==e||t.lost||(t.lost=!0,t.confirmed=!1,this.emit("lost",t.id,"agentOffline",this._subscriptionInfo(t)))}getSubscriptions({callback:e}={}){return e&&this._isEmitter(e)&&!(e=this._emitterCallback(e,{readOnly:!0}))?[]:Object.values(this._cachedSubscriptions).filter(t=>!e||t.callback===e).map(e=>({id:e.id,...this._subscriptionInfo(e),confirmed:e.confirmed,lost:e.lost}))}setSubscriberLabel(e,t){this._isEmitter(e)&&(e=this._emitterCallback(e)),this._subscriberLabels.set(e,t)}async getRegistrations({className:e,instance:t,agent:r=this._agent}={}){return this._callProtocol({className:e,instance:t,agent:r},"__registrations__",[])}async endRegistration({className:e,instance:t,agent:r=this._agent,functionName:n,args:i=[],by:o=null}={}){return this._callProtocol({className:e,instance:t,agent:r},"__end__",[n,i,o])}async _callProtocol({className:e,instance:t,agent:r},n,i){if(!this._isConnected())throw new Error("Client is not connected");if(t&&(!r||"*"===r||!e)){const n=await this._getInstanceData(t,{agent:r,className:e});r=n.agent,e=n.className}if(!r||"*"===r)throw new Error("Agent must be specified");if(await this._waitUntilClassIsOnline(r,e),!(this._agents[r].v>=4))throw new Error(`Agent "${r}" does not speak protocol 4`);const o={c:t||e,f:n,a:i,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},s=`${this._domain}/${r}/${e}/${t||"__static__"}/${n}`;return this._mqttPublish(s,JSON.stringify(o)),this._handleAgentAnswer(o,r)}async _sendUnsubscribe(e,t){const r=t[0].sub.className,n={c:r,f:"__unsubscribe__",a:t.map(({sub:e,context:t})=>void 0===t?e.id:{id:e.id,context:t}),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},i=`${this._domain}/${e}/${r}/__static__/__unsubscribe__`;this._mqttPublish(i,JSON.stringify(n));try{await this._handleAgentAnswer(n,e)}catch(e){this._log.debug(`Withdrawing subscriptions failed: ${e.message}`)}}async _sendLegacyRemoval(e){if(e.callAll||!e.instance)return;let t,r;if("on"===e.functionName||"addListener"===e.functionName)t="removeListener",r=[e.event,e.id];else{const n=e.functionName.replace(/^on(?=[A-Z])/,"off"),i=this._agents[e.agent]&&this._agents[e.agent].classes[e.className],o=i?i.memberFunctions.map(this._stripSignature):[];if(n===e.functionName||!o.includes(n))return;if(!e.declaration)return;t=n,r=e.declaration.a}const n={c:e.instance,f:t,a:r,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4},i=`${this._domain}/${e.agent}/${e.className}/${e.instance}/${t}`;this._mqttPublish(i,JSON.stringify(n));try{await this._handleAgentAnswer(n,e.agent)}catch(e){this._log.debug(`Removing a subscription failed: ${e.message}`)}}getSystemInformation(){return this._agents}getAvailableAgents({mustBeOnline:e=!0}={}){const t=[];if(e){for(const e in this._agents){const{status:r}=this._agents[e];"online"===r&&t.push(e)}return t}return Object.keys(this._agents)}getAvailableClasses({agent:e=this._agent,mustBeOnline:t=!0}={}){if("*"===e)throw new Error("Agent must be specified");if(!this._agents[e])return[];const{classes:r,status:n}=this._agents[e];return t&&"online"!==n?[]:Object.keys(r)}getAvailableInstances({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].instances:[]}getAvailableMemberFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].memberFunctions.map(e=>this._stripSignature(e)):[]}getAvailableStaticFunctions({className:e,agent:t=this._agent,mustBeOnline:r=!0}={}){if("*"===t)throw new Error("Agent must be specified");if(!this._agents[t])return[];const{classes:n,status:i}=this._agents[t];return r&&"online"!==i?[]:n[e]?n[e].staticFunctions.map(e=>this._stripSignature(e)):[]}async reconnectWithToken(e,{agent:t=this._agent}={}){if(this._token=e,this._agent=t,this._client){const e=this._client;await new Promise(t=>d._endMqtt(e,!1,{},t))}return this.connect()}async unregisterAgent(e){if(this._agents[e]&&"offline"===this._agents[e].status){const t=`${this._domain}/${e}/__agentInfo__`;this._mqttPublish(t,null,{retain:!0});const r=this.getAvailableClasses({agent:e,mustBeOnline:!1});for(const t of r)for(const r of["__classInfo__","__classInfoConcise__"]){const n=`${this._domain}/${e}/${t}/${r}`;this._mqttPublish(n,null,{retain:!0})}return delete this._agents[e],!0}return!1}async end(){if(this._subscribeRetrier.cancel(),!this._client)return;this._mqttPublish(`${this._vrpcConnectionId}/__clientInfo__`,JSON.stringify({status:"offline",clientId:this._vrpcClientId,v:4})),this._loseAnswers(()=>!0,"the client ended"),this._eventEmitter.removeAllListeners(),this.removeAllListeners(),this._cachedSubscriptions={},this._redeclare.clear(),this._pendingWithdrawals.clear();const e=this._client;return this._client=null,new Promise(t=>d._endMqtt(e,!1,{},t))}static _createHash(e,t=16){let r=5381,n=52711;for(let t=0;t<e.length;t++){const i=e.charCodeAt(t);r=33*r^i,n=33*n^i}return((r>>>0).toString(16).padStart(8,"0")+(n>>>0).toString(16).padStart(8,"0")).slice(0,t)}_isConnected(){return this._client&&this._client.connected}_generateUserName(){return`${this._domain}:client@${i.hostname()}-${i.platform()}-js`}_createMqttClientId(){const e=i.arch()+i.homedir()+i.hostname()+JSON.stringify(i.networkInterfaces())+i.platform()+i.release()+i.totalmem()+i.type(),t=d._createHash(e,12);return`vc3${this._instance}${t}`}_createVrpcClientId(){const e=this._identity||this._instance;return`${this._domain}/${i.hostname()}/${e}`}_createVrpcConnectionId(){return`${this._domain}/${this._mqttClientId}/${this._connectionSecret}`}_isRevivable(e){return e===this._client&&!h.has(e)}_mqttPublish(e,t,r){const n=this._client;n.publish(e,t,{qos:this._qos,...r},e=>{e&&(this._log.warn(`Could not publish MQTT message because: ${e.message}`),"client disconnecting"===e.message&&this._isRevivable(n)&&(this._log.error(`Failed to publish, because: ${e.message}`),this.emit("error",e),this._log.info("Forcing reconnect now..."),n.disconnecting=!1,n.reconnect()))})}async _mqttSubscribe(e,t){const r=this._client;return new Promise((n,i)=>{r.subscribe(e,{qos:this._qos,...t},(o,s)=>{const{refused:a,granted:c,error:u}=l.outcome(o,s);if(u)if(this._log.warn(`Could not subscribe to topic(s): '${e}', because: ${u.message}`),"client disconnecting"===u.message&&this._isRevivable(r)){const e=`Failed to subscribe, because: ${u.message}`;this._log.error(e),this.emit("error",u),this._log.info("Forcing reconnect now..."),r.disconnecting=!1,r.reconnect(),i(new Error(e))}else i(u);else{let r;const i=Array.isArray(e)?e:[e],o=a;o.length>0&&(r=new Error(`Could not subscribe all ${i.length} topic(s) but got error qos=128 on following ${o.length} topic(s): ${o}`),r.code="SUBSCRIBE_FAILED",r.subscribeOptions=t,this._log.error(r.message),this.emit("error",r),this._subscribeRetrier.schedule(o,t)),this._subscribeRetrier.granted(c.map(e=>e.topic));const s=c.filter(e=>e.qos<this._qos);s.length>0&&(r=new Error(`Could not subscribe all ${i.length} topic(s) at desired qos=${this._qos} but got reduced qos on following ${s.length} topic(s): ${JSON.stringify(s)}`),r.code="SUBSCRIBE_REDUCED_QOS",r.subscribeOptions=t,this._log.warn(r.message),this.emit("error",r)),0===c.length&&0===a.length&&this._log.debug(`Already subscribed to: ${e}`),n()}})})}async _mqttUnsubscribe(e,t){return new Promise((r,n)=>{this._client.unsubscribe(e,t,t=>{t&&this._log.warn(`Could not unsubscribe from topic: ${e} because: ${t.message}`),r()})})}_createIfNotExist(e){this._agents[e]||(this._agents[e]={classes:{}})}async _getProxy(e,t,r){const{f:n,i}=r,o=`${this._domain}/${e}/${t}/__static__/${n}`;return await this._waitUntilClassIsOnline(e,t),this._mqttPublish(o,JSON.stringify(r)),new Promise((r,o)=>{const s=`Proxy creation for class "${t}" on agent "${e}" and domain "${this._domain}"`,a=setTimeout(()=>{l(),o(new Error(`${s} timed out (> ${this._timeout} ms)`))},this._timeout),l=this._awaitAnswer(i,{agent:e,lose:e=>{clearTimeout(a),o(new Error(`${s} lost its answer: ${e}`))}},({e:i,r:s})=>{if(clearTimeout(a),i){const{message:r,cause:s}=d._prepareError(i);o(new Error(`[vrpc ${e}-${t}-${n}]: ${r}`,{cause:s}))}else{const n=this._createProxy(e,t,s);r(n)}})})}async _waitUntilClassIsOnline(e,t){if(!this._hasClassOnline(e,t))return new Promise((r,n)=>{let i=null;const o=()=>{this._hasClassOnline(e,t)&&(i&&clearTimeout(i),this.removeListener("class",o),this.removeListener("agent",o),r())};i=setTimeout(()=>{this.removeListener("class",o),this.removeListener("agent",o),n(new Error(`Connection to class "${t}" on agent "${e}" and domain "${this._domain}" timed out (> ${this._timeout} ms)`))},this._timeout),this.on("class",o),this.on("agent",o)})}_hasClassOnline(e,t){return this._agents[e]&&"online"===this._agents[e].status&&this._agents[e].classes[t]}_createProxy(e,t,r){const n=`${this._domain}/${e}/${t}/${r}`,i=`${this._instance}-${this._proxyId++}`,o={vrpcClientId:this._vrpcClientId,vrpcConnectionId:this._vrpcConnectionId,vrpcInstanceId:r,vrpcProxyId:i};let s=this._agents[e].classes[t].memberFunctions;s=s.map(e=>{const t=e.indexOf("-");return t>0?e.substring(0,t):e});const a=new Set(s);return a.forEach(s=>{o[s]="removeAllListeners"!==s?async(...o)=>{const a=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:s,args:o});if(!a)return!0;try{const t={c:r,f:s,a,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._declare(t,`${n}/${s}`),this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}:async i=>{if(!i)throw new Error("VRPC does not support removing all listeners");Object.values(this._cachedSubscriptions).filter(n=>n.agent===e&&n.className===t&&n.instance===r&&n.event===i).forEach(e=>this._dropSubscription(e));try{const t={c:r,f:s,a:[i],i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._mqttPublish(`${n}/${s}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${s}" because: ${e.message}`)}}}),a.has("vrpcOn")||a.has("vrpcOff")||(o.vrpcOn=async(o,...s)=>{if(!a.has(o))throw new Error("Bad magic");const l=await this._wrapArguments({agent:e,className:t,instance:r,proxyId:i,functionName:"vrpcOn",args:[o,...s]});if(l)try{const t={c:r,f:o,a:l.slice(1),i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};return this._declare(t,`${n}/${o}`),this._mqttPublish(`${n}/${o}`,JSON.stringify(t)),this._handleAgentAnswer(t,e)}catch(e){throw new Error(`Could not remotely call "${o}" because: ${e.message}`)}},o.vrpcOff=async n=>{const i=Object.values(this._cachedSubscriptions).filter(i=>i.agent===e&&i.className===t&&i.instance===r&&i.functionName===n).map(e=>e.id);return 0!==i.length&&this.unsubscribe(i)}),o}async _handleAgentAnswer({i:e,c:t,f:r,a:n},i){return new Promise((o,s)=>{const a=`Function call "${t}::${r}()" on agent "${i}"`,l=setTimeout(()=>{f(),s(new Error(`${a} timed out (> ${this._timeout} ms)`))},this._timeout),c=e=>{clearTimeout(l),s(new Error(`${a} lost its answer: ${e}`))},u=()=>{const e=this._agents[i];e&&e.v>=4&&this._confirmSubscriptions(n)},f=this._awaitAnswer(e,{agent:i,lose:c},e=>{if(clearTimeout(l),e.e){const{message:n,cause:o}=d._prepareError(e.e);s(new Error(`[vrpc ${i}-${t}-${r}]: ${n}`,{cause:o}))}else{const n=e.r;"string"==typeof n&&"__p__"===n.substring(0,5)?this._awaitAnswer(n,{agent:i,lose:c,second:!0},e=>{if(e.e){const{message:n,cause:o}=d._prepareError(e.e);s(new Error(`[vrpc ${i}-${t}-${r}]: ${n}`,{cause:o}))}else u(),o(e.r)}):(u(),o(n))}})})}_awaitAnswer(e,{agent:t,lose:r,second:n=!1},i){const o={agent:t,lose:r,second:n},s=e=>{this._waiting.delete(o),i(e)};return o.forget=()=>{this._waiting.delete(o),this._eventEmitter.removeListener(e,s)},this._waiting.add(o),this._eventEmitter.once(e,s),o.forget}_loseAnswers(e,t){for(const r of Array.from(this._waiting))e(r)&&(r.forget(),r.lose(t))}static _prepareError(e){return"object"==typeof e?{message:e.message,cause:e.cause}:{message:e,cause:void 0}}async _waitForInstance(e,t={}){return new Promise((r,n)=>{const i=n=>(o,{agent:s,className:a})=>{if(o.includes(e)){if(t.agent&&s!==t.agent)return;if(t.className&&a!==t.className)return;clearTimeout(n),this.removeListener("instanceNew",i),r({agent:s,className:a,instance:e})}},o=setTimeout(()=>{this.removeListener("instanceNew",i(o));const t=`Could not find instance: ${e} (> ${this._timeout} ms)`;n(new Error(t))},this._timeout);this.on("instanceNew",i(o))})}_isEventFunction(e,t,r){const n=this._agents[e]&&this._agents[e].classes&&this._agents[e].classes[t],i=n&&n.meta&&n.meta[r],o=i&&i.ret&&i.ret.type;return!("string"!=typeof o||!f.test(o.trim()))||!!/^on[A-Z]/.test(r)||/^(notify|monitor|signal)/.test(r)}async _wrapArguments({agent:e,className:t,instance:r,proxyId:n,functionName:i,args:o,isCallAll:s=!1,selection:a}){const l=[],c=this._isEventFunction(e,t,i),u=/^(off|remove|unmonitor|unsignal)/.test(i),f=("off"===i||"removeListener"===i)&&"string"==typeof o[0];for(const[h,d]of o.entries()){const p=this._isEmitter(d);if(this._isFunction(d)||p){const g=!c&&(f&&1===h||u),b=p?this._emitterCallback(d,{readOnly:g}):d;if(!g&&(p||"vrpcOn"===i||("on"===i||"addListener"===i)&&1===h&&"string"==typeof o[0]||c)){const n="string"==typeof o[0]?o[0]:i,c="vrpcOn"===i,u=await this._onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:b,functionName:c?o[0]:i,args:c?o.slice(1):o,position:c?h-1:h,isCallAll:s,selection:a});l.push(u);continue}if(g){const n=b?this._offRemoteEvent({agent:e,className:t,instance:r,isCallAll:s,selection:a,functionName:i,args:o,position:h,callback:b}):[];if(n.length>0){const t=this._agents[e];if(t&&t.v>=4)return await this._withdrawAt(e,n.map(e=>({sub:e}))),null;l.push(n[0].id);continue}if("off"===i||"removeListener"===i)return null;if(p){l.push(null);continue}}const y=`__f__${n||`${e}-${t}`}-${i}-${h}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`;l.push(y),this._eventEmitter.once(y,({a:n,e:o})=>{o?this.emit("undelivered",y,o,{agent:e,className:t,instance:r,functionName:i}):b.apply(null,n)});continue}l.push(d)}return l}_emitterCallback({emitter:e,event:t},{readOnly:r=!1}={}){let n=this._emitterListener.get(e);if(n&&n.has(t))return n.get(t);if(r)return null;const i=(...r)=>e.emit(t,...r);return n||(n=new Map,this._emitterListener.set(e,n)),n.set(t,i),i}_subscriptionKey(e,t,r){const n="addListener"===e?"on":e,i=t.map((e,t)=>t===r?"\0vrpc-self":this._isFunction(e)||this._isEmitter(e)?"\0vrpc-callback":e);return`${n}\0${d._canonical(i)}`}static _canonical(e){const t=e=>{if(Array.isArray(e))return e.map(t);if(e&&"object"==typeof e&&e.constructor===Object){const r={};for(const n of Object.keys(e).sort())r[n]=t(e[n]);return r}return e};return JSON.stringify(t(e))}static _twinOf(e){return"off"===e||"removeListener"===e?"on":e.replace(/^(off|un)(?=[A-Za-z])/,e=>"off"===e?"on":"")}static _identity({agent:e,className:t,instance:r,isCallAll:n,selection:i,key:o}){const s=[e,t,r||null,!!n,o];return JSON.stringify(void 0===i?s:[...s,i])}_subscriptionTopic(e,t,{readOnly:r=!1}={}){let n=this._subscriptionTopics.get(e);if(!n){if(r)return null;n=new Map,this._subscriptionTopics.set(e,n)}let i=n.get(t);return i||r||(i=`${this._vrpcConnectionId}/s${(this._subscriptionCount++).toString(36)}`,n.set(t,i)),i||null}async _onRemoteEvent({agent:e,className:t,instance:r,event:n,callback:i,functionName:o,args:s,position:a,isCallAll:l=!1,selection:c}){const u=d._identity({agent:e,className:t,instance:r,isCallAll:l,selection:c,key:this._subscriptionKey(o,s,a)}),f=this._subscriptionTopic(i,u),h=`__e__${f}`;if(this._cachedSubscriptions[f])return h;const p={id:h,identity:u,agent:e,className:t,instance:r,event:n,functionName:o,callAll:l,selection:c,callback:i,handler:null,declaration:null,confirmed:!1,lost:!1,withdrawn:new Set};return p.handler=({a:e,end:t,e:r})=>{t?this._handleEnded(f,t):r?this.emit("undelivered",h,r,this._subscriptionInfo(p)):p.withdrawn.size>0&&Array.isArray(e)&&p.withdrawn.has(e[0])||i.apply(null,e)},this._eventEmitter.on(h,p.handler),this._cachedSubscriptions[f]=p,h}_offRemoteEvent({agent:e,className:t,instance:r,isCallAll:n,selection:i,functionName:o,args:s,position:a,callback:l}){const c=d._twinOf(o),u=this._subscriptionTopic(l,d._identity({agent:e,className:t,instance:r,isCallAll:n,selection:i,key:this._subscriptionKey(c,s,a)}),{readOnly:!0});let f=u&&this._cachedSubscriptions[u]?[this._cachedSubscriptions[u]]:[];if(0===f.length){const o=Object.values(this._cachedSubscriptions).filter(o=>o.callback===l&&o.agent===e&&o.className===t&&o.instance===r&&o.callAll===!!n&&JSON.stringify(o.selection)===JSON.stringify(i)),s=o.filter(e=>("addListener"===e.functionName?"on":e.functionName)===c);f=s.length>0?s:o}return f.forEach(e=>this._dropSubscription(e)),f}_dropSubscription(e,{forget:t=!0}={}){this._eventEmitter.removeListener(e.id,e.handler);const r=e.id.slice(5);if(this._cachedSubscriptions[r]===e&&delete this._cachedSubscriptions[r],t){const t=this._subscriptionTopics.get(e.callback);t&&t.get(e.identity)===r&&t.delete(e.identity)}}_declare(e,t){const r={};let n=!1;for(const i of e.a){if("string"!=typeof i||!i.startsWith("__e__"))continue;const o=this._cachedSubscriptions[i.slice(5)];if(!o)continue;o.declaration={topic:t,c:e.c,f:e.f,a:e.a},o.withdrawn.clear();const s=this._subscriberLabels.get(o.callback);void 0!==s&&(r[i]=s,n=!0)}if(n){e.l=r;for(const e of Object.keys(r)){const t=this._cachedSubscriptions[e.slice(5)];t&&t.declaration&&(t.declaration.l=r)}}}_confirmSubscriptions(e){if(Array.isArray(e))for(const t of e){const e="string"==typeof t&&t.startsWith("__e__")&&this._cachedSubscriptions[t.slice(5)];e&&(e.confirmed=!0)}}_redeclareTo(e){if(!this._inboxReady||!this._redeclare.has(e))return;const t=this._agents[e];if(!t||"online"!==t.status)return;if(this._redeclare.delete(e),!(t.v>=4))return;const r=new Map;for(const t of Object.values(this._cachedSubscriptions)){if(t.agent!==e||!t.declaration)continue;const{topic:n,a:i}=t.declaration,o=`${n}\0${JSON.stringify(i)}`;r.has(o)||r.set(o,{declaration:t.declaration,subs:[]}),r.get(o).subs.push(t)}for(const{declaration:t,subs:n}of r.values()){const{topic:r,c:i,f:o,a:s,l:a}=t,l={c:i,f:o,a:s,i:`${this._instance}-${this._invokeId++%Number.MAX_SAFE_INTEGER}`,s:this._vrpcConnectionId,v:4};a&&(l.l=a),this._mqttPublish(r,JSON.stringify(l)),this._handleAgentAnswer(l,e).then(()=>{const t=[];for(const e of n)if(this._cachedSubscriptions[e.id.slice(5)]===e){e.lost&&(e.lost=!1,this.emit("healed",e.id,this._subscriptionInfo(e)));for(const r of e.withdrawn)t.push({sub:e,context:r})}if(t.length>0)return this._sendUnsubscribe(e,t)},e=>{for(const t of n)this._cachedSubscriptions[t.id.slice(5)]===t&&(this._dropSubscription(t,{forget:!1}),this.emit("lost",t.id,e.message,this._subscriptionInfo(t)))})}}_subscriptionInfo(e){return{agent:e.agent,className:e.className,instance:e.instance,functionName:e.functionName,event:e.event,callAll:e.callAll,...void 0===e.selection?{}:{instances:e.selection}}}_handleEnded(e,t){const r=this._cachedSubscriptions[e];if(!r)return;const n={...this._subscriptionInfo(r),context:t.context,failed:!!t.failed};r.callAll||this._dropSubscription(r),this.emit("ended",r.id,t.reason,t.by,n)}_clearCachedSubscriptions({lostAgent:e,lostInstance:t,agent:r,className:n}){const i=Object.values(this._cachedSubscriptions).filter(i=>void 0!==e?i.agent===e:i.instance===t&&i.agent===r&&i.className===n),o=void 0!==e?"agentOffline":"instanceGone";i.forEach(e=>{this._log.debug(`Clearing subscription for obsolete topic: ${e.id}`),this._dropSubscription(e,{forget:!1}),this.emit("lost",e.id,o,this._subscriptionInfo(e))})}_stripSignature(e){const t=e.indexOf("-");return t>0?e.substring(0,t):e}_isFunction(e){const t={}.toString.call(e);return e&&("[object Function]"===t||"[object AsyncFunction]"===t)}_isEmitter(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"emitter")&&Object.prototype.hasOwnProperty.call(e,"event")&&"object"==typeof e.emitter&&"function"==typeof e.emitter.emit}async _getInstanceData(e,t){const r=this._findOwnIsolated(e,t);if(r)return r;const n=this._getInstanceFromCache(e,t);if(!n){if(t.noWait)throw new Error(`Could not find instance: ${e}`);return this._waitForInstance(e,t)}return n}_findOwnIsolated(e,{agent:t,className:r}={}){const n=Array.from(this._ownIsolated.values()).filter(n=>!(n.instance!==e||t&&"*"!==t&&n.agent!==t||r&&n.className!==r));return 1===n.length?{agent:n[0].agent,className:n[0].className}:null}_cachedProxy(e,{agent:t,className:r}={}){const n=Object.values(this._proxies).filter(n=>!(n.instance!==e||t&&n.agent!==t||r&&n.className!==r));return 1===n.length?n[0].proxy:null}_getInstanceFromCache(e,t={}){if(!t.agent&&"*"!==this._agent){const{classes:r,status:n}=this._agents[this._agent]||{};if(r&&"offline"!==n)for(const n in r){if(t.className&&n!==t.className)continue;const{instances:i}=r[n];if(i&&i.includes(e))return{agent:this._agent,className:n,instance:e}}}for(const r in this._agents){if(t.agent&&r!==t.agent)continue;const{classes:n,status:i}=this._agents[r];if(n&&"offline"!==i)for(const i in n){if(t.className&&i!==t.className)continue;const{instances:o}=n[i];if(o&&o.includes(e))return{agent:r,className:i,instance:e}}}}_indicateDeprecation(e){n&&n.emitWarning?n.emitWarning(e,"DeprecationWarning"):this._log.warn("DEPRECATED ",e)}}e.exports=d},8601:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeSlice:i,Error:o,FunctionPrototypeSymbolHasInstance:s,ObjectDefineProperty:a,ObjectDefineProperties:l,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:u,Symbol:f,SymbolHasInstance:h}=r(4469);e.exports=j,j.WritableState=N;const{EventEmitter:d}=r(7007),p=r(4474).Stream,{Buffer:g}=r(8287),b=r(1787),{addAbortSignal:y}=r(982),{getHighWaterMark:_,getDefaultHighWaterMark:m}=r(2100),{ERR_INVALID_ARG_TYPE:w,ERR_METHOD_NOT_IMPLEMENTED:v,ERR_MULTIPLE_CALLBACK:S,ERR_STREAM_CANNOT_PIPE:E,ERR_STREAM_DESTROYED:A,ERR_STREAM_ALREADY_FINISHED:k,ERR_STREAM_NULL_VALUES:I,ERR_STREAM_WRITE_AFTER_END:O,ERR_UNKNOWN_ENCODING:R}=r(2074).codes,{errorOrDestroy:T}=b;function x(){}c(j.prototype,p.prototype),c(j,p);const P=f("kOnFinished");function N(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(7323)),this.objectMode=!(!e||!e.objectMode),n&&(this.objectMode=this.objectMode||!(!e||!e.writableObjectMode)),this.highWaterMark=e?_(this,e,"writableHighWaterMark",n):m(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const i=!(!e||!1!==e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=F.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[P]=[]}function C(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function j(e){const t=this instanceof r(7323);if(!t&&!s(j,this))return new j(e);this._writableState=new N(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&y(e.signal,this)),p.call(this,e),b.construct(this,()=>{const e=this._writableState;e.writing||W(this,e),V(this,e)})}function M(e,t,r,i){const o=e._writableState;if("function"==typeof r)i=r,r=o.defaultEncoding;else{if(r){if("buffer"!==r&&!g.isEncoding(r))throw new R(r)}else r=o.defaultEncoding;"function"!=typeof i&&(i=x)}if(null===t)throw new I;if(!o.objectMode)if("string"==typeof t)!1!==o.decodeStrings&&(t=g.from(t,r),r="buffer");else if(t instanceof g)r="buffer";else{if(!p._isUint8Array(t))throw new w("chunk",["string","Buffer","Uint8Array"],t);t=p._uint8ArrayToBuffer(t),r="buffer"}let s;return o.ending?s=new O:o.destroyed&&(s=new A("write")),s?(n.nextTick(i,s),T(e,s,!0),s):(o.pendingcb++,function(e,t,r,n,i){const o=t.objectMode?1:r.length;t.length+=o;const s=t.length<t.highWaterMark;return s||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:r,encoding:n,callback:i}),t.allBuffers&&"buffer"!==n&&(t.allBuffers=!1),t.allNoop&&i!==x&&(t.allNoop=!1)):(t.writelen=o,t.writecb=i,t.writing=!0,t.sync=!0,e._write(r,n,t.onwrite),t.sync=!1),s&&!t.errored&&!t.destroyed}(e,o,t,r,i))}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new A("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n){--t.pendingcb,n(r),U(t),T(e,r)}function F(e,t){const r=e._writableState,i=r.sync,o=r.writecb;"function"==typeof o?(r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,t?(t.stack,r.errored||(r.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),i?n.nextTick(D,e,r,t,o):D(e,r,t,o)):(r.buffered.length>r.bufferedIndex&&W(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:e,state:r},n.nextTick($,r.afterWriteTickInfo)):B(e,r,1,o))):T(e,new S)}function $({stream:e,state:t,count:r,cb:n}){return t.afterWriteTickInfo=null,B(e,t,r,n)}function B(e,t,r,n){for(!t.ending&&!e.destroyed&&0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,n();t.destroyed&&U(t),V(e,t)}function U(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;const{chunk:n,callback:i}=e.buffered[r],o=e.objectMode?1:n.length;e.length-=o,i(null!==(t=e.errored)&&void 0!==t?t:new A("write"))}const r=e[P].splice(0);for(let t=0;t<r.length;t++){var n;r[t](null!==(n=e.errored)&&void 0!==n?n:new A("end"))}C(e)}function W(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;const{buffered:r,bufferedIndex:n,objectMode:o}=t,s=r.length-n;if(!s)return;let a=n;if(t.bufferProcessing=!0,s>1&&e._writev){t.pendingcb-=s-1;const n=t.allNoop?x:e=>{for(let t=a;t<r.length;++t)r[t].callback(e)},o=t.allNoop&&0===a?r:i(r,a);o.allBuffers=t.allBuffers,L(e,t,!0,t.length,o,"",n),C(t)}else{do{const{chunk:n,encoding:i,callback:s}=r[a];r[a++]=null,L(e,t,!1,o?1:n.length,n,i,s)}while(a<r.length&&!t.writing);a===r.length?C(t):a>256?(r.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}function q(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function V(e,t,r){q(t)&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)T(e,null!=i?i:S());else if(r=!0,t.pendingcb--,i){const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e](i);T(e,i,t.sync)}else q(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,n.nextTick(z,e,t))}t.sync=!0,t.pendingcb++;try{e._final(i)}catch(e){i(e)}t.sync=!1}(e,t)))}(e,t),0===t.pendingcb&&(r?(t.pendingcb++,n.nextTick((e,t)=>{q(t)?z(e,t):t.pendingcb--},e,t)):q(t)&&(t.pendingcb++,z(e,t))))}function z(e,t){t.pendingcb--,t.finished=!0;const r=t[P].splice(0);for(let e=0;e<r.length;e++)r[e]();if(e.emit("finish"),t.autoDestroy){const t=e._readableState;(!t||t.autoDestroy&&(t.endEmitted||!1===t.readable))&&e.destroy()}}N.prototype.getBuffer=function(){return i(this.buffered,this.bufferedIndex)},a(N.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}}),a(j,h,{__proto__:null,value:function(e){return!!s(this,e)||this===j&&e&&e._writableState instanceof N}}),j.prototype.pipe=function(){T(this,new E)},j.prototype.write=function(e,t,r){return!0===M(this,e,t,r)},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){const e=this._writableState;e.corked&&(e.corked--,e.writing||W(this,e))},j.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=u(e)),!g.isEncoding(e))throw new R(e);return this._writableState.defaultEncoding=e,this},j.prototype._write=function(e,t,r){if(!this._writev)throw new v("_write()");this._writev([{chunk:e,encoding:t}],r)},j.prototype._writev=null,j.prototype.end=function(e,t,r){const i=this._writableState;let s;if("function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e){const r=M(this,e,t);r instanceof o&&(s=r)}return i.corked&&(i.corked=1,this.uncork()),s||(i.errored||i.ending?i.finished?s=new k("end"):i.destroyed&&(s=new A("end")):(i.ending=!0,V(this,i,!0),i.ended=!0)),"function"==typeof r&&(s||i.finished?n.nextTick(r,s):i[P].push(r)),this},l(j.prototype,{closed:{__proto__:null,get(){return!!this._writableState&&this._writableState.closed}},destroyed:{__proto__:null,get(){return!!this._writableState&&this._writableState.destroyed},set(e){this._writableState&&(this._writableState.destroyed=e)}},writable:{__proto__:null,get(){const e=this._writableState;return!(!e||!1===e.writable||e.destroyed||e.errored||e.ending||e.ended)},set(e){this._writableState&&(this._writableState.writable=!!e)}},writableFinished:{__proto__:null,get(){return!!this._writableState&&this._writableState.finished}},writableObjectMode:{__proto__:null,get(){return!!this._writableState&&this._writableState.objectMode}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return!!this._writableState&&this._writableState.ending}},writableNeedDrain:{__proto__:null,get(){const e=this._writableState;return!!e&&!e.destroyed&&!e.ending&&e.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._writableState.writable||!this._writableState.destroyed&&!this._writableState.errored||this._writableState.finished)}}});const H=b.destroy;let G;function K(){return void 0===G&&(G={}),G}j.prototype.destroy=function(e,t){const r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[P].length)&&n.nextTick(U,r),H.call(this,e,t),this},j.prototype._undestroy=b.undestroy,j.prototype._destroy=function(e,t){t(e)},j.prototype[d.captureRejectionSymbol]=function(e){this.destroy(e)},j.fromWeb=function(e,t){return K().newStreamWritableFromWritableStream(e,t)},j.toWeb=function(e){return K().newWritableStreamFromStreamWritable(e)}},8636:(e,t,r)=>{"use strict";var n=r(920),i=r(7720),o=r(4765),s=Object.prototype.hasOwnProperty,a={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},l=Array.isArray,c=Array.prototype.push,u=function(e,t){c.apply(e,l(t)?t:[t])},f=Date.prototype.toISOString,h=o.default,d={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:i.encode,encodeValuesOnly:!1,filter:void 0,format:h,formatter:o.formatters[h],indices:!1,serializeDate:function(e){return f.call(e)},skipNulls:!1,strictNullHandling:!1},p={},g=function e(t,r,o,s,a,c,f,h,g,b,y,_,m,w,v,S,E,A){for(var k,I=t,O=A,R=0,T=!1;void 0!==(O=O.get(p))&&!T;){var x=O.get(t);if(R+=1,void 0!==x){if(x===R)throw new RangeError("Cyclic object value");T=!0}void 0===O.get(p)&&(R=0)}if("function"==typeof b?I=b(r,I):I instanceof Date?I=m(I):"comma"===o&&l(I)&&(I=i.maybeMap(I,function(e){return e instanceof Date?m(e):e})),null===I){if(c)return g&&!S?g(r,d.encoder,E,"key",w):r;I=""}if("string"==typeof(k=I)||"number"==typeof k||"boolean"==typeof k||"symbol"==typeof k||"bigint"==typeof k||i.isBuffer(I))return g?[v(S?r:g(r,d.encoder,E,"key",w))+"="+v(g(I,d.encoder,E,"value",w))]:[v(r)+"="+v(String(I))];var P,N=[];if(void 0===I)return N;if("comma"===o&&l(I))S&&g&&(I=i.maybeMap(I,g)),P=[{value:I.length>0?I.join(",")||null:void 0}];else if(l(b))P=b;else{var C=Object.keys(I);P=y?C.sort(y):C}var j=h?String(r).replace(/\./g,"%2E"):String(r),M=s&&l(I)&&1===I.length?j+"[]":j;if(a&&l(I)&&0===I.length)return M+"[]";for(var L=0;L<P.length;++L){var D=P[L],F="object"==typeof D&&D&&void 0!==D.value?D.value:I[D];if(!f||null!==F){var $=_&&h?String(D).replace(/\./g,"%2E"):String(D),B=l(I)?"function"==typeof o?o(M,$):M:M+(_?"."+$:"["+$+"]");A.set(t,R);var U=n();U.set(p,A),u(N,e(F,B,o,s,a,c,f,h,"comma"===o&&S&&l(I)?null:g,b,y,_,m,w,v,S,E,U))}}return N};e.exports=function(e,t){var r,i=e,c=function(e){if(!e)return d;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||d.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=o.default;if(void 0!==e.format){if(!s.call(o.formatters,e.format))throw new TypeError("Unknown format option provided.");r=e.format}var n,i=o.formatters[r],c=d.filter;if(("function"==typeof e.filter||l(e.filter))&&(c=e.filter),n=e.arrayFormat in a?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":d.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var u=void 0===e.allowDots?!0===e.encodeDotInKeys||d.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:d.addQueryPrefix,allowDots:u,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:d.allowEmptyArrays,arrayFormat:n,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:d.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:void 0===e.delimiter?d.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:d.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:d.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:d.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:d.encodeValuesOnly,filter:c,format:r,formatter:i,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:d.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:d.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:d.strictNullHandling}}(t);"function"==typeof c.filter?i=(0,c.filter)("",i):l(c.filter)&&(r=c.filter);var f=[];if("object"!=typeof i||null===i)return"";var h=a[c.arrayFormat],p="comma"===h&&c.commaRoundTrip;r||(r=Object.keys(i)),c.sort&&r.sort(c.sort);for(var b=n(),y=0;y<r.length;++y){var _=r[y],m=i[_];c.skipNulls&&null===m||u(f,g(m,_,h,p,c.allowEmptyArrays,c.strictNullHandling,c.skipNulls,c.encodeDotInKeys,c.encode?c.encoder:null,c.filter,c.sort,c.allowDots,c.serializeDate,c.format,c.formatter,c.encodeValuesOnly,c.charset,b))}var w=f.join(c.delimiter),v=!0===c.addQueryPrefix?"?":"";return c.charsetSentinel&&("iso-8859-1"===c.charset?v+="utf8=%26%2310003%3B&":v+="utf8=%E2%9C%93&"),w.length>0?v+w:""}},8648:e=>{"use strict";e.exports="undefined"!=typeof Reflect&&Reflect.getPrototypeOf||null},8665:(e,t,r)=>{const n=r(5350),i=r(7007),{nanoid:o}=r(3561),s=r(5341),a=r(2732);"symbol"!=typeof Symbol.dispose&&(Symbol.dispose=Symbol.for("nodejs.dispose")),"symbol"!=typeof Symbol.asyncDispose&&(Symbol.asyncDispose=Symbol.for("nodejs.asyncDispose"));const l="__global__",c="vrpc";class u{static registerClass(e,{onlyPublic:t=!0,withNew:r=!0,schema:n=null}={}){let i=u._extractStaticFunctions(e);t&&(i=i.filter(e=>!e.startsWith("_"))),i.push("__createIsolated__"),i.push("__createShared__"),i.push("__callAll__"),i.push("__callMatching__"),i.push("__delete__");let o=u._extractMemberFunctions(e);t&&(o=o.filter(e=>!e.startsWith("_"))),u._functionRegistry.set(e.name,{Klass:e,withNew:r,staticFunctions:i,memberFunctions:o,schema:n,meta:{}})}static registerFunction(e,t){if("function"!=typeof e)throw new Error("Provided argument must be a function object");console.log("registering function",t),window[c]||(window[c]={}),window[c][t]=e;const r=u._functionRegistry.get(l),n=r?[...r.staticFunctions,t]:[t];u._functionRegistry.set(l,{staticFunctions:n,memberFunctions:[],meta:{},Klass:{},withNew:!1,schema:null})}static registerInstance(e,{className:t,instance:r,onlyPublic:n=!0}={}){let i=u._extractMemberFunctions(e);n&&(i=i.filter(e=>!e.startsWith("_"))),u._functionRegistry.has(t)||u._functionRegistry.set(t,{memberFunctions:i,meta:{},Klass:{},withNew:!1,staticFunctions:[],schema:null}),u._instances.set(r,{className:t,instance:e,isIsolated:!1})}static create({className:e,instance:t=o(8),args:r=[],isIsolated:n=!1}={}){const i={c:e,a:[t,...r]},s=n?u._handleCreateIsolated(i):u._handleCreateShared(i);if(i.e)throw new Error(i.e);return s}static delete(e){if("string"==typeof e)return u._delete(e);if("object"==typeof e){for(const[t,r]of u._instances)if(r.instance===e)return u._delete(t);return!1}}static getInstance(e){const t=u._instances.get(e);if(t)return t.instance;throw new Error(`Could not find instance: ${e}`)}static getAvailableClasses(){return u._getClassesArray()}static getAvailableInstances(e){return u._getInstancesArray(e)}static call(e){const t=JSON.parse(e);return u._call(t),JSON.stringify(t)}static onCallback(e){u._callback=e}static on(e,t){u._emitter.on(e,t)}static once(e,t){u._emitter.once(e,t)}static off(e,t){u._emitter.off(e,t)}static removeAllListeners(e){u._emitter.removeAllListeners(e)}static _call(e){u._mustTrackClient=!1,delete e.r,delete e.e;try{if(void 0===e.a&&(e.a=[]),!Array.isArray(e.a))throw new Error("The arguments of a request must be an array");u._dispatch(e)}catch(t){e.e=u._error(t)}return u._mustTrackClient}static _dispatch(e){switch(e.f){case"__createIsolated__":u._handleCreateIsolated(e);break;case"__createShared__":u._handleCreateShared(e);break;case"__callAll__":u._handleCallAll(e);break;case"__callMatching__":u._handleCallMatching(e);break;case"__delete__":u._handleDelete(e);break;case"__unsubscribe__":u._handleUnsubscribe(e);break;case"__registrations__":u._handleRegistrations(e);break;case"__end__":u._handleEnd(e);break;default:u._handleCall(e)}}static _error(e){if(e&&"object"==typeof e&&"message"in e){const t={message:String(e.message)};return void 0!==e.cause&&(t.cause=e.cause),t}return{message:String(e)}}static _isPublished(e,t,r){const n=u._functionRegistry.get(e);return!!n&&(r?n.staticFunctions:n.memberFunctions).includes(t)}static _assertOwner(e,t,r){if(e&&e.isIsolated&&void 0!==e.owner&&t.s!==u.LOCAL_SENDER&&t.s!==e.owner)throw new Error(`Instance '${r}' is isolated to another connection`)}static _assertInstanceName(e){if("string"!=typeof e||0===e.length||/[/+#*]/.test(e)||"__static__"===e)throw new Error(`Invalid instance name: ${JSON.stringify(e)}`)}static _handleCreateIsolated(e){let t;try{const r=e.c,[n,...i]=e.a;u._assertInstanceName(n);const o=u._instances.get(n);if(o){if(!o.isIsolated)throw new Error(`Instance '${n}' exists as a shared instance`);return u._assertOwner(o,e,n),e.r=n,o.instance}t=u._create(r,n,...i),u._instances.set(n,{instance:t,className:r,isIsolated:!0,owner:"string"==typeof e.s?e.s:void 0}),u._emitter.emit("create",{args:i,className:r,isIsolated:!0,instance:n}),e.r=n}catch(t){e.e=u._error(t)}return t}static _handleCreateShared(e){let t;try{const r=e.c,[n,...i]=e.a;u._assertInstanceName(n);const o=u._instances.get(n);if(o){if(o.isIsolated)throw new Error(`Instance '${n}' exists as an isolated instance`);return e.r=n,o.instance}t=u._create(r,n,...i),u._instances.set(n,{instance:t,className:r,isIsolated:!1}),e.r=n,u._emitter.emit("create",{args:i,className:r,isIsolated:!1,instance:n})}catch(t){e.e=u._error(t)}return t}static _handleCallAll(e){const[t,...r]=e.a;u._callAll(e,t,r,()=>!0)}static _handleCallMatching(e){const[t,r,...n]=e.a;a.isSelection(t)?u._callAll(e,r,n,e=>a.selects(t,e)):e.e={message:`Invalid selection: ${JSON.stringify(t)} (a pattern or a list of them)`}}static _callAll(e,t,r,n){try{const i=[],o=s.carriesEventIds(r);if(!(o&&s.isRemover(t,e.v)||u._isPublished(e.c,t,!1)))throw new Error(`Could not find function: ${t}`);const a={...e,a:[t,...r]};for(const[s,{className:l,instance:c,isIsolated:f}]of u._instances)if(l===e.c&&!f&&n(s))try{let n;if(o)n=u._subscribe(e,{contextKey:s,contextName:s,target:c,func:t,args:r,isCallAll:!0}).value;else{const e=u._unwrapArguments(a,s);n=c[t].apply(c,e.slice(1)),n=u.sanitizeEventListenerReturnValues(n)}i.push(u._isPromise(n)?n.then(e=>({id:s,val:e}),e=>({id:s,err:u._error(e)})):{id:s,val:n})}catch(e){i.push({id:s,err:u._error(e)})}u._handlePromise(e,Promise.allSettled(i).then(e=>e.filter(e=>"fulfilled"===e.status).map(e=>e.value)))}catch(t){e.e=u._error(t)}}static sanitizeEventListenerReturnValues(e){return s.sanitize(e)}static _contextKey(e,t){return t?`\0${e}`:e}static _isStaticContext(e){return u._functionRegistry.has(e)}static _subscribe(e,{contextKey:t,contextName:r,target:n,func:i,args:o,isCallAll:s=!1}){const a=u._registrations.call({json:e,contextKey:t,contextName:r,target:n,func:i,args:o,isCallAll:s,speaks:u._speaksFor(r),makeCallback:t=>u._generateCallback({clientId:e.s,isCallAll:s,instanceId:r,eventId:t,receiverVersion:e.v})});return a.ids.length>0&&(u._mustTrackClient=!0),a}static _handleUnsubscribe(e){u._registrations.unsubscribe(e.a||[],e.s),e.r=!0}static _handleRegistrations(e){try{const t=u._isStaticContext(e.c);t||u._assertOwner(u._instances.get(e.c),e,e.c),e.r=u._registrations.list(u._contextKey(e.c,t))}catch(t){e.e=u._error(t)}}static _handleEnd(e){try{const t=u._isStaticContext(e.c);t||u._assertOwner(u._instances.get(e.c),e,e.c);const[r,n=[],i=null]=e.a||[];e.r=u._registrations.end(u._contextKey(e.c,t),r,n,i)}catch(t){e.e=u._error(t)}}static _handleDelete(e){try{const t=e.a[0],r=u._instances.get(t);if(r&&r.className!==e.c&&e.s!==u.LOCAL_SENDER)throw new Error(`Instance '${t}' is not of class '${e.c}'`);u._assertOwner(r,e,t),u._emitter.emit("beforeDelete",{instance:t,className:e.c});const{ended:n,disposed:i}=u._end(t);u._emitter.emit("delete",{instance:t,className:e.c}),i&&e.s!==u.LOCAL_SENDER?u._handlePromise(e,i.then(()=>n)):e.r=n}catch(t){e.e=u._error(t)}}static _handleCall(e){try{u._assertOwner(u._instances.get(e.c),e,e.c)}catch(t){return void(e.e=u._error(t))}if("removeAllListeners"===e.f){const t=u._isStaticContext(e.c);return u._registrations.withdrawEvent(u._contextKey(e.c,t),e.a[0],e.s),void(e.r=!0)}if(!u._functionRegistry.has(e.c)&&!u._instances.has(e.c))throw new Error(`Could not find context: ${e.c}`);if(e.c===l){if(!u._isPublished(l,e.f,!0))throw new Error(`Could not find function: ${e.f}`);try{const t=u._unwrapArguments(e),r=window[c][e.f].apply(null,t);u._isPromise(r)?u._handlePromise(e,r):e.r=r}catch(t){e.e=u._error(t)}return}const t=u._functionRegistry.get(e.c),r=void 0!==t;let n,i=e.c;if(r)n=t.Klass;else{const t=u._instances.get(e.c);if(void 0===t)throw new Error(`Could not find context: ${e.c}`);n=t.instance,i=t.className}const o=s.carriesEventIds(e.a);if(!(o&&s.isRemover(e.f,e.v)||u._isPublished(i,e.f,r)))throw new Error(`Could not find function: ${e.f}`);if(o){try{const{value:t}=u._subscribe(e,{contextKey:u._contextKey(e.c,r),contextName:e.c,target:n,func:e.f,args:e.a});u._isPromise(t)?u._handlePromise(e,t):e.r=t}catch(t){e.e=u._error(t)}return}const a=u._unwrapArguments(e);if("off"!==e.f&&"removeListener"!==e.f||"function"==typeof a[1]){if(!u._isFunction(n[e.f]))throw new Error(`Could not find function: ${e.f}`);try{let t=r?n[e.f].apply(null,a):n[e.f].apply(n,a);r||(t=u.sanitizeEventListenerReturnValues(t)),u._isPromise(t)?u._handlePromise(e,t):e.r=t}catch(t){e.e=u._error(t)}}else e.r=!0}static _create(e,t,...r){const n=u._instances.get(t);if(n)return n.instance;const{Klass:i,withNew:o,schema:s}=u._getClassEntry(e);return null!==s&&u._validate(s,...r),o?new i(...r):i(...r)}static _delete(e){return u._end(e).ended}static _end(e){const t=u._instances.get(e);if(!t)return{ended:!1,disposed:null};u._instances.delete(e);const{instance:r}=t;return u._registrations.forgetContext(e,{release:!(u._isFunction(r[Symbol.asyncDispose])||u._isFunction(r[Symbol.dispose]))}),{ended:!0,disposed:u._dispose(e,t)}}static _dispose(e,{instance:t,className:r}){const n=t=>u._emitter.emit("disposeFailed",{instance:e,className:r,error:t});let i,o;try{u._isFunction(t[Symbol.asyncDispose])?i=t[Symbol.asyncDispose]():u._isFunction(t[Symbol.dispose])&&(i=t[Symbol.dispose]())}catch(e){return n(e),null}if(!u._isPromise(i))return null;const s=new Promise(e=>{o=setTimeout(()=>{n(new Error(`dispose did not settle within ${u.DISPOSE_TIMEOUT} ms`)),e()},u.DISPOSE_TIMEOUT)}),a=i.then(()=>{},e=>n(e));return Promise.race([a,s]).then(()=>clearTimeout(o))}static _unregisterClient(e){u._registrations.withdrawClient(e)}static _validate(e,t){if("function"==typeof n){if(u._ajv||(u._ajv=new n({useDefaults:!0})),!u._ajv.validate(e,t))throw new Error(u._ajv.errorsText())}else u._warnedNoSchemas||(u._warnedNoSchemas=!0,console.warn("vrpc: schema validation is not available in the browser build, constructor arguments are not checked"))}static _unwrapArguments(e,t){const r=e.s,n=void 0!==t,i=n?t:e.c,o=n?e.a.slice(1):e.a,s=n?e.a[0]:e.f,a=n?[s]:[];for(const t of o)"string"==typeof t&&t.startsWith("__f__")?a.push(u._generateCallback({clientId:r,isCallAll:n,instanceId:i,eventId:t,receiverVersion:e.v})):a.push(t);return a}static _speaksFor(e){const t=u._instances.get(e);if(!t)return()=>!0;const{instance:r}=t;return()=>{const t=u._instances.get(e);return void 0!==t&&t.instance===r}}static _generateCallback({eventId:e,clientId:t,instanceId:r,isCallAll:n,receiverVersion:i}){const o=u._speaksFor(r);return(...s)=>{if(!o())return;const a=n?[r,...s]:[...s];u._callback({a,s:t,i:e,receiverVersion:i})}}static _handlePromise(e,t){const r=u._correlationId++%Number.MAX_SAFE_INTEGER,n=`__p__${e.f}-${u._promiseNonce}-${r}`,{s:i}=e;e.r=n,t.then(e=>u._callback({s:i,i:n,r:e}),e=>u._callback({s:i,i:n,e:u._error(e)}))}static _getClassEntry(e){const t=u._functionRegistry.get(e);if(!t)throw new Error(`"${e}" is not a registered class`);return t}static _isFunction(e){if(e){const t={}.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t}return!1}static _isClass(e){return!!e&&"function"==typeof e&&/^\s*class\s+/.test(e.toString())}static _isPromise(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}static _extractMemberFunctions(e){let t=e,r=[];const n=e instanceof i||!!e.prototype&&e.prototype instanceof i,o=(e,t)=>t===i.prototype?e.filter(e=>u._emitterPublic.has(e)):n?e.filter(e=>"emit"!==e):e;do{if(t.prototype){const e=Object.getOwnPropertyNames(t.prototype).filter(e=>!u._blackList.has(e)&&u._isFunction(t.prototype[e]));r=[...r,...o(e,t.prototype)]}else{const e=Object.getOwnPropertyNames(t).filter(e=>!u._blackList.has(e)&&u._isFunction(t[e]));r=[...r,...o(e,t)]}t=Object.getPrototypeOf(t)}while(t);return Array.from(new Set(r))}static _extractStaticFunctions(e){let t=e,r=[];do{t!==i&&(r=[...r,...Object.getOwnPropertyNames(t).filter(e=>{const r=Object.getOwnPropertyDescriptor(t,e);return!!r&&"function"==typeof r.value})]),t=Object.getPrototypeOf(t)}while(t&&t.name);return Array.from(new Set(r))}static _getClassesArray(){return Array.from(u._functionRegistry.keys())}static _getInstancesArray(e){const t=[];return u._instances.forEach((r,n)=>{r.className!==e||r.isIsolated||t.push(n)}),t}static _getMemberFunctionsArray(e){const t=u._functionRegistry.get(e);return t?t.memberFunctions:[]}static _getStaticFunctionsArray(e){const t=u._functionRegistry.get(e);return t?t.staticFunctions:[]}static _getMetaData(e){const t=u._functionRegistry.get(e);return t&&t.meta?t.meta:{}}}u._functionRegistry=new Map,u._instances=new Map,u._emitter=new i,u._correlationId=0,u._promiseNonce=o(8),u._registrations=new s({publish:e=>u._callback(e),emit:(e,t)=>u._emitter.emit(e,t)}),u.DISPOSE_TIMEOUT=1e4,u._emitterPublic=new Set(["on","addListener","off","removeListener","once","removeAllListeners"]),u._blackList=new Set(["constructor","caller","callee","arguments","apply","bind","call","toString","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","valueOf","toLocaleString","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"]),u.LOCAL_SENDER=Symbol("vrpc.local-sender"),e.exports=u},8745:(e,t,r)=>{"use strict";const{ArrayIsArray:n,ObjectSetPrototypeOf:i}=r(2768),{EventEmitter:o}=r(7007);function s(e){o.call(this,e)}function a(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?n(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}i(s.prototype,o.prototype),i(s,o),s.prototype.pipe=function(e,t){const r=this;function n(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",n),e.on("drain",i),e._isStdio||t&&!1===t.end||(r.on("end",l),r.on("close",c));let s=!1;function l(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){f(),0===o.listenerCount(this,"error")&&this.emit("error",e)}function f(){r.removeListener("data",n),e.removeListener("drain",i),r.removeListener("end",l),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return a(r,"error",u),a(e,"error",u),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e},e.exports={Stream:s,prependListener:a}},8835:(e,t,r)=>{"use strict";var n=r(9655);function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}var o=/^([a-z0-9.+-]+:)/i,s=/:[0-9]*$/,a=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,l=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r","\n","\t"]),c=["'"].concat(l),u=["%","/","?",";","#"].concat(c),f=["/","?","#"],h=/^[+a-z0-9A-Z_-]{0,63}$/,d=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,p={javascript:!0,"javascript:":!0},g={javascript:!0,"javascript:":!0},b={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},y=r(5373);function _(e,t,r){if(e&&"object"==typeof e&&e instanceof i)return e;var n=new i;return n.parse(e,t,r),n}i.prototype.parse=function(e,t,r){if("string"!=typeof e)throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e.indexOf("?"),s=-1!==i&&i<e.indexOf("#")?"?":"#",l=e.split(s);l[0]=l[0].replace(/\\/g,"/");var _=e=l.join(s);if(_=_.trim(),!r&&1===e.split("#").length){var m=a.exec(_);if(m)return this.path=_,this.href=_,this.pathname=m[1],m[2]?(this.search=m[2],this.query=t?y.parse(this.search.substr(1)):this.search.substr(1)):t&&(this.search="",this.query={}),this}var w=o.exec(_);if(w){var v=(w=w[0]).toLowerCase();this.protocol=v,_=_.substr(w.length)}if(r||w||_.match(/^\/\/[^@/]+@[^@/]+/)){var S="//"===_.substr(0,2);!S||w&&g[w]||(_=_.substr(2),this.slashes=!0)}if(!g[w]&&(S||w&&!b[w])){for(var E,A,k=-1,I=0;I<f.length;I++)-1!==(O=_.indexOf(f[I]))&&(-1===k||O<k)&&(k=O);for(-1!==(A=-1===k?_.lastIndexOf("@"):_.lastIndexOf("@",k))&&(E=_.slice(0,A),_=_.slice(A+1),this.auth=decodeURIComponent(E)),k=-1,I=0;I<u.length;I++){var O;-1!==(O=_.indexOf(u[I]))&&(-1===k||O<k)&&(k=O)}-1===k&&(k=_.length),this.host=_.slice(0,k),_=_.slice(k),this.parseHost(),this.hostname=this.hostname||"";var R="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!R)for(var T=this.hostname.split(/\./),x=(I=0,T.length);I<x;I++){var P=T[I];if(P&&!P.match(h)){for(var N="",C=0,j=P.length;C<j;C++)P.charCodeAt(C)>127?N+="x":N+=P[C];if(!N.match(h)){var M=T.slice(0,I),L=T.slice(I+1),D=P.match(d);D&&(M.push(D[1]),L.unshift(D[2])),L.length&&(_="/"+L.join(".")+_),this.hostname=M.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=n.toASCII(this.hostname));var F=this.port?":"+this.port:"",$=this.hostname||"";this.host=$+F,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==_[0]&&(_="/"+_))}if(!p[v])for(I=0,x=c.length;I<x;I++){var B=c[I];if(-1!==_.indexOf(B)){var U=encodeURIComponent(B);U===B&&(U=escape(B)),_=_.split(B).join(U)}}var W=_.indexOf("#");-1!==W&&(this.hash=_.substr(W),_=_.slice(0,W));var q=_.indexOf("?");if(-1!==q?(this.search=_.substr(q),this.query=_.substr(q+1),t&&(this.query=y.parse(this.query)),_=_.slice(0,q)):t&&(this.search="",this.query={}),_&&(this.pathname=_),b[v]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){F=this.pathname||"";var V=this.search||"";this.path=F+V}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=(e=encodeURIComponent(e)).replace(/%3A/i,":"),e+="@");var t=this.protocol||"",r=this.pathname||"",n=this.hash||"",i=!1,o="";this.host?i=e+this.host:this.hostname&&(i=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&"object"==typeof this.query&&Object.keys(this.query).length&&(o=y.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||b[t])&&!1!==i?(i="//"+(i||""),r&&"/"!==r.charAt(0)&&(r="/"+r)):i||(i=""),n&&"#"!==n.charAt(0)&&(n="#"+n),s&&"?"!==s.charAt(0)&&(s="?"+s),t+i+(r=r.replace(/[?#]/g,function(e){return encodeURIComponent(e)}))+(s=s.replace("#","%23"))+n},i.prototype.resolve=function(e){return this.resolveObject(_(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if("string"==typeof e){var t=new i;t.parse(e,!1,!0),e=t}for(var r=new i,n=Object.keys(this),o=0;o<n.length;o++){var s=n[o];r[s]=this[s]}if(r.hash=e.hash,""===e.href)return r.href=r.format(),r;if(e.slashes&&!e.protocol){for(var a=Object.keys(e),l=0;l<a.length;l++){var c=a[l];"protocol"!==c&&(r[c]=e[c])}return b[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(e.protocol&&e.protocol!==r.protocol){if(!b[e.protocol]){for(var u=Object.keys(e),f=0;f<u.length;f++){var h=u[f];r[h]=e[h]}return r.href=r.format(),r}if(r.protocol=e.protocol,e.host||g[e.protocol])r.pathname=e.pathname;else{for(var d=(e.pathname||"").split("/");d.length&&!(e.host=d.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==d[0]&&d.unshift(""),d.length<2&&d.unshift(""),r.pathname=d.join("/")}if(r.search=e.search,r.query=e.query,r.host=e.host||"",r.auth=e.auth,r.hostname=e.hostname||e.host,r.port=e.port,r.pathname||r.search){var p=r.pathname||"",y=r.search||"";r.path=p+y}return r.slashes=r.slashes||e.slashes,r.href=r.format(),r}var _=r.pathname&&"/"===r.pathname.charAt(0),m=e.host||e.pathname&&"/"===e.pathname.charAt(0),w=m||_||r.host&&e.pathname,v=w,S=r.pathname&&r.pathname.split("/")||[],E=(d=e.pathname&&e.pathname.split("/")||[],r.protocol&&!b[r.protocol]);if(E&&(r.hostname="",r.port=null,r.host&&(""===S[0]?S[0]=r.host:S.unshift(r.host)),r.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===d[0]?d[0]=e.host:d.unshift(e.host)),e.host=null),w=w&&(""===d[0]||""===S[0])),m)r.host=e.host||""===e.host?e.host:r.host,r.hostname=e.hostname||""===e.hostname?e.hostname:r.hostname,r.search=e.search,r.query=e.query,S=d;else if(d.length)S||(S=[]),S.pop(),S=S.concat(d),r.search=e.search,r.query=e.query;else if(null!=e.search)return E&&(r.host=S.shift(),r.hostname=r.host,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),r.search=e.search,r.query=e.query,null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!S.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var A=S.slice(-1)[0],k=(r.host||e.host||S.length>1)&&("."===A||".."===A)||""===A,I=0,O=S.length;O>=0;O--)"."===(A=S[O])?S.splice(O,1):".."===A?(S.splice(O,1),I++):I&&(S.splice(O,1),I--);if(!w&&!v)for(;I--;I)S.unshift("..");!w||""===S[0]||S[0]&&"/"===S[0].charAt(0)||S.unshift(""),k&&"/"!==S.join("/").substr(-1)&&S.push("");var R,T=""===S[0]||S[0]&&"/"===S[0].charAt(0);return E&&(r.hostname=T?"":S.length?S.shift():"",r.host=r.hostname,(R=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=R.shift(),r.hostname=R.shift(),r.host=r.hostname)),(w=w||r.host&&S.length)&&!T&&S.unshift(""),S.length>0?r.pathname=S.join("/"):(r.pathname=null,r.path=null),null===r.pathname&&null===r.search||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=e.auth||r.auth,r.slashes=r.slashes||e.slashes,r.href=r.format(),r},i.prototype.parseHost=function(){var e=this.host,t=s.exec(e);t&&(":"!==(t=t[0])&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)},t.parse=_,t.resolve=function(e,t){return _(e,!1,!0).resolve(t)},t.resolveObject=function(e,t){return e?_(e,!1,!0).resolveObject(t):t},t.format=function(e){return"string"==typeof e&&(e=_(e)),e instanceof i?e.format():i.prototype.format.call(e)},t.Url=i},8859:(e,t,r)=>{var n="function"==typeof Map&&Map.prototype,i=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,o=n&&i&&"function"==typeof i.get?i.get:null,s=n&&Map.prototype.forEach,a="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&a?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,c=a&&l&&"function"==typeof l.get?l.get:null,u=a&&Set.prototype.forEach,f="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,h="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,d="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,p=Boolean.prototype.valueOf,g=Object.prototype.toString,b=Function.prototype.toString,y=String.prototype.match,_=String.prototype.slice,m=String.prototype.replace,w=String.prototype.toUpperCase,v=String.prototype.toLowerCase,S=RegExp.prototype.test,E=Array.prototype.concat,A=Array.prototype.join,k=Array.prototype.slice,I=Math.floor,O="function"==typeof BigInt?BigInt.prototype.valueOf:null,R=Object.getOwnPropertySymbols,T="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,x="function"==typeof Symbol&&"object"==typeof Symbol.iterator,P="function"==typeof Symbol&&Symbol.toStringTag&&(Symbol.toStringTag,1)?Symbol.toStringTag:null,N=Object.prototype.propertyIsEnumerable,C=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function j(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-I(-e):I(e);if(n!==e){var i=String(n),o=_.call(t,i.length+1);return m.call(i,r,"$&_")+"."+m.call(m.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return m.call(t,r,"$&_")}var M=r(2634),L=M.custom,D=z(L)?L:null,F={__proto__:null,double:'"',single:"'"},$={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};function B(e,t,r){var n=r.quoteStyle||t,i=F[n];return i+e+i}function U(e){return m.call(String(e),/"/g,"&quot;")}function W(e){return!P||!("object"==typeof e&&(P in e||void 0!==e[P]))}function q(e){return"[object Array]"===K(e)&&W(e)}function V(e){return"[object RegExp]"===K(e)&&W(e)}function z(e){if(x)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!T)return!1;try{return T.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,i,a){var l=n||{};if(G(l,"quoteStyle")&&!G(F,l.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(G(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var g=!G(l,"customInspect")||l.customInspect;if("boolean"!=typeof g&&"symbol"!==g)throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(G(l,"indent")&&null!==l.indent&&"\t"!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(G(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return J(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?j(t,S):S}if("bigint"==typeof t){var I=String(t)+"n";return w?j(t,I):I}var R=void 0===l.depth?5:l.depth;if(void 0===i&&(i=0),i>=R&&R>0&&"object"==typeof t)return q(t)?"[Array]":"[Object]";var L,$=function(e,t){var r;if("\t"===e.indent)r="\t";else{if(!("number"==typeof e.indent&&e.indent>0))return null;r=A.call(Array(e.indent+1)," ")}return{base:r,prev:A.call(Array(t+1),r)}}(l,i);if(void 0===a)a=[];else if(Q(a,t)>=0)return"[Circular]";function H(t,r,n){if(r&&(a=k.call(a)).push(r),n){var o={depth:l.depth};return G(l,"quoteStyle")&&(o.quoteStyle=l.quoteStyle),e(t,o,i+1,a)}return e(t,l,i+1,a)}if("function"==typeof t&&!V(t)){var Y=function(e){if(e.name)return e.name;var t=y.call(b.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),ne=re(t,H);return"[Function"+(Y?": "+Y:" (anonymous)")+"]"+(ne.length>0?" { "+A.call(ne,", ")+" }":"")}if(z(t)){var ie=x?m.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):T.call(t);return"object"!=typeof t||x?ie:X(ie)}if((L=t)&&"object"==typeof L&&("undefined"!=typeof HTMLElement&&L instanceof HTMLElement||"string"==typeof L.nodeName&&"function"==typeof L.getAttribute)){for(var oe="<"+v.call(String(t.nodeName)),se=t.attributes||[],ae=0;ae<se.length;ae++)oe+=" "+se[ae].name+"="+B(U(se[ae].value),"double",l);return oe+=">",t.childNodes&&t.childNodes.length&&(oe+="..."),oe+"</"+v.call(String(t.nodeName))+">"}if(q(t)){if(0===t.length)return"[]";var le=re(t,H);return $&&!function(e){for(var t=0;t<e.length;t++)if(Q(e[t],"\n")>=0)return!1;return!0}(le)?"["+te(le,$)+"]":"[ "+A.call(le,", ")+" ]"}if(function(e){return"[object Error]"===K(e)&&W(e)}(t)){var ce=re(t,H);return"cause"in Error.prototype||!("cause"in t)||N.call(t,"cause")?0===ce.length?"["+String(t)+"]":"{ ["+String(t)+"] "+A.call(ce,", ")+" }":"{ ["+String(t)+"] "+A.call(E.call("[cause]: "+H(t.cause),ce),", ")+" }"}if("object"==typeof t&&g){if(D&&"function"==typeof t[D]&&M)return M(t,{depth:R-i});if("symbol"!==g&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!o||!e||"object"!=typeof e)return!1;try{o.call(e);try{c.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var ue=[];return s&&s.call(t,function(e,r){ue.push(H(r,t,!0)+" => "+H(e,t))}),ee("Map",o.call(t),ue,$)}if(function(e){if(!c||!e||"object"!=typeof e)return!1;try{c.call(e);try{o.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var fe=[];return u&&u.call(t,function(e){fe.push(H(e,t))}),ee("Set",c.call(t),fe,$)}if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{h.call(e,h)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return Z("WeakMap");if(function(e){if(!h||!e||"object"!=typeof e)return!1;try{h.call(e,h);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return Z("WeakSet");if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{return d.call(e),!0}catch(e){}return!1}(t))return Z("WeakRef");if(function(e){return"[object Number]"===K(e)&&W(e)}(t))return X(H(Number(t)));if(function(e){if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}(t))return X(H(O.call(t)));if(function(e){return"[object Boolean]"===K(e)&&W(e)}(t))return X(p.call(t));if(function(e){return"[object String]"===K(e)&&W(e)}(t))return X(H(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!function(e){return"[object Date]"===K(e)&&W(e)}(t)&&!V(t)){var he=re(t,H),de=C?C(t)===Object.prototype:t instanceof Object||t.constructor===Object,pe=t instanceof Object?"":"null prototype",ge=!de&&P&&Object(t)===t&&P in t?_.call(K(t),8,-1):pe?"Object":"",be=(de||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ge||pe?"["+A.call(E.call([],ge||[],pe||[]),": ")+"] ":"");return 0===he.length?be+"{}":$?be+"{"+te(he,$)+"}":be+"{ "+A.call(he,", ")+" }"}return String(t)};var H=Object.prototype.hasOwnProperty||function(e){return e in this};function G(e,t){return H.call(e,t)}function K(e){return g.call(e)}function Q(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}function J(e,t){if(e.length>t.maxStringLength){var r=e.length-t.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return J(_.call(e,0,t.maxStringLength),t)+n}var i=$[t.quoteStyle||"single"];return i.lastIndex=0,B(m.call(m.call(e,i,"\\$1"),/[\x00-\x1f]/g,Y),"single",t)}function Y(e){var t=e.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[t];return r?"\\"+r:"\\x"+(t<16?"0":"")+w.call(t.toString(16))}function X(e){return"Object("+e+")"}function Z(e){return e+" { ? }"}function ee(e,t,r,n){return e+" ("+t+") {"+(n?te(r,n):A.call(r,", "))+"}"}function te(e,t){if(0===e.length)return"";var r="\n"+t.prev+t.base;return r+A.call(e,","+r)+"\n"+t.prev}function re(e,t){var r=q(e),n=[];if(r){n.length=e.length;for(var i=0;i<e.length;i++)n[i]=G(e,i)?t(e[i],e):""}var o,s="function"==typeof R?R(e):[];if(x){o={};for(var a=0;a<s.length;a++)o["$"+s[a]]=s[a]}for(var l in e)G(e,l)&&(r&&String(Number(l))===l&&l<e.length||x&&o["$"+l]instanceof Symbol||(S.call(/[^\w$]/,l)?n.push(t(l,e)+": "+t(e[l],e)):n.push(l+": "+t(e[l],e))));if("function"==typeof R)for(var c=0;c<s.length;c++)N.call(e,s[c])&&n.push("["+t(s[c])+"]: "+t(e[s[c]],e));return n}},8875:(e,t,r)=>{"use strict";var n;if(!Object.keys){var i=Object.prototype.hasOwnProperty,o=Object.prototype.toString,s=r(1093),a=Object.prototype.propertyIsEnumerable,l=!a.call({toString:null},"toString"),c=a.call(function(){},"prototype"),u=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],f=function(e){var t=e.constructor;return t&&t.prototype===e},h={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if("undefined"==typeof window)return!1;for(var e in window)try{if(!h["$"+e]&&i.call(window,e)&&null!==window[e]&&"object"==typeof window[e])try{f(window[e])}catch(e){return!0}}catch(e){return!0}return!1}();n=function(e){var t=null!==e&&"object"==typeof e,r="[object Function]"===o.call(e),n=s(e),a=t&&"[object String]"===o.call(e),h=[];if(!t&&!r&&!n)throw new TypeError("Object.keys called on a non-object");var p=c&&r;if(a&&e.length>0&&!i.call(e,0))for(var g=0;g<e.length;++g)h.push(String(g));if(n&&e.length>0)for(var b=0;b<e.length;++b)h.push(String(b));else for(var y in e)p&&"prototype"===y||!i.call(e,y)||h.push(String(y));if(l)for(var _=function(e){if("undefined"==typeof window||!d)return f(e);try{return f(e)}catch(e){return!1}}(e),m=0;m<u.length;++m)_&&"constructor"===u[m]||!i.call(e,u[m])||h.push(u[m]);return h}}e.exports=n},8968:e=>{"use strict";e.exports=Math.floor},9032:(e,t,r)=>{"use strict";var n=r(7244),i=r(8184),o=r(5767),s=r(5680);function a(e){return e.call.bind(e)}var l="undefined"!=typeof BigInt,c="undefined"!=typeof Symbol,u=a(Object.prototype.toString),f=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),d=a(Boolean.prototype.valueOf);if(l)var p=a(BigInt.prototype.valueOf);if(c)var g=a(Symbol.prototype.valueOf);function b(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function y(e){return"[object Map]"===u(e)}function _(e){return"[object Set]"===u(e)}function m(e){return"[object WeakMap]"===u(e)}function w(e){return"[object WeakSet]"===u(e)}function v(e){return"[object ArrayBuffer]"===u(e)}function S(e){return"undefined"!=typeof ArrayBuffer&&(v.working?v(e):e instanceof ArrayBuffer)}function E(e){return"[object DataView]"===u(e)}function A(e){return"undefined"!=typeof DataView&&(E.working?E(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},t.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||A(e)},t.isUint8Array=function(e){return"Uint8Array"===o(e)},t.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},t.isUint16Array=function(e){return"Uint16Array"===o(e)},t.isUint32Array=function(e){return"Uint32Array"===o(e)},t.isInt8Array=function(e){return"Int8Array"===o(e)},t.isInt16Array=function(e){return"Int16Array"===o(e)},t.isInt32Array=function(e){return"Int32Array"===o(e)},t.isFloat32Array=function(e){return"Float32Array"===o(e)},t.isFloat64Array=function(e){return"Float64Array"===o(e)},t.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},t.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},y.working="undefined"!=typeof Map&&y(new Map),t.isMap=function(e){return"undefined"!=typeof Map&&(y.working?y(e):e instanceof Map)},_.working="undefined"!=typeof Set&&_(new Set),t.isSet=function(e){return"undefined"!=typeof Set&&(_.working?_(e):e instanceof Set)},m.working="undefined"!=typeof WeakMap&&m(new WeakMap),t.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(m.working?m(e):e instanceof WeakMap)},w.working="undefined"!=typeof WeakSet&&w(new WeakSet),t.isWeakSet=function(e){return w(e)},v.working="undefined"!=typeof ArrayBuffer&&v(new ArrayBuffer),t.isArrayBuffer=S,E.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&E(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=A;var k="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function I(e){return"[object SharedArrayBuffer]"===u(e)}function O(e){return void 0!==k&&(void 0===I.working&&(I.working=I(new k)),I.working?I(e):e instanceof k)}function R(e){return b(e,f)}function T(e){return b(e,h)}function x(e){return b(e,d)}function P(e){return l&&b(e,p)}function N(e){return c&&b(e,g)}t.isSharedArrayBuffer=O,t.isAsyncFunction=function(e){return"[object AsyncFunction]"===u(e)},t.isMapIterator=function(e){return"[object Map Iterator]"===u(e)},t.isSetIterator=function(e){return"[object Set Iterator]"===u(e)},t.isGeneratorObject=function(e){return"[object Generator]"===u(e)},t.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===u(e)},t.isNumberObject=R,t.isStringObject=T,t.isBooleanObject=x,t.isBigIntObject=P,t.isSymbolObject=N,t.isBoxedPrimitive=function(e){return R(e)||T(e)||x(e)||P(e)||N(e)},t.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(S(e)||O(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})})},9037:(e,t,r)=>{"use strict";const{Buffer:n}=r(8287),{ObjectDefineProperty:i,ObjectKeys:o,ReflectApply:s}=r(4469),{promisify:{custom:a}}=r(7797),{streamReturningOperators:l,promiseReturningOperators:c}=r(7712),{codes:{ERR_ILLEGAL_CONSTRUCTOR:u}}=r(2074),f=r(6357),{setDefaultHighWaterMark:h,getDefaultHighWaterMark:d}=r(2100),{pipeline:p}=r(4867),{destroyer:g}=r(1787),b=r(577),y=r(3942),_=r(5980),m=e.exports=r(4474).Stream;m.isDestroyed=_.isDestroyed,m.isDisturbed=_.isDisturbed,m.isErrored=_.isErrored,m.isReadable=_.isReadable,m.isWritable=_.isWritable,m.Readable=r(2729);for(const v of o(l)){const S=l[v];function E(...e){if(new.target)throw u();return m.Readable.from(s(S,this,e))}i(E,"name",{__proto__:null,value:S.name}),i(E,"length",{__proto__:null,value:S.length}),i(m.Readable.prototype,v,{__proto__:null,value:E,enumerable:!1,configurable:!0,writable:!0})}for(const A of o(c)){const k=c[A];function I(...e){if(new.target)throw u();return s(k,this,e)}i(I,"name",{__proto__:null,value:k.name}),i(I,"length",{__proto__:null,value:k.length}),i(m.Readable.prototype,A,{__proto__:null,value:I,enumerable:!1,configurable:!0,writable:!0})}m.Writable=r(8601),m.Duplex=r(7323),m.Transform=r(6269),m.PassThrough=r(519),m.pipeline=p;const{addAbortSignal:w}=r(982);m.addAbortSignal=w,m.finished=b,m.destroy=g,m.compose=f,m.setDefaultHighWaterMark=h,m.getDefaultHighWaterMark=d,i(m,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>y}),i(p,a,{__proto__:null,enumerable:!0,get:()=>y.pipeline}),i(b,a,{__proto__:null,enumerable:!0,get:()=>y.finished}),m.Stream=m,m._isUint8Array=function(e){return e instanceof Uint8Array},m._uint8ArrayToBuffer=function(e){return n.from(e.buffer,e.byteOffset,e.byteLength)}},9075:(e,t,r)=>{"use strict";const{StringPrototypeSlice:n,SymbolIterator:i,TypedArrayPrototypeSet:o,Uint8Array:s}=r(2768),{Buffer:a}=r(8287),{inspect:l}=r(9862);e.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){const t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){const t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;const e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return a.alloc(0);const t=a.allocUnsafe(e>>>0);let r=this.head,n=0;for(;r;)o(t,r.data,n),n+=r.data.length,r=r.next;return t}consume(e,t){const r=this.head.data;if(e<r.length){const t=r.slice(0,e);return this.head.data=r.slice(e),t}return e===r.length?this.shift():t?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[i](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let t="",r=this.head,i=0;do{const o=r.data;if(!(e>o.length)){e===o.length?(t+=o,++i,r.next?this.head=r.next:this.head=this.tail=null):(t+=n(o,0,e),this.head=r,r.data=n(o,e));break}t+=o,e-=o.length,++i}while(null!==(r=r.next));return this.length-=i,t}_getBuffer(e){const t=a.allocUnsafe(e),r=e;let n=this.head,i=0;do{const a=n.data;if(!(e>a.length)){e===a.length?(o(t,a,r-e),++i,n.next?this.head=n.next:this.head=this.tail=null):(o(t,new s(a.buffer,a.byteOffset,e),r-e),this.head=n,n.data=a.slice(e));break}o(t,a,r-e),e-=a.length,++i}while(null!==(n=n.next));return this.length-=i,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return l(this,{...t,depth:0,customInspect:!1})}}},9083:(e,t,r)=>{"use strict";e.exports=u;var n=r(2463).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,l=r(8101);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(e){if(!(this instanceof u))return new u(e);l.call(this,e),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",f)}function f(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(t,r){h(e,t,r)})}function h(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(6698)(u,l),u.prototype.push=function(e,t){return this._transformState.needTransform=!1,l.prototype.push.call(this,e,t)},u.prototype._transform=function(e,t,r){r(new i("_transform()"))},u.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},u.prototype._destroy=function(e,t){l.prototype._destroy.call(this,e,function(e){t(e)})}},9092:(e,t,r)=>{"use strict";var n=r(1333);e.exports=function(){return n()&&!!Symbol.toStringTag}},9096:(e,t,r)=>{"use strict";var n=r(2045);Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;const i="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date,o=new Set,s="object"==typeof n&&n?n:{},a=(e,t,r,n)=>{"function"==typeof s.emitWarning?s.emitWarning(e,t,r,n):console.error(`[${r}] ${t}: ${e}`)};let l=globalThis.AbortController,c=globalThis.AbortSignal;if(void 0===l){c=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(e,t){this._onabort.push(t)}},l=class{constructor(){t()}signal=new c;abort(e){if(!this.signal.aborted){this.signal.reason=e,this.signal.aborted=!0;for(const t of this.signal._onabort)t(e);this.signal.onabort?.(e)}}};let e="1"!==s.env?.LRU_CACHE_IGNORE_AC_WARNING;const t=()=>{e&&(e=!1,a("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",t))}}Symbol("type");const u=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),f=e=>u(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?h:null:null;class h extends Array{constructor(e){super(e),this.fill(0)}}class d{heap;length;static#e=!1;static create(e){const t=f(e);if(!t)return[];d.#e=!0;const r=new d(e,t);return d.#e=!1,r}constructor(e,t){if(!d.#e)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class p{#t;#r;#n;#i;#o;#s;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#a;#l;#c;#u;#f;#h;#d;#p;#g;#b;#y;#_;#m;#w;#v;#S;#E;static unsafeExposeInternals(e){return{starts:e.#m,ttls:e.#w,sizes:e.#_,keyMap:e.#c,keyList:e.#u,valList:e.#f,next:e.#h,prev:e.#d,get head(){return e.#p},get tail(){return e.#g},free:e.#b,isBackgroundFetch:t=>e.#A(t),backgroundFetch:(t,r,n,i)=>e.#k(t,r,n,i),moveToTail:t=>e.#I(t),indexes:t=>e.#O(t),rindexes:t=>e.#R(t),isStale:t=>e.#T(t)}}get max(){return this.#t}get maxSize(){return this.#r}get calculatedSize(){return this.#l}get size(){return this.#a}get fetchMethod(){return this.#o}get memoMethod(){return this.#s}get dispose(){return this.#n}get disposeAfter(){return this.#i}constructor(e){const{max:t=0,ttl:r,ttlResolution:n=1,ttlAutopurge:i,updateAgeOnGet:s,updateAgeOnHas:l,allowStale:c,dispose:h,disposeAfter:g,noDisposeOnSet:b,noUpdateTTL:y,maxSize:_=0,maxEntrySize:m=0,sizeCalculation:w,fetchMethod:v,memoMethod:S,noDeleteOnFetchRejection:E,noDeleteOnStaleGet:A,allowStaleOnFetchRejection:k,allowStaleOnFetchAbort:I,ignoreFetchAbort:O}=e;if(0!==t&&!u(t))throw new TypeError("max option must be a nonnegative integer");const R=t?f(t):Array;if(!R)throw new Error("invalid max value: "+t);if(this.#t=t,this.#r=_,this.maxEntrySize=m||this.#r,this.sizeCalculation=w,this.sizeCalculation){if(!this.#r&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(void 0!==S&&"function"!=typeof S)throw new TypeError("memoMethod must be a function if defined");if(this.#s=S,void 0!==v&&"function"!=typeof v)throw new TypeError("fetchMethod must be a function if specified");if(this.#o=v,this.#S=!!v,this.#c=new Map,this.#u=new Array(t).fill(void 0),this.#f=new Array(t).fill(void 0),this.#h=new R(t),this.#d=new R(t),this.#p=0,this.#g=0,this.#b=d.create(t),this.#a=0,this.#l=0,"function"==typeof h&&(this.#n=h),"function"==typeof g?(this.#i=g,this.#y=[]):(this.#i=void 0,this.#y=void 0),this.#v=!!this.#n,this.#E=!!this.#i,this.noDisposeOnSet=!!b,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!E,this.allowStaleOnFetchRejection=!!k,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!O,0!==this.maxEntrySize){if(0!==this.#r&&!u(this.#r))throw new TypeError("maxSize must be a positive integer if specified");if(!u(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#x()}if(this.allowStale=!!c,this.noDeleteOnStaleGet=!!A,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!l,this.ttlResolution=u(n)||0===n?n:1,this.ttlAutopurge=!!i,this.ttl=r||0,this.ttl){if(!u(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#P()}if(0===this.#t&&0===this.ttl&&0===this.#r)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#t&&!this.#r){const e="LRU_CACHE_UNBOUNDED";(e=>!o.has(e))(e)&&(o.add(e),a("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",e,p))}}getRemainingTTL(e){return this.#c.has(e)?1/0:0}#P(){const e=new h(this.#t),t=new h(this.#t);this.#w=e,this.#m=t,this.#N=(r,n,o=i.now())=>{if(t[r]=0!==n?o:0,e[r]=n,0!==n&&this.ttlAutopurge){const e=setTimeout(()=>{this.#T(r)&&this.#C(this.#u[r],"expire")},n+1);e.unref&&e.unref()}},this.#j=r=>{t[r]=0!==e[r]?i.now():0},this.#M=(i,o)=>{if(e[o]){const s=e[o],a=t[o];if(!s||!a)return;i.ttl=s,i.start=a,i.now=r||n();const l=i.now-a;i.remainingTTL=s-l}};let r=0;const n=()=>{const e=i.now();if(this.ttlResolution>0){r=e;const t=setTimeout(()=>r=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=i=>{const o=this.#c.get(i);if(void 0===o)return 0;const s=e[o],a=t[o];return s&&a?s-((r||n())-a):1/0},this.#T=i=>{const o=t[i],s=e[i];return!!s&&!!o&&(r||n())-o>s}}#j=()=>{};#M=()=>{};#N=()=>{};#T=()=>!1;#x(){const e=new h(this.#t);this.#l=0,this.#_=e,this.#L=t=>{this.#l-=e[t],e[t]=0},this.#D=(e,t,r,n)=>{if(this.#A(t))return 0;if(!u(r)){if(!n)throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(r=n(t,e),!u(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return r},this.#F=(t,r,n)=>{if(e[t]=r,this.#r){const r=this.#r-e[t];for(;this.#l>r;)this.#$(!0)}this.#l+=e[t],n&&(n.entrySize=r,n.totalCalculatedSize=this.#l)}}#L=e=>{};#F=(e,t,r)=>{};#D=(e,t,r,n)=>{if(r||n)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#O({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#g;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#p);)t=this.#d[t]}*#R({allowStale:e=this.allowStale}={}){if(this.#a)for(let t=this.#p;this.#B(t)&&(!e&&this.#T(t)||(yield t),t!==this.#g);)t=this.#h[t]}#B(e){return void 0!==e&&this.#c.get(this.#u[e])===e}*entries(){for(const e of this.#O())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*rentries(){for(const e of this.#R())void 0===this.#f[e]||void 0===this.#u[e]||this.#A(this.#f[e])||(yield[this.#u[e],this.#f[e]])}*keys(){for(const e of this.#O()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*rkeys(){for(const e of this.#R()){const t=this.#u[e];void 0===t||this.#A(this.#f[e])||(yield t)}}*values(){for(const e of this.#O())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}*rvalues(){for(const e of this.#R())void 0===this.#f[e]||this.#A(this.#f[e])||(yield this.#f[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(const r of this.#O()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;if(void 0!==i&&e(i,this.#u[r],this))return this.get(this.#u[r],t)}}forEach(e,t=this){for(const r of this.#O()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}rforEach(e,t=this){for(const r of this.#R()){const n=this.#f[r],i=this.#A(n)?n.__staleWhileFetching:n;void 0!==i&&e.call(t,i,this.#u[r],this)}}purgeStale(){let e=!1;for(const t of this.#R({allowStale:!0}))this.#T(t)&&(this.#C(this.#u[t],"expire"),e=!0);return e}info(e){const t=this.#c.get(e);if(void 0===t)return;const r=this.#f[t],n=this.#A(r)?r.__staleWhileFetching:r;if(void 0===n)return;const o={value:n};if(this.#w&&this.#m){const e=this.#w[t],r=this.#m[t];if(e&&r){const t=e-(i.now()-r);o.ttl=t,o.start=Date.now()}}return this.#_&&(o.size=this.#_[t]),o}dump(){const e=[];for(const t of this.#O({allowStale:!0})){const r=this.#u[t],n=this.#f[t],o=this.#A(n)?n.__staleWhileFetching:n;if(void 0===o||void 0===r)continue;const s={value:o};if(this.#w&&this.#m){s.ttl=this.#w[t];const e=i.now()-this.#m[t];s.start=Math.floor(Date.now()-e)}this.#_&&(s.size=this.#_[t]),e.unshift([r,s])}return e}load(e){this.clear();for(const[t,r]of e){if(r.start){const e=Date.now()-r.start;r.start=i.now()-e}this.set(t,r.value,r)}}set(e,t,r={}){if(void 0===t)return this.delete(e),this;const{ttl:n=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:s=this.sizeCalculation,status:a}=r;let{noUpdateTTL:l=this.noUpdateTTL}=r;const c=this.#D(e,t,r.size||0,s);if(this.maxEntrySize&&c>this.maxEntrySize)return a&&(a.set="miss",a.maxEntrySizeExceeded=!0),this.#C(e,"set"),this;let u=0===this.#a?void 0:this.#c.get(e);if(void 0===u)u=0===this.#a?this.#g:0!==this.#b.length?this.#b.pop():this.#a===this.#t?this.#$(!1):this.#a,this.#u[u]=e,this.#f[u]=t,this.#c.set(e,u),this.#h[this.#g]=u,this.#d[u]=this.#g,this.#g=u,this.#a++,this.#F(u,c,a),a&&(a.set="add"),l=!1;else{this.#I(u);const r=this.#f[u];if(t!==r){if(this.#S&&this.#A(r)){r.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:t}=r;void 0===t||o||(this.#v&&this.#n?.(t,e,"set"),this.#E&&this.#y?.push([t,e,"set"]))}else o||(this.#v&&this.#n?.(r,e,"set"),this.#E&&this.#y?.push([r,e,"set"]));if(this.#L(u),this.#F(u,c,a),this.#f[u]=t,a){a.set="replace";const e=r&&this.#A(r)?r.__staleWhileFetching:r;void 0!==e&&(a.oldValue=e)}}else a&&(a.set="update")}if(0===n||this.#w||this.#P(),this.#w&&(l||this.#N(u,n,i),a&&this.#M(a,u)),!o&&this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}return this}pop(){try{for(;this.#a;){const e=this.#f[this.#p];if(this.#$(!0),this.#A(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(void 0!==e)return e}}finally{if(this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}}}#$(e){const t=this.#p,r=this.#u[t],n=this.#f[t];return this.#S&&this.#A(n)?n.__abortController.abort(new Error("evicted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(n,r,"evict"),this.#E&&this.#y?.push([n,r,"evict"])),this.#L(t),e&&(this.#u[t]=void 0,this.#f[t]=void 0,this.#b.push(t)),1===this.#a?(this.#p=this.#g=0,this.#b.length=0):this.#p=this.#h[t],this.#c.delete(r),this.#a--,t}has(e,t={}){const{updateAgeOnHas:r=this.updateAgeOnHas,status:n}=t,i=this.#c.get(e);if(void 0!==i){const e=this.#f[i];if(this.#A(e)&&void 0===e.__staleWhileFetching)return!1;if(!this.#T(i))return r&&this.#j(i),n&&(n.has="hit",this.#M(n,i)),!0;n&&(n.has="stale",this.#M(n,i))}else n&&(n.has="miss");return!1}peek(e,t={}){const{allowStale:r=this.allowStale}=t,n=this.#c.get(e);if(void 0===n||!r&&this.#T(n))return;const i=this.#f[n];return this.#A(i)?i.__staleWhileFetching:i}#k(e,t,r,n){const i=void 0===t?void 0:this.#f[t];if(this.#A(i))return i;const o=new l,{signal:s}=r;s?.addEventListener("abort",()=>o.abort(s.reason),{signal:o.signal});const a={signal:o.signal,options:r,context:n},c=(n,i=!1)=>{const{aborted:s}=o.signal,l=r.ignoreFetchAbort&&void 0!==n;if(r.status&&(s&&!i?(r.status.fetchAborted=!0,r.status.fetchError=o.signal.reason,l&&(r.status.fetchAbortIgnored=!0)):r.status.fetchResolved=!0),s&&!l&&!i)return u(o.signal.reason);const c=f;return this.#f[t]===f&&(void 0===n?c.__staleWhileFetching?this.#f[t]=c.__staleWhileFetching:this.#C(e,"fetch"):(r.status&&(r.status.fetchUpdated=!0),this.set(e,n,a.options))),n},u=n=>{const{aborted:i}=o.signal,s=i&&r.allowStaleOnFetchAbort,a=s||r.allowStaleOnFetchRejection,l=a||r.noDeleteOnFetchRejection,c=f;if(this.#f[t]===f&&(l&&void 0!==c.__staleWhileFetching?s||(this.#f[t]=c.__staleWhileFetching):this.#C(e,"fetch")),a)return r.status&&void 0!==c.__staleWhileFetching&&(r.status.returnedStale=!0),c.__staleWhileFetching;if(c.__returned===c)throw n};r.status&&(r.status.fetchDispatched=!0);const f=new Promise((t,n)=>{const s=this.#o?.(e,i,a);s&&s instanceof Promise&&s.then(e=>t(void 0===e?void 0:e),n),o.signal.addEventListener("abort",()=>{r.ignoreFetchAbort&&!r.allowStaleOnFetchAbort||(t(void 0),r.allowStaleOnFetchAbort&&(t=e=>c(e,!0)))})}).then(c,e=>(r.status&&(r.status.fetchRejected=!0,r.status.fetchError=e),u(e))),h=Object.assign(f,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return void 0===t?(this.set(e,h,{...a.options,status:void 0}),t=this.#c.get(e)):this.#f[t]=h,h}#A(e){if(!this.#S)return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof l}async fetch(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:f=this.allowStaleOnFetchRejection,ignoreFetchAbort:h=this.ignoreFetchAbort,allowStaleOnFetchAbort:d=this.allowStaleOnFetchAbort,context:p,forceRefresh:g=!1,status:b,signal:y}=t;if(!this.#S)return b&&(b.fetch="get"),this.get(e,{allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,status:b});const _={allowStale:r,updateAgeOnGet:n,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:s,size:a,sizeCalculation:l,noUpdateTTL:c,noDeleteOnFetchRejection:u,allowStaleOnFetchRejection:f,allowStaleOnFetchAbort:d,ignoreFetchAbort:h,status:b,signal:y};let m=this.#c.get(e);if(void 0===m){b&&(b.fetch="miss");const t=this.#k(e,m,_,p);return t.__returned=t}{const t=this.#f[m];if(this.#A(t)){const e=r&&void 0!==t.__staleWhileFetching;return b&&(b.fetch="inflight",e&&(b.returnedStale=!0)),e?t.__staleWhileFetching:t.__returned=t}const i=this.#T(m);if(!g&&!i)return b&&(b.fetch="hit"),this.#I(m),n&&this.#j(m),b&&this.#M(b,m),t;const o=this.#k(e,m,_,p),s=void 0!==o.__staleWhileFetching&&r;return b&&(b.fetch=i?"stale":"refresh",s&&i&&(b.returnedStale=!0)),s?o.__staleWhileFetching:o.__returned=o}}async forceFetch(e,t={}){const r=await this.fetch(e,t);if(void 0===r)throw new Error("fetch() returned undefined");return r}memo(e,t={}){const r=this.#s;if(!r)throw new Error("no memoMethod provided to constructor");const{context:n,forceRefresh:i,...o}=t,s=this.get(e,o);if(!i&&void 0!==s)return s;const a=r(e,s,{options:o,context:n});return this.set(e,a,o),a}get(e,t={}){const{allowStale:r=this.allowStale,updateAgeOnGet:n=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=t,s=this.#c.get(e);if(void 0!==s){const t=this.#f[s],a=this.#A(t);return o&&this.#M(o,s),this.#T(s)?(o&&(o.get="stale"),a?(o&&r&&void 0!==t.__staleWhileFetching&&(o.returnedStale=!0),r?t.__staleWhileFetching:void 0):(i||this.#C(e,"expire"),o&&r&&(o.returnedStale=!0),r?t:void 0)):(o&&(o.get="hit"),a?t.__staleWhileFetching:(this.#I(s),n&&this.#j(s),t))}o&&(o.get="miss")}#U(e,t){this.#d[t]=e,this.#h[e]=t}#I(e){e!==this.#g&&(e===this.#p?this.#p=this.#h[e]:this.#U(this.#d[e],this.#h[e]),this.#U(this.#g,e),this.#g=e)}delete(e){return this.#C(e,"delete")}#C(e,t){let r=!1;if(0!==this.#a){const n=this.#c.get(e);if(void 0!==n)if(r=!0,1===this.#a)this.#W(t);else{this.#L(n);const r=this.#f[n];if(this.#A(r)?r.__abortController.abort(new Error("deleted")):(this.#v||this.#E)&&(this.#v&&this.#n?.(r,e,t),this.#E&&this.#y?.push([r,e,t])),this.#c.delete(e),this.#u[n]=void 0,this.#f[n]=void 0,n===this.#g)this.#g=this.#d[n];else if(n===this.#p)this.#p=this.#h[n];else{const e=this.#d[n];this.#h[e]=this.#h[n];const t=this.#h[n];this.#d[t]=this.#d[n]}this.#a--,this.#b.push(n)}}if(this.#E&&this.#y?.length){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}return r}clear(){return this.#W("delete")}#W(e){for(const t of this.#R({allowStale:!0})){const r=this.#f[t];if(this.#A(r))r.__abortController.abort(new Error("deleted"));else{const n=this.#u[t];this.#v&&this.#n?.(r,n,e),this.#E&&this.#y?.push([r,n,e])}}if(this.#c.clear(),this.#f.fill(void 0),this.#u.fill(void 0),this.#w&&this.#m&&(this.#w.fill(0),this.#m.fill(0)),this.#_&&this.#_.fill(0),this.#p=0,this.#g=0,this.#b.length=0,this.#l=0,this.#a=0,this.#E&&this.#y){const e=this.#y;let t;for(;t=e?.shift();)this.#i?.(...t)}}}t.LRUCache=p},9122:()=>{},9133:(e,t,r)=>{"use strict";var n=r(8403);e.exports=function(){return Object.assign?function(){if(!Object.assign)return!1;for(var e="abcdefghijklmnopqrst",t=e.split(""),r={},n=0;n<t.length;++n)r[t[n]]=t[n];var i=Object.assign({},r),o="";for(var s in i)o+=s;return e!==o}()||function(){if(!Object.assign||!Object.preventExtensions)return!1;var e=Object.preventExtensions({1:2});try{Object.assign(e,"xy")}catch(t){return"y"===e[1]}return!1}()?n:Object.assign:n}},9157:(e,t,r)=>{"use strict";const{format:n,inspect:i}=r(1077),{AggregateError:o}=r(2768),s=globalThis.AggregateError||o,a=Symbol("kIsNodeError"),l=["string","function","number","object","Function","Object","boolean","bigint","symbol"],c=/^([A-Z][a-z0-9]*)+$/,u={};function f(e,t){if(!e)throw new u.ERR_INTERNAL_ASSERTION(t)}function h(e){let t="",r=e.length;const n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function d(e,t,r){r||(r=Error);class i extends r{constructor(...r){super(function(e,t,r){if("function"==typeof t)return f(t.length<=r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${t.length}).`),t(...r);const i=(t.match(/%[dfijoOs]/g)||[]).length;return f(i===r.length,`Code: ${e}; The provided arguments length (${r.length}) does not match the required ones (${i}).`),0===r.length?t:n(t,...r)}(e,t,r))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(i.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),i.prototype.code=e,i.prototype[a]=!0,u[e]=i}function p(e){const t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class g extends Error{constructor(e="The operation was aborted",t=void 0){if(void 0!==t&&"object"!=typeof t)throw new u.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}d("ERR_ASSERTION","%s",Error),d("ERR_INVALID_ARG_TYPE",(e,t,r)=>{f("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";const o=[],s=[],a=[];for(const e of t)f("string"==typeof e,"All expected entries have to be of type string"),l.includes(e)?o.push(e.toLowerCase()):c.test(e)?s.push(e):(f("object"!==e,'The value "object" should be written as "Object"'),a.push(e));if(s.length>0){const e=o.indexOf("object");-1!==e&&(o.splice(o,e,1),s.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{const e=o.pop();n+=`one of type ${o.join(", ")}, or ${e}`}}(s.length>0||a.length>0)&&(n+=" or ")}if(s.length>0){switch(s.length){case 1:n+=`an instance of ${s[0]}`;break;case 2:n+=`an instance of ${s[0]} or ${s[1]}`;break;default:{const e=s.pop();n+=`an instance of ${s.join(", ")}, or ${e}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{const e=a.pop();n+=`one of ${a.join(", ")}, or ${e}`}}if(null==r)n+=`. Received ${r}`;else if("function"==typeof r&&r.name)n+=`. Received function ${r.name}`;else if("object"==typeof r){var u;null!==(u=r.constructor)&&void 0!==u&&u.name?n+=`. Received an instance of ${r.constructor.name}`:n+=`. Received ${i(r,{depth:-1})}`}else{let e=i(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),n+=`. Received type ${typeof r} (${e})`}return n},TypeError),d("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let n=i(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${n}`},TypeError),d("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var n;return`Expected ${e} to be returned from the "${t}" function but got ${null!=r&&null!==(n=r.constructor)&&void 0!==n&&n.name?`instance of ${r.constructor.name}`:"type "+typeof r}.`},TypeError),d("ERR_MISSING_ARGS",(...e)=>{let t;f(e.length>0,"At least one arg needs to be specified");const r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{const r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),d("ERR_OUT_OF_RANGE",(e,t,r)=>{let n;if(f(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>2**32)n=h(String(r));else if("bigint"==typeof r){n=String(r);const e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(n=h(n)),n+="n"}else n=i(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError),d("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),d("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),d("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),d("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),d("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),d("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),d("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),d("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),d("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),d("ERR_STREAM_WRITE_AFTER_END","write after end",Error),d("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),e.exports={AbortError:g,aggregateTwoErrors:p(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;const r=new s([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:p,codes:u}},9209:(e,t,r)=>{"use strict";var n=r(6578),i="undefined"==typeof globalThis?r.g:globalThis;e.exports=function(){for(var e=[],t=0;t<n.length;t++)"function"==typeof i[n[t]]&&(e[e.length]=n[t]);return e}},9211:e=>{"use strict";var t=function(e){return e!=e};e.exports=function(e,r){return 0===e&&0===r?1/e==1/r:e===r||!(!t(e)||!t(r))}},9214:(e,t,r)=>{"use strict";const n=r(5606),{ArrayPrototypeIndexOf:i,NumberIsInteger:o,NumberIsNaN:s,NumberParseInt:a,ObjectDefineProperties:l,ObjectKeys:c,ObjectSetPrototypeOf:u,Promise:f,SafeSet:h,SymbolAsyncDispose:d,SymbolAsyncIterator:p,Symbol:g}=r(2768);e.exports=G,G.ReadableState=H;const{EventEmitter:b}=r(7007),{Stream:y,prependListener:_}=r(8745),{Buffer:m}=r(8287),{addAbortSignal:w}=r(5121),v=r(6364);let S=r(9862).debuglog("stream",e=>{S=e});const E=r(9075),A=r(7302),{getHighWaterMark:k,getDefaultHighWaterMark:I}=r(3513),{aggregateTwoErrors:O,codes:{ERR_INVALID_ARG_TYPE:R,ERR_METHOD_NOT_IMPLEMENTED:T,ERR_OUT_OF_RANGE:x,ERR_STREAM_PUSH_AFTER_EOF:P,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:N},AbortError:C}=r(9157),{validateObject:j}=r(4947),M=g("kPaused"),{StringDecoder:L}=r(7419),D=r(2070);u(G.prototype,y.prototype),u(G,y);const F=()=>{},{errorOrDestroy:$}=A,B=1,U=16,W=32,q=2048,V=4096;function z(e){return{enumerable:!1,get(){return 0!==(this.state&e)},set(t){t?this.state|=e:this.state&=~e}}}function H(e,t,n){"boolean"!=typeof n&&(n=t instanceof r(2648)),this.state=q|V|U|W,e&&e.objectMode&&(this.state|=B),n&&e&&e.readableObjectMode&&(this.state|=B),this.highWaterMark=e?k(this,e,"readableHighWaterMark",n):I(!1),this.buffer=new E,this.length=0,this.pipes=[],this.flowing=null,this[M]=null,e&&!1===e.emitClose&&(this.state&=~q),e&&!1===e.autoDestroy&&(this.state&=~V),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new L(e.encoding),this.encoding=e.encoding)}function G(e){if(!(this instanceof G))return new G(e);const t=this instanceof r(2648);this._readableState=new H(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&w(e.signal,this)),y.call(this,e),A.construct(this,()=>{this._readableState.needReadable&&Z(this,this._readableState)})}function K(e,t,r,n){S("readableAddChunk",t);const i=e._readableState;let o;if(0===(i.state&B)&&("string"==typeof t?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?t=m.from(t,r).toString(i.encoding):(t=m.from(t,r),r=""))):t instanceof m?r="":y._isUint8Array(t)?(t=y._uint8ArrayToBuffer(t),r=""):null!=t&&(o=new R("chunk",["string","Buffer","Uint8Array"],t))),o)$(e,o);else if(null===t)i.state&=-9,function(e,t){if(S("onEofChunk"),!t.ended){if(t.decoder){const e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}t.ended=!0,t.sync?Y(e):(t.needReadable=!1,t.emittedReadable=!0,X(e))}}(e,i);else if(0!==(i.state&B)||t&&t.length>0)if(n)if(4&i.state)$(e,new N);else{if(i.destroyed||i.errored)return!1;Q(e,i,t,!0)}else if(i.ended)$(e,new P);else{if(i.destroyed||i.errored)return!1;i.state&=-9,i.decoder&&!r?(t=i.decoder.write(t),i.objectMode||0!==t.length?Q(e,i,t,!1):Z(e,i)):Q(e,i,t,!1)}else n||(i.state&=-9,Z(e,i));return!i.ended&&(i.length<i.highWaterMark||0===i.length)}function Q(e,t,r,n){t.flowing&&0===t.length&&!t.sync&&e.listenerCount("data")>0?(65536&t.state?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),64&t.state&&Y(e)),Z(e,t)}function J(e,t){return e<=0||0===t.length&&t.ended?0:0!==(t.state&B)?1:s(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function Y(e){const t=e._readableState;S("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(S("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(X,e))}function X(e){const t=e._readableState;S("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||t.errored||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,ie(e)}function Z(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ee,e,t))}function ee(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){const r=t.length;if(S("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function te(e){const t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!1===t[M]?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function re(e){S("readable nexttick read 0"),e.read(0)}function ne(e,t){S("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),ie(e),t.flowing&&!t.reading&&e.read(0)}function ie(e){const t=e._readableState;for(S("flow",t.flowing);t.flowing&&null!==e.read(););}function oe(e,t){"function"!=typeof e.read&&(e=G.wrap(e,{objectMode:!0}));const r=async function*(e,t){let r,n=F;function i(t){this===e?(n(),n=F):n=t}e.on("readable",i);const o=v(e,{writable:!1},e=>{r=e?O(r,e):null,n(),n=F});try{for(;;){const t=e.destroyed?null:e.read();if(null!==t)yield t;else{if(r)throw r;if(null===r)return;await new f(i)}}}catch(e){throw r=O(r,e),r}finally{!r&&!1===(null==t?void 0:t.destroyOnReturn)||void 0!==r&&!e._readableState.autoDestroy?(e.off("readable",i),o()):A.destroyer(e,null)}}(e,t);return r.stream=e,r}function se(e,t){if(0===t.length)return null;let r;return t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r}function ae(e){const t=e._readableState;S("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(le,t,e))}function le(e,t){if(S("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length)if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(ce,t);else if(e.autoDestroy){const e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}function ce(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}let ue;function fe(){return void 0===ue&&(ue={}),ue}l(H.prototype,{objectMode:z(B),ended:z(2),endEmitted:z(4),reading:z(8),constructed:z(U),sync:z(W),needReadable:z(64),emittedReadable:z(128),readableListening:z(256),resumeScheduled:z(512),errorEmitted:z(1024),emitClose:z(q),autoDestroy:z(V),destroyed:z(8192),closed:z(16384),closeEmitted:z(32768),multiAwaitDrain:z(65536),readingMore:z(1<<17),dataEmitted:z(1<<18)}),G.prototype.destroy=A.destroy,G.prototype._undestroy=A.undestroy,G.prototype._destroy=function(e,t){t(e)},G.prototype[b.captureRejectionSymbol]=function(e){this.destroy(e)},G.prototype[d]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new C,this.destroy(e)),new f((t,r)=>v(this,n=>n&&n!==e?r(n):t(null)))},G.prototype.push=function(e,t){return K(this,e,t,!1)},G.prototype.unshift=function(e,t){return K(this,e,t,!0)},G.prototype.isPaused=function(){const e=this._readableState;return!0===e[M]||!1===e.flowing},G.prototype.setEncoding=function(e){const t=new L(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;const r=this._readableState.buffer;let n="";for(const e of r)n+=t.write(e);return r.clear(),""!==n&&r.push(n),this._readableState.length=n.length,this},G.prototype.read=function(e){S("read",e),void 0===e?e=NaN:o(e)||(e=a(e,10));const t=this._readableState,r=e;if(e>t.highWaterMark&&(t.highWaterMark=function(e){if(e>1073741824)throw new x("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(t.state&=-129),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return S("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?ae(this):Y(this),null;if(0===(e=J(e,t))&&t.ended)return 0===t.length&&ae(this),null;let n,i=!!(64&t.state);if(S("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,S("length less than watermark",i)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)i=!1,S("reading, ended or constructing",i);else if(i){S("do read"),t.state|=8|W,0===t.length&&(t.state|=64);try{this._read(t.highWaterMark)}catch(e){$(this,e)}t.state&=~W,t.reading||(e=J(r,t))}return n=e>0?se(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&ae(this)),null===n||t.errorEmitted||t.closeEmitted||(t.dataEmitted=!0,this.emit("data",n)),n},G.prototype._read=function(e){throw new T("_read()")},G.prototype.pipe=function(e,t){const r=this,i=this._readableState;1===i.pipes.length&&(i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new h(i.awaitDrainWriters?[i.awaitDrainWriters]:[]))),i.pipes.push(e),S("pipe count=%d opts=%j",i.pipes.length,t);const o=t&&!1===t.end||e===n.stdout||e===n.stderr?g:s;function s(){S("onend"),e.end()}let a;i.endEmitted?n.nextTick(o):r.once("end",o),e.on("unpipe",function t(n,o){S("onunpipe"),n===r&&o&&!1===o.hasUnpiped&&(o.hasUnpiped=!0,S("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),a&&e.removeListener("drain",a),e.removeListener("error",f),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",g),r.removeListener("data",u),l=!0,a&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&a())});let l=!1;function c(){l||(1===i.pipes.length&&i.pipes[0]===e?(S("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(S("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),a||(a=function(e,t){return function(){const r=e._readableState;r.awaitDrainWriters===t?(S("pipeOnDrain",1),r.awaitDrainWriters=null):r.multiAwaitDrain&&(S("pipeOnDrain",r.awaitDrainWriters.size),r.awaitDrainWriters.delete(t)),r.awaitDrainWriters&&0!==r.awaitDrainWriters.size||!e.listenerCount("data")||e.resume()}}(r,e),e.on("drain",a))}function u(t){S("ondata");const r=e.write(t);S("dest.write",r),!1===r&&c()}function f(t){if(S("onerror",t),g(),e.removeListener("error",f),0===e.listenerCount("error")){const r=e._writableState||e._readableState;r&&!r.errorEmitted?$(e,t):e.emit("error",t)}}function d(){e.removeListener("finish",p),g()}function p(){S("onfinish"),e.removeListener("close",d),g()}function g(){S("unpipe"),r.unpipe(e)}return r.on("data",u),_(e,"error",f),e.once("close",d),e.once("finish",p),e.emit("pipe",r),!0===e.writableNeedDrain?c():i.flowing||(S("pipe resume"),r.resume()),e},G.prototype.unpipe=function(e){const t=this._readableState;if(0===t.pipes.length)return this;if(!e){const e=t.pipes;t.pipes=[],this.pause();for(let t=0;t<e.length;t++)e[t].emit("unpipe",this,{hasUnpiped:!1});return this}const r=i(t.pipes,e);return-1===r||(t.pipes.splice(r,1),0===t.pipes.length&&this.pause(),e.emit("unpipe",this,{hasUnpiped:!1})),this},G.prototype.on=function(e,t){const r=y.prototype.on.call(this,e,t),i=this._readableState;return"data"===e?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===e&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,S("on readable",i.length,i.reading),i.length?Y(this):i.reading||n.nextTick(re,this))),r},G.prototype.addListener=G.prototype.on,G.prototype.removeListener=function(e,t){const r=y.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(te,this),r},G.prototype.off=G.prototype.removeListener,G.prototype.removeAllListeners=function(e){const t=y.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||n.nextTick(te,this),t},G.prototype.resume=function(){const e=this._readableState;return e.flowing||(S("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,n.nextTick(ne,e,t))}(this,e)),e[M]=!1,this},G.prototype.pause=function(){return S("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(S("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[M]=!0,this},G.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{$(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};const r=c(e);for(let t=1;t<r.length;t++){const n=r[t];void 0===this[n]&&"function"==typeof e[n]&&(this[n]=e[n].bind(e))}return this},G.prototype[p]=function(){return oe(this)},G.prototype.iterator=function(e){return void 0!==e&&j(e,"options"),oe(this,e)},l(G.prototype,{readable:{__proto__:null,get(){const e=this._readableState;return!(!e||!1===e.readable||e.destroyed||e.errorEmitted||e.endEmitted)},set(e){this._readableState&&(this._readableState.readable=!!e)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!(!1===this._readableState.readable||!this._readableState.destroyed&&!this._readableState.errored||this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.objectMode}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return!!this._readableState&&this._readableState.closed}},destroyed:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.destroyed},set(e){this._readableState&&(this._readableState.destroyed=e)}},readableEnded:{__proto__:null,enumerable:!1,get(){return!!this._readableState&&this._readableState.endEmitted}}}),l(H.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return!1!==this[M]},set(e){this[M]=!!e}}}),G._fromList=se,G.from=function(e,t){return D(G,e,t)},G.fromWeb=function(e,t){return fe().newStreamReadableFromReadableStream(e,t)},G.toWeb=function(e,t){return fe().newReadableStreamFromStreamReadable(e,t)},G.wrap=function(e,t){var r,n;return new G({objectMode:null===(r=null!==(n=e.readableObjectMode)&&void 0!==n?n:e.objectMode)||void 0===r||r,...t,destroy(t,r){A.destroyer(e,t),r(t)}}).wrap(e)}},9288:()=>{},9290:e=>{"use strict";e.exports=RangeError},9353:e=>{"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r};e.exports=function(e){var i=this;if("function"!=typeof i||"[object Function]"!==t.apply(i))throw new TypeError("Function.prototype.bind called on incompatible "+i);for(var o,s=function(e){for(var t=[],r=1,n=0;r<e.length;r+=1,n+=1)t[n]=e[r];return t}(arguments),a=r(0,i.length-s.length),l=[],c=0;c<a;c++)l[c]="$"+c;if(o=Function("binder","return function ("+function(e){for(var t="",r=0;r<e.length;r+=1)t+=e[r],r+1<e.length&&(t+=",");return t}(l)+"){ return binder.apply(this,arguments); }")(function(){if(this instanceof o){var t=i.apply(this,n(s,arguments));return Object(t)===t?t:this}return i.apply(e,n(s,arguments))}),i.prototype){var u=function(){};u.prototype=i.prototype,o.prototype=new u,u.prototype=null}return o}},9372:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0});const l=s(r(1676));t.default=l,a(r(1676),t)},9383:e=>{"use strict";e.exports=Error},9394:(e,t,r)=>{"use strict";var n=r(9211);e.exports=function(){return"function"==typeof Object.is?Object.is:n}},9538:e=>{"use strict";e.exports=ReferenceError},9584:(e,t,r)=>{"use strict";const n=r(5244),i=r(3425),o=n.Readable.destroy;e.exports=n.Readable,e.exports._uint8ArrayToBuffer=n._uint8ArrayToBuffer,e.exports._isUint8Array=n._isUint8Array,e.exports.isDisturbed=n.isDisturbed,e.exports.isErrored=n.isErrored,e.exports.isReadable=n.isReadable,e.exports.Readable=n.Readable,e.exports.Writable=n.Writable,e.exports.Duplex=n.Duplex,e.exports.Transform=n.Transform,e.exports.PassThrough=n.PassThrough,e.exports.addAbortSignal=n.addAbortSignal,e.exports.finished=n.finished,e.exports.destroy=n.destroy,e.exports.destroy=o,e.exports.pipeline=n.pipeline,e.exports.compose=n.compose,Object.defineProperty(n,"promises",{configurable:!0,enumerable:!0,get:()=>i}),e.exports.Stream=n.Stream,e.exports.default=e.exports},9597:(e,t,r)=>{"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function i(e,t){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},i(e,t)}function o(e){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},o(e)}var s,a,l={};function c(e,t,r){r||(r=Error);var s=function(r){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&i(e,t)}(u,r);var s,a,l,c=(a=u,l=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,t=o(a);if(l){var r=o(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function u(r,n,i){var o;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,u),o=c.call(this,function(e,r,n){return"string"==typeof t?t:t(e,r,n)}(r,n,i)),o.code=e,o}return s=u,Object.defineProperty(s,"prototype",{writable:!1}),s}(r);l[e]=s}function u(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(e){return String(e)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}c("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),c("ERR_INVALID_ARG_TYPE",function(e,t,i){var o,a,l,c,f;if(void 0===s&&(s=r(4148)),s("string"==typeof e,"'name' must be a string"),"string"==typeof t&&(a="not ",t.substr(0,4)===a)?(o="must not be",t=t.replace(/^not /,"")):o="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))l="The ".concat(e," ").concat(o," ").concat(u(t,"type"));else{var h=("number"!=typeof f&&(f=0),f+1>(c=e).length||-1===c.indexOf(".",f)?"argument":"property");l='The "'.concat(e,'" ').concat(h," ").concat(o," ").concat(u(t,"type"))}return l+". Received type ".concat(n(i))},TypeError),c("ERR_INVALID_ARG_VALUE",function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"is invalid";void 0===a&&(a=r(537));var i=a.inspect(t);return i.length>128&&(i="".concat(i.slice(0,128),"...")),"The argument '".concat(e,"' ").concat(n,". Received ").concat(i)},TypeError,RangeError),c("ERR_INVALID_RETURN_VALUE",function(e,t,r){var i;return i=r&&r.constructor&&r.constructor.name?"instance of ".concat(r.constructor.name):"type ".concat(n(r)),"Expected ".concat(e,' to be returned from the "').concat(t,'"')+" function but got ".concat(i,".")},TypeError),c("ERR_MISSING_ARGS",function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];void 0===s&&(s=r(4148)),s(t.length>0,"At least one arg needs to be specified");var i="The ",o=t.length;switch(t=t.map(function(e){return'"'.concat(e,'"')}),o){case 1:i+="".concat(t[0]," argument");break;case 2:i+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:i+=t.slice(0,o-1).join(", "),i+=", and ".concat(t[o-1]," arguments")}return"".concat(i," must be specified")},TypeError),e.exports.codes=l},9600:e=>{"use strict";var t,r,n=Function.prototype.toString,i="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof i&&"function"==typeof Object.defineProperty)try{t=Object.defineProperty({},"length",{get:function(){throw r}}),r={},i(function(){throw 42},null,t)}catch(e){e!==r&&(i=null)}else i=null;var o=/^\s*class\b/,s=function(e){try{var t=n.call(e);return o.test(t)}catch(e){return!1}},a=function(e){try{return!s(e)&&(n.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,c="function"==typeof Symbol&&!!Symbol.toStringTag,u=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var h=document.all;l.call(h)===l.call(document.all)&&(f=function(e){if((u||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}e.exports=i?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{i(e,null,t)}catch(e){if(e!==r)return!1}return!s(e)&&a(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(c)return a(e);if(s(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&a(e)}},9612:e=>{"use strict";e.exports=Object},9655:function(e,t,r){var n;e=r.nmd(e),function(){t&&t.nodeType,e&&e.nodeType;var i="object"==typeof r.g&&r.g;i.global!==i&&i.window!==i&&i.self;var o,s=2147483647,a=36,l=/^xn--/,c=/[^\x20-\x7E]/,u=/[\x2E\u3002\uFF0E\uFF61]/g,f={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},h=Math.floor,d=String.fromCharCode;function p(e){throw new RangeError(f[e])}function g(e,t){for(var r=e.length,n=[];r--;)n[r]=t(e[r]);return n}function b(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+g((e=e.replace(u,".")).split("."),t).join(".")}function y(e){for(var t,r,n=[],i=0,o=e.length;i<o;)(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<o?56320==(64512&(r=e.charCodeAt(i++)))?n.push(((1023&t)<<10)+(1023&r)+65536):(n.push(t),i--):n.push(t);return n}function _(e){return g(e,function(e){var t="";return e>65535&&(t+=d((e-=65536)>>>10&1023|55296),e=56320|1023&e),t+d(e)}).join("")}function m(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:a}function w(e,t){return e+22+75*(e<26)-((0!=t)<<5)}function v(e,t,r){var n=0;for(e=r?h(e/700):e>>1,e+=h(e/t);e>455;n+=a)e=h(e/35);return h(n+36*e/(e+38))}function S(e){var t,r,n,i,o,l,c,u,f,d,g=[],b=e.length,y=0,w=128,S=72;for((r=e.lastIndexOf("-"))<0&&(r=0),n=0;n<r;++n)e.charCodeAt(n)>=128&&p("not-basic"),g.push(e.charCodeAt(n));for(i=r>0?r+1:0;i<b;){for(o=y,l=1,c=a;i>=b&&p("invalid-input"),((u=m(e.charCodeAt(i++)))>=a||u>h((s-y)/l))&&p("overflow"),y+=u*l,!(u<(f=c<=S?1:c>=S+26?26:c-S));c+=a)l>h(s/(d=a-f))&&p("overflow"),l*=d;S=v(y-o,t=g.length+1,0==o),h(y/t)>s-w&&p("overflow"),w+=h(y/t),y%=t,g.splice(y++,0,w)}return _(g)}function E(e){var t,r,n,i,o,l,c,u,f,g,b,_,m,S,E,A=[];for(_=(e=y(e)).length,t=128,r=0,o=72,l=0;l<_;++l)(b=e[l])<128&&A.push(d(b));for(n=i=A.length,i&&A.push("-");n<_;){for(c=s,l=0;l<_;++l)(b=e[l])>=t&&b<c&&(c=b);for(c-t>h((s-r)/(m=n+1))&&p("overflow"),r+=(c-t)*m,t=c,l=0;l<_;++l)if((b=e[l])<t&&++r>s&&p("overflow"),b==t){for(u=r,f=a;!(u<(g=f<=o?1:f>=o+26?26:f-o));f+=a)E=u-g,S=a-g,A.push(d(w(g+E%S,0))),u=h(E/S);A.push(d(w(u,0))),o=v(r,m,n==i),r=0,++n}++r,++t}return A.join("")}o={version:"1.4.1",ucs2:{decode:y,encode:_},decode:S,encode:E,toASCII:function(e){return b(e,function(e){return c.test(e)?"xn--"+E(e):e})},toUnicode:function(e){return b(e,function(e){return l.test(e)?S(e.slice(4).toLowerCase()):e})}},void 0===(n=function(){return o}.call(t,r,t,e))||(e.exports=n)}()},9675:e=>{"use strict";e.exports=TypeError},9721:(e,t,r)=>{"use strict";var n=r(6556),i=r(4035),o=n("RegExp.prototype.exec"),s=r(9675);e.exports=function(e){if(!i(e))throw new s("`regex` must be a RegExp");return function(t){return null!==o(e,t)}}},9777:function(e,t,r){"use strict";var n,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);i&&!("get"in i?!t.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||(n=function(e){return n=Object.getOwnPropertyNames||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[t.length]=r);return t},n(e)},function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r=n(e),s=0;s<r.length;s++)"default"!==r[s]&&i(t,e,r[s]);return o(t,e),t}),a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const l=a(r(1278)),c=r(9584),u=a(r(3885)),f=a(r(7833)),h=s(r(128)),d=a(r(7969)),p=a(r(6912)),g=r(1021),b=a(r(579)),y=a(r(2639)),_=r(4723),m=r(4152),w=a(r(3175)),v=s(r(6887)),S=globalThis.setImmediate||((...e)=>{const t=e.shift();(0,_.nextTick)(()=>{t(...e)})}),E=65535,A={keepalive:60,reschedulePings:!0,protocolId:"MQTT",protocolVersion:4,reconnectPeriod:1e3,connectTimeout:3e4,clean:!0,resubscribe:!0,subscribeBatchSize:null,writeCache:!0,timerVariant:"auto"};class k extends m.TypedEventEmitter{static VERSION=_.MQTTJS_VERSION;connected;disconnecting;disconnected;reconnecting;incomingStore;outgoingStore;options;queueQoSZero;_reconnectCount;log;messageIdProvider;outgoing;messageIdToTopic;noop;keepaliveManager;stream;queue;streamBuilder;_resubscribeTopics;connackTimer;reconnectTimer;_storeProcessing;_packetIdsDuringStoreProcessing;_storeProcessingQueue;_firstConnection;topicAliasRecv;topicAliasSend;_incomingQoS2Ids;_receiveMaximum;_deferredReconnect;_currentPump;connackReceived;reconnectSuppressed;_authenticationMethod;connackPacket;_serverProperties;static defaultId(){return`mqttjs_${Math.random().toString(16).substr(2,8)}`}constructor(e,t){super(),this.options=t||{};for(const e in A)void 0===this.options[e]?this.options[e]=A[e]:this.options[e]=t[e];this.log=this.options.log||(0,f.default)("mqttjs:client"),this.noop=this._noop.bind(this),this.log("MqttClient :: version:",k.VERSION),v.isWebWorker?this.log("MqttClient :: environment","webworker"):this.log("MqttClient :: environment",v.default?"browser":"node"),this.log("MqttClient :: options.protocol",t.protocol),this.log("MqttClient :: options.protocolVersion",t.protocolVersion),this.log("MqttClient :: options.username",t.username),this.log("MqttClient :: options.keepalive",t.keepalive),this.log("MqttClient :: options.reconnectPeriod",t.reconnectPeriod),this.log("MqttClient :: options.rejectUnauthorized",t.rejectUnauthorized),this.log("MqttClient :: options.properties.topicAliasMaximum",t.properties?t.properties.topicAliasMaximum:void 0),this.options.clientId="string"==typeof t.clientId?t.clientId:k.defaultId(),this.log("MqttClient :: clientId",this.options.clientId),this.options.customHandleAcks=5===t.protocolVersion&&t.customHandleAcks?t.customHandleAcks:(...e)=>{e[3](null,0)},this.options.writeCache||(l.default.writeToStream.cacheNumbers=!1),this.streamBuilder=e,this.messageIdProvider=void 0===this.options.messageIdProvider?new b.default:this.options.messageIdProvider,this.outgoingStore=t.outgoingStore||new d.default,this.incomingStore=t.incomingStore||new d.default,this._incomingQoS2Ids=new Set,this._receiveMaximum=E;const r=t.properties?.receiveMaximum;void 0!==r&&(Number.isInteger(r)&&r>=1&&r<=E?this._receiveMaximum=r:this.log("MqttClient :: options.properties.receiveMaximum %o is not an integer between 1 and %d, enforcing and advertising %d instead",r,E,E)),this.queueQoSZero=void 0===t.queueQoSZero||t.queueQoSZero,this._resubscribeTopics={},this.messageIdToTopic={},this.keepaliveManager=null,this.connected=!1,this.disconnecting=!1,this.reconnecting=!1,this.queue=[],this.connackTimer=null,this.connackReceived=!1,this.reconnectSuppressed=!1,this.reconnectTimer=null,this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={},this._storeProcessingQueue=[],this.outgoing={},this._firstConnection=!0,t.properties&&t.properties.topicAliasMaximum>0&&(t.properties.topicAliasMaximum>65535?this.log("MqttClient :: options.properties.topicAliasMaximum is out of range"):this.topicAliasRecv=new y.default(t.properties.topicAliasMaximum)),this.on("connect",()=>{const{queue:e}=this,t=()=>{const r=e.shift();this.log("deliver :: entry %o",r);let n=null;if(!r)return void this._resubscribe();n=r.packet,this.log("deliver :: call _sendPacket for %o",n);let i=!0;n.messageId&&0!==n.messageId&&(this.messageIdProvider.register(n.messageId)||(i=!1)),i?this._sendPacket(n,e=>{r.cb&&r.cb(e),t()}):(this.log("messageId: %d has already used. The message is skipped and removed.",n.messageId),t())};this.log("connect :: sending queued packets"),t()}),this.on("close",()=>{this.log("close :: connected set to `false`"),this.connected=!1,this.log("close :: clearing connackTimer"),clearTimeout(this.connackTimer),this._destroyKeepaliveManager(),this._serverProperties=void 0,this.topicAliasRecv&&this.topicAliasRecv.clear(),this.log("close :: calling _setupReconnect"),this._setupReconnect()}),this.options.manualConnect||(this.log("MqttClient :: setting up stream"),this.connect())}handleAuth(e,t){t()}handleMessage(e,t){t()}_nextId(){return this.messageIdProvider.allocate()}getLastMessageId(){return this.messageIdProvider.getLastAllocated()}_trackIncomingQoS2Publish(e,t,r){return!!this._incomingQoS2Ids.has(e)||(5===this.options.protocolVersion&&this._incomingQoS2Ids.size>=this._receiveMaximum?(this.log("_trackIncomingQoS2Publish :: inbound QoS 2 messages exceeded receiveMaximum %d",this._receiveMaximum),r?.discardParsedPackets(),r&&!r.isCurrent()||this._cleanUp(!0),t(),this.emit("error",new _.ErrorWithReasonCode(`${g.ReasonCodes[147]}: ${this._incomingQoS2Ids.size+1} inbound QoS 2 messages in flight, receiveMaximum is ${this._receiveMaximum}`,147)),!1):(this._incomingQoS2Ids.add(e),!0))}_releaseIncomingQoS2Publish(e){this._incomingQoS2Ids.delete(e)}_discardIncomingQoS2State(){if(0!==this._incomingQoS2Ids.size){this.log("_discardIncomingQoS2State :: session not resumed, dropping %d inbound QoS 2 message(s)",this._incomingQoS2Ids.size);for(const e of this._incomingQoS2Ids)this.incomingStore.del({messageId:e},this.noop);this._incomingQoS2Ids.clear()}}connect(){const e=new c.Writable,t=l.default.parser(this.options);let r=null;const n=[],i={discardParsedPackets:()=>{n.length=0},isCurrent:()=>this._currentPump===i};this._currentPump=i,this.connackReceived=!1,this.reconnectSuppressed=!1,this.log("connect :: calling method to clear reconnect"),this._clearReconnect(),this._serverProperties=void 0,this.disconnected&&!this.reconnecting&&(this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1),this.log("connect :: using streamBuilder provided to client to create stream"),this.stream=this.streamBuilder(this),t.on("packet",e=>{this.log("parser :: on packet push to packets array."),n.push(e)});const o=()=>{this.log("work :: getting next packet in queue"),this._currentPump!==i&&(this.log("work :: pump superseded, dropping %d queued packets",n.length),n.length=0);const e=n.shift();if(e)this.log("work :: packet pulled from queue"),(0,p.default)(this,e,s,i);else{this.log("work :: no packets in queue");const e=r;r=null,this.log("work :: done flag is %s",!!e),e&&e()}},s=()=>{if(n.length)(0,_.nextTick)(o);else{const e=r;r=null,e&&e()}};e._write=(e,n,i)=>{r=i,this.log("writable stream :: parsing buffer"),t.parse(e),o()},this.log("connect :: pipe stream to writable stream"),this.stream.pipe(e),this.stream.on("error",e=>{this.log("streamErrorHandler :: error",e.message),e.code?(this.log("streamErrorHandler :: emitting error"),this.emit("error",e)):this.noop(e)}),this.stream.on("close",()=>{this.log("(%s)stream :: on close",this.options.clientId),this._flushVolatile(),this.log("stream: emit close to MqttClient"),this.emit("close")}),this.log("connect: sending packet `connect`");const a={cmd:"connect",protocolId:this.options.protocolId,protocolVersion:this.options.protocolVersion,clean:this.options.clean,clientId:this.options.clientId,keepalive:this.options.keepalive,username:this.options.username,password:this.options.password,properties:this.options.properties?{...this.options.properties}:void 0};if(void 0!==a.properties?.receiveMaximum&&(a.properties.receiveMaximum=this._receiveMaximum),this.options.will&&(a.will={...this.options.will,payload:this.options.will?.payload}),this.topicAliasRecv&&(a.properties||(a.properties={}),this.topicAliasRecv&&(a.properties.topicAliasMaximum=this.topicAliasRecv.max)),this._authenticationMethod=a.properties?.authenticationMethod,this._writePacket(a),t.on("error",this.emit.bind(this,"error")),this.options.properties){if(!this.options.properties.authenticationMethod&&this.options.properties.authenticationData)return this.end(()=>this.emit("error",new Error("Packet has no Authentication Method"))),this;if(this.options.properties.authenticationMethod&&this.options.authPacket&&"object"==typeof this.options.authPacket){const e={cmd:"auth",reasonCode:0,...this.options.authPacket};this._writePacket(e)}}return this.stream.setMaxListeners(1e3),clearTimeout(this.connackTimer),this.connackTimer=setTimeout(()=>this._onConnackTimeout(),this.options.connectTimeout),this}_onConnackTimeout(){this.log("!!connectTimeout hit!! Calling _cleanUp with force `true`"),this._cleanUp(!0),this.emit("error",new Error("connack timeout"))}publish(e,t,r,n){this.log("publish :: message `%s` to topic `%s`",t,e);const{options:i}=this;"function"==typeof r&&(n=r,r=null),r=r||{},r={qos:0,retain:!1,dup:!1,...r};const{qos:o,retain:s,dup:a,properties:l,cbStorePut:c}=r;if(this._checkDisconnecting(n))return this;const u=()=>{let r=0;if((1===o||2===o)&&(r=this._nextId(),null===r))return this.log("No messageId left"),!1;const u={cmd:"publish",topic:e,payload:t,qos:o,retain:s,messageId:r,dup:a};switch(5===i.protocolVersion&&(u.properties=l),this.log("publish :: qos",o),o){case 1:case 2:this.outgoing[u.messageId]={volatile:!1,cmd:"publish",cb:n||this.noop},this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,void 0,c);break;default:this.log("MqttClient:publish: packet cmd: %s",u.cmd),this._sendPacket(u,n,c)}return!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!u())&&this._storeProcessingQueue.push({invoke:u,cbStorePut:r.cbStorePut,callback:n}),this}publishAsync(e,t,r){return new Promise((n,i)=>{this.publish(e,t,r,(e,t)=>{e?i(e):n(t)})})}subscribe(e,t,r){const n=this.options.protocolVersion;"function"==typeof t&&(r=t),r=r||this.noop;let i=!1,o=[];"string"==typeof e?o=e=[e]:Array.isArray(e)?o=e:"object"==typeof e&&(i=e.resubscribe,delete e.resubscribe,o=Object.keys(e));const s=h.validateTopics(o);if(null!==s)return S(r,new Error(`Invalid topic ${s}`)),this;if(this._checkDisconnecting(r))return this.log("subscribe: discconecting true"),this;const a={qos:0};5===n&&(a.nl=!1,a.rap=!1,a.rh=0),t={...a,...t};const{properties:l}=t,c=[],u=(e,r)=>{if(r=r||t,!Object.prototype.hasOwnProperty.call(this._resubscribeTopics,e)||this._resubscribeTopics[e].qos<r.qos||i){const t={topic:e,qos:r.qos};5===n&&(t.nl=r.nl,t.rap=r.rap,t.rh=r.rh,t.properties=l),this.log("subscribe: pushing topic `%s` and qos `%s` to subs list",t.topic,t.qos),c.push(t)}};if(Array.isArray(e)?e.forEach(e=>{this.log("subscribe: array topic %s",e),u(e)}):Object.keys(e).forEach(t=>{this.log("subscribe: object topic %s, %o",t,e[t]),u(t,e[t])}),!c.length)return r(null,[]),this;const f=(e,t)=>{const r={cmd:"subscribe",subscriptions:e,messageId:t};if(l&&(r.properties=l),this.options.resubscribe){this.log("subscribe :: resubscribe true");const t=[];e.forEach(e=>{if(this.options.reconnectPeriod>0){const r={qos:e.qos};5===n&&(r.nl=e.nl||!1,r.rap=e.rap||!1,r.rh=e.rh||0,r.properties=e.properties),this._resubscribeTopics[e.topic]=r,t.push(e.topic)}}),this.messageIdToTopic[r.messageId]=t}const i=new Promise((t,n)=>{this.outgoing[r.messageId]={volatile:!0,cmd:"subscribe",cb:(r,i)=>{if(r)return void n(new _.ErrorWithSubackPacket(r.message,i));const{granted:o}=i;if(o.length!==e.length)return n(new _.ErrorWithSubackPacket(`Protocol error: suback granted ${o.length} reason code(s) for ${e.length} subscription(s)`,i)),void this._cleanUp(!0);for(let t=0;t<o.length;t+=1)e[t].qos=o[t];t(i)}}});return this.log("subscribe :: call _sendPacket"),this._sendPacket(r),i},d=()=>{const e=this.options.subscribeBatchSize??c.length,t=[];for(let r=0;r<c.length;r+=e){const n=c.slice(r,r+e),i=this._nextId();if(null===i)return this.log("No messageId left"),!1;t.push(f(n,i))}return Promise.all(t).then(e=>{r(null,c,e.at(-1))}).catch(e=>{r(e,c,e.packet)}),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!d())&&this._storeProcessingQueue.push({invoke:d,callback:r}),this}subscribeAsync(e,t){return new Promise((r,n)=>{this.subscribe(e,t,(e,t)=>{e?n(e):r(t)})})}unsubscribe(e,t,r){"string"==typeof e&&(e=[e]),"function"==typeof t&&(r=t),r=r||this.noop;const n=h.validateTopics(e);if(null!==n)return S(r,new Error(`Invalid topic ${n}`)),this;if(this._checkDisconnecting(r))return this;const i=()=>{const n=this._nextId();if(null===n)return this.log("No messageId left"),!1;const i={cmd:"unsubscribe",messageId:n,unsubscriptions:[]};return"string"==typeof e?i.unsubscriptions=[e]:Array.isArray(e)&&(i.unsubscriptions=e),this.options.resubscribe&&i.unsubscriptions.forEach(e=>{delete this._resubscribeTopics[e]}),"object"==typeof t&&t.properties&&(i.properties=t.properties),this.outgoing[i.messageId]={volatile:!0,cmd:"unsubscribe",cb:r},this.log("unsubscribe: call _sendPacket"),this._sendPacket(i),!0};return(this._storeProcessing||this._storeProcessingQueue.length>0||!i())&&this._storeProcessingQueue.push({invoke:i,callback:r}),this}unsubscribeAsync(e,t){return new Promise((r,n)=>{this.unsubscribe(e,t,(e,t)=>{e?n(e):r(t)})})}end(e,t,r){this.log("end :: (%s)",this.options.clientId),null!=e&&"boolean"==typeof e||(r=r||t,t=e,e=!1),"object"!=typeof t&&(r=r||t,t=null),this.log("end :: cb? %s",!!r),r&&"function"==typeof r||(r=this.noop);const n=()=>{this.log("end :: closeStores: closing incoming and outgoing stores"),this.disconnected=!0,this._incomingQoS2Ids.clear(),this.incomingStore.close(e=>{this.outgoingStore.close(t=>{if(this.log("end :: closeStores: emitting end"),this.emit("end"),r){const n=e||t;this.log("end :: closeStores: invoking callback with args"),r(n)}})}),this._deferredReconnect?this._deferredReconnect():(0===this.options.reconnectPeriod||this.options.manualConnect)&&(this.disconnecting=!1)},i=()=>{this.log("end :: (%s) :: finish :: calling _cleanUp with force %s",this.options.clientId,e),this._cleanUp(e,()=>{this.log("end :: finish :: calling process.nextTick on closeStores"),(0,_.nextTick)(n)},t)};return this.disconnecting?(r(),this):(this._clearReconnect(),this.disconnecting=!0,!e&&Object.keys(this.outgoing).length>0?(this.log("end :: (%s) :: calling finish in 10ms once outgoing is empty",this.options.clientId),this.once("outgoingEmpty",setTimeout.bind(null,i,10))):(this.log("end :: (%s) :: immediately calling finish",this.options.clientId),i()),this)}endAsync(e,t){return new Promise((r,n)=>{this.end(e,t,e=>{e?n(e):r()})})}removeOutgoingMessage(e){if(this.outgoing[e]){const{cb:t}=this.outgoing[e];this._removeOutgoingAndStoreMessage(e,()=>{t(new Error("Message removed"))})}return this}reconnect(e){this.log("client reconnect");const t=()=>{e?(this.options.incomingStore=e.incomingStore,this.options.outgoingStore=e.outgoingStore):(this.options.incomingStore=null,this.options.outgoingStore=null),this.incomingStore=this.options.incomingStore||new d.default,this.outgoingStore=this.options.outgoingStore||new d.default,this._incomingQoS2Ids.clear(),this.disconnecting=!1,this.disconnected=!1,this._deferredReconnect=null,this._reconnect()};return this.disconnecting&&!this.disconnected?this._deferredReconnect=t:t(),this}_flushVolatile(){this.outgoing&&(this.log("_flushVolatile :: deleting volatile messages from the queue and setting their callbacks as error function"),Object.keys(this.outgoing).forEach(e=>{this.outgoing[e].volatile&&"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_flush(){this.outgoing&&(this.log("_flush: queue exists? %b",!!this.outgoing),Object.keys(this.outgoing).forEach(e=>{"function"==typeof this.outgoing[e].cb&&(this.outgoing[e].cb(new Error("Connection closed")),delete this.outgoing[e])}))}_removeTopicAliasAndRecoverTopicName(e){let t;e.properties&&(t=e.properties.topicAlias);let r=e.topic.toString();if(this.log("_removeTopicAliasAndRecoverTopicName :: alias %d, topic %o",t,r),0===r.length){if(void 0===t)return new Error("Unregistered Topic Alias");if(r=this.topicAliasSend.getTopicByAlias(t),void 0===r)return new Error("Unregistered Topic Alias");e.topic=r}t&&delete e.properties.topicAlias}_checkDisconnecting(e){return this.disconnecting&&(e&&e!==this.noop?e(new Error("client disconnecting")):this.emit("error",new Error("client disconnecting"))),this.disconnecting}_reconnect(){this.log("_reconnect: emitting reconnect to client"),this.emit("reconnect"),this.connected?(this.end(()=>{this.connect()}),this.log("client already connected. disconnecting first.")):(this.log("_reconnect: calling connect"),this.connect())}_setupReconnect(){!this.disconnecting&&!this.reconnectSuppressed&&!this.reconnectTimer&&this.options.reconnectPeriod>0?(this.reconnecting||(this.log("_setupReconnect :: emit `offline` state"),this.emit("offline"),this.log("_setupReconnect :: set `reconnecting` to `true`"),this.reconnecting=!0),this.log("_setupReconnect :: setting reconnectTimer for %d ms",this.options.reconnectPeriod),this.reconnectTimer=setInterval(()=>{this.log("reconnectTimer :: reconnect triggered!"),this._reconnect()},this.options.reconnectPeriod)):this.log("_setupReconnect :: doing nothing...")}_clearReconnect(){this.log("_clearReconnect : clearing reconnect timer"),this.reconnectTimer&&(clearInterval(this.reconnectTimer),this.reconnectTimer=null)}_cleanUp(e,t,r={}){if(t&&(this.log("_cleanUp :: done callback provided for on stream close"),this.stream.on("close",t)),this.log("_cleanUp :: forced? %s",e),e)0===this.options.reconnectPeriod&&this.options.clean&&this._flush(),this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),this.stream.destroy();else{const e={cmd:"disconnect",...r};this.log("_cleanUp :: (%s) :: call _sendPacket with disconnect packet",this.options.clientId),this._sendPacket(e,()=>{this.log("_cleanUp :: (%s) :: destroying stream",this.options.clientId),S(()=>{this.stream.end(()=>{this.log("_cleanUp :: (%s) :: stream destroyed",this.options.clientId)})})})}this.disconnecting||this.reconnecting||(this.log("_cleanUp :: client not disconnecting/reconnecting. Clearing and resetting reconnect."),this._clearReconnect(),this._setupReconnect()),this._destroyKeepaliveManager(),t&&!this.connected&&(this.log("_cleanUp :: (%s) :: removing stream `done` callback `close` listener",this.options.clientId),this.stream.removeListener("close",t),t())}_storeAndSend(e,t,r){this.log("storeAndSend :: store packet with cmd %s to outgoingStore",e.cmd);let n,i=e;if("publish"===i.cmd&&(i=(0,u.default)(e),n=this._removeTopicAliasAndRecoverTopicName(i),n))return t&&t(n);this.outgoingStore.put(i,n=>{if(n)return t&&t(n);r(),this._writePacket(e,t)})}_applyTopicAlias(e){if(5===this.options.protocolVersion&&"publish"===e.cmd){let t;e.properties&&(t=e.properties.topicAlias);const r=e.topic.toString();if(this.topicAliasSend)if(t){if(0!==r.length&&(this.log("applyTopicAlias :: register topic: %s - alias: %d",r,t),!this.topicAliasSend.put(r,t)))return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}else 0!==r.length&&(this.options.autoAssignTopicAlias?(t=this.topicAliasSend.getAliasByTopic(r),t?(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign(use) topic: %s - alias: %d",r,t)):(t=this.topicAliasSend.getLruAlias(),this.topicAliasSend.put(r,t),e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto assign topic: %s - alias: %d",r,t))):this.options.autoUseTopicAlias&&(t=this.topicAliasSend.getAliasByTopic(r),t&&(e.topic="",e.properties={...e.properties,topicAlias:t},this.log("applyTopicAlias :: auto use topic: %s - alias: %d",r,t))));else if(t)return this.log("applyTopicAlias :: error out of range. topic: %s - alias: %d",r,t),new Error("Sending Topic Alias out of range")}}_noop(e){this.log("noop ::",e)}_writePacket(e,t){this.log("_writePacket :: packet: %O",e),this.log("_writePacket :: emitting `packetsend`"),this.emit("packetsend",e),this.log("_writePacket :: writing to stream");const r=l.default.writeToStream(e,this.stream,this.options);this.log("_writePacket :: writeToStream result %s",r),!r&&t&&t!==this.noop?(this.log("_writePacket :: handle events on `drain` once through callback."),this.stream.once("drain",t)):t&&(this.log("_writePacket :: invoking cb"),t())}_sendPacket(e,t,r,n){this.log("_sendPacket :: (%s) :: start",this.options.clientId),r=r||this.noop,t=t||this.noop;const i=this._applyTopicAlias(e);if(i)t(i);else{if(!this.connected)return"auth"===e.cmd?void this._writePacket(e,t):(this.log("_sendPacket :: client not connected. Storing packet offline."),void this._storePacket(e,t,r));if(n)this._writePacket(e,t);else{switch(e.cmd){case"publish":break;case"pubrel":return void this._storeAndSend(e,t,r);default:return void this._writePacket(e,t)}switch(e.qos){case 2:case 1:this._storeAndSend(e,t,r);break;default:this._writePacket(e,t)}this.log("_sendPacket :: (%s) :: end",this.options.clientId)}}}_storePacket(e,t,r){this.log("_storePacket :: packet: %o",e),this.log("_storePacket :: cb? %s",!!t),r=r||this.noop;let n=e;if("publish"===n.cmd){n=(0,u.default)(e);const r=this._removeTopicAliasAndRecoverTopicName(n);if(r)return t&&t(r)}const i=n.qos||0;0===i&&this.queueQoSZero||"publish"!==n.cmd?this.queue.push({packet:n,cb:t}):i>0?(t=this.outgoing[n.messageId]?this.outgoing[n.messageId].cb:null,this.outgoingStore.put(n,e=>{if(e)return t&&t(e);r()})):t&&t(new Error("No connection to broker"))}get serverProperties(){return this._serverProperties}get keepalive(){const e=this.connected?this._serverProperties?.serverKeepAlive:void 0;return e&&this.options.keepalive?e:this.options.keepalive}_setupKeepaliveManager(){this.log("_setupKeepaliveManager :: keepalive %d (seconds)",this.keepalive),!this.keepaliveManager&&this.keepalive&&(this.keepaliveManager=new w.default(this,this.options.timerVariant))}_destroyKeepaliveManager(){this.keepaliveManager&&(this.log("_destroyKeepaliveManager :: destroying keepalive manager"),this.keepaliveManager.destroy(),this.keepaliveManager=null)}reschedulePing(e=!1){this.keepaliveManager&&this.keepalive&&(e||this.options.reschedulePings)&&this._reschedulePing()}_reschedulePing(){this.log("_reschedulePing :: rescheduling ping"),this.keepaliveManager.reschedule()}sendPing(){this.log("_sendPing :: sending pingreq"),this._sendPacket({cmd:"pingreq"})}onKeepaliveTimeout(){this.log("onKeepaliveTimeout :: calling _cleanUp with force true"),this._cleanUp(!0),this.emit("error",new Error("Keepalive timeout"))}_resubscribe(){this.log("_resubscribe");const e=Object.keys(this._resubscribeTopics);if(!this._firstConnection&&(this.options.clean||this.options.protocolVersion>=4&&!this.connackPacket.sessionPresent)&&e.length>0)if(this.options.resubscribe)if(5===this.options.protocolVersion){this.log("_resubscribe: protocolVersion 5");for(let t=0;t<e.length;t++){const r={};r[e[t]]=this._resubscribeTopics[e[t]],r.resubscribe=!0,this.subscribe(r,{properties:r[e[t]].properties})}}else this._resubscribeTopics.resubscribe=!0,this.subscribe(this._resubscribeTopics);else this._resubscribeTopics={};this._firstConnection=!1}_onConnect(e){if(this.disconnected)return void this.emit("connect",e);this.connackPacket=e,!this.options.clean&&(this.options.protocolVersion<4||!0===e.sessionPresent)||this._discardIncomingQoS2State(),this.messageIdProvider.clear(),this.connected=!0,this._setupKeepaliveManager();const t=()=>{let r=this.outgoingStore.createStream();const n=()=>{r.destroy(),r=null,this._flushStoreProcessingQueue(),i()},i=()=>{this._storeProcessing=!1,this._packetIdsDuringStoreProcessing={}};this.once("close",n),r.on("error",e=>{i(),this._flushStoreProcessingQueue(),this.removeListener("close",n),this.emit("error",e)});const o=()=>{if(!r)return;const e=r.read(1);let t;e?(this._storeProcessing=!0,this._packetIdsDuringStoreProcessing[e.messageId]?o():this.disconnecting||this.reconnectTimer?r.destroy&&r.destroy():(t=this.outgoing[e.messageId]?this.outgoing[e.messageId].cb:null,this.outgoing[e.messageId]={volatile:!1,cmd:e.cmd,cb(e,r){t&&t(e,r),o()}},this._packetIdsDuringStoreProcessing[e.messageId]=!0,this.messageIdProvider.register(e.messageId)?this._sendPacket(e,void 0,void 0,!0):this.log("messageId: %d has already used.",e.messageId))):r.once("readable",o)};r.on("end",()=>{let r=!0;for(const e in this._packetIdsDuringStoreProcessing)if(!this._packetIdsDuringStoreProcessing[e]){r=!1;break}this.removeListener("close",n),r?(i(),this._invokeAllStoreProcessingQueue(),this.emit("connect",e)):t()}),o()};t()}_invokeStoreProcessingQueue(){if(!this._storeProcessing&&this._storeProcessingQueue.length>0){const e=this._storeProcessingQueue[0];if(e&&e.invoke())return this._storeProcessingQueue.shift(),!0}return!1}_invokeAllStoreProcessingQueue(){for(;this._invokeStoreProcessingQueue(););}_flushStoreProcessingQueue(){for(const e of this._storeProcessingQueue)e.cbStorePut&&e.cbStorePut(new Error("Connection closed")),e.callback&&e.callback(new Error("Connection closed"));this._storeProcessingQueue.splice(0)}_removeOutgoingAndStoreMessage(e,t){delete this.outgoing[e],this.outgoingStore.del({messageId:e},(r,n)=>{t(r,n),this.messageIdProvider.deallocate(e),this._invokeStoreProcessingQueue()})}}t.default=k},9844:(e,t,r)=>{"use strict";var n=r(8287).Buffer;function i(e){return e instanceof n?n.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}e.exports=function(e){if((e=e||{}).circles)return function(e){const t=[],r=[],n=new Map;if(n.set(Date,e=>new Date(e)),n.set(Map,(e,t)=>new Map(s(Array.from(e),t))),n.set(Set,(e,t)=>new Set(s(Array.from(e),t))),e.constructorHandlers)for(const t of e.constructorHandlers)n.set(t[0],t[1]);let o=null;return e.proto?function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const l={};t.push(a),r.push(l);for(const s in a){const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(o=n.get(c.constructor)))l[s]=o(c,e);else if(ArrayBuffer.isView(c))l[s]=i(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l}:function e(a){if("object"!=typeof a||null===a)return a;if(Array.isArray(a))return s(a,e);if(a.constructor!==Object&&(o=n.get(a.constructor)))return o(a,e);const l={};t.push(a),r.push(l);for(const s in a){if(!1===Object.hasOwnProperty.call(a,s))continue;const c=a[s];if("object"!=typeof c||null===c)l[s]=c;else if(c.constructor!==Object&&(o=n.get(c.constructor)))l[s]=o(c,e);else if(ArrayBuffer.isView(c))l[s]=i(c);else{const n=t.indexOf(c);l[s]=-1!==n?r[n]:e(c)}}return t.pop(),r.pop(),l};function s(e,s){const a=Object.keys(e),l=new Array(a.length);for(let c=0;c<a.length;c++){const u=a[c],f=e[u];if("object"!=typeof f||null===f)l[u]=f;else if(f.constructor!==Object&&(o=n.get(f.constructor)))l[u]=o(f,s);else if(ArrayBuffer.isView(f))l[u]=i(f);else{const e=t.indexOf(f);l[u]=-1!==e?r[e]:s(f)}}return l}}(e);const t=new Map;if(t.set(Date,e=>new Date(e)),t.set(Map,(e,t)=>new Map(n(Array.from(e),t))),t.set(Set,(e,t)=>new Set(n(Array.from(e),t))),e.constructorHandlers)for(const r of e.constructorHandlers)t.set(r[0],r[1]);let r=null;return e.proto?function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s}:function e(o){if("object"!=typeof o||null===o)return o;if(Array.isArray(o))return n(o,e);if(o.constructor!==Object&&(r=t.get(o.constructor)))return r(o,e);const s={};for(const n in o){if(!1===Object.hasOwnProperty.call(o,n))continue;const a=o[n];"object"!=typeof a||null===a?s[n]=a:a.constructor!==Object&&(r=t.get(a.constructor))?s[n]=r(a,e):ArrayBuffer.isView(a)?s[n]=i(a):s[n]=e(a)}return s};function n(e,n){const o=Object.keys(e),s=new Array(o.length);for(let a=0;a<o.length;a++){const l=o[a],c=e[l];"object"!=typeof c||null===c?s[l]=c:c.constructor!==Object&&(r=t.get(c.constructor))?s[l]=r(c,n):ArrayBuffer.isView(c)?s[l]=i(c):s[l]=n(c)}return s}}},9848:(e,t,r)=>{"use strict";const{pipeline:n}=r(3616),i=r(2648),{destroyer:o}=r(7302),{isNodeStream:s,isReadable:a,isWritable:l,isWebStream:c,isTransformStream:u,isWritableStream:f,isReadableStream:h}=r(6801),{AbortError:d,codes:{ERR_INVALID_ARG_VALUE:p,ERR_MISSING_ARGS:g}}=r(9157),b=r(6364);e.exports=function(...e){if(0===e.length)throw new g("streams");if(1===e.length)return i.from(e[0]);const t=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){const t=e.length-1;e[t]=i.from(e[t])}for(let r=0;r<e.length;++r)if(s(e[r])||c(e[r])){if(r<e.length-1&&!(a(e[r])||h(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be readable");if(r>0&&!(l(e[r])||f(e[r])||u(e[r])))throw new p(`streams[${r}]`,t[r],"must be writable")}let r,y,_,m,w;const v=e[0],S=n(e,function(e){const t=m;m=null,t?t(e):e?w.destroy(e):A||E||w.destroy()}),E=!!(l(v)||f(v)||u(v)),A=!!(a(S)||h(S)||u(S));if(w=new i({writableObjectMode:!(null==v||!v.writableObjectMode),readableObjectMode:!(null==S||!S.readableObjectMode),writable:E,readable:A}),E){if(s(v))w._write=function(e,t,n){v.write(e,t)?n():r=n},w._final=function(e){v.end(),y=e},v.on("drain",function(){if(r){const e=r;r=null,e()}});else if(c(v)){const e=(u(v)?v.writable:v).getWriter();w._write=async function(t,r,n){try{await e.ready,e.write(t).catch(()=>{}),n()}catch(e){n(e)}},w._final=async function(t){try{await e.ready,e.close().catch(()=>{}),y=t}catch(e){t(e)}}}const e=u(S)?S.readable:S;b(e,()=>{if(y){const e=y;y=null,e()}})}if(A)if(s(S))S.on("readable",function(){if(_){const e=_;_=null,e()}}),S.on("end",function(){w.push(null)}),w._read=function(){for(;;){const e=S.read();if(null===e)return void(_=w._read);if(!w.push(e))return}};else if(c(S)){const e=(u(S)?S.readable:S).getReader();w._read=async function(){for(;;)try{const{value:t,done:r}=await e.read();if(!w.push(t))return;if(r)return void w.push(null)}catch{return}}}return w._destroy=function(e,t){e||null===m||(e=new d),_=null,r=null,y=null,null===m?t(e):(m=t,s(S)&&o(S,e))},w}},9862:(e,t,r)=>{"use strict";const n=r(8287),{format:i,inspect:o}=r(1077),{codes:{ERR_INVALID_ARG_TYPE:s}}=r(9157),{kResistStopPropagation:a,AggregateError:l,SymbolDispose:c}=r(2768),u=globalThis.AbortSignal||r(5568).AbortSignal,f=globalThis.AbortController||r(5568).AbortController,h=Object.getPrototypeOf(async function(){}).constructor,d=globalThis.Blob||n.Blob,p=void 0!==d?function(e){return e instanceof d}:function(e){return!1},g=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new s(t,"AbortSignal",e)};e.exports={AggregateError:l,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,n)=>{e=r,t=n}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...n)=>e?r(e):t(...n))}),debuglog:()=>function(){},format:i,inspect:o,types:{isAsyncFunction:e=>e instanceof h,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:p,deprecate:(e,t)=>e,addAbortListener:r(7007).addAbortListener||function(e,t){if(void 0===e)throw new s("signal","AbortSignal",e);let r;return g(e,"signal"),(e=>{if("function"!=typeof e)throw new s("listener","Function",e)})(t),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[a]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null===(e=r)||void 0===e||e()}}},AbortSignalAny:u.any||function(e){if(1===e.length)return e[0];const t=new f,r=()=>t.abort();return e.forEach(e=>{g(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},e.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")},9868:(e,t,r)=>{"use strict";const n=r(7829).Duplex,i=r(6698),o=r(7396);function s(e){if(!(this instanceof s))return new s(e);if("function"==typeof e){this._callback=e;const t=function(e){this._callback&&(this._callback(e),this._callback=null)}.bind(this);this.on("pipe",function(e){e.on("error",t)}),this.on("unpipe",function(e){e.removeListener("error",t)}),e=null}o._init.call(this,e),n.call(this)}i(s,n),Object.assign(s.prototype,o.prototype),s.prototype._new=function(e){return new s(e)},s.prototype._write=function(e,t,r){this._appendBuffer(e),"function"==typeof r&&r()},s.prototype._read=function(e){if(!this.length)return this.push(null);e=Math.min(e,this.length),this.push(this.slice(0,e)),this.consume(e)},s.prototype.end=function(e){n.prototype.end.call(this,e),this._callback&&(this._callback(null,this.slice()),this._callback=null)},s.prototype._destroy=function(e,t){this._bufs.length=0,this.length=0,t(e)},s.prototype._isBufferList=function(e){return e instanceof s||e instanceof o||s.isBufferList(e)},s.isBufferList=o.isBufferList,e.exports=s,e.exports.BufferListStream=s,e.exports.BufferList=o},9957:(e,t,r)=>{"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(6743);e.exports=o.call(n,i)},9993:(e,t,r)=>{"use strict";r.r(t),r.d(t,{clearInterval:()=>_,clearTimeout:()=>m,setInterval:()=>w,setTimeout:()=>v});var n=r(8389);const i=(c=new WeakMap,o=e=>{if(c.has(e))return c.get(e);const t=new Map;return c.set(e,t),t},l=new WeakMap,s=e=>({...e,connect:({call:e})=>async()=>{const{port1:t,port2:r}=new MessageChannel,n=await e("connect",{port:t},[t]);return l.set(r,n),r},disconnect:({call:e})=>async t=>{const r=l.get(t);if(void 0===r)throw new Error("The given port is not connected.");await e("disconnect",{portId:r})},isSupported:({call:e})=>()=>e("isSupported")}),a=n.generateUniqueNumber,e=>{const t=s(e);return e=>{const r=o(e);e.addEventListener("message",({data:e})=>{const{id:t}=e;if(null!==t&&r.has(t)){const{reject:n,resolve:i}=r.get(t);r.delete(t),void 0===e.error?i(e.result):n(new Error(e.error.message))}}),(e=>"function"==typeof e.start)(e)&&e.start();const n=(t,n=null,i=[])=>new Promise((o,s)=>{const l=a(r);r.set(l,{reject:s,resolve:o}),null===n?e.postMessage({id:l,method:t},i):e.postMessage({id:l,method:t,params:n},i)}),i=(t,r,n=[])=>{e.postMessage({id:null,method:t,params:r},n)};let s={};for(const[e,r]of Object.entries(t))s={...s,[e]:r({call:n,notify:i})};return{...s}}});var o,s,a,l,c;const u=new Map([[0,null]]),f=new Map([[0,null]]),h=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(u),d=(e=>t=>r=>{"symbol"==typeof e.get(r)&&(e.set(r,null),t(r).then(()=>{e.delete(r)}))})(f),p=((e,t)=>r=>(n,i=0,...o)=>{const s=Symbol(),a=e(t);t.set(a,s);const l=()=>r(i,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(n(...o),t.get(a)===s&&l())});return l(),a})(n.generateUniqueNumber,u),g=((e,t)=>r=>(n,i=0,...o)=>{const s=Symbol(),a=e(t);return t.set(a,s),r(i,a).then(()=>{const e=t.get(a);if(void 0===e)throw new Error("The timer is in an undefined state.");e===s&&(t.delete(a),n(...o))}),a})(n.generateUniqueNumber,f),b=i({clearInterval:({call:e})=>h(t=>e("clear",{timerId:t,timerType:"interval"})),clearTimeout:({call:e})=>d(t=>e("clear",{timerId:t,timerType:"timeout"})),setInterval:({call:e})=>p((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"interval"})),setTimeout:({call:e})=>g((t,r)=>e("set",{delay:t,now:performance.timeOrigin+performance.now(),timerId:r,timerType:"timeout"}))}),y=(()=>{let e=null;return()=>{if(null!==e)return e;const t=new Blob(['(()=>{var e={455(e,t){!function(e){"use strict";var t=function(e){return function(t){var r=e(t);return t.add(r),r}},r=function(e){return function(t,r){return e.set(t,r),r}},n=void 0===Number.MAX_SAFE_INTEGER?9007199254740991:Number.MAX_SAFE_INTEGER,o=536870912,s=2*o,a=function(e,t){return function(r){var a=t.get(r),i=void 0===a?r.size:a<s?a+1:0;if(!r.has(i))return e(r,i);if(r.size<o){for(;r.has(i);)i=Math.floor(Math.random()*s);return e(r,i)}if(r.size>n)throw new Error("Congratulations, you created a collection of unique numbers which uses all available integers!");for(;r.has(i);)i=Math.floor(Math.random()*n);return e(r,i)}},i=new WeakMap,u=r(i),c=a(u,i),l=t(c);e.addUniqueNumber=l,e.generateUniqueNumber=c}(t)}};const t={};function r(n){const o=t[n];if(void 0!==o)return o.exports;const s=t[n]={exports:{}};return e[n].call(s.exports,s,s.exports,r),s.exports}(()=>{"use strict";const e=-32603,t=-32602,n=-32601,o=(e,t)=>Object.assign(new Error(e),{status:t}),s=t=>o(\'The handler of the method called "\'.concat(t,\'" returned an unexpected result.\'),e),a=(t,r)=>async({data:{id:a,method:i,params:u}})=>{const c=r[i];try{if(void 0===c)throw(e=>o(\'The requested method called "\'.concat(e,\'" is not supported.\'),n))(i);const r=void 0===u?c():c(u);if(void 0===r)throw(t=>o(\'The handler of the method called "\'.concat(t,\'" returned no required result.\'),e))(i);const l=r instanceof Promise?await r:r;if(null===a){if(void 0!==l.result)throw s(i)}else{if(void 0===l.result)throw s(i);const{result:e,transferables:r=[]}=l;t.postMessage({id:a,result:e},r)}}catch(e){const{message:r,status:n=-32603}=e;t.postMessage({error:{code:n,message:r},id:a})}};var i=r(455);const u=new Map,c=(e,r,n)=>({...r,connect:({port:t})=>{t.start();const n=e(t,r),o=(0,i.generateUniqueNumber)(u);return u.set(o,()=>{n(),t.close(),u.delete(o)}),{result:o}},disconnect:({portId:e})=>{const r=u.get(e);if(void 0===r)throw(e=>o(\'The specified parameter called "portId" with the given value "\'.concat(e,\'" does not identify a port connected to this worker.\'),t))(e);return r(),{result:null}},isSupported:async()=>{if(await new Promise(e=>{const t=new ArrayBuffer(0),{port1:r,port2:n}=new MessageChannel;r.onmessage=({data:t})=>e(null!==t),n.postMessage(t,[t])})){const e=n();return{result:e instanceof Promise?await e:e}}return{result:!1}}}),l=(e,t,r=()=>!0)=>{const n=c(l,t,r),o=a(e,n);return e.addEventListener("message",o),()=>e.removeEventListener("message",o)},d=(e,t)=>r=>{const n=t.get(r);if(void 0===n)return Promise.resolve(!1);const[o,s]=n;return e(o),t.delete(r),s(!1),Promise.resolve(!0)},m=(e,t,r,n)=>(o,s,a)=>{const i=o+s-t.timeOrigin,u=i-t.now();return new Promise(t=>{e.set(a,[r(n,u,i,e,t,a),t])})},f=new Map,h=d(globalThis.clearTimeout,f),p=new Map,w=d(globalThis.clearTimeout,p),v=((e,t)=>{const r=(n,o,s,a)=>{const i=n-e.now();i>0?o.set(a,[t(r,i,n,o,s,a),s]):(o.delete(a),s(!0))};return r})(performance,globalThis.setTimeout),g=m(f,performance,globalThis.setTimeout,v),T=m(p,performance,globalThis.setTimeout,v);l(self,{clear:async({timerId:e,timerType:t})=>({result:await("interval"===t?h(e):w(e))}),set:async({delay:e,now:t,timerId:r,timerType:n})=>({result:await("interval"===n?g:T)(e,t,r)})})})()})();'],{type:"application/javascript; charset=utf-8"}),r=URL.createObjectURL(t);return e=(e=>{const t=new Worker(e);return b(t)})(r),setTimeout(()=>URL.revokeObjectURL(r)),e}})(),_=e=>y().clearInterval(e),m=e=>y().clearTimeout(e),w=(...e)=>y().setInterval(...e),v=(...e)=>y().setTimeout(...e)}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),r(1860)})());